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 articles
- Hacking Tools 2020
- Blackhat Hacker Tools
- Pentest Tools Apk
- Hacker Tools Linux
- New Hacker Tools
- New Hack Tools
- New Hacker Tools
- Hacking Tools For Mac
- Hack Tools Mac
- Hacking Tools 2020
- Nsa Hack Tools Download
- Hacking Tools Free Download
- What Is Hacking Tools
- Hacker Tools Linux
- Hack Apps
- Usb Pentest Tools
- Pentest Reporting Tools
- What Are Hacking Tools
- How To Hack
- Free Pentest Tools For Windows
- Pentest Tools Subdomain
- Hack Tools For Pc
- Hacker Tools Free
- Pentest Tools Nmap
- Hacker Tools Github
- Hacker Tools Software
- Hack Tools Download
- Pentest Tools Framework
- Hacker Tools Software
- Install Pentest Tools Ubuntu
- Hacker Tools Apk Download
- How To Install Pentest Tools In Ubuntu
- Hack Tools Github
- Termux Hacking Tools 2019
- Hacker Tools Free Download
- Hacker Tools 2020
- Hacking Tools For Games
- Hacking Apps
- Hack Tools
- How To Install Pentest Tools In Ubuntu
- Pentest Tools Free
- Hacker Tool Kit
- Hackers Toolbox
- Hacker Tool Kit
- Hacking Tools Hardware
- Hacking Tools Name
- Pentest Tools Kali Linux
- Hacking Tools Hardware
- Physical Pentest Tools
- Pentest Tools Find Subdomains
- Pentest Tools Bluekeep
- Blackhat Hacker Tools
- Hacker Tools Linux
- Easy Hack Tools
- Install Pentest Tools Ubuntu
- Hacker Tools Free
- Pentest Tools Free
- World No 1 Hacker Software
- Wifi Hacker Tools For Windows
- World No 1 Hacker Software
- Hacking Tools For Windows Free Download
- New Hacker Tools
- Best Pentesting Tools 2018
- Pentest Recon Tools
- Usb Pentest Tools
- Hacker Tools Apk
- Best Hacking Tools 2020
- Pentest Automation Tools
- Pentest Tools Url Fuzzer
- Android Hack Tools Github
- Hack Tool Apk
- Hacking Tools Windows 10
- Pentest Tools For Android
- New Hacker Tools
- Pentest Tools Linux
- Pentest Tools Android
- Hak5 Tools
- Nsa Hack Tools Download
- Hacking Tools For Pc
- Hacks And Tools
- Hacker Security Tools
- Pentest Tools Android
- Hacking Tools For Mac
- Pentest Box Tools Download
- Best Pentesting Tools 2018
- Computer Hacker
- Best Hacking Tools 2020
- Pentest Tools Apk
- Hack Tools For Windows
- Pentest Tools For Android
- Hack Tools For Mac
- New Hack Tools
- Hacking Tools For Kali Linux
- Pentest Tools Linux
- Pentest Tools Tcp Port Scanner
- Pentest Tools For Windows
- Hacker Hardware Tools
- Hack Tools For Mac
- Hacker Tool Kit
- Hacking Tools Pc
- Pentest Tools For Mac
- Pentest Tools Online
- Hacker Tools Apk
- Hacker Tools Free Download
- Pentest Tools For Ubuntu
- Ethical Hacker Tools
- How To Make Hacking Tools
- Ethical Hacker Tools
- Hacking Tools Github
- Nsa Hacker Tools
- Hacking Tools For Kali Linux
- Hacker Tools 2020
- Hacking Tools Free Download
- Hack Tools Download
- Ethical Hacker Tools
- Hack Tools
- Hacking Tools For Games
- Pentest Tools Android
- Pentest Tools Windows
- Install Pentest Tools Ubuntu
- Best Pentesting Tools 2018
- Usb Pentest Tools
- Pentest Tools Online
- Pentest Tools Bluekeep
- How To Hack
- Hacker Tools For Ios
- Hacker Security Tools
- Hacker Tools Free Download
- Best Hacking Tools 2020
- Easy Hack Tools
- Hack Apps
- Hacker Tools 2019
- Pentest Tools Nmap
- Hak5 Tools
- World No 1 Hacker Software
- Hackrf Tools
- Hacker Search Tools
- Hacker Tools 2019
- Hack Tools Github
- Hacker Tools Apk Download
- Hacker Tools Windows
- Nsa Hacker Tools
- Tools For Hacker
- Easy Hack Tools
- Nsa Hacker Tools
- Hacker Tools Apk
- Hacker Security Tools
No hay comentarios:
Publicar un comentario
Nota: solo los miembros de este blog pueden publicar comentarios.