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.
Read more
- Pentest Tools List
- Growth Hacker Tools
- Pentest Tools Port Scanner
- Hacking Tools Mac
- Top Pentest Tools
- Pentest Tools Kali Linux
- Hacker Tools Mac
- Hacker Tools Hardware
- Computer Hacker
- Physical Pentest Tools
- Hackers Toolbox
- Hack Tools For Mac
- Pentest Tools Nmap
- Pentest Automation Tools
- Hacking Tools For Mac
- Hack Tools For Mac
- Hack Tools Pc
- Hack Tools Download
- Pentest Tools Tcp Port Scanner
- Hacker Tools For Mac
- Hacking Tools For Kali Linux
- Hack Rom Tools
- How To Install Pentest Tools In Ubuntu
- Hacker Tools
- Pentest Tools For Android
- Hacking Apps
- Hack Tools Mac
- Nsa Hack Tools Download
- Pentest Tools Tcp Port Scanner
- How To Install Pentest Tools In Ubuntu
- Hacker Tools
- Hacker Tools Github
- Pentest Tools Open Source
- Black Hat Hacker Tools
- Pentest Tools For Android
- Hacker Tools For Pc
- Hacking Tools Windows
- Hacking App
- Pentest Tools Port Scanner
- Hackrf Tools
- Pentest Tools Review
- Tools 4 Hack
- Hack Tools Pc
- Hacker Tools Free Download
- Underground Hacker Sites
- Pentest Tools
- Nsa Hack Tools Download
- Pentest Tools Find Subdomains
- Hacking Tools Name
- Hack Tools For Pc
- Hacking Tools Hardware
- Hack Tools For Ubuntu
- Hacker Tools Github
- Hacker Tools
- Best Pentesting Tools 2018
- What Is Hacking Tools
- What Is Hacking Tools
- Tools For Hacker
- Pentest Tools Framework
- Hacking Tools Pc
- Hack Website Online Tool
- Hacker Security Tools
- Pentest Tools Windows
- Hacker Tools
- Pentest Tools List
- Hacking Apps
- Hack Tools
- Hack Tools For Windows
- Hack Tools Online
- Pentest Tools Windows
- Hacks And Tools
- Nsa Hacker Tools
- Hacking App
- Free Pentest Tools For Windows
- Hack Tool Apk
- Hack Tools Download
- Hacking Tools 2020
- Hacker Tools
- Pentest Tools List
- Pentest Tools
- Pentest Tools Alternative
- Nsa Hack Tools
- Hacker Hardware Tools
- Blackhat Hacker Tools
- Pentest Tools For Windows
- Pentest Tools Kali Linux
- New Hacker Tools
- Pentest Tools For Android
- Hacker Tools 2020
- Hack Tools Mac
- Hacking Tools
- Physical Pentest Tools
- Hacker Tools 2019
- Hacking Tools Kit
- Hacking Tools For Beginners
- Pentest Tools For Mac
- Hacker Tools Mac
- Kik Hack Tools
- Hacker Techniques Tools And Incident Handling
- Kik Hack Tools
- Hacking Tools
- Hackrf Tools
- Hack Tools 2019
- Pentest Tools Android
- Pentest Tools Alternative
- Hackers Toolbox
- Hacker Tools Free
- Hacker Tools Software
- Hack Tools
- Hacking Tools Software
- Hacking Tools Usb
- Hacker Tools Free
- Hack Tools
- Hack Tools Pc
- Hacking Apps
- Hack Tools Online
- Pentest Tools For Mac
- Hack Tools Mac
No hay comentarios:
Publicar un comentario