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 Url Fuzzer
- Hack Tools 2019
- Hacker Tools Github
- Hack Tool Apk
- Tools 4 Hack
- How To Make Hacking Tools
- Easy Hack Tools
- Usb Pentest Tools
- Pentest Tools Kali Linux
- Hacking Tools For Pc
- Hacking Tools Mac
- Pentest Tools Website
- Hacker Tools Linux
- Tools Used For Hacking
- World No 1 Hacker Software
- Hacker Hardware Tools
- Easy Hack Tools
- Hacker Tools Apk
- Easy Hack Tools
- Pentest Tools Tcp Port Scanner
- Hack Tools Download
- Hacking Tools Pc
- How To Make Hacking Tools
- Hacker Tools Free
- Wifi Hacker Tools For Windows
- Android Hack Tools Github
- Hacker Tools For Windows
- Hacker Tools For Mac
- Free Pentest Tools For Windows
- Pentest Recon Tools
- Hacking Tools For Mac
- Tools 4 Hack
- Hacker Tools Github
- Ethical Hacker Tools
- Hack Tools 2019
- Pentest Recon Tools
- Hackrf Tools
- Hacking Tools Kit
- Hacker
- New Hacker Tools
- Install Pentest Tools Ubuntu
- Hack Tools Github
- Pentest Tools Website
- Blackhat Hacker Tools
- Hack Website Online Tool
- Hack Tool Apk No Root
- Pentest Tools Framework
- Hacking Tools For Windows
- How To Install Pentest Tools In Ubuntu
- Hack Tool Apk
- Hack Rom Tools
- Pentest Tools Website Vulnerability
- Hack Website Online Tool
- Hacker Search Tools
- Pentest Tools Github
- Pentest Tools For Windows
- What Is Hacking Tools
- Pentest Recon Tools
- Hacker Tools Windows
- World No 1 Hacker Software
- Hacking Tools Pc
- Hacker Tools Windows
- Hack Tools Pc
- Pentest Tools For Windows
- Hacker Tools Online
- Pentest Tools Website Vulnerability
- Pentest Tools Url Fuzzer
- Usb Pentest Tools
- Android Hack Tools Github
- Install Pentest Tools Ubuntu
- New Hacker Tools
- Nsa Hack Tools
- Hacks And Tools
- How To Hack
- Hacker Tools List
- Tools For Hacker
- Pentest Tools Website
- Hacking Tools For Kali Linux
- Github Hacking Tools
- Hacking Tools For Beginners
- Hacking Tools Free Download
- Pentest Tools
- Hacking Tools Hardware
- New Hack Tools
- New Hacker Tools
- Pentest Tools Subdomain
- Hacking Tools Download
- Pentest Tools Website Vulnerability
- Hacker Tool Kit
- Pentest Tools Open Source
- Pentest Tools Tcp Port Scanner
- Hacking Tools Pc
- Hacking Tools Pc
- Pentest Tools Apk
- Pentest Tools Tcp Port Scanner
- Hack Tools
- How To Make Hacking Tools
- Top Pentest Tools
- Game Hacking
- Hack Tools Pc
- Physical Pentest Tools
- How To Hack
- Tools 4 Hack
- Pentest Tools Github
- Hacking Tools And Software
- Hacker Tools 2020
- Hacker Tools Github
- Pentest Tools For Ubuntu
- Hacker Tools For Pc
- Hack Tools For Windows
- Pentest Tools Open Source
- Hacker
- Pentest Tools Bluekeep
- Pentest Tools Url Fuzzer
- Hacking Tools
- Black Hat Hacker Tools
- New Hacker Tools
- New Hacker Tools
- Pentest Tools Online
- Hacker Search Tools
- Computer Hacker
- Hacker Tools Windows
- Hacking Tools For Windows 7
- Tools Used For Hacking
- Pentest Box Tools Download
- New Hacker Tools
- Hacker Tools Linux
- Pentest Tools For Android
- Hacker
- Hacking Tools For Windows
- Hacker Tools Hardware
- Hacking Tools Free Download
- Hacker Tools Hardware
- Computer Hacker
- Hack Tools For Games
- Hacker Techniques Tools And Incident Handling
- Hacking Tools And Software
- Hack Tools 2019
- Hack Rom Tools
- Nsa Hack Tools Download
- Hack Tools Online
- Hack Tools
- Hacking Tools Free Download
- Hacker Tools Linux
- Hack Tools For Pc
- Pentest Tools Windows
- Hack Tool Apk
- Pentest Tools Linux
- Hacker Tools Github
- Hak5 Tools
- Tools Used For Hacking
- Hack Tool Apk
- Pentest Box Tools Download
- Hack Tools For Windows
- Hack And Tools
- Pentest Tools Framework
- Best Pentesting Tools 2018
- Best Hacking Tools 2020
- Best Hacking Tools 2019
- Wifi Hacker Tools For Windows
- Hack And Tools
- Hacker Tools Free Download
- Pentest Tools Review
- Pentest Tools Github
- Pentest Tools Nmap
No comments:
Post a Comment