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.
Continue reading
- Hack Tools Github
- Hacker Tool Kit
- Hacker Tools For Mac
- Hack Rom Tools
- Pentest Tools Apk
- Hacker Tools 2020
- Hacking App
- Hacker Tools Software
- Hacking Tools Hardware
- Pentest Tools For Android
- Pentest Tools For Mac
- Hack App
- Hacker Tools
- Hack Tool Apk No Root
- Hacking Tools For Windows Free Download
- Hacking Tools For Mac
- Hacker Tools Free Download
- Hacker Tools
- Hacker Tools Hardware
- Blackhat Hacker Tools
- Pentest Tools Bluekeep
- Hacking Apps
- Nsa Hack Tools
- Hack Tools Pc
- World No 1 Hacker Software
- Game Hacking
- Hacking Tools Pc
- Hacker Tools 2020
- Pentest Tools Android
- Hack Tools For Games
- Easy Hack Tools
- Hack Tools For Ubuntu
- Beginner Hacker Tools
- Hack And Tools
- Best Pentesting Tools 2018
- Blackhat Hacker Tools
- Hacker Tools For Pc
- Pentest Tools Website
- Pentest Tools Apk
- Hak5 Tools
- Hacker Tools Github
- Pentest Tools Url Fuzzer
- Usb Pentest Tools
- Hacking Tools Kit
- Usb Pentest Tools
- Hacking Tools Online
- Tools 4 Hack
- Hackrf Tools
- Best Pentesting Tools 2018
- Hacker Tools Github
- Hacking Tools Download
- Hackrf Tools
- Hacking Tools For Windows 7
- New Hacker Tools
- Best Hacking Tools 2019
- Hacker Tools Apk Download
- Pentest Tools Tcp Port Scanner
- Tools Used For Hacking
- Hack Tools 2019
- Black Hat Hacker Tools
- Pentest Tools Find Subdomains
- Hacker Tools Free
- Blackhat Hacker Tools
- Hacking App
- Hack Tools For Ubuntu
- Hack And Tools
- Pentest Tools Framework
- What Are Hacking Tools
- Hack Apps
- Hacker Tools Software
- Nsa Hack Tools
- Hack Tools Download
- Pentest Tools Linux
- Hacker
- Pentest Automation Tools
- Hacking Tools For Windows
- What Is Hacking Tools
- Pentest Tools For Windows
- Hack And Tools
- Hacker Tools For Pc
- New Hack Tools
- Hack Rom Tools
- World No 1 Hacker Software
- Kik Hack Tools
- How To Make Hacking Tools
- Hack Tools Pc
- Hacking Tools Hardware
- Pentest Tools Free
- Hacker Tools Free Download
- Pentest Tools For Ubuntu
- How To Hack
- Hacking Tools
- How To Make Hacking Tools
- Computer Hacker
- Underground Hacker Sites
- Hacking Tools Name
- What Is Hacking Tools
- Hack Tool Apk
- Tools For Hacker
- Hacker Tools Apk
- Pentest Tools Free
- Top Pentest Tools
- Hacking Tools 2019
- Pentest Tools List
- Hacking App
- Hacking App
- Pentest Box Tools Download
- Hacking Tools For Windows 7
- Hack Tools Download
- Hacker Tools For Windows
- Hacker Tools Windows
- Bluetooth Hacking Tools Kali
- Hack Tools
- Pentest Tools Github
- Hacking Tools 2020
- Termux Hacking Tools 2019
- Pentest Recon Tools
- Hack Tools
- Hacking Tools Hardware
- Hack Tools Github
- Pentest Reporting Tools
- Free Pentest Tools For Windows
- Free Pentest Tools For Windows
- Beginner Hacker Tools
- Pentest Tools Open Source
- Hacker Tools Linux
- Hacks And Tools
- Nsa Hack Tools Download
- Hacker Tools For Pc
- Hacking Tools Software
- Hacker Security Tools
- New Hack Tools
- Pentest Tools Url Fuzzer
- Hacking Tools Online
- Hack Tools For Pc
- Github Hacking Tools
- Hacking Tools For Pc
- Pentest Tools
- Pentest Tools Bluekeep
- Hacker Tools For Ios
- Hacker Tools 2019
- Hack Tools For Pc
- Pentest Tools Subdomain
- Hack And Tools
- Android Hack Tools Github
- Hacking Tools Hardware
- Pentest Tools For Mac
- Hacker Tools Windows
- Best Hacking Tools 2019
- Hacking Tools Online
- Hack Tools Github
- Pentest Tools Apk
No comments:
Post a Comment