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

Crash Zenmap - nmap 7.80 #1839

Open
gbiay opened this issue Nov 29, 2019 · 4 comments
Open

Crash Zenmap - nmap 7.80 #1839

gbiay opened this issue Nov 29, 2019 · 4 comments

Comments

@gbiay
Copy link

@gbiay gbiay commented Nov 29, 2019

Hello,

New to nmap, I wanted to try a command in zenmap in order to get status of certifcate on a host.
I tried this one : "nmap -v --script ssl-cert x.x.x.x" where x.x.x.x is the IP from the host.

I received this issue when I click on scan :

Version: 7.80
Traceback (most recent call last):
  File "zenmapGUI\ScanInterface.pyo", line 459, in start_scan_cb
  File "zenmapGUI\ScanInterface.pyo", line 554, in execute_command
UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 13: invalid start byte

Can you help me ?

@dmiller-nmap

This comment has been minimized.

Copy link

@dmiller-nmap dmiller-nmap commented Dec 2, 2019

Thanks for the report. What is the locale you have configured Windows to use? You can see this in Control Panel -> Clock, Language, and Region -> Region and Language.

@gbiay

This comment has been minimized.

Copy link
Author

@gbiay gbiay commented Dec 3, 2019

Hi Daniel,
Thanks for your reply.
I see "Match the Windows display language (recommended)" so -> Français (France)
I'm french :)
Guillaume.

@gbiay

This comment has been minimized.

Copy link
Author

@gbiay gbiay commented Dec 3, 2019

This morning I tried to run Zenmap "as admin" and error disappeared.
I tried last command above :

nmap -v --script ssl-cert x.x.x.x" where x.x.x.x is the IP from my test host (a print server).

Host was found down by nmap while I confirm that my print server is up :)

So I tried recommandations in the result (add "-Pn") like this :

nmap -v -Pn --script ssl-cert x.x.x.x

=> Results :

Host is up.

All 1000 scanned ports on "fqdn" (x.x.x.x) are filtered

The same command run by my colleague on her PC (same windows, same nmap version), returns more information like encryption, certificate, and so on.

Do you know why ?

@dmiller-nmap

This comment has been minimized.

Copy link

@dmiller-nmap dmiller-nmap commented Dec 10, 2019

This crash is caused by attempting to convert a Python Exception object to a unicode string. Exceptions are supposed to be caught by Zenmap to avoid crashing, but this one happens inside an exception handler, so there's nowhere else to handle it. I changed the line to try to decode the message attribute instead of the entire Exception object, since I found some references to issues with calling unicode() on Exceptions in earlier versions of Python. I also added the errors='replace' keyword argument so that any decoding errors will not result in a crash, but instead the REPLACEMENT CHARACTER unicode glyph will be inserted. This doesn't really solve the problem that we aren't decoding the error message and resolving the cause of the error, but it ought to get us closer, especially for languages like French, which on Windows uses an encoding that is mostly the same as ASCII, and so will be mostly comprehensible with the offending characters removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.