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.
Continue reading
- Pentest Tools Github
- Top Pentest Tools
- Computer Hacker
- Hack And Tools
- Hacker Tools Apk
- Pentest Tools Github
- Best Hacking Tools 2019
- Tools 4 Hack
- Tools 4 Hack
- Tools 4 Hack
- Pentest Tools
- Hack Tool Apk No Root
- Hack Tools For Ubuntu
- Tools For Hacker
- Install Pentest Tools Ubuntu
- Hack Rom Tools
- Hack Tools Pc
- Pentest Tools Website
- Pentest Tools Website
- Pentest Tools List
- How To Install Pentest Tools In Ubuntu
- Install Pentest Tools Ubuntu
- Hacking Tools 2020
- Github Hacking Tools
- Hack Tool Apk No Root
- Hacker Tools For Windows
- Hacking Tools Free Download
- Hacker Tools Free
- Pentest Tools Linux
- Easy Hack Tools
- Pentest Tools Free
- Hacker Tools Hardware
- Wifi Hacker Tools For Windows
- World No 1 Hacker Software
- Best Hacking Tools 2019
- Pentest Tools Download
- Hacking Tools For Pc
- Hack Tools Github
- Hack Tools Download
- World No 1 Hacker Software
- Easy Hack Tools
- New Hack Tools
- Hacker Tools Windows
- Pentest Tools For Windows
- Pentest Tools Windows
- Hacking Tools Usb
- Pentest Tools Review
- Hack And Tools
- Usb Pentest Tools
- World No 1 Hacker Software
- Underground Hacker Sites
- Pentest Tools Website
- Pentest Tools Download
- Hacking Tools Hardware
- How To Install Pentest Tools In Ubuntu
- Hacking Tools Usb
- Hack Tool Apk
- Tools For Hacker
- Hack Tool Apk
- Hacker Tools Hardware
- Hack Tools For Mac
- Hack Tools Online
- Hacking Tools For Games
- Pentest Tools Github
- Pentest Tools
- Hacking Tools For Games
- Hacker Tools Software
- Hacks And Tools
- Pentest Automation Tools
- Hacking Tools Software
- Hacking Tools And Software
- Pentest Tools Find Subdomains
- Hacker Tools Linux
- Top Pentest Tools
- World No 1 Hacker Software
- Pentest Tools Free
- Hacker Tools Github
- Computer Hacker
- How To Install Pentest Tools In Ubuntu
- Hacking Tools Pc
- Hackers Toolbox
- Easy Hack Tools
- Hack Tools For Games
- Pentest Tools Url Fuzzer
- Hacking Tools For Windows Free Download
- Hacker Tools 2019
- Pentest Tools Kali Linux
- Top Pentest Tools
- Black Hat Hacker Tools
- Hack Tools Pc
- Pentest Recon Tools
- Hacker Tools 2020
- Hacking Tools For Pc
- Game Hacking
- Nsa Hack Tools
- Underground Hacker Sites
- Hacker Tools Apk
- Pentest Tools Online
- World No 1 Hacker Software
- Hacking Tools Software
- Hacking Tools Free Download
- Hacker Tools Github
- Pentest Tools Android
- Hack Tools Download
- Hacker Tools Free
- Hack Tools Pc
- Pentest Tools Bluekeep
- Physical Pentest Tools
- Hacker Tools Free Download
- Pentest Tools Download
- Hacker Tools Software
- Growth Hacker Tools
- Pentest Reporting Tools
- Hacker Tools Mac
- Hack Tools Download
- Kik Hack Tools
- Hack Tools For Games
- Usb Pentest Tools
- Hack Tools For Windows
- Growth Hacker Tools
- Hacking Tools For Beginners
- Hacking Tools Software
- Hacking Tools Mac
- Hacker Techniques Tools And Incident Handling
- How To Install Pentest Tools In Ubuntu
- Hacker Techniques Tools And Incident Handling
- Best Hacking Tools 2019
- Hack And Tools
- Pentest Tools Review
- Free Pentest Tools For Windows
- Hacking Tools Hardware
- Hacker Tools 2020
- Pentest Tools For Windows
- Hack And Tools
- Hacker Tools 2019
- Hack And Tools
- Hack Tools Online
- Hacker Tools 2020
- Hacking Tools Mac
- Hacking Apps
- Android Hack Tools Github
- Pentest Recon Tools
- Pentest Tools Website
- Hacker Tools For Mac
- Hacking Tools 2020
No hay comentarios:
Publicar un comentario