Skip to content

Commit c371b45

Browse files
committed
Added support for Priviledges #27 but for linux only
1 parent 8018595 commit c371b45

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

nmap3/nmap3.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
__author__ = 'Wangolo Joel (info@nmapper.com)'
3838
__version__ = '1.4.7'
3939
__last_modification__ = '2020/08/01'
40+
OS_TYPE = sys.platform
4041

4142
class Nmap(object):
4243
"""
@@ -65,6 +66,17 @@ def default_command(self):
6566
eg nmap -oX -
6667
"""
6768
return self.default_args.format(nmap=self.nmaptool, outarg="-oX")
69+
70+
def default_command_privileged(self):
71+
"""
72+
Commands that require root privileges
73+
"""
74+
if OS_TYPE == 'win32':
75+
# Elevate privileges and return nmap command
76+
# For windows now is not fully supported so just return the default
77+
return self.default_command()
78+
else:
79+
return self.default_args.format(nmap="sudo "+self.nmaptool, outarg="-oX")
6880

6981
def nmap_version(self):
7082
"""

0 commit comments

Comments
 (0)