The first portion of any ELF file is the ELF header. This generally provides offsets to other headers (program headers and section headers) within an ELF.
typedef struct {
unsigned char e_ident[EI_NIDENT];
uint16_t e_type;| <?php | |
| /* | |
| Updated version, 2016-12-02: fixed shellcode so it *actually* works on QEMU | |
| usermode emulation (seems I pushed an old version), and removed debug output. | |
| ------------------------- | |
| NB: THIS PoC ONLY WORKS IN QEMU USERMODE EMULATION! | |
| If anyone wants to fix this, go ahead (no pun intended). | |
| However, I don't have a vulnerable product and am unwilling to acquire one. |
$ uname -r
| # Fail2Ban action for reporting to badips.com | |
| # | |
| # Author: Robert Wohleb | |
| # | |
| [Definition] | |
| # Option: actionstart | |
| # Notes.: command executed once at the start of Fail2Ban. | |
| # Values: CMD |
| local ffi = require("ffi") | |
| ffi.cdef[[ | |
| typedef void (*cb)(void); | |
| void call(int n, void (*)(void)); | |
| void loop(int n); | |
| void func(void); | |
| ]] | |
| local callback = ffi.load("./callback.so") | |
| local timeit = require("timeit") |