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