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
- Hacking Tools 2019
- Underground Hacker Sites
- Tools For Hacker
- Hacker Tools Mac
- Physical Pentest Tools
- Hacking Tools Free Download
- Hacker Tools Hardware
- Hacker Security Tools
- Tools For Hacker
- Wifi Hacker Tools For Windows
- Hacking Tools Github
- Pentest Tools Alternative
- Hacking Tools For Pc
- Black Hat Hacker Tools
- Hak5 Tools
- World No 1 Hacker Software
- Hack Tools 2019
- Hack Tools Github
- Usb Pentest Tools
- Pentest Tools Open Source
- Pentest Tools Review
- Hacking Tools For Kali Linux
- Pentest Tools Subdomain
- Hacking Tools 2020
- Pentest Tools Website
- What Is Hacking Tools
- Hack Tools
- Hacking Tools Name
- Hacking Tools For Mac
- Hack Website Online Tool
- Nsa Hack Tools
- Hacking Tools Usb
- Hackrf Tools
- Pentest Tools For Mac
- How To Make Hacking Tools
- Hacking Tools For Kali Linux
- Hacker Tools
- Hacking Tools 2019
- Hack And Tools
- Ethical Hacker Tools
- Hacking Tools Github
- Hacking Tools Kit
- Hacking Tools For Windows 7
- Growth Hacker Tools
- Hacker Tools For Mac
- Blackhat Hacker Tools
- Pentest Tools Download
- Hacker Tools For Windows
- Pentest Tools Website
- Pentest Tools For Ubuntu
- Termux Hacking Tools 2019
- Hacker Tool Kit
- Hacking Tools For Pc
- Hack Tools For Windows
- Easy Hack Tools
- Hacks And Tools
- Hacking Tools For Games
- Hacking Tools For Kali Linux
- Hack Tools
- Pentest Tools Free
- Pentest Tools Online
- Tools Used For Hacking
- Hacker Tools 2019
- Pentest Tools For Ubuntu
- Hak5 Tools
- Hak5 Tools
- Android Hack Tools Github
- Underground Hacker Sites
- Hacking Apps
- Pentest Tools For Mac
- Pentest Tools Linux
- Pentest Tools Bluekeep
- Pentest Tools For Windows
- Black Hat Hacker Tools
- Pentest Automation Tools
- Hacking Tools Download
- Pentest Tools Website Vulnerability
- Pentest Tools Url Fuzzer
- Hacking Tools Kit
- Wifi Hacker Tools For Windows
- What Are Hacking Tools
- Hacker Tools For Mac
- Hacking Tools Hardware
- Hacking Tools Name
- Hacking Tools Hardware
- Underground Hacker Sites
- Hack Tools For Games
- Hacking Tools Pc
- Pentest Tools Nmap
- Hack Tools Download
- Pentest Box Tools Download
- Growth Hacker Tools
- Hack Apps
- New Hacker Tools
- Hacking Tools Pc
- What Are Hacking Tools
- Beginner Hacker Tools
- Hacking Tools Kit
- Pentest Tools For Windows
- Pentest Tools For Windows
- Hacker Tools Free Download
- Pentest Recon Tools
- Pentest Tools Online
- Pentest Tools Framework
- Hack Tools
- Hacker Hardware Tools
- Pentest Tools Apk
- Hacking Tools For Windows 7
- Hack Tools For Games
- Hacking Tools Kit
No hay comentarios:
Publicar un comentario