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

Exception in nmap.py - single quote in macvendor string #47

Open
juniperz opened this issue Aug 9, 2018 · 0 comments
Open

Exception in nmap.py - single quote in macvendor string #47

juniperz opened this issue Aug 9, 2018 · 0 comments

Comments

@juniperz
Copy link

juniperz commented Aug 9, 2018

This issue only affects people who have a MAC Vendor on their network with a single quote in their name (example: Microtech Int'l Corp.)

I was struggling to get Sweet Security to work and I traced it down to an issue in nmap.py. It was generating an exception because the vendor name for one of my devices has a single qoute in the name. I was able to get it working by changing line 114 of nmap.py from macvendor to macvendor.replace("'", "") which strips out the single qoute from the vendor name. This isn't likely the best strategy, but it got things up and running for me.

Line 114 now looks like this:
query = "INSERT INTO hosts VALUES ('%s','%s','%s','%s','%s',0,1,'%s','%s')" % (hostname,hostname,str(ipaddress),macaddress,macvendor.replace("'", ""),datetime.now().strftime("%Y-%m-%d %H:%M:%S"),datetime.now().strftime("%Y-%m-%d %H:%M:%S"))

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

No branches or pull requests

1 participant