def runningAsAdmin():
 isAdmin = None
 if (PLATFORM in ('posix', 'mac')):
  _ = os.geteuid()
  isAdmin = (isinstance(_, (int, float, long)) and (_ == 0))
 elif IS_WIN:
  import ctypes
  _ = ctypes.windll.shell32.IsUserAnAdmin()
  isAdmin = (isinstance(_, (int, float, long)) and (_ == 1))
 else:
  errMsg = 'sqlmap is not able to check if you are running it '
  errMsg += 'as an administrator account on this platform. '
  errMsg += 'sqlmap will assume that you are an administrator '
  errMsg += 'which is mandatory for the requested takeover attack '
  errMsg += 'to work properly'
  logger.error(errMsg)
  isAdmin = True
 return isAdmin

def runningAsAdmin ( ) : isAdmin = None if ( PLATFORM in ( 'posix' , 'mac' ) ) : _ = os . geteuid ( ) isAdmin = ( isinstance ( _ , ( int , float , long ) ) and ( _ == 0 ) ) elif IS_WIN : import ctypes _ = ctypes . windll . shell32 . IsUserAnAdmin ( ) isAdmin = ( isinstance ( _ , ( int , float , long ) ) and ( _ == 1 ) ) else : errMsg = 'sqlmap is not able to check if you are running it ' errMsg += 'as an administrator account on this platform. ' errMsg += 'sqlmap will assume that you are an administrator ' errMsg += 'which is mandatory for the requested takeover attack ' errMsg += 'to work properly' logger . error ( errMsg ) isAdmin = True return isAdmin
returns true if the current process is run under admin privileges .