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.
More info
- Hacking Tools 2020
- Pentest Tools Url Fuzzer
- New Hacker Tools
- Usb Pentest Tools
- What Is Hacking Tools
- Hack Tools Pc
- Pentest Tools Open Source
- Hacking App
- Hacking Tools Download
- Hack Tools
- Pentest Tools Online
- Pentest Box Tools Download
- Hack Tools For Windows
- Pentest Tools For Android
- Hacker Tools List
- Hacker Tools Free
- Pentest Tools Free
- New Hack Tools
- Hacking Tools For Windows
- Hacking Apps
- Pentest Tools List
- Hack Tools For Windows
- Hacker Tools Online
- Pentest Tools Open Source
- Usb Pentest Tools
- Best Hacking Tools 2020
- Hack And Tools
- Hacking Tools Mac
- Hacking Tools For Games
- Pentest Tools Alternative
- Pentest Tools Free
- Hacking Tools Name
- Hack And Tools
- What Are Hacking Tools
- Pentest Tools Review
- Hacking Tools For Windows 7
- Pentest Tools Android
- Pentest Tools Windows
- Hacker Tools Apk
- Best Hacking Tools 2020
- Github Hacking Tools
- Wifi Hacker Tools For Windows
- Underground Hacker Sites
- Hacker Techniques Tools And Incident Handling
- Hack Tools
- Hacker Security Tools
- Hacking Tools Pc
- Hack Tool Apk No Root
- Hack Tool Apk
- Hack Rom Tools
- Hacker Search Tools
- Hacking Tools For Mac
- Pentest Tools For Mac
- Hacker Tools Online
- Nsa Hacker Tools
- Android Hack Tools Github
- Hack Apps
- Hacking Tools Pc
- Hacker Tools Linux
- Hacker Tools For Windows
- Hackrf Tools
- How To Hack
- Hacker Tools Apk
- Hacking Tools For Pc
- How To Install Pentest Tools In Ubuntu
- Hacker Search Tools
- Beginner Hacker Tools
- Pentest Tools Open Source
- Top Pentest Tools
- Hacking Apps
- Pentest Tools
- Hack Tools
- Kik Hack Tools
- Hacking App
- Physical Pentest Tools
- What Is Hacking Tools
- Computer Hacker
- Nsa Hack Tools
- Termux Hacking Tools 2019
- Hack Tools Mac
- Hacking Tools Download
- Physical Pentest Tools
- Pentest Box Tools Download
- What Are Hacking Tools
- Pentest Tools Tcp Port Scanner
- Hacking Tools
- Hack Tools For Windows
- Pentest Tools Open Source
- Tools 4 Hack
- Hack Tool Apk No Root
- Hacker Tools Software
- Hacker Tools Apk Download
- Pentest Tools For Mac
- Hacking Tools Mac
- Physical Pentest Tools
- Hack Tool Apk
- Hacker Tool Kit
- Hacking Tools Windows
- Tools 4 Hack
- Hacking Tools Software
- What Is Hacking Tools
- Hacker Tools Apk
- Hack Tools Online
- Hacker
- Hacking Tools Windows 10
- How To Hack
- Hackrf Tools
- Pentest Tools List
- Hacking Tools For Pc
- Github Hacking Tools
- Pentest Tools For Mac
- Hacking Tools For Kali Linux
- Tools For Hacker
- Hacks And Tools
- Hack Tools For Windows
- Hacking Tools For Games
- Hacking Tools Free Download
- Hacker Tools Apk
- Hacker Tools 2020
- Tools Used For Hacking
- Ethical Hacker Tools
- Hacking Tools Kit
- Hack Apps
- Hacking Tools Windows 10
- Pentest Tools For Windows
- Pentest Tools Url Fuzzer
- Pentest Tools Online
- Hacking Tools For Windows 7
- Nsa Hack Tools
- Physical Pentest Tools
- Nsa Hacker Tools
- Pentest Tools For Android
- Pentest Tools Online
- Hack Tools
- Pentest Tools Url Fuzzer
- Pentest Tools Alternative
- Pentest Tools Linux
- Pentest Tools Tcp Port Scanner
- Pentest Tools Free
- Hack Tools For Mac
- Hack Tools Github
- Pentest Tools Framework
- Hacking Tools Online
- Nsa Hack Tools
- Best Pentesting Tools 2018
- Game Hacking
- Free Pentest Tools For Windows
- Hacker Security Tools
- Hacker Hardware Tools
- Wifi Hacker Tools For Windows
No comments:
Post a Comment