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.
Related word
- Hacking Tools Name
- Hack Tools
- Hacking Tools Software
- Hack Website Online Tool
- Hacker Tools List
- Hack Tools
- Hacker Tool Kit
- Hacker Security Tools
- Nsa Hack Tools
- Github Hacking Tools
- Hacker Tools Free
- Hacking Tools Windows
- Hacking Tools Kit
- Hacking Tools Online
- Pentest Tools Alternative
- Hack Tool Apk No Root
- Hacking Tools Free Download
- Pentest Tools For Android
- Pentest Tools For Mac
- Ethical Hacker Tools
- Pentest Tools Review
- Hacking Tools Name
- Hacking Tools Pc
- Hacker Tools For Windows
- Hack Tools For Windows
- Hacker Tools Software
- Hack Tools For Ubuntu
- New Hacker Tools
- What Is Hacking Tools
- Hacking Tools Free Download
- Hacker Tool Kit
- Hack Tools Github
- Hacking App
- Hacking Tools For Windows Free Download
- Pentest Tools Find Subdomains
- Install Pentest Tools Ubuntu
- Hacker Tools Github
- How To Make Hacking Tools
- Hacker Tools Hardware
- Pentest Tools Find Subdomains
- What Are Hacking Tools
- Hackrf Tools
- Pentest Tools
- Hacking App
- Hack And Tools
- Hacking Tools For Windows
- Hacking Tools Mac
- Pentest Tools Github
- Pentest Tools Github
- Best Pentesting Tools 2018
- Pentest Tools Apk
- Pentest Tools Website Vulnerability
- Pentest Tools Subdomain
- What Are Hacking Tools
- Tools 4 Hack
- Hackrf Tools
- Hack Tools Pc
- Pentest Tools Review
- Hacker Tools For Pc
- Hack Tools
- Pentest Tools Open Source
- Hack Tool Apk No Root
- Blackhat Hacker Tools
- Growth Hacker Tools
- Pentest Tools Url Fuzzer
- Hacking Tools And Software
- Hacking Tools For Windows Free Download
- Best Pentesting Tools 2018
- Pentest Tools For Mac
- Nsa Hacker Tools
- Hacking Tools 2020
- Black Hat Hacker Tools
- Pentest Tools Nmap
- Pentest Tools Open Source
- Hack Tools For Windows
- Hacker Tools For Mac
- Tools 4 Hack
- Hack Tool Apk No Root
- Game Hacking
- Pentest Tools Tcp Port Scanner
- Hacker Hardware Tools
- Hack Tools Mac
- World No 1 Hacker Software
- Hacker Tools Online
- What Are Hacking Tools
- Hacking Tools For Games
- Pentest Tools Android
- Hack Tools Online
- How To Hack
- Bluetooth Hacking Tools Kali
- Hacker Tools For Mac
- Hack Tools Pc
- Hacking Tools For Games
- Hacker Tools Mac
- Hack Tools
- Hacker
- Pentest Tools List
- Blackhat Hacker Tools
- Best Hacking Tools 2019
- Pentest Tools Open Source
- Black Hat Hacker Tools
- Termux Hacking Tools 2019
- Hacking Tools Github
- Computer Hacker
- Tools For Hacker
- Pentest Tools Github
- Hacking Tools Hardware
- World No 1 Hacker Software
- Tools For Hacker
- Hacking Tools Windows 10
- Hacking Tools Software
- Nsa Hack Tools Download
- Hacker Tools For Ios
- Pentest Automation Tools
- Pentest Tools Open Source
- Hack Tools For Ubuntu
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