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 information
- Hack Tools Online
- Hacker Tools Software
- Hacking Tools For Pc
- Tools For Hacker
- Pentest Tools Website
- Hacking Tools For Mac
- Pentest Tools Bluekeep
- Pentest Tools Linux
- Tools Used For Hacking
- Bluetooth Hacking Tools Kali
- Bluetooth Hacking Tools Kali
- Hacking Tools For Windows
- Nsa Hack Tools Download
- Pentest Tools Review
- Pentest Tools Review
- Hack Tools Pc
- Black Hat Hacker Tools
- Hacker
- Hak5 Tools
- Nsa Hacker Tools
- How To Hack
- Nsa Hacker Tools
- Hacking Tools Download
- Hack And Tools
- Nsa Hack Tools
- Pentest Tools Open Source
- Pentest Tools For Mac
- Wifi Hacker Tools For Windows
- Hack Tools For Games
- Computer Hacker
- Pentest Tools Website Vulnerability
- Hacking Tools For Kali Linux
- Hacker Search Tools
- Kik Hack Tools
- Hackrf Tools
- Hacker
- World No 1 Hacker Software
- Pentest Box Tools Download
- Hack Tools
- Hacker Search Tools
- Pentest Tools Alternative
- Underground Hacker Sites
- Beginner Hacker Tools
- Nsa Hack Tools
- Pentest Automation Tools
- Pentest Recon Tools
- Top Pentest Tools
- World No 1 Hacker Software
- Hack Tools For Games
- Hacker Tools Github
- Hack Tools Pc
- Hacking Tools Hardware
- Hacker Tools For Pc
- Pentest Tools
- Pentest Tools Nmap
- Hacking Tools Github
- World No 1 Hacker Software
- Hacking Tools Windows 10
- Pentest Tools
- Pentest Tools Framework
- Hacker Tools Windows
- Top Pentest Tools
- Hack Tools Github
- Hacker Tools 2020
- Pentest Tools Url Fuzzer
- Best Pentesting Tools 2018
- Tools Used For Hacking
- Pentest Tools Download
- Bluetooth Hacking Tools Kali
- Pentest Tools For Windows
- Pentest Tools Subdomain
- Pentest Tools Open Source
- Hacking Tools Windows 10
- Hacking Tools Usb
- Hacker Tools Free Download
- Hack Tools Github
- Ethical Hacker Tools
- Pentest Tools For Mac
- Pentest Tools
- Nsa Hack Tools Download
- Best Hacking Tools 2019
- Pentest Tools For Android
- Pentest Tools List
- Underground Hacker Sites
- Computer Hacker
- Pentest Tools For Windows
- Hacking Tools For Windows
- Pentest Box Tools Download
- Nsa Hacker Tools
- Hacking Tools Software
- Pentest Tools Nmap
- Hacking Tools Pc
- Hack Tools Pc
- Hacker Tools Github
- Hacker Tools Mac
- Hacker Tools Software
- Kik Hack Tools
- Easy Hack Tools
- Hacker Tools 2020
- Pentest Box Tools Download
- Pentest Tools Port Scanner
- Hacker Tools Free Download
- Hak5 Tools
- How To Hack
- Nsa Hacker Tools
- Hacking Tools Pc
- Hack Rom Tools
- Pentest Tools Port Scanner
- Pentest Tools Github
- Kik Hack Tools
- Tools For Hacker
- Game Hacking
- Pentest Tools List
- Pentest Automation Tools
- Hack Tools For Windows
- Hacks And Tools
- Pentest Tools Website Vulnerability
- Hacking Tools Usb
- Hacking Tools Pc
- What Are Hacking Tools
- Nsa Hacker Tools
- Android Hack Tools Github
- Hacker Tools Windows
- Best Pentesting Tools 2018
- Android Hack Tools Github
- Hack Tools Pc
- Hacking Tools Free Download
- Pentest Tools Find Subdomains
- Hack Tools Github
- Hacker Tools Free Download
- Hak5 Tools
No comments:
Post a Comment