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
- Hacker Tools Hardware
- Pentest Tools Open Source
- Pentest Tools For Android
- Hacking Tools Hardware
- Pentest Tools For Ubuntu
- Hacker Tools For Windows
- World No 1 Hacker Software
- What Are Hacking Tools
- Hacking Tools For Mac
- Pentest Tools Linux
- Hack Website Online Tool
- Hacking Tools Kit
- Hacking Tools For Beginners
- Nsa Hacker Tools
- Hacking Tools For Pc
- Hacking Tools And Software
- Hacking Tools Windows 10
- Hacking App
- Pentest Tools Kali Linux
- Hack Tools
- Hacking Tools Software
- Hacking Tools Windows 10
- Growth Hacker Tools
- Install Pentest Tools Ubuntu
- Pentest Tools Website
- Hacking Tools Hardware
- Hacking Tools Github
- Hacking Tools Github
- Pentest Tools Android
- Top Pentest Tools
- What Is Hacking Tools
- Pentest Box Tools Download
- Hacking Tools For Pc
- Hacker Tools Windows
- Hacker Tools Apk Download
- Hacking Tools For Windows Free Download
- Hacker Tools List
- Pentest Tools Bluekeep
- Pentest Tools Open Source
- Hack Tools For Windows
- Hacker Tools Software
- Bluetooth Hacking Tools Kali
- Hacker Tools Free
- Hacking Tools For Windows Free Download
- Hacking Tools
- Hack Apps
- Hacking Tools Hardware
- Pentest Tools Online
- Underground Hacker Sites
- Pentest Tools Nmap
- Pentest Tools Android
- Best Hacking Tools 2020
- New Hack Tools
- Usb Pentest Tools
- Pentest Tools Linux
- Nsa Hack Tools Download
- Hacking Tools Kit
- Hack And Tools
- Best Hacking Tools 2020
- Hacker
- Nsa Hacker Tools
- Hack Tools For Pc
- Pentest Automation Tools
- Hackers Toolbox
- Hacker Tools Mac
- Hack Tools For Games
- Hacker Hardware Tools
- Kik Hack Tools
- Hacking Tools For Beginners
- Tools Used For Hacking
- Hacker Tools Mac
- Hacks And Tools
- Hacker Tools Github
- Best Pentesting Tools 2018
- Hack Rom Tools
- Kik Hack Tools
- Hacks And Tools
- How To Make Hacking Tools
- Pentest Reporting Tools
- Easy Hack Tools
- Hacking Tools Online
- Pentest Tools Find Subdomains
- Hack Tools Pc
- Hack Tool Apk
- Bluetooth Hacking Tools Kali
- How To Install Pentest Tools In Ubuntu
- Hacker Tools Apk
- Pentest Tools Online
- Easy Hack Tools
- Hacker Security Tools
- Black Hat Hacker Tools
- Hacker Tools Free
- Hacker Tools Mac
- Hack App
- Pentest Tools Nmap
- Pentest Tools Subdomain
- Pentest Tools Nmap
- Pentest Tools Apk
- Hacker Tools Apk
- Beginner Hacker Tools
- Pentest Tools Download
- Hack App
- Best Hacking Tools 2019
- Android Hack Tools Github
- Hacks And Tools
- Hack Tools Github
- Hacking Tools Windows 10
- Hack Tools Download
- Pentest Tools Online
- Hacking Tools Mac
- Pentest Recon Tools
- Hack Tools Download
- Pentest Tools Github
- How To Hack
- Pentest Tools Tcp Port Scanner
- Hack Tools Pc
- Hacking Tools Online
- Hacking Tools Github
- Hacker Tools Hardware
No comments:
Post a Comment