-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshadowtools.cpp
More file actions
319 lines (272 loc) · 11.1 KB
/
Copy pathshadowtools.cpp
File metadata and controls
319 lines (272 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
#include <windows.h>
#include <mmsystem.h>
#include <gdiplus.h>
#include <cstdlib>
#include <vector>
#include <string>
#include <ctime>
#include <iostream>
#include <fstream>
using namespace Gdiplus;
using namespace std;
/* MinGW link with: -lwinmm -lgdiplus */
HWND gLogBox = NULL;
HWND gFooter = NULL;
HBRUSH gBgBrush = NULL;
COLORREF gNeon = RGB(0,255,0);
ULONG_PTR gGdiplusToken = 0;
Image* gCurrentImage = nullptr;
vector<wstring> gImages = {
L"images\\image (1).jpg",
L"images\\image (1).png",
L"images\\image (2).jpg",
L"images\\image (3).jpg",
L"images\\image (4).jpg",
L"images\\image (5).jpg",
L"images\\image (6).jpg"
};
const UINT TIMER_IMAGE = 2001;
// ---- append log + save to file ----
static void AppendLog(const string &s) {
if (!gLogBox) return;
int len = GetWindowTextLengthA(gLogBox);
SendMessageA(gLogBox, EM_SETSEL, len, len);
SendMessageA(gLogBox, EM_REPLACESEL, FALSE, (LPARAM)s.c_str());
SendMessageA(gLogBox, EM_REPLACESEL, FALSE, (LPARAM)"\r\n");
SendMessageA(gLogBox, EM_SCROLLCARET, 0, 0);
// Save to logs.log
ofstream logFile("logs.log", ios::app);
if (logFile.is_open()) {
logFile << s << endl;
}
}
// ---- owner-draw button ----
static void DrawOwnerButton(LPDRAWITEMSTRUCT dis, const char* text) {
HDC hdc = dis->hDC;
RECT rc = dis->rcItem;
BOOL pressed = (dis->itemState & ODS_SELECTED) != 0;
BOOL focus = (dis->itemState & ODS_FOCUS) != 0;
COLORREF fill = pressed ? RGB(45,45,45) : RGB(35,35,35);
COLORREF border = pressed ? RGB(70,70,70) : RGB(90,90,90);
HBRUSH b = CreateSolidBrush(fill);
HPEN pen = CreatePen(PS_SOLID, 1, border);
HGDIOBJ oldB = SelectObject(hdc, b);
HGDIOBJ oldP = SelectObject(hdc, pen);
RoundRect(hdc, rc.left, rc.top, rc.right, rc.bottom, 8, 8);
HPEN pen2 = CreatePen(PS_INSIDEFRAME, 1, RGB(60,60,60));
SelectObject(hdc, pen2);
RECT r2 = rc; InflateRect(&r2, -1, -1);
RoundRect(hdc, r2.left, r2.top, r2.right, r2.bottom, 8, 8);
SetBkMode(hdc, TRANSPARENT);
SetTextColor(hdc, RGB(0,255,0));
HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
HGDIOBJ oldF = SelectObject(hdc, hFont);
DrawTextA(hdc, text, -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
if (focus) {
RECT r3 = rc; InflateRect(&r3, -3, -3);
DrawFocusRect(hdc, &r3);
}
SelectObject(hdc, oldF);
SelectObject(hdc, oldP);
SelectObject(hdc, oldB);
DeleteObject(b);
DeleteObject(pen);
DeleteObject(pen2);
}
// ---- select random image ----
static void ShowRandomImage(HWND hwnd) {
if(gCurrentImage) delete gCurrentImage;
int idx = rand() % gImages.size();
gCurrentImage = new Image(gImages[idx].c_str());
InvalidateRect(hwnd, NULL, TRUE);
}
// ---- run command and capture output ----
string RunCommand(const string &cmd) {
string result;
char buffer[256];
FILE* pipe = popen(cmd.c_str(), "r");
if (!pipe) return "Error: Unable to run command.";
while (fgets(buffer, sizeof(buffer), pipe)) result += buffer;
pclose(pipe);
return result;
}
// ---- window proc ----
LRESULT CALLBACK MainProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
switch(msg) {
case WM_CREATE:
{
srand((unsigned int)time(NULL));
CreateWindowA("STATIC", "=== Welcome in ShadowTools ===\r\nCreated by Shohan",
WS_CHILD|WS_VISIBLE|SS_CENTER, 10, 10, 450, 40, hwnd, (HMENU)100, GetModuleHandle(NULL), NULL);
CreateWindowA("BUTTON", "CopyMan", WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,
30, 60, 130, 40, hwnd, (HMENU)1, GetModuleHandle(NULL), NULL);
CreateWindowA("BUTTON", "Hack WIFI", WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,
175, 60, 130, 40, hwnd, (HMENU)2, GetModuleHandle(NULL), NULL);
CreateWindowA("BUTTON", "Exit", WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,
320, 60, 130, 40, hwnd, (HMENU)3, GetModuleHandle(NULL), NULL);
// ---- full output box ----
gLogBox = CreateWindowExA(
WS_EX_CLIENTEDGE, "EDIT", "",
WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY,
470, 10, 400, 400,
hwnd, (HMENU)200, GetModuleHandle(NULL), NULL
);
HFONT hFont = CreateFontA(
16, 0, 0,0, FW_NORMAL, FALSE,FALSE,FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY, FF_DONTCARE, "Consolas"
);
SendMessage(gLogBox, WM_SETFONT, (WPARAM)hFont, TRUE);
AppendLog("[INFO] Everything is easy for Shohan :)");
AppendLog("-------------------------------------------");
gFooter = CreateWindowA("STATIC", "ShadowTools - Hacking made easy!",
WS_CHILD|WS_VISIBLE|SS_CENTER, 10, 420, 660, 20, hwnd, (HMENU)300, GetModuleHandle(NULL), NULL);
ShowRandomImage(hwnd);
SetTimer(hwnd, TIMER_IMAGE, 5000, NULL);
}
return 0;
case WM_CTLCOLORSTATIC:
{
HDC hdc = (HDC)wParam;
if((HWND)lParam==gFooter) SetTextColor(hdc, RGB(210,210,210));
else SetTextColor(hdc, gNeon);
SetBkColor(hdc, RGB(0,0,0));
return (LRESULT)gBgBrush;
}
case WM_CTLCOLOREDIT:
{
HDC hdc = (HDC)wParam;
SetTextColor(hdc, gNeon);
SetBkColor(hdc, RGB(0,0,0));
return (LRESULT)gBgBrush;
}
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if(dis->CtlID==1) DrawOwnerButton(dis,"CopyMan");
else if(dis->CtlID==2) DrawOwnerButton(dis,"Hack WIFI");
else if(dis->CtlID==3) DrawOwnerButton(dis,"Exit");
return TRUE;
}
case WM_COMMAND:
switch(LOWORD(wParam)) {
case 1: AppendLog("[INFO] Checking ... (mockup)"); AppendLog("[DONE] Looks good!"); break;
case 2:
{
AppendLog("[INFO] Starting Wi-Fi hacking...");
AppendLog("[+] Scanning all WIFI logs...");
Sleep(700);
AppendLog("[+] Capturing handshake...");
Sleep(1000);
AppendLog("[+] Handshake captured successfully!");
Sleep(500);
AppendLog("[+] Starting Fetch attack...");
// Fetch real Wi-Fi profiles and passwords
const char* cmd =
"powershell -Command \""
"$profiles = netsh wlan show profiles | Select-String 'All User Profile' | ForEach-Object { ($_ -split ':')[1].Trim() }; "
"if ($profiles.Count -eq 0) { Write-Host 'No Wi-Fi profiles found on this PC.' } "
"else { "
"$results = foreach ($profile in $profiles) { "
"$details = netsh wlan show profile name=$profile key=clear; "
"$keyContent = ($details | Select-String 'Key Content') -replace '.*:\\\\s*',''; "
"[PSCustomObject]@{ 'Wi-Fi Name' = $profile; 'Password' = if ($keyContent) { $keyContent } else { 'No Password / Open Network' } } "
"}; $results }\"";
FILE* pipe = popen(cmd, "r");
if (!pipe) {
AppendLog("[ERROR] Failed to run PowerShell command.");
break;
}
char buffer[256];
vector<string> passwords;
while (fgets(buffer, sizeof(buffer), pipe)) {
string line = buffer;
if (!line.empty() && line.back() == '\n') line.pop_back();
// Skip headers/empty lines
if (line.find("Wi-Fi Name") != string::npos || line.find("Password") != string::npos || line.find("---") != string::npos)
continue;
if (!line.empty()) passwords.push_back(line);
}
pclose(pipe);
for (const auto& pwd : passwords) {
AppendLog("[+] Trying password: " + pwd);
Sleep(800);
}
if (!passwords.empty()) {
AppendLog("[+] Password found: " + passwords.back());
AppendLog("[SUCCESS] Wi-Fi hacking completed!");
AppendLog("-------------------------------------------");
} else {
AppendLog("[!] No Wi-Fi passwords found.");
AppendLog("-------------------------------------------");
}
}
break;
case 3: PostQuitMessage(0); break;
}
return 0;
case WM_TIMER:
if(wParam==TIMER_IMAGE) ShowRandomImage(hwnd);
return 0;
case WM_PAINT:
{
PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd,&ps);
RECT rc; GetClientRect(hwnd,&rc);
FillRect(hdc,&rc,gBgBrush);
if(gCurrentImage){
Graphics g(hdc);
int bannerWidth = 450;
int bannerHeight = gCurrentImage->GetHeight() * bannerWidth / gCurrentImage->GetWidth();
Rect r(10,110,bannerWidth,bannerHeight);
g.DrawImage(gCurrentImage,r);
Pen pen(Color(255,200,0,0),2.0f);
g.DrawRectangle(&pen,r);
}
RECT client; GetClientRect(hwnd,&client);
SetWindowPos(gFooter,NULL,10,client.bottom-30,client.right-20,20,SWP_NOZORDER|SWP_NOACTIVATE);
EndPaint(hwnd,&ps);
}
return 0;
case WM_DESTROY:
KillTimer(hwnd,TIMER_IMAGE);
if(gCurrentImage) delete gCurrentImage;
PostQuitMessage(0);
return 0;
case WM_SIZE:
InvalidateRect(hwnd,NULL,TRUE);
return 0;
}
return DefWindowProc(hwnd,msg,wParam,lParam);
}
// ---- main ----
int WINAPI WinMain(HINSTANCE hInst,HINSTANCE,LPSTR,int){
GdiplusStartupInput gpsi;
GdiplusStartup(&gGdiplusToken,&gpsi,NULL);
gBgBrush = CreateSolidBrush(RGB(0,0,0));
mciSendStringA("open \"music.mp3\" type mpegvideo alias mp3",NULL,0,0);
mciSendStringA("setaudio mp3 volume to 400",NULL,0,0);
mciSendStringA("play mp3 repeat",NULL,0,0);
const char* CLASS_NAME = "ShadowToolsMainClass";
WNDCLASSA wc = {0};
wc.lpfnWndProc = MainProc;
wc.hInstance = hInst;
wc.lpszClassName = CLASS_NAME;
wc.hbrBackground = gBgBrush;
wc.hCursor = LoadCursor(NULL,IDC_ARROW);
RegisterClassA(&wc);
HWND hwnd = CreateWindowExA(
0, CLASS_NAME, "ShadowTools",
WS_OVERLAPPED | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU,
120,120,900,470,NULL,NULL,hInst,NULL);
ShowWindow(hwnd,SW_SHOW);
MSG msg;
while(GetMessage(&msg,NULL,0,0)>0){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
mciSendStringA("close mp3",NULL,0,0);
if(gCurrentImage) delete gCurrentImage;
if(gGdiplusToken) GdiplusShutdown(gGdiplusToken);
if(gBgBrush) DeleteObject(gBgBrush);
return 0;
}