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.
More articles
- Pentest Tools Subdomain
- Hacker Tools Linux
- Pentest Tools Github
- Pentest Tools Linux
- Hack Tools Mac
- Hacking Tools Windows 10
- Hacking Tools For Windows Free Download
- Nsa Hack Tools Download
- Hack Tools Pc
- Tools Used For Hacking
- Pentest Tools Windows
- World No 1 Hacker Software
- Black Hat Hacker Tools
- Install Pentest Tools Ubuntu
- Hak5 Tools
- Hacking Tools Download
- Pentest Tools For Ubuntu
- Growth Hacker Tools
- Pentest Tools List
- Hacker Tools For Ios
- Pentest Tools Tcp Port Scanner
- Hacking Tools Mac
- Pentest Tools Tcp Port Scanner
- Tools For Hacker
- Hacking Tools For Kali Linux
- Hacker Tools Software
- Hacker Tools For Windows
- Hacker Search Tools
- Hack Tool Apk No Root
- Hacking Tools For Windows Free Download
- Hacks And Tools
- Hacker Tools For Ios
- Underground Hacker Sites
- Hack Tool Apk
- Hacking Tools 2020
- Hacker Tools 2019
- Hacker Tools Software
- Hacking Tools Windows 10
- Hacker Tools Mac
- Pentest Tools Url Fuzzer
- Android Hack Tools Github
- Hacker Tools For Mac
- Free Pentest Tools For Windows
- Hacking Tools For Pc
- Physical Pentest Tools
- Pentest Tools Free
- Pentest Tools Online
- Pentest Tools Windows
- Hacker Tools Free
- Best Hacking Tools 2020
- Hack Tools 2019
- Pentest Tools Download
- Pentest Tools Framework
- Hack Tool Apk No Root
- Usb Pentest Tools
- Pentest Tools Open Source
- Hack And Tools
- Pentest Tools Bluekeep
- Hack Tools 2019
- Pentest Tools Review
- Hack Tools For Windows
- Hacking Tools Name
- Hacks And Tools
- Hacking Tools Download
- Hacker Tool Kit
- Hacker Tools 2020
- Hacking Tools For Beginners
- Pentest Tools Linux
- Hacker Tools Software
- Hacking Tools Software
- Hacking Tools Kit
- Pentest Recon Tools
- Hacking Tools Hardware
- Pentest Tools Free
- New Hack Tools
- Hacking Tools And Software
- Pentest Tools Bluekeep
- Hacking Tools
- Hack Tools Pc
- Beginner Hacker Tools
- Hacker Tools 2020
- Github Hacking Tools
- Pentest Tools Free
- Hacking Tools Mac
- Pentest Tools Framework
- Hack Tools For Games
- Hacking Tools Mac
- Hacker Tools For Pc
- Pentest Tools Alternative
- Pentest Tools Url Fuzzer
- Hacker Tools 2019
- Hacking Tools 2019
- Hacking Tools For Windows 7
- Hacking Tools Github
- Bluetooth Hacking Tools Kali
- Pentest Tools Kali Linux
- Best Hacking Tools 2020
- Hack Tools For Mac
- Pentest Box Tools Download
- Github Hacking Tools
- How To Install Pentest Tools In Ubuntu
- Hack Tools Download
- Hacker Tools Free Download
- New Hack Tools
- Hacker Tool Kit
- Hack Tool Apk No Root
- Hacking Tools For Windows Free Download
- Hacker Tools Free Download
- Android Hack Tools Github
- Pentest Automation Tools
- Hacking Tools Free Download
- Hacking Tools Free Download
- Pentest Tools Windows
- Wifi Hacker Tools For Windows
- Pentest Tools Kali Linux
- Pentest Box Tools Download
- Hacker Techniques Tools And Incident Handling
- Usb Pentest Tools
- Hack Tools For Games
- Hack Tools For Pc
- Physical Pentest Tools
- Pentest Tools Online
- Pentest Tools Port Scanner
- Best Hacking Tools 2019
- Hacking Tools For Pc
- Ethical Hacker Tools
- Hack Tools Github
- Pentest Automation Tools
- Pentest Tools Subdomain
- Hacker Tools List
- Hacking Tools Windows
- What Are Hacking Tools
- Pentest Tools For Mac
- Underground Hacker Sites
- Usb Pentest Tools
- Hacker Tools Windows
- Hacker Tool Kit
- Pentest Tools For Ubuntu
- Hacking Tools Software
- Best Pentesting Tools 2018
- Hacker Tools Apk Download
- Hacking Tools Kit
- Pentest Tools Open Source
- Hack Tool Apk No Root
- Github Hacking Tools
- Physical Pentest Tools
- Free Pentest Tools For Windows
- Hacking Tools Pc
- Hacking Tools For Windows
- Tools 4 Hack
- Pentest Recon Tools
- Pentest Tools Nmap
- Hack Tools Online
- Hack Rom Tools
- Hacking Tools Download
- Hacking Tools 2019
- Hacker Tool Kit
- Hacker Tools Github
- Pentest Tools Port Scanner
- Hacker Tool Kit
- Pentest Tools
- Hack Tools For Windows
- Pentest Box Tools Download
- Pentest Box Tools Download
- Pentest Tools
- Nsa Hack Tools Download
- Pentest Tools Windows
- Pentest Tools Website
- Hack Tool Apk No Root
- Hack Tools For Ubuntu
- Tools Used For Hacking
- Hacking Tools Usb
- Pentest Tools Open Source
- Hack Tools For Games
- Hacker
- Hack Tools Download
- Pentest Tools Review
- Hacker Techniques Tools And Incident Handling
No comments:
Post a Comment
All comments are welcome, but if you choose to comment using the "anonymous" button, please be sure to include your name at the end. All TRULY anonymous comments will be deleted. Thanks for your understanding...Blaine (aka 5KidMom)