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 links
- Hacking Tools Kit
- New Hacker Tools
- Hack Tool Apk No Root
- Hacker Tools Apk Download
- Pentest Tools Github
- Growth Hacker Tools
- Kik Hack Tools
- Hack Tools For Mac
- Hack Tools Mac
- Hacking Tools For Kali Linux
- Best Hacking Tools 2020
- Hack App
- Hack Tools For Mac
- Pentest Tools Apk
- Pentest Tools Free
- Hack Tools Pc
- Hacker Security Tools
- Hacker Techniques Tools And Incident Handling
- Black Hat Hacker Tools
- Pentest Tools Github
- Hack Rom Tools
- Hacking Tools 2020
- Hacking Tools For Kali Linux
- Hacker Tools Windows
- Hack Tools
- Hacker Security Tools
- Pentest Tools For Mac
- Hacking Tools Software
- Pentest Tools Apk
- Hacking Tools For Windows
- Pentest Tools Free
- Hacking Tools For Mac
- Hacking Tools 2019
- Pentest Tools Free
- Hacking Tools Usb
- Game Hacking
- Pentest Tools Open Source
- Hack Tools For Pc
- Android Hack Tools Github
- Hacking Apps
- Hack Tool Apk
- Pentest Tools Review
- Pentest Tools Framework
- Hacking Tools Download
- Pentest Tools Port Scanner
- Kik Hack Tools
- Pentest Tools Open Source
- Pentest Tools List
- Hack Tools For Windows
- World No 1 Hacker Software
- Computer Hacker
- Pentest Tools Download
- Pentest Tools Apk
- Pentest Tools Subdomain
- Hacker Tools Linux
- Hacking Tools For Windows Free Download
- Pentest Tools Online
- Hacking App
- Hacker Tools Free
- Nsa Hack Tools
- Hacking Tools For Pc
- Pentest Tools List
- Hack Tools For Pc
- Hack Rom Tools
- New Hack Tools
- Hack Tools 2019
- Pentest Tools Find Subdomains
- Hacking Tools Free Download
- Best Pentesting Tools 2018
- Pentest Tools List
- Hacking Tools For Windows
- Hacker Tools Apk
- Pentest Tools Port Scanner
- Hacker Tools Online
- Pentest Tools Free
- Pentest Tools Find Subdomains
- Hacker Tools
- Hacking Tools Windows
- Pentest Tools Free
- Pentest Tools Alternative
- Hacker Tools Apk
- Hack Website Online Tool
- Best Pentesting Tools 2018
- Top Pentest Tools
- Computer Hacker
- Hacker Tools 2019
- Hack Tools For Mac
- Wifi Hacker Tools For Windows
- Pentest Tools List
- Hacker Tools 2019
- Pentest Tools Android
- Pentest Tools Windows
- How To Install Pentest Tools In Ubuntu
- Hack Tools
- Pentest Tools Windows
- Hack Tool Apk No Root
- Hack And Tools
- How To Hack
- Hacker Tools For Mac
- Hack Tools Github
- Hacking Tools Download
- Hack Website Online Tool
- Hack Rom Tools
- Pentest Tools Alternative
- Hack Tools Download
- How To Install Pentest Tools In Ubuntu
- Hacker Tools Linux
- Hack Tool Apk
- Hack And Tools
- How To Install Pentest Tools In Ubuntu
- Hack App
- Hack Tools For Ubuntu
- Pentest Tools For Mac
- Wifi Hacker Tools For Windows
- Pentest Tools
- Hacking Tools 2020
- How To Install Pentest Tools In Ubuntu
- Free Pentest Tools For Windows
- Pentest Recon Tools
- Pentest Tools Windows
- Hacker Tools For Ios
- Hackrf Tools
- Blackhat Hacker Tools
- Pentest Tools Bluekeep
- Hacking Tools For Windows 7
- Hacker Techniques Tools And Incident Handling
- Hacker Security Tools
- Hacking Tools And Software
- Hacking Tools Name
- Hacking Apps
- Hacker Tools List
- Pentest Tools Github
- Pentest Tools Kali Linux
- Tools 4 Hack
- Pentest Tools Apk
- Beginner Hacker Tools
- Hacking Tools Github
- Hacking Tools Mac
- Pentest Box Tools Download
- Hacking Tools For Pc
- Game Hacking
- Pentest Tools For Mac
- Hacking Tools For Games
- Termux Hacking Tools 2019
- Pentest Tools Github
- Pentest Tools Port Scanner
- Hack Tools For Windows
- World No 1 Hacker Software
- Kik Hack Tools
- Pentest Reporting Tools
- Pentest Tools Github
- Hacker Tool Kit
- Pentest Tools Website
- Hack Tools Mac
- Ethical Hacker Tools
- Hacker Tools Linux
- Pentest Tools For Ubuntu
- Pentest Automation Tools
- What Is Hacking Tools
0 comments:
Post a Comment