Skip to content

Crash during dictionary generation with man_parsing heuristic #10

Description

@krpandrei05
  • When attempting to generate an arguments dictionary using the man_parsing heuristic, the process fails with a FileNotFoundError.
  • The command terminates abruptly and does not produce the expected output file.
  • The result is:
$ poetry run attack_surface_approximation generate --heuristic man_parsing --output examples/dictionaries/ex1.txt --top 10
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation_original/attack_surface_approximation/cli.py", line 194, in main
    cli(prog_name="attack_surface_approximation")
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation/.venv/lib/python3.12/site-packages/click/core.py", line 1514, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation/.venv/lib/python3.12/site-packages/click/core.py", line 1435, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation/.venv/lib/python3.12/site-packages/click/core.py", line 1902, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation/.venv/lib/python3.12/site-packages/click/core.py", line 1298, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation/.venv/lib/python3.12/site-packages/click/core.py", line 853, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation_original/attack_surface_approximation/cli.py", line 58, in generate
    generator.generate(heuristic, elf)
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation_original/attack_surface_approximation/dictionaries_generators/generator.py", line 63, in generate
    self.arguments = heuristic_module.generate(elf)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation_original/attack_surface_approximation/dictionaries_generators/heuristics/man_parsing.py", line 43, in generate
    all_arguments.update(arguments)
  File "/home/krpandrei/andreiOpenCRS/attack_surface_approximation_original/attack_surface_approximation/dictionaries_generators/heuristics/man_parsing.py", line 24, in __get_arguments_from_manual
    with gzip.open(filename, "rt") as manual:
         ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/gzip.py", line 61, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/gzip.py", line 192, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/man/man1/cpp.1.gz'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions