Skip to content

Commit

Permalink
Added support for Priviledges #27 but for linux only
Browse files Browse the repository at this point in the history
  • Loading branch information
nmmapper committed Sep 22, 2020
1 parent 8018595 commit c371b45
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nmap3/nmap3.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
__author__ = 'Wangolo Joel (info@nmapper.com)'
__version__ = '1.4.7'
__last_modification__ = '2020/08/01'
OS_TYPE = sys.platform

class Nmap(object):
"""
Expand Down Expand Up @@ -65,6 +66,17 @@ def default_command(self):
eg nmap -oX -
"""
return self.default_args.format(nmap=self.nmaptool, outarg="-oX")

def default_command_privileged(self):
"""
Commands that require root privileges
"""
if OS_TYPE == 'win32':
# Elevate privileges and return nmap command
# For windows now is not fully supported so just return the default
return self.default_command()
else:
return self.default_args.format(nmap="sudo "+self.nmaptool, outarg="-oX")

def nmap_version(self):
"""
Expand Down

0 comments on commit c371b45

Please sign in to comment.