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
- Pentest Tools Kali Linux
- Hacking Tools Pc
- Hacking Tools For Mac
- Bluetooth Hacking Tools Kali
- Hacking Tools Pc
- Hacker Tools For Ios
- Hack Website Online Tool
- Hacking Tools Kit
- Pentest Tools Website Vulnerability
- Pentest Tools Download
- Best Hacking Tools 2019
- Pentest Reporting Tools
- Pentest Tools Linux
- Easy Hack Tools
- Pentest Tools Free
- Hacker Tools List
- Hacking Tools 2020
- Hacker Tools For Windows
- Ethical Hacker Tools
- Hack Rom Tools
- Pentest Automation Tools
- Ethical Hacker Tools
- Pentest Tools Kali Linux
- Hack Tools Github
- Hack Tools For Games
- Pentest Tools Linux
- Hack Tools
- Hacking Tools And Software
- Pentest Tools Free
- Pentest Tools For Windows
- Pentest Box Tools Download
- Hack Tools
- Hacker Tools For Windows
- Hacker Tools Free
- Hack Tools Mac
- Hacker Tools Github
- Hack Tools For Pc
- Pentest Tools Android
- Top Pentest Tools
- Hack Tools Pc
- Hacking Tools For Windows
- Black Hat Hacker Tools
- Blackhat Hacker Tools
- Hack Tools 2019
- Pentest Recon Tools
- Pentest Tools Android
- Pentest Tools Website Vulnerability
- Hacker Tools Mac
- Hack Apps
- Hacking Tools For Windows Free Download
- Hacking Tools Name
- Best Hacking Tools 2019
- Hacking Tools Github
- Tools 4 Hack
- Pentest Tools Github
- Pentest Tools Subdomain
- Hacker Tools Mac
- Hacks And Tools
- Pentest Tools For Android
- Hacker Tools For Ios
- Hacking Tools Mac
- Hacking Tools For Kali Linux
- Pentest Tools Github
- Pentest Box Tools Download
- Tools Used For Hacking
- Pentest Tools
- Hacker Tools List
- Hack Tools 2019
- Hacker Tools Mac
- Pentest Automation Tools
- Hack Rom Tools
- Best Hacking Tools 2020
- Hack Tools For Pc
- Hacker Tools Linux
- Pentest Tools Android
- Hack Tool Apk
- Hacking Tools Github
- Pentest Tools Nmap
- Pentest Tools Online
- What Are Hacking Tools
- Pentest Tools Port Scanner
- Nsa Hack Tools
- Pentest Tools Subdomain
- Wifi Hacker Tools For Windows
- Pentest Automation Tools
- Physical Pentest Tools
- Hacking Tools Windows 10
- Hacker Tools Apk
- Hacker Tools Apk Download
- Hacker Tools Free
- Nsa Hack Tools Download
- Hack Tools Github
- Pentest Tools Apk
- Install Pentest Tools Ubuntu
- Hacking Tools Name
- Hack Tools Pc
- Pentest Tools Website
- How To Hack
- Pentest Tools For Windows
- Ethical Hacker Tools
- What Is Hacking Tools
- Hacking Tools Free Download
- Pentest Tools Github
- Black Hat Hacker Tools
- Hack And Tools
- Hack Tools Pc
- Kik Hack Tools
- Hacker Tools For Ios
- Nsa Hacker Tools
- Pentest Tools Github
- What Are Hacking Tools
- Hack Tool Apk
- Hacker Security Tools
- Pentest Tools For Mac
- World No 1 Hacker Software
- Hacking Tools For Pc
- Top Pentest Tools
- Hacking Tools Pc
- Hacker Tools For Windows
- Hackers Toolbox
- Nsa Hack Tools Download
- Android Hack Tools Github
- Hacker Tool Kit
- Hacker Tools For Mac
- Hacking Tools
- Hacking Tools For Beginners
- Hack Tools For Ubuntu
- Pentest Tools For Windows
- Tools Used For Hacking
- Hack Tools
No comments:
Post a Comment