Giter Club home page Giter Club logo

functionstomping's Introduction

Hi there! ๐Ÿ‘‹

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป About me:

I am an experienced security researcher who has worked in various cybersecurity roles. My main interests are OS internals, reverse engineering, kernel development and exploit development. In my free time, I am working on projects regarding evasion, persistence, and injection methods for UEFI, kernel, and user mode. Based on these, I publish educational papers and presents talks to give back to the cybersecurity community.

๐Ÿ“ง Feel free to contact me via Twitter, Telegram or mail regarding any of my projects or publications.


๐Ÿ’ญ Currently working on:

  • New projects

  • New papers

  • New talks


๐ŸŒ My blog posts:


๐Ÿ—ฃ๏ธ Talks:


โš’๏ธ Programming Languages โš’๏ธ

ย ย ย  ย ย ย  ย ย ย  ย ย ย  ย ย ย  ย ย ย  ย ย ย 


๐Ÿ“Š My stats ๐Ÿ“Š


Ido's GitHub Stats

Ido's Trophies

functionstomping's People

Contributors

idov31 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

functionstomping's Issues

Possible with .net assembly ?

Hi , is your beautiful peace of work working with .net assembly ?

Im trying to run a .net assembly shellcode generated with the donuts tools from TheWover.
https://github.com/TheWover/donut

the .net PE i converted is a asyncrat PE, when i try to inject it inside a process (i had to remove the max shellcode lengh because shellcode is 147k bytes long) but i get no connection back / the asssembly is not starting ?

is this even possible to work with a .net PE?

sorry for retarded question but im really noy good with shellcode stuff.

[BUG] Failed to change protection [0]

Hello, I'm currently studying some codes and I ended up here.

I use windows x64, I had to compile the cpp using the "-DUNICODE" flag to be able to compile, but when I run the console it does not inject any pid and brings this error:

[+] Got process handle!
[+] Got function base!
[-] Failed to change protection: 0

I tried in notepad and others, in rust when I compile it says that this program is compatible with 32bits and not x64, so the normal "cargo b" instruction doesn't work.

I tried various processes from notepad to others and it doesn't work
Screenshot_128
.

Edit:
I was able to resolve the architecture error(Windows 10 x64) in rust by running the following commands:
rustup target add x86_64-pc-windows-gnu
cargo build --target x86_64-pc-windows-gnu

After the test, the calc does not open but in the console everything seems normal, I will continue the tests
The message shows the following
Screenshot_130
:

Notepad.exe throwing Unhandled Exception: System.AccessViolationException

Hello @Idov31

Many thanks for your previous advice as those allowed me to make some little progress. I have tried the C++ code as well and I am facing the following challenge. Even when I am trying to put a breakpoint to debug the code. I have tried with the POC shellcode to spawn Calc and generated other examples with reverse shells in case that was the issue. Tested with the classic Windows calculator.

Many thanks,
Kind regards,
Federico

Microsoft Windows [Version 10.0.19045.3086]

C:\Users\federico\source\repos\test\x64\Release>test.exe
[+] Got process handle!
[+] Got function base!
[+] Changed protection to RW to write the shellcode.
[+] Successfuly stomped the function!
[+] Changed protection to WCX to run the shellcode!
[+] Shellcode successfuly injected!

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at FunctionStomping(UInt32 pid) in C:\Users\federico\source\repos\test\functionstomping.hpp:line 41
at mainCRTStartup()

Possible to have > 0x1000 size?

Hello, neat idea you found there.
Is it possible to have more then 4096 bytes available for the shellcode or is it max?
If more is not possible, would it be possible to split it across more functions to achieve the goal?

functionstomping architecture

Hello @Idov31

I am currently studying slowly on related subjects and I am new to Rust, how do I compile this for 64bits?

functionstomping.exe is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.

Many thanks,
Best regards,
Federico

[QUESTIONS] Some victim processes crash without execution

First of all, thanks for your work and publishing it along with the very interesting blog post.

I've been playing a bit with your POC, especially the Rust version, and there is something I'm not fully getting. Depending on the victim process, I get the following results:

  • Majority of processes (e.g notepad): when the stomped function is called the shelllcode executes (calc pops open) and the victim process crashes with an access violation error.
  • Some processes (e.g explorer.exe): when the stomped function is called the process crashes with an access violation error, but the shellcode does not seem to execute (nothing happens, no calc).

I've tried with a custom shellcode and by changing the targeted function in kernel32.dll but I always get the same results. So my questions are:

  • Do you know why for some process the shellcode will not execute, the process will just crash ? (function used ? bad shellcode ?)
  • Do you have an idea to get reliable shellcode execution on all processes ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.