Skip to content

hijack_fd ¤

Classes:

Functions:

Attributes:

parser module-attribute ¤

parser = ArgumentParser(
    description="Replace a file descriptor of a debugged process.\n\nThe new file descriptor can point to:\n- a file\n- a pipe\n- a socket\n- a device, etc.\n\nExamples:\n1. Redirect STDOUT to a file:\n   `hijack-fd 1 /dev/null`\n\n2. Redirect STDERR to a socket:\n   `hijack-fd 2 tcp://localhost:8888`\n"
)

PARSED_FILE_ARG module-attribute ¤

PARSED_FILE_ARG = Tuple[Optional[ParsedSocket], Optional[str]]

ShellcodeRegs ¤

Bases: NamedTuple

Attributes:

newfd instance-attribute ¤

newfd: str

syscall_ret instance-attribute ¤

syscall_ret: str

stack instance-attribute ¤

stack: str

ParsedSocket ¤

Bases: NamedTuple

Attributes:

protocol instance-attribute ¤

protocol: Literal['tcp', 'udp']

ip_version instance-attribute ¤

ip_version: Literal['ipv4', 'ipv6']

address instance-attribute ¤

address: str

port instance-attribute ¤

port: int

get_shellcode_regs ¤

get_shellcode_regs() -> ShellcodeRegs

stack_size_alignment ¤

stack_size_alignment(s: int) -> int

asm_replace_file ¤

asm_replace_file(replace_fd: int, filename: str) -> tuple[int, str]

asm_replace_socket ¤

asm_replace_socket(
    replace_fd: int, socket_data: ParsedSocket
) -> tuple[int, str]

exec_shellcode_with_stack async ¤

exec_shellcode_with_stack(ec: ExecutionController, blob, stack_size: int)

parse_socket ¤

parse_socket(url: str) -> ParsedSocket

parse_file_or_socket ¤

parse_file_or_socket(s: str) -> PARSED_FILE_ARG

hijack_fd ¤

hijack_fd(fdnum: int, newfile: PARSED_FILE_ARG) -> None