Returns True if the current process is run under admin privileges
()
| 3040 | return result |
| 3041 | |
| 3042 | def 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 | |
| 3071 | def logHTTPTraffic(requestLogMsg, responseLogMsg, startTime=None, endTime=None): |
| 3072 | """ |
no test coverage detected
searching dependent graphs…