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.
Read more
- How To Install Pentest Tools In Ubuntu
- What Is Hacking Tools
- Hack Website Online Tool
- Github Hacking Tools
- Hak5 Tools
- Pentest Tools Subdomain
- Pentest Tools Website Vulnerability
- Hack Website Online Tool
- Hacker Tools For Windows
- Hacking Tools Kit
- Hacker Tool Kit
- Underground Hacker Sites
- Pentest Tools Tcp Port Scanner
- Hacker Tools 2020
- Hacker
- Pentest Tools For Android
- Hacking Tools
- What Is Hacking Tools
- Github Hacking Tools
- Nsa Hack Tools
- Hacking Tools Software
- Hacking Tools Kit
- Pentest Tools Url Fuzzer
- Hacker Techniques Tools And Incident Handling
- Top Pentest Tools
- Hackers Toolbox
- Pentest Reporting Tools
- Pentest Tools Framework
- Hack Tools For Pc
- How To Install Pentest Tools In Ubuntu
- Pentest Tools Bluekeep
- Nsa Hacker Tools
- How To Install Pentest Tools In Ubuntu
- Install Pentest Tools Ubuntu
- New Hacker Tools
- Hacker Tools Mac
- What Are Hacking Tools
- Hacker Security Tools
- Hacking Tools Github
- Pentest Tools Bluekeep
- Wifi Hacker Tools For Windows
- Pentest Recon Tools
- Ethical Hacker Tools
- Underground Hacker Sites
- Hack Tools Github
- Growth Hacker Tools
- Hacking Tools Github
- Top Pentest Tools
- Pentest Tools Review
- Hacking Tools And Software
- Pentest Tools List
- Hacking Tools Free Download
- Hack Tools
- Best Hacking Tools 2019
- Hacking Tools Windows
- Hacker Tools Windows
- Hacker Security Tools
- Hack And Tools
- New Hacker Tools
- Hack Tools
- Pentest Tools
- Hacking Tools Name
- Pentest Recon Tools
- Best Hacking Tools 2020
- Hacker Tools For Ios
- Pentest Tools
- What Are Hacking Tools
- Pentest Tools For Android
- Hack Tools For Games
- Hack Tools
- Pentest Tools For Ubuntu
- What Are Hacking Tools
- World No 1 Hacker Software
- How To Make Hacking Tools
- Hacker Tools Mac
- Game Hacking
- New Hacker Tools
- Pentest Tools Alternative
- Hacker Tool Kit
- Hacking Tools Software
- Hacking Apps
- Hacker Tools Mac
- Pentest Recon Tools
- Hacking Tools Usb
- Hacking Tools And Software
- Hacking Tools Windows 10
- Hacking Tools And Software
- Pentest Tools Windows
- Hacker Tools Software
- Hacking Tools For Beginners
- Hacking Apps
- Free Pentest Tools For Windows
- Pentest Tools Android
- Pentest Tools Android
- Pentest Tools
- Hacks And Tools
- Hacker Tools List
- How To Make Hacking Tools
- Hacker Tools For Ios
- Pentest Recon Tools
- Hacking Tools Download
- Blackhat Hacker Tools
- Pentest Tools Linux
- Pentest Tools
- Hacking Tools Windows 10
- Hacking Tools For Kali Linux
- Hack Tools Pc
- Pentest Tools Online
- Install Pentest Tools Ubuntu
- Hack App
- Hack Website Online Tool
- Pentest Tools Free
- Hack Website Online Tool
- Hacking Tools For Pc
- Pentest Tools For Android
- Hacker Tools Free Download
- Hacking Tools Windows
- Hack Tool Apk
- Pentest Tools Nmap
- Hack Tools For Ubuntu
- Hacking Tools Name
- Hacking Tools Mac
- Hacker Tools Free Download
- Hacking Tools Pc
- Nsa Hack Tools Download
- Hacker Tools Apk
- Pentest Tools Linux
- Hacker Search Tools
- Pentest Tools For Windows
- Pentest Tools For Ubuntu
- Hacking Tools For Beginners
- Hacking Tools Github
- Hacker Security Tools
- Hacks And Tools
- Pentest Tools Nmap
- Hacking Tools Windows 10
- Pentest Tools Kali Linux
- Github Hacking Tools
- Hacker Tools Apk Download
- Free Pentest Tools For Windows
- Hack Website Online Tool
- Pentest Tools Tcp Port Scanner
- Pentest Tools Windows
No comments:
Post a Comment