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

Rustscan cannot saved output anymore with -oN/-oA command #535

Closed
w0lfcat opened this issue Feb 4, 2024 · 6 comments · Fixed by #373
Closed

Rustscan cannot saved output anymore with -oN/-oA command #535

w0lfcat opened this issue Feb 4, 2024 · 6 comments · Fixed by #373
Assignees

Comments

@w0lfcat
Copy link

w0lfcat commented Feb 4, 2024

Describe the bug
It was working ok till someday it didn't. I didn't know what happened. I was using the same version, the same command, and somehow get this error. Then, I tried to reinstall it again, use different approach such as via docker but still getting the same error.
If I did not use -oN/-oA command, rustscan is working just fine. The problem is that I need the output to be saved.

To Reproduce
Steps to reproduce the behavior:

  1. Run the command
docker run -it --rm --name rustscan rustscan/rustscan:2.1.1 -a 127.0.0.1 -- -Pn -A -oN test
  1. See error below
$ docker run -it --rm --name rustscan rustscan/rustscan:2.1.1 -a 127.0.0.1 -- -Pn -A -oN test
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-' `-'`-----'`----'  `-'  `----'  `---' `-'  `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog           :
: https://github.com/RustScan/RustScan :
 --------------------------------------
Real hackers hack time ⌛

[~] The config file is expected to be at "/home/rustscan/.rustscan.toml"
[~] File limit higher than batch size. Can increase speed by increasing batch size '-b 1048476'.
Open 127.0.0.1:1337
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} {{ip}} -Pn -A -oN test" on ip 127.0.0.1
Depending on the complexity of the script, results may take some time to appear.
Failed to open normal output file test for writing
QUITTING!
[!] Error Exit code = 1

Expected behavior
I'm expecting to see the normal nmap output without any errors.

@sakyb7
Copy link

sakyb7 commented Feb 7, 2024

facing same issue.

rustscan -a 10.10.55.125 -r 1-1000  -- -Sc -Sv
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-' `-'`-----'`----'  `-'  `----'  `---' `-'  `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog           :
: https://github.com/RustScan/RustScan :
 --------------------------------------
🌍HACK THE PLANET🌍

[~] The config file is expected to be at "/home/kali/.rustscan.toml"
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan's speed. Use the Docker image, or up the Ulimit with '--ulimit 5000'. 
Open 10.10.55.125:80
Open 10.10.55.125:135
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} {{ip}} -Sc -Sv" on ip 10.10.55.125
Depending on the complexity of the script, results may take some time to appear.
You can only use the source option once!  Use -D <decoy1> -D <decoy2> etc. for decoys

QUITTING!
[!] Error Exit code = 1

someone please help to resolve this issue

@chintanpuggalok
Copy link

hey i will try this out!

@zevelix
Copy link

zevelix commented Mar 12, 2024

These are both nmap issues.

@sakyb7 Your error is because you switched the capitalization of the nmap flags. You want -sV -sC not -Sv -Sc

@CMNatic
Copy link
Contributor

CMNatic commented Mar 15, 2024

Hey @w0lfcat 👋🏻 yes this is indeed a Nmap fault. I tested this on the same version of Nmap that the rustscan:2.1.1 docker image uses (nmap 7.80) on a seperate VM (and just installing nmap, not even using RustScan) and could replicate it.

Updating to Nmap 7.93 worked docker run -it --rm --name rustscan rustscan:nmap793-a scanme.nmap.org -- -oN /tmp/test (note that you'll need to provide a path that has write permissions. (/tmp worked).

Simply building a RustScan image from the Dockerfile in the repo will update everything. I'll see about updating the images on the DockerHub to use at least Nmap 7.93, but i'll need to review the Nmap changelogs to see if it might break anything (I.e. different syntax/formatted expected)

image

@w0lfcat
Copy link
Author

w0lfcat commented Apr 16, 2024

Thanks @CMNatic CMNatic, I did try to build this with the following command, but still can't save the output with similar error.

git clone https://github.com/RustScan/RustScan
cd RustScan
docker build -t rustscan .

What was the exact command did you use to build it?

I have write permission as the output is saved in my home directory.

Second question, how do you find out the nmap version in the rustscan docker container? I tried the following to get access to bash but did not work

docker exec -it RustScan bash

@w0lfcat
Copy link
Author

w0lfcat commented Apr 16, 2024

Can you try to run the command inside /tmp instead of -oN /tmp/test

Try this

cd /tmp
docker run -it rustscan -a 10.10.10.10 -p 88 -- -oN test

instead of

docker run -it rustscan -a 10.10.10.10 -p 88 -- -oN /tmp/test

Did you see the file /tmp/test created?

$ pwd
/tmp

$ docker run -it rustscan -a 10.10.10.10 -p 88 -- -oN test
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-' `-'`-----'`----'  `-'  `----'  `---' `-'  `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog/         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
I don't always scan ports, but when I do, I prefer RustScan.

[~] The config file is expected to be at "/home/rustscan/.rustscan.toml"
[~] File limit higher than batch size. Can increase speed by increasing batch size '-b 1048476'.
Open 10.10.10.10:88
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} {{ip}} -oN test" on ip 10.10.10.10
Depending on the complexity of the script, results may take some time to appear.
Failed to open normal output file output for writing: Permission denied (13)
[!] Error Exit code = 1

$ ls -lh                           
total 0

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.

5 participants