@@ -46,3 +46,96 @@ PythonRAT is a Command and Control (C2) server which can control multiple machin
4646 persistence *RegName* *filename* --> Create Persistence In Registry
4747 screenshot --> Takes screenshot and sends to server ./screenshots/
4848 remove_backdoor --> Removes backdoor from target
49+
50+
51+ # Backdoor Compilation and Obfuscation for Windows
52+
53+ ** Compile to Executable using Pyinstaller**
54+
55+ $ pip install pyinstaller
56+ $ pyinstaller --onefile --noconsole backdoor.py
57+
58+ This will produce _ ./dist/backdoor.exe_
59+
60+
61+ ** Obfuscation using SFX archive**
62+
63+ The executable _ backdoor.exe_ will be made to look like an image (jpg) file.
64+ By default Windows does not show file extensions (e.g. backdoor.exe will show in Windows Explorer as backdoor).
65+ Hence, we will create an SFX archive name _ wallpaper.jpg.exe_ which Windows Explorer will show as _ wallpaper.jpg_ .
66+
67+ This will involve having image.jpg which we will also create an icon version of _ .ico_ to assign the SFX archive.
68+ Making the executable appear to be an image.
69+
70+ ** Creating SFX archive**
71+
72+ WinRAR > Add To Archive (image.jpg and backdoor.exe)
73+
74+ Rename archive to: _ image.jpg.exe_
75+
76+
77+ -Add to SFX Archive (Y) and Advanced>
78+
79+ **Setup>Run after extraction**
80+
81+ California-HD-Background.jpg
82+ backdoor.exe
83+
84+ **Modes**
85+ Unpack to temporary folder
86+ Silent mode
87+ Hide all
88+
89+ **Update**
90+ Update mode>
91+ Extract and update files
92+ Overwrite mode>
93+ Overwrite all files
94+
95+ **Text and icon**
96+ Load SFX icon from the file (image ICO)
97+
98+
99+ This will produce an SFX archive which looks like an image
100+
101+ While inspecting the file will reveal it is an executable the file extension _ .exe_ is concealed.
102+ Furthermore, if viewed from the Desktop cannot be differentiated between a 'real' image.
103+
104+ <img width =" 842 " alt =" image8 " src =" https://user-images.githubusercontent.com/10171446/153408539-972eba00-ca38-4cfc-be3b-556cf9ae74c7.PNG " >
105+
106+
107+ Once opened the SFX archive will open the image file inside the archive and the malware will execute after.
108+
109+ Due to _ --noconsole_ argument in _ Pyinstaller_ , no window will be rendered.
110+
111+
112+ ** Task Manager**
113+
114+ The _ backdoor.exe_ process can be seen in Task Manager and ended there if necessary.
115+
116+ # Preview Images
117+
118+ ** Target connection to C2 Server**
119+
120+ ![ Screenshot_2022-02-10_06-16-22] ( https://user-images.githubusercontent.com/10171446/153403206-4ce3dc23-4c1a-41b6-a715-2e2021d965ce.png )
121+
122+
123+ ** Interacting with Session**
124+
125+ ![ Screenshot_2022-02-10_06-17-20] ( https://user-images.githubusercontent.com/10171446/153403283-3df77fd8-2cbe-4990-b82f-d847bdde3bee.png )
126+
127+
128+ ** Test Commands on Target**
129+
130+ ![ Screenshot_2022-02-10_06-22-48] ( https://user-images.githubusercontent.com/10171446/153403427-058ebe8a-36d8-465c-8386-7a55cea1641b.png )
131+
132+
133+ ** Session Options**
134+
135+ ![ Screenshot_2022-02-10_06-23-21] ( https://user-images.githubusercontent.com/10171446/153403579-3b090b00-2dec-4c33-a94d-020eb2b0d2b4.png )
136+
137+
138+ ** Backgrounding and Killing Session**
139+
140+ ![ Screenshot_2022-02-10_06-25-04] ( https://user-images.githubusercontent.com/10171446/153403973-d9757c68-4ca2-405f-ae13-a0ca0666bfcc.png )
141+
0 commit comments