nmmapper / python3-nmap

A python 3 library which helps in using nmap port scanner. This is done by converting each nmap command into a callable python3 method or function. System administrators can now automatic nmap scans using python
https://www.nmmapper.com/sys/networkmapper/nmap/online-port-scanning/
GNU General Public License v3.0
277 stars 73 forks source link

nmap_os_detection not working on Windows 10 20H2 #52

Closed MrEnergy64 closed 3 years ago

MrEnergy64 commented 3 years ago

Dear nmap3 creator,

first of all I have to say thank you for your python3 nmap3 module. I've created a little nmap frontend with this nmap3 module: https://github.com/MrEnergy64/IPventur-Python-Curses

when I start my program under Linux, most scan technics are working fine, when I did it under Window 10 with scan-technic: nmap_os_detection, I get this error:

Traceback (most recent call last): File "C:\Users\mrene\Documents\Python\IPventur-Python-1.0v3.py", line 222, in results = nmap.nmap_os_detection(f'{ip}') File "C:\Users\mrene\AppData\Local\Programs\Python\Python39\lib\site-packages\nmap3\utils.py", line 74, in wrapper if(os.geteuid() == 0): AttributeError: module 'os' has no attribute 'geteuid'

I know that geteuid is not exist on Windows 10, therefore I used a little trick to identify if someone startet the program in an administrator window or not:

if os_version == "Windows": import win32api check = win32api.GetConsoleTitle() if "Administrator" in check: User = "Administrator" else: User = "Normal User"

so, maybe this could be a solution for you as well. Or is my issue complete different?

Thanks,

Norman

nmmapper commented 3 years ago

I will look into it. If you can make a pull request that would be quick. Thank you

MrEnergy64 commented 3 years ago

Brilliant, thanks.

Von: Nmmapper @.> Gesendet: Sonntag, 30. Mai 2021 14:49 An: nmmapper/python3-nmap @.> Cc: MrEnergy64 @.>; Author @.> Betreff: Re: [nmmapper/python3-nmap] nmap_os_detection not working on Windows 10 20H2 (#52)

Closed #52 https://github.com/nmmapper/python3-nmap/issues/52 via https://github.com/nmmapper/python3-nmap/commit/3d558449bc76017a03dac2fc0dc2c1e7cf9a38a9 3d55844.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nmmapper/python3-nmap/issues/52#event-4817107615 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3CUBYBCRH73JRGM7PRLF3TQIX5PANCNFSM44HMI2FQ . https://github.com/notifications/beacon/AN3CUB3LD5LJPUOIPPESSSTTQIX5PA5CNFSM44HMI2F2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGPAAAAAAI7D45J6.gif