r/ExploitDev • • Sep 23 '23

"Basic" Buffer Overflow Questions

4 Upvotes

I was working a "basic" (no dep, no aslr, no canaries etc) problem where there was not enough space to inject shellcode at the address esp was pointing to.

Being a newbie, I thought okay I'll inject code to jmp to a lower memory address on the stack, which is filled with the overflow placeholder. Except I'll change the placeholder to a nop slide and append the actual shellcode to it. To do this, I tried a few approaches which didn't work, including a mov eax, esp -> sub eax,0x248 -> jmp eax and an analogous method using push eax -> ret. But nothing I cooked up worked.

I came upon the actual solution, which was to just inject a jmp <register> at the address esp points to. This register stored an address where the placeholder/shellcode was also present.

This prompts a few questions that it would be very helpful to have answered to improve my understanding of these kinds of attacks, and I suppose architecture in general:

  1. Why doesn't my stuff work?
  2. Why does my injected shellcode show up in 2 locations: at a lower address on the stack AND at a location pointed to by another register?

Please let me know if any further information is needed, and I'll do my best to provide it.

edit:

I found out why my own solution was not working. Execution was always being passed to my nop sled, but the shellcode itself was crashing because esp was too far away from eip. The person that helped me understand this surmised that the shellcode was computing offsets from ebp, the value of which would have been based on esp. So that's where the null bytes came from.

To remedy this, I added an additional instruction to copy the computed address of the nop sled into esp. So the code that I placed at the original address esp was pointing to looked like this in the end:

\x8d\x84\x24\x70\xfe\xff\xff # lea eax,[esp,-0x190]
\x89\xc4 # mov esp, eax
\xff\xe0 # jmp eax

Thanks to all who commented and guided me.

SEO: msfvenom shellcode error C0000005


r/ExploitDev • • Sep 20 '23

CVE-2023-4047 Root Cause Analysis

Thumbnail richardosgood.com
6 Upvotes

r/ExploitDev • • Sep 20 '23

Is it possible to hack Android via PDF

0 Upvotes

Good afternoon, today in 2023 are there ways to access Android remotely using PDF, if so, how does it work and can you leave links to tutorials that show how to do it?


r/ExploitDev • • Sep 18 '23

Comp eng or Comp sci?

3 Upvotes

Hi guys I am wondering which bachelors will help the most if I want to become an exploit developer?

Thanks


r/ExploitDev • • Sep 14 '23

Memory Leak Exploitability?

4 Upvotes

Can we only perform DoS exploits against memory leak vulnerabilities that are caused by not freeing memory and having it build up until the process virtual alloc call fails?

I have been looking for different ways to exploit memory leaks that crash the process due to large amounts of memory allocated, but have had no luck.

Any references to papers or topics would be nice.

Thank you in advance!


r/ExploitDev • • Sep 12 '23

From Terminal Output to Arbitrary Remote Code Execution

Thumbnail blog.solidsnail.com
4 Upvotes

r/ExploitDev • • Sep 12 '23

Dynamic malware analysis tools for Kali Linux

Thumbnail self.asknetsec
2 Upvotes

r/ExploitDev • • Sep 10 '23

Help with firmadyne

5 Upvotes

Hey everyone! I am trying to use firmadyne to emulate a tp-links router firmware. I am able to extract the firmware and manually go through the sqaush-fs filesystem. But when I try to emulate it and do some dynamic analysis i get this error:[ 6.520000] EXT2-fs (sda1): error: ext2_lookup: deleted inode referenced: 2570

[ 6.520000] EXT2-fs (sda1): error: ext2_lookup: deleted inode referenced: 2570

[ 6.520000] EXT2-fs (sda1): error: ext2_lookup: deleted inode referenced: 2570

[ 6.520000] EXT2-fs (sda1): error: ext2_lookup: deleted inode referenced: 2570

after doing some research I see that using the e2fsck binary would usually help in fixing the filesystem. The only issue is i am having trouble finding /dev/sda1 . any advice or resources i can look at to get a better understanding of the problem would be great :)! I am using Ubuntu 22.04 as a host OS.

thanks you

Edit: should probably add the firmware is MIPS32, LSB


r/ExploitDev • • Aug 25 '23

#NoFilter - Abusing Windows Filtering Platform for Privilege Escalation | Deep Instinct

Thumbnail
deepinstinct.com
4 Upvotes

r/ExploitDev • • Aug 24 '23

CVE-2023-36874

2 Upvotes

r/ExploitDev • • Aug 19 '23

Journey into Windows Kernel Exploitation: The Basics

Thumbnail
blog.neuvik.com
15 Upvotes

r/ExploitDev • • Aug 18 '23

Tools to automatically find and use decryption stubs to decrypt encrypted binaries

3 Upvotes

Are there any tools to automatically find and use decryption stubs to decrypt encrypted binaries?

Encrypted binaries and stubs mentioned here: https://intezer.com/blog/incident-response/malware-reverse-engineering-for-beginners-part-2/


r/ExploitDev • • Aug 18 '23

Two "Call" assembly instructions with different encodings - exploitable?

4 Upvotes

I am looking through some disassembled code and see two "call" instructions but the instructions seem to be encoded with different bits/bytes. Can these two encodings ("11101000" and "11111111") be used interchangeably? Can the different encodings be an (exploitable) vulnerability? Is this the case for other assembly instructions as well, that different encodings are equivalent/not equivalent?


r/ExploitDev • • Aug 16 '23

What's your development environment setup?

9 Upvotes

Hey all, I was just curious how others had their exploit development environments configured.

Windows & Linux:

  • What OS versions do you prefer for research/testing?
  • Do you disable any exploit mitigations during research?

Please share any other config/software preferences you have when researching (ex: debuggers, specific tools, etc).

I'm re-configuring my development environment and wanted to seek some inspiration from the community.

Thanks!


r/ExploitDev • • Aug 11 '23

The History of Heap Spraying

8 Upvotes

A live class of in-depth Heap Spraying explaination - https://www.youtube.com/watch?v=W9AHEhG1sPc