what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

ishopcart-cgi-bof.c.txt

ishopcart-cgi-bof.c.txt
Posted Jun 3, 2006
Site awarenetwork.org

ishopcart.cgi suffers from a buffer overflow in the vGetPost() function. POC included.

tags | exploit, overflow, cgi
SHA-256 | f4b07660ad5a348c1dbafdfd6cc4b4787cab9c62bf3ca8f7b05872ffe58d50e8

ishopcart-cgi-bof.c.txt

Change Mirror Download
Vendor: ishopcart inc
Vendor Site: ishopcart.com
Vendor Status: notified via telephone

While spending a night auditing I have found 2 buffer overflows and 1
directory traversal in the ishopcart cgi, which is written in C.

The directory traversal is caused by how the cgi chooses to show pages.
If, for example, the CGI is tould to show an order form, the order
form's name is taken as argv[1] and opens this file and prints it, ie:

/cgi-bin/easy-scart.cgi?../../../../../../../etc/passwd

The first buffer overflow is in main()'s szTmp[100] variable. argv[1] is
placed in this variable through a sprintf, although no check is made on
the size of argv[1] before putting it in szTmp:

sprintf(szTmp,"%s",argv[1]);

The other buffer overflow (of which I have succesfuly exploited) lies in
main() also, but is overflowed in vGetPost(). char szBuf[4000]; is
passed to vGetPost() under the circumstance that argv[1] contains
specific criteria. vGetPost() reads POST data until the word "Submit" is
encountered, doing absolutely no bounds checking on the ammount of data
supplied.

When notified via telephone, the author claimed to be in the process of
fixing these errors, and at the same time took ishopcart.com offline.
Provided is the exploit code that spawns a connect back shell. It has been tested both localy and remotely
and has proved to work 100%

The real issue lies in the fact that this is a shopping cart system.
Also, since this is a cgi script, apache forks before executing it and
hence does not die on unsuccessful attempts, meaning that combined with
a massive 4000 NOP buffer, brute forcing of the offset is possible
leading to a theoretical 100% probability of remote code execution.

The good news is that this program doesn't seem to be common. If you you
would like to view the site and the code, search 'ishopcart' on google
and click it's cached link, then hit the source code link and you'll see
easy-scart.c through easy-scart6.c (all, of which, are vulnerable)

--K-sPecial
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close