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.
https://play.golang.org/p/HppcVpLfuMf
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:
https://play.golang.org/p/7htJHJp8gUJ
In this way it's possible to build a rop chain using golang runtime to unprotect a shellcode.
Related news
- Hacking Tools Pc
- Hacking Tools Github
- Hacker Tools List
- Hacker Tools Apk
- Hack Tool Apk
- Hak5 Tools
- Hack Tools
- Hacking App
- How To Make Hacking Tools
- Install Pentest Tools Ubuntu
- Best Pentesting Tools 2018
- Tools For Hacker
- Hacking Tools For Windows Free Download
- Hacker Tools For Mac
- Hacker Search Tools
- Easy Hack Tools
- Easy Hack Tools
- Pentest Tools Free
- Hacker Tools Free
- Kik Hack Tools
- Pentest Tools Download
- Hacker Tools For Mac
- Hacker
- Free Pentest Tools For Windows
- Hacking Tools Usb
- Hacker Tools For Mac
- Hacker Tools List
- Pentest Tools Url Fuzzer
- Hacker Techniques Tools And Incident Handling
- Top Pentest Tools
- Hacking Tools For Kali Linux
- Hacking Tools Kit
- Hacking Tools 2019
- Hacking Tools For Windows
- Hacker Search Tools
- Hack Tool Apk
- Pentest Tools Url Fuzzer
- Hacker Tools For Windows
- Hacking Tools Online
- Hacking Tools Software
- Free Pentest Tools For Windows
- Hacker Hardware Tools
- Hacking Tools For Pc
- Github Hacking Tools
- What Is Hacking Tools
- Physical Pentest Tools
- Hacker Tools Apk Download
- Pentest Tools Android
- Kik Hack Tools
- Hacking Tools Hardware
- Hacker Tool Kit
- Game Hacking
- Wifi Hacker Tools For Windows
- Pentest Tools
- Hack Tools For Windows
- Pentest Tools Online
- Hack Tool Apk
- Computer Hacker
- Hacking Tools Online
- Hack Tools For Windows
- Usb Pentest Tools
- Top Pentest Tools
- Pentest Reporting Tools
- Hacker Tools List
- Ethical Hacker Tools
- Wifi Hacker Tools For Windows
- Hacker Tools For Mac
- Game Hacking
- Hackrf Tools
- Pentest Tools Online
- Pentest Tools Url Fuzzer
- Pentest Tools Website
- Hacking Tools Windows 10
- What Is Hacking Tools
- Hacker Tool Kit
- Hackers Toolbox
- Hacking Tools Windows
- Hack Tools For Ubuntu
- Kik Hack Tools
- Hacker Tools Hardware
- New Hacker Tools
- Hack Tool Apk No Root
- Pentest Tools Free
- Pentest Box Tools Download
- Pentest Tools For Mac
- Hak5 Tools
- Best Pentesting Tools 2018
- Hack Tools 2019
- Growth Hacker Tools
- Hacking Tools For Pc
- Hacking Tools For Mac
- Pentest Tools Windows
- Hacker Tools
- Hack Tools
- Nsa Hacker Tools
- Hacking Tools Hardware
- Pentest Tools For Ubuntu
- Hack Tool Apk
- What Are Hacking Tools
- Nsa Hack Tools Download
- Pentest Tools Review
- Tools 4 Hack
- Github Hacking Tools
- Hacking Tools Free Download
- Hack Tools For Pc
- Pentest Tools Online
- Hacking Tools For Pc
- Hacker
- Hacking Tools For Windows 7
- Growth Hacker Tools
- Android Hack Tools Github
- Hacker Tools Online
- Hacking Tools For Pc
- Hacking Tools 2019
- Tools For Hacker
- Pentest Tools Tcp Port Scanner
- Hack Website Online Tool
- Hacking Tools Windows 10
- Hacker Tools For Windows
- Hack Website Online Tool
- Hacking Tools Download
- Hacker Tools
- Hacker Security Tools
- Hack Tools For Games
- Hacking Tools 2019
- Hacker Tools Software
- Hack Tools Pc
- Nsa Hack Tools
- Install Pentest Tools Ubuntu
No comments:
Post a Comment