Skip to content

thread 'main' panicked at 'Too many open files. Please reduce batch size.' in kali on WSL2 #39

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

Closed
fuomag9 opened this issue Jul 23, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@fuomag9
Copy link

fuomag9 commented Jul 23, 2020

I've installed the latest .deb from the release page on WSL2 kali and it crashes when doing a scan. I have nmap installed.

kali@Anonymous:/tmp$ rustscan 192.168.1.140

     _____           _    _____
    |  __ \         | |  / ____|
    | |__) |   _ ___| |_| (___   ___ __ _ _ __
    |  _  / | | / __| __|\___ \ / __/ _` | '_ \
    | | \ \ |_| \__ \ |_ ____) | (_| (_| | | | |
    |_|  \_\__,_|___/\__|_____/ \___\__,_|_| |_|
    Faster nmap scanning with rust.
 Automated Decryption Tool - https://github.com/ciphey/ciphey
 Creator https://github.com/brandonskerritt
Open 80
Os { code: 24, kind: Other, message: "Too many open files" }
thread 'main' panicked at 'Too many open files. Please reduce batch size. The default is 5000. Try -b 2500.', src/main.rs:179:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.76. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug Something isn't working label Jul 23, 2020
@fuomag9 fuomag9 mentioned this issue Jul 23, 2020
@bee-san
Copy link
Owner

bee-san commented Jul 23, 2020

Hey!

You need to decrease the batch size as your OS doesn't support that. Or increase your OS' batch size.

Run this:

ulimit -a
ulimit -Hn
ulimit -Sn

This will tell you how many open files you're allowed at any given time. Reduce the batch size to either that number or below.

Alternatively, increase the batch size of your OS. Use ulimit -n to do this, where the flag for -n is how much you are comfortable with. For RustScan, the default is 5000.

@fuomag9
Copy link
Author

fuomag9 commented Jul 23, 2020

Unfortunately kali linux on WSL2 doesn't seem to have ulimit?

sudo ulimit -n 5000
[sudo] password for kali:
sudo: ulimit: command not found

Edit: nevermind, I fixed it with sudo sh -c "ulimit -n 5000"

@fuomag9
Copy link
Author

fuomag9 commented Jul 23, 2020

I still get the same error

kali@Anonymous:/tmp$ sudo sh -c "ulimit -n 5000"
kali@Anonymous:/tmp$ rustscan 192.168.1.140

     _____           _    _____
    |  __ \         | |  / ____|
    | |__) |   _ ___| |_| (___   ___ __ _ _ __
    |  _  / | | / __| __|\___ \ / __/ _` | '_ \
    | | \ \ |_| \__ \ |_ ____) | (_| (_| | | | |
    |_|  \_\__,_|___/\__|_____/ \___\__,_|_| |_|
    Faster nmap scanning with rust.
 Automated Decryption Tool - https://github.com/ciphey/ciphey
 Creator https://github.com/brandonskerritt
Open 80
Os { code: 24, kind: Other, message: "Too many open files" }
thread 'main' panicked at 'Too many open files. Please reduce batch size. The default is 5000. Try -b 2500.', src/main.rs:179:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
kali@Anonymous:/tmp$ sudo rustscan 192.168.1.140

     _____           _    _____
    |  __ \         | |  / ____|
    | |__) |   _ ___| |_| (___   ___ __ _ _ __
    |  _  / | | / __| __|\___ \ / __/ _` | '_ \
    | | \ \ |_| \__ \ |_ ____) | (_| (_| | | | |
    |_|  \_\__,_|___/\__|_____/ \___\__,_|_| |_|
    Faster nmap scanning with rust.
 Automated Decryption Tool - https://github.com/ciphey/ciphey
 Creator https://github.com/brandonskerritt
Os { code: 24, kind: Other, message: "Too many open files" }
thread 'main' panicked at 'Too many open files. Please reduce batch size. The default is 5000. Try -b 2500.', src/main.rs:179:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@bee-san
Copy link
Owner

bee-san commented Jul 23, 2020

It looks like WSL doesn't support ulimit :-(

microsoft/WSL#1679

See here too
microsoft/WSL#1688

@fuomag9
Copy link
Author

fuomag9 commented Jul 23, 2020

It looks like WSL doesn't support ulimit :-(

microsoft/WSL#1679

Damn, ironically using docker worked fine

@bee-san
Copy link
Owner

bee-san commented Jul 23, 2020

I'm writing documentation for this issue, so thanks for bringing it up!

PS: I'm releasing a Docker version maybe tomorrow? That way people don't have to sweat about ulimit stuff 🤷‍♂️✨

@bee-san bee-san closed this as completed Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants