Skip to content

Commit 158087b

Browse files
author
ekultek
committed
creating a check to see if you are admin or not. Will close if you are not
1 parent b998ad8 commit 158087b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ secret.p
66
uid.p
77
etc/tokens/*
88
autosploit_out/*
9+
venv/*

autosploit/main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import os
12
import sys
3+
import ctypes
24
import psutil
35
import platform
46

@@ -27,6 +29,14 @@
2729

2830
def main():
2931

32+
try:
33+
is_admin = os.getuid() == 0
34+
except AttributeError:
35+
is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
36+
37+
if not is_admin:
38+
close("must have admin privileges to run")
39+
3040
opts = AutoSploitParser().optparser()
3141

3242
logo()

0 commit comments

Comments
 (0)