punk-security / dnsReaper

dnsReaper - subdomain takeover tool for attackers, bug bounty hunters and the blue team!
GNU Affero General Public License v3.0
2.03k stars 167 forks source link

AWS Lambda Parallelism Issue #180

Closed wf-aw closed 4 months ago

wf-aw commented 4 months ago

I am trying to deploy this tool via an AWS lambda function and am running into an issue with the multiprocessing module. After looking at this page: https://aws.amazon.com/blogs/compute/parallel-processing-in-python-with-aws-lambda/ it seems like parallelism isn't supported. Is there any way the code can be modified to not use the module when setting the number of threads to 1 via the CLI argument?

Traceback (most recent call last):\n File "/var/task/./dnsReaper/main.py", line 105, in <module>\n pool = ThreadPool(processes=args.parallelism)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/var/lang/lib/python3.11/multiprocessing/pool.py", line 930, in __init__\n Pool.__init__(self, processes, initializer, initargs)\n File "/var/lang/lib/python3.11/multiprocessing/pool.py", line 196, in __init__\n self._change_notifier = self._ctx.SimpleQueue()\n ^^^^^^^^^^^^^^^^^^^^^^^\n File "/var/lang/lib/python3.11/multiprocessing/context.py", line 113, in SimpleQueue\n return SimpleQueue(ctx=self.get_context())\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/var/lang/lib/python3.11/multiprocessing/queues.py", line 341, in __init__\n self._rlock = ctx.Lock()\n ^^^^^^^^^^\n File "/var/lang/lib/python3.11/multiprocessing/context.py", line 68, in Lock\n return Lock(ctx=self.get_context())\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/var/lang/lib/python3.11/multiprocessing/synchronize.py", line 169, in __init__\n SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)\n File "/var/lang/lib/python3.11/multiprocessing/synchronize.py", line 57, in __init__\n sl = self._semlock = _multiprocessing.SemLock(\n ^^^^^^^^^^^^^^^^^^^^^^^^^\nOSError: [Errno 38] Function not implemented\n')

imnotbrandon commented 4 months ago

Hi, We've done a fair bit of work in the lambda branch to optimise dnsreaper for lambda.

Because we can't use multiprocessing, we've converted it to be async and it performs far better. You'll have much better luck with that branch.

It's still technically pre-release, but we're actively using it without issue.

wf-aw commented 4 months ago

Oh awesome I didn't see that branch, thank you I'll test this out today!

wf-aw commented 4 months ago

Confirmed working except for a Godaddy issue (no records in godaddy for a domain purchased through godaddy and it's throwing a domain not found error)