Exemplo n.º 1
0
def create_poc_single(folder_name, analysis_name, binary_name, result_name,
                      desc_name, source_name, poc_path):
    status = OK

    config_path = os.path.join(folder_name, analysis_name)
    binary_path = os.path.join(folder_name, binary_name)

    with open(config_path, "r") as config:
        gen_pocs(config, binary_path, result_name, desc_name, source_name)

    poc_path = glob.glob(poc_path)[0]
    try:
        cmd = ['make', '-C', poc_path, 'pocs-print']
        check_output(cmd, stderr=STDOUT)
    except CalledProcessError as e:
        if e.output:
            logger.error("CalledProcessError: Traceback of running %s:", cmd)
            logger.error(e.output.decode('utf-8'))
        status = ERROR

    msg = "Failed to compile the synthesized concrete source code.\nMost likely the poc-generation created invalid " \
          "C. This is a strong indication for ab bug in the poc-generation and most likely has nothing to do with " \
          "the symbolic execution in angr. "
    nose.tools.assert_equal(status, OK, msg)

    return True
Exemplo n.º 2
0
def create_poc_single(
    folder_name,
    analysis_name,
    binary_name,
    result_name,
    desc_name,
    source_name,
    poc_path,
):
    config_path = os.path.join(folder_name, analysis_name)
    binary_path = os.path.join(folder_name, binary_name)

    with open(config_path, "r") as config:
        gen_pocs(config, binary_path, result_name, desc_name, source_name)

    poc_path = glob.glob(poc_path)[0]
    try:
        cmd = ["make", "-C", poc_path, "pocs-print"]
        check_output(cmd, stderr=STDOUT)
    except CalledProcessError as e:
        if e.output:
            logger.error("CalledProcessError: Traceback of running %s:", cmd)
            logger.error(e.output.decode("utf-8"))
        msg = (
            "Failed to compile the synthesized concrete source code.\nMost likely the poc-generation created invalid "
            "C. This is a strong indication for ab bug in the poc-generation and most likely has nothing to do with "
            "the symbolic execution in angr. "
        )
        assert False, msg
    return True
Exemplo n.º 3
0
def run_poc_gen(config, binary, result, desc, source):
    gen_pocs(config, binary, result, desc, source)
    sys.exit(0)