How to use the archr.targets.DockerImageTarget function in archr

To help you get started, we’ve selected a few archr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angr / archr / tests / test_dockertarget_simple.py View on Github external
def test_entrypoint_false(self):
        with archr.targets.DockerImageTarget('archr-test:entrypoint-false').build().start() as t:
            p = t.run_command()
            p.wait()
            assert p.returncode == 1
github angr / archr / tests / test_bow_datascout.py View on Github external
def test_datascout(self):
        with archr.targets.DockerImageTarget('archr-test:entrypoint-env').build().start() as t:
            _,_,_,maps = self.datascout_checks(t)
            docker_ref = {
                '/lib/x86_64-linux-gnu/libc-2.27.so': 0x7ffff79e4000,
                '/lib/x86_64-linux-gnu/ld-2.27.so': 0x7ffff7dd5000,
                '[stack-end]': 0x7ffffffff000,
                '[heap]': 0x55555575d000,
                '[vvar]': 0x7ffff7ff8000,
                '[vdso]': 0x7ffff7ffb000,
                '[vsyscall]': 0xffffffffff600000
            }
            assert all(maps[x] == docker_ref[x] for x in docker_ref)
github angr / archr / tests / test_bow_qemu.py View on Github external
def test_crasher_trace(self):
        with archr.targets.DockerImageTarget('archr-test:crasher').build().start() as t:
            self.crasher_checks(t)
github angr / archr / tests / test_sync.py View on Github external
def test_offsetprinter32(self):
        #with archr.targets.DockerImageTarget('archr-test:offsetprinter').build().start() as t:
        t = archr.targets.DockerImageTarget('archr-test:offsetprinter32', target_arch='i386').build().start()
        self.check_offsetprinter(t)
        t.stop()
github angr / archr / tests / test_bow_qemu.py View on Github external
def test_arrow_injection_docker(self):
        with archr.targets.DockerImageTarget('archr-test:crasher').build().start() as t:
            archr.arsenal.QEMUTracerBow(t)
            fire_path = os.path.join(t.tmpwd, "shellphish_qemu", "fire")
            assert t.retrieve_contents(fire_path).startswith(b"#!/bin/sh")
github angr / archr / tests / test_dockertarget_simple.py View on Github external
def test_cat(self):
        with archr.targets.DockerImageTarget('archr-test:cat').build().start() as t:
            p = t.run_command()
            p.stdin.write(b"Hello!\n")
            assert p.stdout.read(7) == b"Hello!\n"
github angr / archr / tests / test_bow_gdbserver.py View on Github external
def test_cat_docker(self):
        with archr.targets.DockerImageTarget('archr-test:entrypoint-false').build().start() as t:
            self.check_gdb_cat(t)
github angr / archr / tests / test_bow_angr.py View on Github external
def test_env_angr(self):
        with archr.targets.DockerImageTarget('archr-test:entrypoint-env').build().start() as t:
            self.angr_checks(t)
github angr / angr-management / angrmanagement / ui / main_window.py View on Github external
required = {
            'archr: git clone https://github.com/angr/archr && cd archr && pip install -e .':archr,
            'keystone: pip install --no-binary keystone-engine keystone-engine':keystone
            }
        is_missing = [ key for key, value in required.items() if value is None ]
        if len(is_missing) > 0:
            req_msg = 'You need to install the following:\n\n\t' + '\n\t'.join(is_missing)
            req_msg += '\n\nInstall them to enable this functionality.'
            req_msg += '\nRelaunch angr-management after install.'
            QMessageBox(self).critical(None, 'Dependency error', req_msg)
            return

        img_name = self._pick_image_dialog()
        if img_name is None:
            return
        target = archr.targets.DockerImageTarget(img_name, target_path=None)
        self.workspace.instance.add_job(LoadTargetJob(target))
        self.workspace.instance.set_image(img_name)
github angr / archr / gdbserver.py View on Github external
#!/usr/bin/env python

import archr
import sys

with archr.targets.DockerImageTarget(sys.argv[1]).build().start() as t:
	print("target remote %s:1337" % t.ipv4_address)
	g = archr.arsenal.GDBServerBow(t)
	g.fire(stdout=1, stderr=2, port=1337, timeout=None)