vagd.virts.degd =============== .. py:module:: vagd.virts.degd Classes ------- .. autoapisummary:: vagd.virts.degd.Degd Module Contents --------------- .. py:class:: Degd(binary: str, image: str = DEFAULT_IMAGE, user: str = DEFAULT_USER, forward: Optional[Dict[str, Any]] = None, packages: Optional[List[str]] = None, cap_add: Optional[List[str]] = None, privileged: bool = False, symbols: bool = True, files: Optional[Union[str, List[str]]] = None, libs: bool = False, tmp: bool = False, rm: bool = True, fast: bool = False, ex: bool = False, **kwargs: Any) Bases: :py:obj:`vagd.virts.pwngd.Pwngd` Native Docker API backend with Docker exec and gdbserver integration. :param binary: local binary to upload and execute :param image: Debian or Ubuntu base image :param user: user for target processes inside the container :param forward: additional Docker port mappings :param packages: additional packages installed while building the image :param cap_add: Linux capabilities to add to the container :param privileged: run the container with extended privileges :param symbols: install libc debug symbols :param files: additional files or directories to upload :param libs: download the target's dynamically linked libraries :param tmp: use a fresh temporary working directory :param rm: automatically remove the container when it stops .. py:attribute:: TYPE :value: 'degd' .. py:attribute:: LOCKFILE :value: './.vagd/docker-api.lock' .. py:attribute:: DOCKERHOME .. py:attribute:: DEFAULT_IMAGE :value: 'ubuntu:noble' .. py:attribute:: DEFAULT_USER :value: 'vagd' .. py:attribute:: WORKDIR :value: '/vagd' .. py:attribute:: GDBSERVER_PORT :value: 42069 .. py:attribute:: DEFAULT_PACKAGES :value: ['gdbserver', 'python3', 'sudo'] .. py:attribute:: is_new :value: False .. py:attribute:: _path :value: b'.' .. py:attribute:: _binary .. py:attribute:: _image :value: 'ubuntu:noble' .. py:attribute:: _user :value: 'vagd' .. py:attribute:: _forward .. py:attribute:: _cap_add :value: [] .. py:attribute:: _privileged :value: False .. py:attribute:: _rm :value: True .. py:attribute:: _symbols :value: True .. py:attribute:: _packages :value: ['gdbserver', 'python3', 'sudo'] .. py:attribute:: _client .. py:attribute:: _container .. py:attribute:: _workdir :value: '/vagd' .. py:method:: _ssh_setup() -> None setup ssh connection .. py:method:: _configuration() -> Dict[str, Any] .. py:method:: _image_configuration() -> Dict[str, Any] .. py:method:: _build_directory() -> str .. py:method:: _create_dockerfile() -> str .. py:method:: _build_image() -> Any .. py:method:: _container_name() -> str .. py:method:: _create_container() -> None .. py:method:: _vm_setup() -> None setup vagrant machine creates new one if no Vagrantfile is specified or box does not match .. py:method:: _run_wait(command: Union[str, List[str]], user: Optional[str] = None) -> bytes .. py:method:: _remote_exists(path: str) -> bool .. py:method:: _sync(file: str) -> bool upload file on remote if not exist :type file: file to upload :return: if the file was uploaded .. py:method:: _archive(path: str) -> bytes :staticmethod: .. py:method:: put_to(container: Any, file: str, remote: str) -> None :staticmethod: .. py:method:: put(file: str, remote: Optional[str] = None) -> None upload file or dir on vm, :param file: file to upload :param remote: remote location of file, working directory if not specified :return: returns .. py:method:: pull_from(container: Any, file: str, local: Optional[str] = None) -> None :staticmethod: .. py:method:: pull(file: str, local: Optional[str] = None) -> None download file or dir on vm, :param file: remote location of file, working directory if not specified :param local: local location of file, current directory if not specified :return: returns .. py:method:: libs(directory: str) -> None Downloads the libraries referred to by a file. This is done by running ldd on the remote server, parsing the output and downloading the relevant files. directory(str): Output directory :return: .. py:method:: which(program: str) -> Optional[str] .. py:method:: process(argv: Optional[List[str]] = None, command: Optional[List[str]] = None, **kwargs: Any) -> vagd.virts.docker_exec.DockerExecTube run binary in vm as process :param argv: comandline arguments for binary :param kwargs: pwntool parameters :return: pwntools process .. py:method:: system(command: Union[str, List[str]]) -> vagd.virts.docker_exec.DockerExecTube executes command on vm, interface to pwnlib.tubes.ssh.ssh.system :param cmd: command to execute on vm :return: returns .. py:method:: debug(argv: Optional[List[str]] = None, gdb_args: Optional[List[str]] = None, gdbscript: str = '', sysroot: Optional[str] = None, sysroot_debug: Optional[str] = None, api: bool = False, **kwargs: Any) -> vagd.virts.docker_exec.DockerExecTube run binary in vm with gdb (pwnlib feature set) :param argv: comandline arguments for binary :param gdb_args: gdb args to forward to gdb :param gdbscript: GDB script for GDB :param sysroot: sysroot dir :param sysroot_debug: sysroot debug lib dir :param kwargs: pwntool parameters :return: pwntools process .. py:method:: start(argv: Optional[List[str]] = None, gdbscript: str = '', api: bool = False, sysroot: Optional[str] = None, sysroot_debug: Optional[str] = None, gdb_args: Optional[List[str]] = None, **kwargs: Any) -> vagd.virts.docker_exec.DockerExecTube start binary on remote and return pwnlib.tubes.process.process :param argv: commandline arguments for binary :param gdbscript: GDB script for GDB :param api: if GDB API should be enabled :param sysroot: sysroot dir :param sysroot_debug: sysroot debug lib dir :param gdb_args: extra gdb args :param kwargs: pwntool parameters :return: pwntools process, if api=True tuple with gdb api