Exploiting Golang Unsafe Pointers
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.
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:
In this way it's possible to build a rop chain using golang runtime to unprotect a shellcode.
More articles
- Pentest Tools Apk
- Hackers Toolbox
- Hacking Tools For Windows Free Download
- Hacker Tools 2020
- Hacking Apps
- Easy Hack Tools
- Hacker Tools For Mac
- Hacker
- Pentest Tools Find Subdomains
- Hacking Tools Name
- Hacker Tools Software
- Hacker Techniques Tools And Incident Handling
- Hacker Tools
- Hacker Tools Apk Download
- Hacker Tools Linux
- Pentest Tools Find Subdomains
- Best Pentesting Tools 2018
- Hacking Apps
- Tools Used For Hacking
- Hacking Tools Usb
- Hackrf Tools
- Hacker Tools Github
- Hack Tools For Games
- Best Hacking Tools 2019
- Hacking Tools For Pc
- Pentest Tools Subdomain
- Hacker Tools Mac
- Pentest Tools Download
- Hacker Tools Windows
- Pentest Tools List
- Hacker Security Tools
- Hacking Tools For Windows 7
- Install Pentest Tools Ubuntu
- Pentest Tools Open Source
- Pentest Tools Framework
- Hack Tools For Ubuntu
- Hack Tools
- Hacker Tools For Windows
- How To Make Hacking Tools
- Hackrf Tools
- Pentest Tools Framework
- Blackhat Hacker Tools
- Hacker Hardware Tools
- Hack App
- Hackers Toolbox
- Pentest Tools Port Scanner
- Hacking Tools For Windows Free Download
- Install Pentest Tools Ubuntu
- Hack Tools For Pc
- Best Pentesting Tools 2018
- Hack Tools For Games
- Free Pentest Tools For Windows
- Hack Tools Github
- Game Hacking
- Nsa Hacker Tools
- Pentest Tools List
- Hack Tools For Windows
- Pentest Tools Windows
- Hacking Tools Github
- Hacking Apps
- Hack Tools For Pc
- Hack Tools For Windows
- Pentest Tools Find Subdomains
- Hacker Tools Software
- Hacker Tools Apk
- Pentest Tools Find Subdomains
- Top Pentest Tools
- Pentest Tools Free
- Beginner Hacker Tools
- Nsa Hack Tools Download
- Hack Website Online Tool
- Hacker Tools
- Hacker Tools Free Download
- How To Hack
- Termux Hacking Tools 2019
- Pentest Tools Tcp Port Scanner
- Hacking Tools For Kali Linux
- Hack Tools
- Hacker Tools Hardware
- Hack Tools Mac
- Hacking Tools Software
- Pentest Tools Url Fuzzer
- Hack Tools For Ubuntu
- Hack Tools For Windows
- Pentest Tools Download
- Hack Website Online Tool
- Hack Tools For Mac
- Hack Tools Download
- World No 1 Hacker Software
- Pentest Tools Url Fuzzer
- Pentest Tools Windows
- Hacking Tools 2020
- Hacker Tools Hardware
- Pentest Tools Subdomain
- Pentest Tools Linux
- Pentest Tools Bluekeep
- Github Hacking Tools
- Hacks And Tools
- Hacking Tools Windows
- Best Hacking Tools 2019
- Best Hacking Tools 2020
- Hacker Tools 2019
- Bluetooth Hacking Tools Kali
- Hacker Tools Linux
- Hacking Tools 2020
- Hacking Tools
- Hack Tools Github
- Hacking Tools For Windows
- Pentest Tools Website
- New Hack Tools
- Hacking Tools Usb
- Hacking App
- Android Hack Tools Github
- Bluetooth Hacking Tools Kali
- Hacking Tools Software
- Hacking Tools 2019
- Hacking Tools Hardware
- Pentest Box Tools Download
- New Hack Tools
- Pentest Tools Alternative
- Wifi Hacker Tools For Windows
- Computer Hacker
- Pentest Tools Kali Linux
- Hack Rom Tools
- Hack Tools For Pc
- Hacking Tools 2019
- World No 1 Hacker Software
- Hacker Tools For Ios
- Hacker Tools Software
Write admin description here..
Get Updates
Subscribe to our e-mail newsletter to receive updates.
Share This Post
Related posts
0 comentarios:
Publicar un comentario