MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / runningAsAdmin

Function runningAsAdmin

lib/core/common.py:3042–3069  ·  view source on GitHub ↗

Returns True if the current process is run under admin privileges

()

Source from the content-addressed store, hash-verified

3040 return result
3041
3042def runningAsAdmin():
3043 """
3044 Returns True if the current process is run under admin privileges
3045 """
3046
3047 isAdmin = None
3048
3049 if PLATFORM in ("posix", "mac"):
3050 _ = os.geteuid()
3051
3052 isAdmin = isinstance(_, (float, six.integer_types)) and _ == 0
3053 elif IS_WIN:
3054 import ctypes
3055
3056 _ = ctypes.windll.shell32.IsUserAnAdmin()
3057
3058 isAdmin = isinstance(_, (float, six.integer_types)) and _ == 1
3059 else:
3060 errMsg = "sqlmap is not able to check if you are running it "
3061 errMsg += "as an administrator account on this platform. "
3062 errMsg += "sqlmap will assume that you are an administrator "
3063 errMsg += "which is mandatory for the requested takeover attack "
3064 errMsg += "to work properly"
3065 logger.error(errMsg)
3066
3067 isAdmin = True
3068
3069 return isAdmin
3070
3071def logHTTPTraffic(requestLogMsg, responseLogMsg, startTime=None, endTime=None):
3072 """

Callers 3

_setMetasploitFunction · 0.90
_setDNSServerFunction · 0.90
osPwnMethod · 0.90

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…