There are situations when c interacts with golang for example in a library, and its possible to exploit a golang function writing raw memory using an unsafe.Pointer() parameter.
When golang receive a null terminated string on a *C.Char parameter, can be converted to golang s tring with s2 := C.GoString(s1) we can do string operations with s2 safelly if the null byte is there.
When golang receives a pointer to a buffer on an unsafe.Pointer() and the length of the buffer on a C.int, if the length is not cheated can be converted to a []byte safelly with b := C.GoBytes(buf,sz)
Buuut what happens if golang receives a pointer to a buffer on an unsafe.Pointer() and is an OUT variable? the golang routine has to write on this pointer unsafelly for example we can create a golangs memcpy in the following way:
We convert to uintptr for indexing the pointer and then convert again to pointer casted to a byte pointer dereferenced and every byte is writed in this way.
If b is controlled, the memory can be written and the return pointer of main.main or whatever function can be modified.
The return addres can be pinpointed, for example 0x41 buffer 0x42 address:
We can reproduce it simulating the buffer from golang in this way:
we can dump the address of a function and redirect the execution to it:
In this way it's possible to build a rop chain using golang runtime to unprotect a shellcode.
More info
- Hacking Apps
- Growth Hacker Tools
- Pentest Tools Framework
- Hacking Tools
- Black Hat Hacker Tools
- Hack Tools For Ubuntu
- Hacking Tools Pc
- Pentest Tools Review
- Hacker Tools Hardware
- Best Hacking Tools 2020
- Pentest Tools Nmap
- Hack Tools For Mac
- Pentest Automation Tools
- Pentest Tools List
- Hacker Tools Linux
- Hacker Security Tools
- Hacking Tools Windows
- Pentest Tools Find Subdomains
- Pentest Automation Tools
- How To Install Pentest Tools In Ubuntu
- Underground Hacker Sites
- Growth Hacker Tools
- Black Hat Hacker Tools
- Hacks And Tools
- Hacker Tools Free Download
- How To Hack
- Pentest Tools Find Subdomains
- Pentest Tools For Windows
- Hacker Tools Windows
- Pentest Tools Apk
- Pentest Tools Bluekeep
- Pentest Recon Tools
- Hacker Tools For Pc
- Pentest Automation Tools
- Hack App
- Pentest Tools
- Pentest Box Tools Download
- Hack Tools Pc
- Wifi Hacker Tools For Windows
- Pentest Tools Nmap
- Pentest Tools For Windows
- Pentest Tools Nmap
- Pentest Tools Website
- Hacking Tools Download
- Pentest Tools Url Fuzzer
- Hackers Toolbox
- Hacking Tools Windows
- Hacker Tools Online
- Hacking Tools For Kali Linux
- Physical Pentest Tools
- Best Pentesting Tools 2018
- Wifi Hacker Tools For Windows
- Hacking Tools
- Pentest Recon Tools
- Hacker Techniques Tools And Incident Handling
- Hacker Tools Mac
- Hacker Tools Software
- Pentest Tools Nmap
- Hacker Tools List
- How To Install Pentest Tools In Ubuntu
- Hacker
- World No 1 Hacker Software
- Hacking Tools Kit
- Hacking Tools 2020
- Hak5 Tools
- How To Install Pentest Tools In Ubuntu
- Hacking Tools Software
- Hackers Toolbox
- Hack Tools For Ubuntu
- Hack And Tools
- Hacker Tools Apk
- Black Hat Hacker Tools
- Hack Apps
- Easy Hack Tools
- Nsa Hack Tools Download
- Easy Hack Tools
- Hack Tools
- Pentest Automation Tools
- Pentest Tools Windows
- Hacking Tools For Windows 7
- Hacking Tools Software
- Hacking Tools For Kali Linux
- Nsa Hack Tools Download
- Hack Tools For Games
- Beginner Hacker Tools
- New Hacker Tools
- Hacker Tools 2020
- Best Pentesting Tools 2018
- Nsa Hack Tools
- Pentest Tools Website
- Growth Hacker Tools
- Pentest Tools For Windows
- Black Hat Hacker Tools
- Pentest Tools Port Scanner
- Hack Tools For Pc
- Hacker Tools Apk
- Black Hat Hacker Tools
- Hacking Tools For Mac
- Hacker Tools For Pc
- Pentest Tools Subdomain
- Hack Tools For Windows
- Pentest Tools Website
- Growth Hacker Tools
- Hack Tool Apk No Root
- Hack Tools Download
- Hacking Tools Windows
- Hacker Tools Apk
- What Is Hacking Tools
- Hacks And Tools
- Pentest Tools Review
- Pentest Tools For Mac
- Tools Used For Hacking
No comments:
Post a Comment
Post your comments here: