pry0cc / axiom

The dynamic infrastructure framework for everybody! Distribute the workload of many different scanning tools with ease, including nmap, ffuf, masscan, nuclei, meg and many more!
MIT License
4k stars 622 forks source link

SecretFinder custom module is not finishing correctly #517

Closed jcr7301 closed 2 years ago

jcr7301 commented 2 years ago

I did a custom SecretFinder (https://github.com/m4ll0k/SecretFinder) module that was working as expected before, but now, I don't know what changed, but it is not finishing correctly when I launch it. It seems to be doing everything correct until the end, where it gets stuck and doesn't finish execution.

Module:

[{
  "command":"python3 -u /home/op/recon/SecretFinder/SecretFinder.py -i _target_ -o cli | tee -a _output_/_cleantarget_",
  "ext":"",
  "threads":"4"
}]

When it finishes it gets stuck in:

Generated 69 commands in total
Repeat set to 1
100%|██████████| 69/69 [00:39<00:00,  1.76it/s]

And the error given when I kill the process is:

Traceback (most recent call last):
  File "/usr/local/bin/interlace", line 33, in <module>
    sys.exit(load_entry_point('Interlace==1.9.5', 'console_scripts', 'interlace')())
  File "/usr/local/lib/python3.9/dist-packages/Interlace-1.9.5-py3.9.egg/Interlace/interlace.py", line 43, in main
  File "/usr/local/lib/python3.9/dist-packages/Interlace-1.9.5-py3.9.egg/Interlace/lib/threader.py", line 123, in run
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 636, in __exit__
    self.shutdown(wait=True)
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 229, in shutdown
    t.join()
  File "/usr/lib/python3.9/threading.py", line 1053, in join
    self._wait_for_tstate_lock()
  File "/usr/lib/python3.9/threading.py", line 1069, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt
0xtavian commented 2 years ago

@jcr7301

I’ll look into this later today. In the meantime can you run axiom-exec id to make sure everything in $HOME/.axiom/selected.conf is up and running? If one machine doesn’t work axiom-scan will hang, but I plan to fix this soon.

0xtavian commented 2 years ago

@jcr7301 testing this and it worked as expected. Was the issue repeatable? Maybe one was still running? you can check by running axiom-exec tmux ls. LMK if you can repeat

jcr7301 commented 2 years ago

@0xtavian I removed the instances/initiated them again, and this problem is still happening. I have tried with a different set of data, and it's working correctly, it works well even with partial data of the first set but not the whole of it. I can't spot any differences in format or anything else that could be breaking it. Can I send you this file privately, so you can try it yourself? It's just a .txt

0xtavian commented 2 years ago

@jcr7301 sure. Do you mind uploading it here? If so DM me on twitter/discord.

You might be able to identify the troublesome hosts by letting the scan run until it hangs and then run something like axiom-exec ps aux | grep SecretFinder. You should see the expanded _target_ in the process lists.

jcr7301 commented 2 years ago

I can see some SecretFinder processes stuck, but running these commands locally works fine. I've shared the file on discord. The command I'm running is: axiom-scan js_test.txt -m secretfinder -o js_test_output --rm-logs

0xtavian commented 2 years ago

@jcr7301 ill look into this. Another user reported the same problem with the secretfinder recently. They have a fork version thats patched to get it working ( along with other additions). https://github.com/storenth/SecretFinder

0xtavian commented 2 years ago

Closing. If you still see the issue after updating feel free to post a comment or reopen.