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 information
- Hack Rom Tools
- Pentest Tools Url Fuzzer
- Hack Tools
- Hack Tools
- Hacking Tools Mac
- Hacking Tools Windows 10
- Hacker Tools List
- Pentest Tools Online
- Hacker Tools Free Download
- Hacking Tools Windows
- Hack And Tools
- Pentest Tools Online
- Growth Hacker Tools
- Hacking Tools Hardware
- Hacker Search Tools
- Pentest Tools Port Scanner
- Hackers Toolbox
- Hacker Tools List
- Pentest Tools Online
- Bluetooth Hacking Tools Kali
- Nsa Hack Tools Download
- New Hacker Tools
- Hacking Tools Software
- Hacker Tools Windows
- What Is Hacking Tools
- Hacker Tools For Windows
- Growth Hacker Tools
- Hackrf Tools
- Hacker Tools Apk
- Hacking Tools For Windows 7
- Hacking Tools For Kali Linux
- Best Hacking Tools 2019
- Hacker Tools Software
- Github Hacking Tools
- Hak5 Tools
- Pentest Tools Port Scanner
- Blackhat Hacker Tools
- Pentest Tools Online
- Pentest Tools Bluekeep
- Hack Tools
- Tools Used For Hacking
- Pentest Recon Tools
- Pentest Tools Subdomain
- Pentest Tools Github
- Pentest Tools Subdomain
- Hacker Tools 2019
- Hacking Tools
- Hacking Tools Usb
- Best Pentesting Tools 2018
- How To Install Pentest Tools In Ubuntu
- Hack Tools
- Hacking Tools For Mac
- Hacker Tools 2019
- Hacking Apps
- Hack Rom Tools
- Hacker Tools Apk
- Pentest Box Tools Download
- Hack Tools Pc
- Pentest Tools Bluekeep
- What Is Hacking Tools
- World No 1 Hacker Software
- Easy Hack Tools
- Hack Tools
- Hacking Tools For Windows 7
- Computer Hacker
- Bluetooth Hacking Tools Kali
- Hack Tools Pc
- Hacking Tools Github
- Pentest Tools For Mac
- Best Hacking Tools 2020
- Free Pentest Tools For Windows
- Github Hacking Tools
- Hacking Tools
- Wifi Hacker Tools For Windows
- Pentest Tools Tcp Port Scanner
- Pentest Tools Windows
- Hacking App
- Kik Hack Tools
- Hacker Tools For Pc
- Pentest Tools Review
- Pentest Tools Nmap
- Hacker Security Tools
- Hacker Tools For Ios
- Hacking Tools For Windows 7
- Computer Hacker
- Tools 4 Hack
- Pentest Tools Website
- Underground Hacker Sites
- Pentest Reporting Tools
- Pentest Tools Open Source
- Hack Tools For Games
- Hacker Tools Software
- Hacker Tools Apk
- Pentest Tools Windows
- New Hack Tools
- Hack Tools
- Hacker Tools List
- Pentest Tools Kali Linux
- Hack Tool Apk
- Pentest Tools Open Source
- Hacking Tools Github
- Hacker Search Tools
- Hacking Tools For Mac
- Pentest Tools Port Scanner
- Hacking Tools For Windows
- Beginner Hacker Tools
- Hacker Search Tools
- Hacker
- Hacker Tools Apk Download
- Pentest Tools For Ubuntu
- Hacker Tools For Windows
- Hacking Tools Hardware
- Ethical Hacker Tools
- Hacking Tools For Games
- Hackrf Tools
- Hacking Tools And Software
- Install Pentest Tools Ubuntu
- Pentest Tools Github
- Pentest Tools For Windows
- Growth Hacker Tools
- Hacking Tools Windows
- Hacking Tools Download
- Underground Hacker Sites
- Hacker Tools 2019
- How To Install Pentest Tools In Ubuntu
- Bluetooth Hacking Tools Kali
- Hacking Tools For Beginners
- Pentest Tools For Ubuntu
- Hack Tools For Ubuntu
- Android Hack Tools Github
- Pentest Tools Review
- Hack App
- Easy Hack Tools
- Top Pentest Tools
0 comments:
Post a Comment