Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot save advanced scan parameters #41

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
ghost opened this issue Aug 7, 2018 · 18 comments · Fixed by #2665
Closed

Cannot save advanced scan parameters #41

ghost opened this issue Aug 7, 2018 · 18 comments · Fixed by #2665

Comments

@ghost
Copy link

ghost commented Aug 7, 2018

Hi,
I installed scb via docker-compose, added a user, granted it all permissions and roles and spun up instances of dvwa and juice-shop to test on.
When I try to initiate an advanced scan I get a ticket and claim it, but when I try to set anything in the advanced parameters field (i.e. nmap -A localhost or nikto -host localhost -port 3000) the "Complete" Button is disabled, same goes for the "Save" button. I can click it once, but when I refresh the ticket no changes are actually saved.
Is this a known bug or am I doing something wrong?

Thanks in advance, Cheers!

@J12934
Copy link
Member

J12934 commented Aug 7, 2018

Hi 👋
Mhh can't reproduce the bug you are describing...

When i set up a scan using the advanced parameters the save button is disabled, but the complete button enabled and working as intended.

I attached a screenshot of the way it should look like. (I removed the command line options listing as it was getting in the way)
image

Are you sure that the task is assigned to your user account and the rights are ok? This is off the top of my head the first causes for such a behavior.

@J12934
Copy link
Member

J12934 commented Aug 7, 2018

Also on the topic of nmap advanced parameters, especially the -A flag.
-A scans currently don't work properly as nmap needs to be run with administrator privileges. (This issue is tracked here: secureCodeBox/scanner-infrastructure-nmap#2)
When using NSE you will likely also encounter problems. As this integration wasn't really tested so far.

@ghost
Copy link
Author

ghost commented Aug 10, 2018

Okay, I started from scratch an now the advanced parameters get applied and I receive the "Review scan results" ticket. Thanks for the heads-up regarding nmap -A.
Cheers!

@ghost ghost closed this as completed Aug 10, 2018
@ghost
Copy link
Author

ghost commented Aug 13, 2018

Hi,
unfortunately I just got the same behaviour again. I tried an advanced nmap scan and wanted to add
-p 3000. The Complete Button was inactive again.
Any ideas what could cause this?
Cheers!
nmap-advanced1
nmap-advanced2

@ghost ghost reopened this Aug 13, 2018
@J12934
Copy link
Member

J12934 commented Aug 13, 2018

Hi again 😉
whats seems odd to me on these screenshots is that the target host is empty in the field.
Did you enter the Target host in the previous step? Normally that host should show up in the disabled form input field. (See my screenshot).

@ruedih
Copy link
Contributor

ruedih commented Aug 14, 2018

Hi,
can you try opening the Browser Developer Tools? Probably there is some kind of JavaScript-Error.

@ghost
Copy link
Author

ghost commented Aug 14, 2018

I think I found it.
When I initiate the scan with localhost:3000 the Target Host in the ticket is empty.
nmap-advanced3

If I don't then Target Host gets populated with "localhost"
nmap-advanced4

@ghost
Copy link
Author

ghost commented Aug 14, 2018

Another strange thing... When I initiate an advanced scan and add the -p 3000 parameters later on I get an empty report
nmap-advanced5

But when I initiate a default scan with localhost:3000 I get the full report
nmap-default2

nmap-default3

Any advice on this one?
Cheers!

@J12934
Copy link
Member

J12934 commented Aug 14, 2018

localhost:3000 doesn't seem to be a valid target for nmap.
At least when i run nmap directly with this as the target, it wont accept it.

➜ nmap localhost:3000
Starting Nmap 7.70 ( https://nmap.org ) at 2018-08-14 09:47 CEST
Failed to resolve "localhost:3000".
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.07 seconds

It's interesting that the scanner works regardless of the :3000 in the target 😅

Looking at the report it also seems as if the scan with -p 3000 seems to be correct as there seems to be no port 3000 open at your machine,

@ghost
Copy link
Author

ghost commented Aug 14, 2018

Okay now it's getting strange =)
Port 3000 is definitely open because of Juice Shop. When I run the host version on nmap I get this output

[gecz@dso-playground ~]$ nmap localhost -p 3000
Starting Nmap 7.70 ( https://nmap.org ) at 2018-08-14 09:53 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000074s latency).
Other addresses for localhost (not scanned): ::1
PORT STATE SERVICE
3000/tcp open ppp
Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds

@J12934
Copy link
Member

J12934 commented Aug 14, 2018

😅
I assume your are running the nmap scanner via docker, right?
If so localhost would be localhost of the docker container. Not of your host system.

@ruedih
Copy link
Contributor

ruedih commented Aug 14, 2018

@J12934 maybe we should add some validation to the fields ?

@gecz83 This depends a little bit on how you operate Docker:
The nmap container sits in a (virtual) docker network. So localhost will scan the nmap container itself. You either provide the juice shop hostname to the nmap container or your hostmachine ip address. (If you use something like docker for windows or docker-machine the host ip might be different).

@ghost
Copy link
Author

ghost commented Aug 14, 2018

@J12934 Whoops my bad. 😅 (I'm new to docker)
@Trosky Thanks for the advice, now it works!

@J12934
Copy link
Member

J12934 commented Aug 14, 2018

@ruedih Hostname validation was already added in secureCodeBox/engine#17.
This is issue is probably based on a older build.

@ghost
Copy link
Author

ghost commented Aug 14, 2018

@J12934 Hhmm... strange. I deleted and pulled the images a week ago. Are there any configs / persistent storage locations I'm missing?

@J12934
Copy link
Member

J12934 commented Aug 14, 2018

Mhh no that should have worked.
Will take a look at the validation maybe i missed something with the validation regex.

@J12934
Copy link
Member

J12934 commented Aug 14, 2018

Okay there really was an error in the hostname validation in it validating the target name not the target location / hostname.
This gets fixed with secureCodeBox/engine#25

@ghost
Copy link
Author

ghost commented Aug 24, 2018

Hi,
I just tested the new images and can confirm it's working as expected.
Thanks and Cheers!

This issue was closed.
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.

2 participants