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
- Hacking Tools Download
- Physical Pentest Tools
- Pentest Tools Find Subdomains
- Hacking Tools Hardware
- Hacker Tool Kit
- Hack Rom Tools
- Hacking Tools For Beginners
- Pentest Tools Port Scanner
- Pentest Tools Kali Linux
- Github Hacking Tools
- Pentest Tools Linux
- Hacker Tools 2019
- Pentest Tools Download
- Kik Hack Tools
- Kik Hack Tools
- Hacking Tools Hardware
- Nsa Hack Tools
- Hacker Tool Kit
- Install Pentest Tools Ubuntu
- Hacker Tool Kit
- Hacker Tools Software
- Hacking Tools Free Download
- Pentest Tools Online
- Pentest Tools Find Subdomains
- Pentest Tools Github
- Growth Hacker Tools
- Hacker Tools Online
- Pentest Tools For Android
- Growth Hacker Tools
- Pentest Tools Nmap
- Hacking Tools Windows
- Hacking App
- Wifi Hacker Tools For Windows
- Hacking Tools Free Download
- Hacking Tools And Software
- Hacker Tools Mac
- Pentest Tools Subdomain
- Ethical Hacker Tools
- Nsa Hacker Tools
- Github Hacking Tools
- Hacking Tools Windows
- Hacking Tools For Pc
- Pentest Tools Open Source
- Hacking Tools For Beginners
- Hack Tools For Games
- Blackhat Hacker Tools
- Pentest Tools Apk
- Game Hacking
- Pentest Tools Review
- Hacker Tools For Ios
- Pentest Tools Online
- Install Pentest Tools Ubuntu
- Ethical Hacker Tools
- Best Hacking Tools 2019
- Hacking Tools
- Tools Used For Hacking
- Hack Tools Online
- Pentest Tools List
- Hack Tools For Mac
- Hacker Tools Free Download
- Hacker Tools 2020
- Top Pentest Tools
- Hack Tools For Pc
- Hacker Tools List
- Best Pentesting Tools 2018
- Pentest Tools For Android
- New Hacker Tools
- How To Hack
- Hacking Tools Windows 10
- Black Hat Hacker Tools
- Hacking Tools For Pc
- Hack Tools Github
- Pentest Reporting Tools
- Hack Rom Tools
- Android Hack Tools Github
- Kik Hack Tools
- Pentest Tools Port Scanner
- Hacking Tools Free Download
- Hacking Tools For Beginners
- Hacking Tools Windows
- Hacking Tools
- Hacking Tools Online
- Hacker Tools Linux
- Pentest Tools Linux
- Best Hacking Tools 2019
- Hacking Apps
- Hacker Tools Mac
- Blackhat Hacker Tools
- Hacker Tools For Pc
- Hacking Tools Windows
- Hacking Tools Windows 10
- Best Hacking Tools 2019
- Hacking Tools Hardware
- Hacking Tools For Mac
- Hack Tools For Ubuntu
- Pentest Tools Download
- Hack Rom Tools
- Hacker Tools Github
- Hacking Tools Mac
- Hack Tools Github
- Hacking Tools 2019





Tidak ada komentar:
Posting Komentar