vagd.cli

Attributes

DOGD_BOX

DOGD

POGD

QEGD_BOX

QEGD

SHGD

VAGD_BOX

VAGD

AD_ENV

app

err_console

console

Functions

quote(x)

_version(→ None)

main() → None)

add_virt(dependencies, vms, dependency, template, args)

_parse_target(→ Tuple[str, int])

split unified targets like HOST:PORT or 'nc HOST PORT' into ip and port

_info(→ str)

template([binary, ip, port, output_exploit, output, ...])

creates a template

info([binary])

analyses the binary, prints checksec and .comment (often includes Distro and Compiler info)

_get_type(→ str)

_exec(cmd[, env])

_ssh(port, user)

ssh([user])

ssh to current vagd instance (must be in exploit dir)

_scp(port, user, source, target, recursive[, keyfile])

_unmount_sysroot()

scp([source, target, recursive, user])

scp to from current vagd instance (must be in exploit dir)

clean()

clean current vagd instance (stop/kill/remove/destroy)

start()

Module Contents

vagd.cli.quote(x: str)
vagd.cli.DOGD_BOX = 'Box.DOCKER_UBUNTU'
vagd.cli.DOGD = 'vm = Dogd(BINARY, image={box}, {args})  # Docker'
vagd.cli.POGD = 'vm = Pogd(BINARY, image={box}, {args})  # Podman'
vagd.cli.QEGD_BOX = 'Box.QEMU_UBUNTU'
vagd.cli.QEGD = 'vm = Qegd(BINARY, img={box}, {args})  # Qemu'
vagd.cli.SHGD = "vm = Shgd(BINARY, user='user', host='localhost', port=22, {args})  # SSH"
vagd.cli.VAGD_BOX = 'Box.VAGRANT_JAMMY64'
vagd.cli.VAGD = 'vm = Vagd(BINARY, {box}, {args})  # Vagrant'
vagd.cli.AD_ENV = Multiline-String
Show Value
"""# ad envs
IS_AD  = os.getenv('TARGET_IP') is not None           # running on ad
IP     = os.getenv('TARGET_IP', IP)                   # remote ip
EXTRA  = json.loads(os.getenv('TARGET_EXTRA', '{}'))  # flag ids"""
vagd.cli.app
vagd.cli.err_console
vagd.cli.console
vagd.cli._version(value: bool) → None
vagd.cli.main(version: bool | None = typer.Option(None, '--version', '-v', help='Show current vagd version and exit.', callback=_version, is_eager=True)) → None
vagd.cli.add_virt(dependencies: List[str], vms: List[str], dependency: str, template: str, args: Dict[str, str], multi: bool = False, box: str = 'BOX')
vagd.cli._parse_target(ip: str, port: int) → Tuple[str, int]

split unified targets like HOST:PORT or ‘nc HOST PORT’ into ip and port

vagd.cli._info(binary, color=True) → str
vagd.cli.template(binary: str | None = typer.Argument('', help='Binary to Exploit, may be omitted (then IP and PORT shift left)'), ip: str | None = typer.Argument('', envvar='VAGD_IP', help="remote target, accepts HOST, HOST:PORT or 'nc HOST PORT'"), port: int | None = typer.Argument(0, envvar='VAGD_PORT', help='port of the remote target'), output_exploit: bool | None = typer.Option(False, '-e', help='output file of the template (also add +x) to exploit.py'), output: str | None = typer.Option('', '-o', help='output file of the template (also add +x), default stdout'), libc: str | None = typer.Option('', '--libc', '-l', help='add libc to template'), library: List[str] | None = typer.Option([], '--library', '-L', help='patch the binary to use a local shared library'), interpreter: str | None = typer.Option('', '--interpreter', '--ld', '-i', help='patch the binary to use a local ELF interpreter'), patchelf: bool | None = typer.Option(False, '--patchelf', '-p', help='patch the binary with the supplied libraries/interpreter'), libs: bool | None = typer.Option(False, '--libs', help='download libraries from virt'), files: List[str] | None = typer.Option([], '--files', '-f', help='add files to remote'), packages: List[str] | None = typer.Option([], '--package', '--packages', help='install package in the virtual environment'), ssl: bool | None = typer.Option(False, '--ssl', help='use TLS for the remote pwntools connection'), socket: bool | None = typer.Option(False, '--socket', help='use a one-shot socket for the virtual target'), symbols: bool | None = typer.Option(True, '--no-symbols', help='install libc debug symbols (might update libc)'), auto: bool | None = typer.Option(False, '--auto', '-a', help="detect the container image from a Dockerfile (binary dir, then cwd) or the binary's .comment"), dogd: bool | None = typer.Option(False, '--dogd', '--docker', '-d', help='create docker template'), pogd: bool | None = typer.Option(False, '--pogd', '--podman', '-P', help='create podman template'), image: str | None = typer.Option(DOGD_BOX, '--image', help='docker image to use'), qegd: bool | None = typer.Option(False, '--qegd', '--qemu', '-q', help='create qemu template'), img: str | None = typer.Option(QEGD_BOX, '--img', help='qemu cloud image to use'), vagd: bool | None = typer.Option(False, '--vagd', '--vagrant', help='DEPRECATED: create vagrant template'), vbox: str | None = typer.Option(VAGD_BOX, '--vbox', help='vagrant box to use'), shgd: bool | None = typer.Option(False, '--shgd', '--ssh', '-s', help='create ssh template'), local: bool | None = typer.Option(False, '--local', help='create local template'), ad: bool | None = typer.Option(False, '--ad', help='create an ad compatible template'), root: bool | None = typer.Option(False, '--root', '-r', help='create a root environment'), no_aliases: bool | None = typer.Option(False, '--no-aliases', help='no aliases in the template'), no_info: bool | None = typer.Option(False, '--no-info', help='no binary info'))

creates a template

vagd.cli.info(binary: str = typer.Argument(..., help='Binary to analyse'))

analyses the binary, prints checksec and .comment (often includes Distro and Compiler info)

vagd.cli._get_type() → str
vagd.cli._exec(cmd: str, env: Dict[str, str] | None = None)
vagd.cli._ssh(port, user)
vagd.cli.ssh(user: str | None = typer.Option(None, '--user', '-u', help='ssh user'))

ssh to current vagd instance (must be in exploit dir)

vagd.cli._scp(port: int, user: str, source: str, target: str, recursive: bool, keyfile: str = Pwngd.KEYFILE)
vagd.cli._unmount_sysroot()
vagd.cli.scp(source: str = typer.Argument(..., help='source file'), target: str = typer.Argument('vagd:./', help='target file'), recursive: bool = typer.Option(False, '-r', '--recursive', help='recursive copy'), user: str | None = typer.Option(None, '--user', '-u', help='ssh user'))

scp to from current vagd instance (must be in exploit dir)

vagd.cli.clean()

clean current vagd instance (stop/kill/remove/destroy)

vagd.cli.start()