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.
Related news
- Pentest Tools For Ubuntu
- Pentest Tools Website
- Hack Rom Tools
- Wifi Hacker Tools For Windows
- Pentest Tools Online
- Hack Tools Online
- Hacker Tools For Ios
- Hacking Tools
- Hak5 Tools
- Hacking Tools For Windows 7
- Hacker Tools Software
- Hacking Tools Windows 10
- Bluetooth Hacking Tools Kali
- Hacking Tools Online
- Hackrf Tools
- Pentest Recon Tools
- How To Make Hacking Tools
- World No 1 Hacker Software
- Pentest Tools Nmap
- Hackers Toolbox
- Pentest Tools Website Vulnerability
- Pentest Tools For Ubuntu
- Top Pentest Tools
- Hacker Tools Apk
- Hack Tools For Games
- Wifi Hacker Tools For Windows
- Ethical Hacker Tools
- Pentest Tools Nmap
- Hacking Tools 2019
- Game Hacking
- Hacker Tools Software
- Tools Used For Hacking
- Pentest Tools Find Subdomains
- Hacker Tools For Ios
- Hacking Tools Hardware
- Best Pentesting Tools 2018
- Pentest Tools Review
- Hacker Tools For Pc
- Hacking Tools For Mac
- Hacking Tools Free Download
- Hacking Tools Github
- Hacker Tools 2020
- What Is Hacking Tools
- Top Pentest Tools
- Pentest Tools For Mac
- Hacking Tools Name
- Hack Tools For Mac
- Hacker Tool Kit
- Hacking Tools Software
- Pentest Tools Apk
- Hacking Tools 2020
- Hacking Tools Online
- Hack Tools Download
- Hacker Security Tools
- Pentest Tools Port Scanner
- Pentest Tools Apk
- Bluetooth Hacking Tools Kali
- Hack Tools Pc
- Hacking Tools For Windows
- Pentest Tools Nmap
- Game Hacking
- Usb Pentest Tools
- Hacking Tools Windows 10
- Hacker Tool Kit
- Pentest Tools Find Subdomains
- Pentest Tools Open Source
- Pentest Tools Nmap
- Pentest Tools Subdomain
- Hack Tools
- Computer Hacker
- Blackhat Hacker Tools
- Pentest Tools Github
- Hack Tools For Ubuntu
- Hack Tools For Pc
- Hack Tools Download
- Hacking Tools For Windows Free Download
- Pentest Tools Open Source
- Pentest Tools Review
- Tools Used For Hacking
- Hack Tools For Ubuntu
- Hacker Tools Mac
- Hacking Tools Online
- Hacker Tools For Ios
- Hack Website Online Tool
- Pentest Tools
- Hacks And Tools
- Hacker Techniques Tools And Incident Handling
- Hack Tools For Games
- Hacking Tools Github
- Hacker Tools 2019
- New Hacker Tools
- Hacker Tools 2020
- Pentest Tools Find Subdomains
- Best Hacking Tools 2020
- Kik Hack Tools
- Pentest Tools Website
- Pentest Tools Framework
- Kik Hack Tools
- Best Pentesting Tools 2018
- Hacker Tools Github
- Hackers Toolbox
- Hacker Tools For Mac
- Hacking Tools Software
- Pentest Tools For Windows
- Pentest Automation Tools
- Hacker Tools Free Download
- Hack Tool Apk
- Pentest Tools For Mac
- Install Pentest Tools Ubuntu
- How To Make Hacking Tools
- Hacker Tool Kit
- Pentest Recon Tools
- Hacking Tools For Pc
- Hack Tools For Mac
- Underground Hacker Sites
- Kik Hack Tools
- Hacker Search Tools
- Top Pentest Tools
- Best Hacking Tools 2020
- Top Pentest Tools
- Hack Tools Online
- Growth Hacker Tools
- Hack Tools For Windows
- Pentest Tools For Ubuntu
- Pentest Tools Website Vulnerability
- Hacking Tools Windows
- Hacking App
- Hacking Tools Free Download
- Usb Pentest Tools
- Pentest Tools Open Source
- Pentest Tools Download
- Hacker Tools Software
- Hacking Tools For Windows 7
- Pentest Tools For Android
- Tools For Hacker
- Free Pentest Tools For Windows
- Hacking Tools Free Download
- Hacking Tools For Windows Free Download
- Hacking Tools Online
- Nsa Hacker Tools
- Hacking Tools Hardware
- Hacker Tools 2019
- Hacking Tools For Pc
- Hacker Tools 2020
- Hacking Tools For Windows Free Download
- Hack Tools For Games
- Termux Hacking Tools 2019
- Hacker Tools Free Download
- Hacker Tools Apk
- Pentest Tools Github
- Nsa Hack Tools Download
- Hacker Tools Free
- Hacker Techniques Tools And Incident Handling
No comments:
Post a Comment