Skip to content

Commit

Permalink
Update asyncRequests.py
Browse files Browse the repository at this point in the history
  • Loading branch information
constantinedev committed Dec 9, 2024
1 parent c56800d commit 096f3b3
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions modules/asyncRequests.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
import re, os, io, sys, ast, ssl, csv, json, requests, sqlite_utils
import re, io, os, sys, ast, ssl, csv, json, sqlite_utils, requests, asyncio, base64
from datetime import datetime as DT, timezone as TZ, timedelta as TD
import cloudscraper
from random_user_agent.user_agent import UserAgent
from random_user_agent.params import SoftwareName, OperatingSystem
software_names = [SoftwareName.CHROME.value, SoftwareName.FIREFOX.value, SoftwareName.SAFARI.value]
operating_systems = [OperatingSystem.WINDOWS.value, OperatingSystem.LINUX.value, OperatingSystem.MAC.value]
user_agent_rotator = UserAgent(software_names=software_names, operating_systems=operating_systems, limit=200)
from random_user_agent.params import SoftwareName, OperatingSystem, HardwareType, SoftwareEngine

operating_systems = [OperatingSystem.WINDOWS.value, OperatingSystem.LINUX.value, OperatingSystem.UNIX.value, OperatingSystem.MAC.value]
hardware_types = [HardwareType.MOBILE.value, HardwareType.SERVER.value]
software_names = [SoftwareName.CHROME.value, SoftwareName.FIREFOX.value, SoftwareName.SAFARI.value, SoftwareName.ANDROID.value]
software_engines = [SoftwareEngine.GECKO.value, SoftwareEngine.WEBKIT.value, SoftwareEngine.BLINK.value]
user_agent_rotator = UserAgent(software_names=software_names, software_engines=software_engines, hardware_types=hardware_types, operating_systems=operating_systems, limit=100)
user_agent = user_agent_rotator.get_random_user_agent()

session = requests.session()
session.proxies = {}
session.proxies['http'] = 'socks5h://localhost:9050'
session.proxies['https'] = 'socks5h://localhost:9050'

def_headers = {
'User-Agent': user_agent,
'Content-Type': 'text/html',
}

async def gun_shell(url, method, type, headers, payload):
if url=="" or url is None:
if url == "" or url is None:
return {"status": "Error", "response": "URL was empty!"}
if headers=={} or headers is None:
headers={"User-Agent":user_agent, "Content-Type": 'application/json'}
if payload=={} or payload is None:

if headers == {} or headers is None:
headers = def_headers
else:
headers = def_headers.update(headers)

if payload == {} or payload is None:
payload = {}
if type=="nor":
if type == "nor":
return await nor_req(url, method, type, headers, payload)
if type=="tor":
if type == "tor":
return await tor_req(url, method, type, headers, payload)

async def nor_req(url, method, type, headers, payload):
Expand Down

0 comments on commit 096f3b3

Please sign in to comment.