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 word
- Pentest Tools For Mac
- Easy Hack Tools
- Pentest Tools Windows
- Physical Pentest Tools
- Hack Tools For Mac
- Hacker Tools
- Wifi Hacker Tools For Windows
- Hack Tools Pc
- Easy Hack Tools
- Hacking Tools For Mac
- New Hacker Tools
- Hack App
- Blackhat Hacker Tools
- Hacker Tool Kit
- Hacking Tools For Mac
- Hacker Tools Windows
- Usb Pentest Tools
- Hacking Tools Name
- Best Hacking Tools 2020
- Hackers Toolbox
- Pentest Tools Android
- Kik Hack Tools
- Pentest Recon Tools
- Hacker Tool Kit
- Hacking Tools Mac
- Pentest Tools Review
- Wifi Hacker Tools For Windows
- Physical Pentest Tools
- Hacks And Tools
- Usb Pentest Tools
- Termux Hacking Tools 2019
- Hacker Tools For Windows
- Hack Tools For Pc
- New Hacker Tools
- Hacking Tools Mac
- Bluetooth Hacking Tools Kali
- Hacking Tools Name
- Hacks And Tools
- Pentest Box Tools Download
- Hacker Tools Apk
- Android Hack Tools Github
- Pentest Tools Download
- Hacking Tools 2020
- Tools 4 Hack
- Hacker Tools Github
- Hacking Tools 2019
- Hackers Toolbox
- Hack Tools For Ubuntu
- Pentest Tools Open Source
- Hack Tools For Windows
- Beginner Hacker Tools
- Pentest Tools Url Fuzzer
- Hacker Tools Software
- Hacker Techniques Tools And Incident Handling
- Hacking Tools For Beginners
- Top Pentest Tools
- Hacking Tools
- Hacker Tools For Ios
- Hacker Tools Hardware
- Hack Tools For Pc
- New Hacker Tools
- Pentest Tools Android
- Black Hat Hacker Tools
- Hack Tools Download
- Computer Hacker
- Hacker Tools Free Download
- Hack App
- Hacker Tools Github
- New Hacker Tools
- Hacker Tools For Ios
- Physical Pentest Tools
- Pentest Tools For Windows
- Hacking Tools For Beginners
- Hack And Tools
- Nsa Hack Tools Download
- Pentest Tools Website Vulnerability
- Hacking Tools For Windows 7
- Github Hacking Tools
- Hacker Tools Windows
- Hacker Tools For Mac
- How To Install Pentest Tools In Ubuntu
- Hacking Tools Mac
- Beginner Hacker Tools
- Free Pentest Tools For Windows
- Hacker Techniques Tools And Incident Handling
- Hacker Techniques Tools And Incident Handling
- Best Hacking Tools 2019
- Pentest Tools Windows
- How To Install Pentest Tools In Ubuntu
- Nsa Hacker Tools
- Hacker Tool Kit
- Hacker Tools Software
- Hacker Tools Hardware
- Hacker Tools For Mac
- Hack Tools For Ubuntu
- Pentest Tools Port Scanner
- Hacker Techniques Tools And Incident Handling
- Hacking App
- Hacking Tools Free Download
- Pentest Tools Review
- Growth Hacker Tools
- Hack Tool Apk No Root
- Pentest Tools For Windows
- Pentest Tools Kali Linux
- What Are Hacking Tools
- Best Hacking Tools 2019
- Usb Pentest Tools
- Hacking Tools
- Pentest Tools Tcp Port Scanner
- Hacker Tools
- Pentest Tools Bluekeep
- Hack And Tools
- Hack Tools For Mac
- Hack App
- Hacker Tools Linux
- Hacker Tools List
- Pentest Tools Linux
- Hacking App
- Beginner Hacker Tools
- Hacker Tools For Ios
- How To Hack
- Hacking Tools For Pc
- Pentest Tools Open Source
- Hacker Tools Linux
- Hacker
- Pentest Recon Tools
- Hacker Tools Windows
- Pentest Tools Find Subdomains
- Hacking Tools Windows
- Hacking Tools Github
- Kik Hack Tools
- Pentest Tools Website Vulnerability
- Hacking Tools 2020
- Hack Rom Tools
- Hacker Tool Kit
- Hack App
- Hacker Tools Software
- Pentest Tools Website
- Hacker Tools 2020
- How To Make Hacking Tools
- Hacker
- Hack Tools For Ubuntu
- Nsa Hacker Tools
- Hacking Tools For Pc
- Android Hack Tools Github
- Best Hacking Tools 2019
- Pentest Box Tools Download
- Hacker Tools 2020
- Hack Tools For Games
- Nsa Hack Tools
- Hacker Tools Free
- What Is Hacking Tools
- Physical Pentest Tools
- Hacker Techniques Tools And Incident Handling
- Hack Tools Download
- Pentest Tools Android
- Blackhat Hacker Tools
- Pentest Tools Download
- Pentest Recon Tools
- Hacking Tools Windows
- Hack Tools
- Hacking Tools For Mac
- Hacker Tools 2020
- Top Pentest Tools
- Pentest Box Tools Download
- Android Hack Tools Github
- Hacker
- Growth Hacker Tools
- Bluetooth Hacking Tools Kali
- Hacks And Tools
- How To Make Hacking Tools
- Pentest Tools Website
- Usb Pentest Tools
No comments:
Post a Comment