From 720522a385dd72038c39543718480222ebb58b01 Mon Sep 17 00:00:00 2001 From: ZSecurity Date: Sat, 24 Oct 2026 14:07:06 +0700 Subject: [PATCH] feat(poc): profiles, elf symbol derivation, wire layer --- .gitattributes | 6 +++ .gitignore | 1 + poc/__init__.py | 3 ++ poc/elf.py | 44 +++++++++++++++++++++ poc/profiles.py | 38 ++++++++++++++++++ poc/wire.py | 87 ++++++++++++++++++++++++++++++++++++++++++ tests/test_elf.py | 22 +++++++++++ tests/test_profiles.py | 36 +++++++++++++++++ tests/test_wire.py | 30 +++++++++++++++ 9 files changed, 267 insertions(+) create mode 100644 .gitattributes create mode 100644 poc/__init__.py create mode 100644 poc/elf.py create mode 100644 poc/profiles.py create mode 100644 poc/wire.py create mode 100644 tests/test_elf.py create mode 100644 tests/test_profiles.py create mode 100644 tests/test_wire.py diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b66ae78 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +* text=auto eol=lf +*.sh text eol=lf +*.conf text eol=lf +*.php text eol=lf +*.py text eol=lf +*.md text eol=lf diff --git a/.gitignore b/.gitignore index c1a8b96..d676557 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ research/upstream/ research/captures/*.resp research/captures/*.bin research/libphp.so +research/control/ diff --git a/poc/__init__.py b/poc/__init__.py new file mode 100644 index 0000000..6db105a --- /dev/null +++ b/poc/__init__.py @@ -0,0 +1,3 @@ +__author__ = "Hermes Agent" +__org__ = "independent security research" +__version__ = "0.1.0" diff --git a/poc/elf.py b/poc/elf.py new file mode 100644 index 0000000..41aee63 --- /dev/null +++ b/poc/elf.py @@ -0,0 +1,44 @@ +import struct + +SHT_SYMTAB = 2 +SHT_DYNSYM = 11 + + +def _sections(buf): + if buf[:4] != b"\x7fELF" or buf[4] != 2: + raise ValueError("not an ELF64 file") + e_shoff, = struct.unpack_from("