Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to cleanup Aquatone files #157

Closed
0xdade opened this issue Sep 28, 2019 · 1 comment
Closed

Failure to cleanup Aquatone files #157

0xdade opened this issue Sep 28, 2019 · 1 comment
Labels
agent affecting natlas-agent bug Something isn't working

Comments

@0xdade
Copy link
Member

0xdade commented Sep 28, 2019

In some situations, such as below when the process gets killed, we fail to cleanup the aquatone directory for some reason that I haven't noticed before.

[!] (3ud7hcwtnz) Killing slacker process
[!] Thread-2: Failed to acquire HTTPS screenshot for 178.128.187.177
[+] Thread-2: Cleaning up files for 3ud7hcwtnz
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "./natlas-agent.py", line 359, in run
    result = scan(target_data)
  File "./natlas-agent.py", line 335, in scan
    cleanup_files(scan_id)
  File "./natlas-agent.py", line 181, in cleanup_files
    os.remove(file)
IsADirectoryError: [Errno 21] Is a directory: 'data/aquatone.3ud7hcwtnz.https'
@0xdade 0xdade added bug Something isn't working agent affecting natlas-agent labels Sep 28, 2019
@0xdade 0xdade added this to the v0.7 milestone Sep 28, 2019
@0xdade
Copy link
Member Author

0xdade commented Oct 3, 2019

[+] Thread-1: Fetching Target from https://natlas.io
[+] Thread-1: [Server] Target: 91.58.21.142
[+] Thread-1: Scan an0z6nauq27xiw4i Complete
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "./natlas-agent.py", line 365, in run
    result = scan(target_data)
  File "./natlas-agent.py", line 322, in scan
    shutil.rmtree("data/aquatone.%s" % scan_id)
  File "/opt/natlas/natlas-agent/venv/lib/python3.6/shutil.py", line 477, in rmtree
    onerror(os.lstat, path, sys.exc_info())
  File "/opt/natlas/natlas-agent/venv/lib/python3.6/shutil.py", line 475, in rmtree
    orig_st = os.lstat(path)
FileNotFoundError: [Errno 2] No such file or directory: 'data/aquatone.an0z6nauq27xiw4i'

Another example

@0xdade 0xdade closed this as completed in f7c838c Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent affecting natlas-agent bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant