File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 3737__author__ = 'Wangolo Joel (info@nmapper.com)'
3838__version__ = '1.4.7'
3939__last_modification__ = '2020/08/01'
40+ OS_TYPE = sys .platform
4041
4142class 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 """
You can’t perform that action at this time.
0 commit comments