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

Interlace hangs with large amount of IPs in a file #131

Closed
0xtavian opened this issue Jan 14, 2021 · 8 comments · Fixed by #132
Closed

Interlace hangs with large amount of IPs in a file #131

0xtavian opened this issue Jan 14, 2021 · 8 comments · Fixed by #132

Comments

@0xtavian
Copy link
Contributor

0xtavian commented Jan 14, 2021

Get 50,000 random IPs from https://onlinerandomtools.com/generate-random-ip and save to file named ips.txt
The following command hangs and never starts. CPU is maxed out. From what I can tell, this bug only impacts IPs in a list. For example:
interlace -tL ips.txt -c "echo _target_ " -threads 5

Attempting with hostnames instead of IPs works as expected and is successful, example interlace -tL subdomains.txt -c "echo _target_ " -threads 5 (download hostnames from a target with more than 50k subdomains from https://chaos.projectdiscovery.io/#/).
Attempting with CIDR expansion works as expected and is successful, example interlace -t 10.0.0.0/16 -c "echo _target_ " -threads 5

I've tried with Ubuntu 20.04 and Kali 2020.4.

@prodigysml
Copy link
Collaborator

Hey @0xtavian , this is a known issue. There is a cheeky workaround for it. Basically using a fake target (like -t a) and then passing a command list (-cL) with all the string replacements already done, will speed up the process significantly! Unfortunately, atm the string replacement is written really slow, which is why interlace starts off a bit slow. The command list workaround works well and I use it myself!

@prodigysml
Copy link
Collaborator

After some chit chat with @0xtavian, we think the issue may lie in the usage of the IP object (slows down everything). When we get around to fixing this, it's something we need to take a look at (#reminder)

@pry0cc
Copy link

pry0cc commented Jan 20, 2021

So I did some quick n dirty forking and just removed the IP object piece altogether - ...and it works!

So maybe we just need an option to skip putting them into options? Or do we make it more performant?

pry0cc@64ef017

@0xtavian
Copy link
Contributor Author

I can confirm this fixes the issue as well.

@prodigysml
Copy link
Collaborator

Awesome! I'll try to take a look and push a patch soon! Might be a while as some other things are on fire atm. Thanks for being patient everyone!

@pry0cc
Copy link

pry0cc commented Jan 28, 2021

Any movement on this issue?

@prodigysml
Copy link
Collaborator

Hey @pry0cc, tad busy with some work stuff, but I am working on it in the background :) So far my analysis is that we will need to rewrite that section (IP related and all operations around that).

@prodigysml
Copy link
Collaborator

I can confirm the patch is working a LOT better than before! It is easily compatible with 50k IPs now. Waiting on the reviewer to approve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants