jordanpotti / AWSBucketDump

Security Tool to Look For Interesting Files in S3 Buckets
MIT License
1.36k stars 240 forks source link

The script hangs when "arguments.threads" is set to 1. #18

Open darumaseye opened 5 years ago

darumaseye commented 5 years ago

Hi! First of all, thanks for the work! Secondly... when lunching the script without -t argument:

python AWSBucketDump.py -D -l BucketNames.txt -g interesting_Keywords.txt

It seems that the script hangs right before downloading the files:

Downloads enabled (-D), will be saved to current directory. Starting thread... Queuing http://####.s3.amazonaws.com... Fetching http://####.s3.amazonaws.com... Pilfering http://####.s3.amazonaws.com... Collectable: http://####.s3.amazonaws.com/#### Collectable: http://####.s3.amazonaws.com/#### ... ...


I think to have spotted the problem.

Due to "for i in range(1, arguments.threads)" in:

https://github.com/jordanpotti/AWSBucketDump/blob/f8a63019f59d51831b9bff763007af960f1dc218/AWSBucketDump.py#L217-L221

if the user sets "arguments.threads" = 1, no downloadworker will be generated, so the queue will not be empied, causing "download_q.join()" to hang: https://github.com/jordanpotti/AWSBucketDump/blob/f8a63019f59d51831b9bff763007af960f1dc218/AWSBucketDump.py#L230-L231

A possible solution could be to change

"for` i in range(1, arguments.threads)"

in

"for i in range(0, arguments.threads)"

Is this possible? I hope i was helpful.

jbpratt commented 4 years ago

@darumaseye It does seem that the download thread does not kick off when arguments.thread is equal to 1 and it is set by 1 by default so this may lead to it never kicking off by default.