vagd.cli ======== .. py:module:: vagd.cli Attributes ---------- .. autoapisummary:: vagd.cli.DOGD_BOX vagd.cli.DOGD vagd.cli.QEGD_BOX vagd.cli.QEGD vagd.cli.SHGD vagd.cli.VAGD_BOX vagd.cli.VAGD vagd.cli.AD_ENV vagd.cli.app vagd.cli.err_console vagd.cli.console Functions --------- .. autoapisummary:: vagd.cli.quote vagd.cli._version vagd.cli.main vagd.cli.add_virt vagd.cli._info vagd.cli.template vagd.cli.info vagd.cli._get_type vagd.cli._exec vagd.cli._ssh vagd.cli.ssh vagd.cli._scp vagd.cli.scp vagd.cli.clean vagd.cli.start Module Contents --------------- .. py:function:: quote(x: str) .. py:data:: DOGD_BOX :value: 'Box.DOCKER_UBUNTU' .. py:data:: DOGD :value: 'vm = Dogd(BINARY, image={box}, {args}) # Docker' .. py:data:: QEGD_BOX :value: 'Box.QEMU_UBUNTU' .. py:data:: QEGD :value: 'vm = Qegd(BINARY, img={box}, {args}) # Qemu' .. py:data:: SHGD :value: "vm = Shgd(BINARY, user='user', host='localhost', port=22, {args}) # SSH" .. py:data:: VAGD_BOX :value: 'Box.VAGRANT_JAMMY64' .. py:data:: VAGD :value: 'vm = Vagd(BINARY, {box}, {args}) # Vagrant' .. py:data:: AD_ENV :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """# 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""" .. raw:: html
.. py:data:: app .. py:data:: err_console .. py:data:: console .. py:function:: _version(value: bool) -> None .. py:function:: main(version: Optional[bool] = typer.Option(None, '--version', '-v', help='Show current vagd version and exit.', callback=_version, is_eager=True)) -> None .. py:function:: add_virt(dependencies: List[str], vms: List[str], dependency: str, template: str, args: Dict[str, str], multi: bool = False, box: str = 'BOX') .. py:function:: _info(binary, color=True) -> str .. py:function:: template(binary: Optional[str] = typer.Argument('', help='Binary to Exploit'), ip: Optional[str] = typer.Argument('', help='Ip or Domain of the remote target'), port: Optional[int] = typer.Argument(0, help='port of the remote target'), output_exploit: Optional[bool] = typer.Option(False, '-e', help='output file of the template (also add +x) to exploit.py'), output: Optional[str] = typer.Option('', '-o', help='output file of the template (also add +x), default stdout'), libc: Optional[str] = typer.Option('', '--libc', '-l', help='add libc to template'), libs: Optional[bool] = typer.Option(False, '--libs', help='download libraries from virt'), files: Optional[List[str]] = typer.Option([], '--files', '-f', help='add files to remote'), symbols: Optional[bool] = typer.Option(True, '--no-symbols', help='install libc debug symbols (might update libc)'), aslr: Optional[bool] = typer.Option(False, '--aslr', '-a', help='enable gdb ASLR (default: disabled for gdb)'), dogd: Optional[bool] = typer.Option(False, '--dogd', '--docker', '-d', help='create docker template'), image: Optional[str] = typer.Option(DOGD_BOX, '--image', help='docker image to use'), qegd: Optional[bool] = typer.Option(False, '--qegd', '--qemu', '-q', help='create qemu template'), img: Optional[str] = typer.Option(QEGD_BOX, '--img', help='qemu cloud image to use'), vagd: Optional[bool] = typer.Option(False, '--vagd', '--vagrant', help='DEPRECATED: create vagrant template'), vbox: Optional[str] = typer.Option(VAGD_BOX, '--vbox', help='vagrant box to use'), shgd: Optional[bool] = typer.Option(False, '--shgd', '--ssh', '-s', help='create ssh template'), local: Optional[bool] = typer.Option(False, '--local', help='create local template'), ad: Optional[bool] = typer.Option(False, '--ad', help='create an ad compatible template'), root: Optional[bool] = typer.Option(False, '--root', '-r', help='create a root environment'), no_aliases: Optional[bool] = typer.Option(False, '--no-aliases', help='no aliases in the template'), no_info: Optional[bool] = typer.Option(False, '--no-info', help='no binary info')) creates a template .. py:function:: info(binary: str = typer.Argument(..., help='Binary to analyse')) analyses the binary, prints checksec and .comment (often includes Distro and Compiler info) .. py:function:: _get_type() -> str .. py:function:: _exec(cmd: str, env: Optional[Dict[str, str]] = None) .. py:function:: _ssh(port, user) .. py:function:: ssh(user: Optional[str] = typer.Option(None, '--user', '-u', help='ssh user')) ssh to current vagd instance (must be in exploit dir) .. py:function:: _scp(port: int, user: str, source: str, target: str, recursive: bool, keyfile: str = Pwngd.KEYFILE) .. py:function:: 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: Optional[str] = typer.Option(None, '--user', '-u', help='ssh user')) scp to from current vagd instance (must be in exploit dir) .. py:function:: clean() clean current vagd instance (stop/kill/remove/destroy) .. py:function:: start()