-
Notifications
You must be signed in to change notification settings - Fork 250
/
Copy pathpowermenu.bat
executable file
·277 lines (196 loc) · 7.47 KB
/
powermenu.bat
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
@echo off
::set CMD window size
mode con: cols=70 lines=50
:: Set global variables - change as required
set powermenu_directory="%userprofile%\powermenu"
::start menu
:MENU
CLS
ECHO ============= Powershell Menu - @LeonTeale =============
setlocal EnableDelayedExpansion
IF EXIST %powermenu_directory% (
ECHO Available Tools:
dir /a:d /b
)
ECHO --------------------------------------------------------
ECHO 1. Run powershell as a Local user
ECHO 2. Run powershell as a remote user
ECHO 3. Load this script as authenticated user
ECHO 4. Selection 4
ECHO 5. Selection 5
ECHO 6. Selection 6
ECHO 7. Selection 7
ECHO --------------------------------------------------------
ECHO Powershell Recon
ECHO --------------------------------------------------------
ECHO 8. Get Domain name
ECHO 9. Export Domain Users
ECHO --------------------------------------------------------
ECHO Config:
ECHO --------------------------------------------------------
ECHO 10. Set powersploit location
ECHO 11. Download powersploit
ECHO 12. Download Inveigh
ECHO 13. Set Inveigh location
ECHO --------------------------------------------------------
ECHO ===================PRESS 'Q' TO QUIT====================
ECHO.
:: Coming Soon
::
:: UAC bypass - 'UACME'
:: Custom Priv esc checks
:: Inveigh (powershell responder
SET INPUT=
SET /P INPUT=Please select a number:
IF /I '%INPUT%'=='1' GOTO Selection1
IF /I '%INPUT%'=='2' GOTO Selection2
IF /I '%INPUT%'=='3' GOTO Selection3
IF /I '%INPUT%'=='4' GOTO Selection4
IF /I '%INPUT%'=='5' GOTO Selection5
IF /I '%INPUT%'=='6' GOTO Selection6
IF /I '%INPUT%'=='7' GOTO Selection7
IF /I '%INPUT%'=='8' GOTO Selection8
IF /I '%INPUT%'=='9' GOTO Selection9
IF /I '%INPUT%'=='10' GOTO Selection10
IF /I '%INPUT%'=='11' GOTO Selection11
IF /I '%INPUT%'=='12' GOTO Selection12
IF /I '%INPUT%'=='13' GOTO Selection13
IF /I '%INPUT%'=='Q' GOTO Quit
CLS
ECHO ============INVALID INPUT============
ECHO -------------------------------------
ECHO Please select a number from the Main
echo Menu [1-9] or select 'Q' to quit.
ECHO -------------------------------------
ECHO ======PRESS ANY KEY TO CONTINUE======
PAUSE > NUL
GOTO MENU
:Selection1
:: UAC eleviate privs
::-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
::--------------------------------------
start c:\windows\system32\cmd.exe /k powershell
PAUSE > NUL
GOTO MENU
:Selection2
set /p domain="Enter Domain: "
set /p user="Enter User: "
runas /netonly /user:%domain%\%user% "c:\windows\system32\cmd.exe /k powershell"
PAUSE > NUL
GOTO MENU
:Selection3
set /p domain="Enter Domain: "
set /p user="Enter User: "
runas /netonly /user:%domain%\%user% "%powermenu_directory%\powermenu.bat "
EXIT
:Selection4 and so on
:Selection5 and so on
:Selection6 and so on
:Selection7 and so on
:Selection8
ECHO Run the following within powersploit: 'Import-Module PowerSploit.psm1; Get-NetDomain'
ECHO.
set /p autorun="Would you like to autorun this shell script? (y/n)"
setlocal EnableDelayedExpansion
if "%autorun%"=="y" (
if EXIST %powermenu_directory%\PowerSploit-master (
start C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -Command "import-module %powermenu_directory%\PowerSploit-master\PowerSploit.psm1;Get-NetDomain;Read-Host -Prompt 'Press Enter to continue'"
) else (
echo "powersploit location not set. Please set this within the Menu")
PAUSE > NUL
GOTO MENU
) else (
ECHO "Press enter to continue.."
PAUSE > NUL
GOTO MENU
)
PAUSE > NUL
GOTO MENU
:Selection9
ECHO Run the following within powersploit:
ECHO 'Import-Module PowerSploit.psm1; Get-NetUser'
ECHO.
ECho Make sure you are running as a domain authenticated user
ECHO.
set /p autorun="Would you like to autorun this shell script? (y/n)"
setlocal EnableDelayedExpansion
if "%autorun%"=="y" (
if EXIST %powermenu_directory%\PowerSploit-master (
start C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -Command "import-module%powermenu_directory%\PowerSploit-master\PowerSploit.psm1;Get-NetUser;Read-Host -Prompt 'Press Enter to continue'"
) else (
echo "powersploit location not set. Please set this within the Menu")
PAUSE > NUL
GOTO MENU
) else (
ECHO "Press enter to continue.."
PAUSE > NUL
GOTO MENU
)
PAUSE > NUL
GOTO MENU
:Selection10
rem set /p powersploit_loc="Where is powersploit folder located: "
rem echo %powersploit_loc%> %userprofile%\powermenu.conf
rem ECHO.
rem ECHO "Location set....Press enter to return to menu"
rem PAUSE > NUL
rem GOTO MENU
PAUSE > NUL
GOTO MENU
:Selection11
start C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -Command "(New-Object Net.WebClient).DownloadFile('https://codeload.github.com/PowerShellMafia/PowerSploit/zip/master', 'powersploit.zip')"
start C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -Command "echo 'downloading PowerSploit from Github'; Invoke-WebRequest https://codeload.github.com/PowerShellMafia/PowerSploit/zip/master -OutFile %powermenu_directory%\powersploit.zip"
ECHO Powersploit downloaded to "%powermenu_directory%\powersploit.zip"
PAUSE > NUL
GOTO MENU
:Selection12
start C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -Command "(New-Object Net.WebClient).DownloadFile('https://codeload.github.com/Kevin-Robertson/Inveigh/zip/master', 'Inveigh.zip')"
start C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -Command "echo 'downloading PowerSploit from Github'; Invoke-WebRequest https://codeload.github.com/Kevin-Robertson/Inveigh/zip/master -OutFile %powermenu_directory%\Inveigh.zip"
ECHO Powersploit downloaded to "%powermenu_directory%\Inveigh.zip"
PAUSE > NUL
GOTO MENU
:Selection13
ECHO Run the following within powersploit:
ECHO 'Import-Module Inveigh.psm1; XXXXX'
ECHO.
ECho Make sure you are running as a domain authenticated user
ECHO.
set /p autorun="Would you like to autorun this shell script? (y/n)"
setlocal EnableDelayedExpansion
if "%autorun%"=="y" (
if EXIST %powermenu_directory%\PowerSploit-master (
start C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -Command "import-module %powersploit_loc%\PowerSploit.psm1;Get-NetUser;Read-Host -Prompt 'Press Enter to continue'"
) else (
echo "powersploit location not set. Please set this within the Menu")
PAUSE > NUL
GOTO MENU
) else (
ECHO "Press enter to continue.."
PAUSE > NUL
GOTO MENU
)
PAUSE > NUL
GOTO MENU
PAUSE > NUL
GOTO MENU
:Quit
CLS
ECHO ==============THANKYOU===============
ECHO.
ECHO ======PRESS ANY KEY TO CONTINUE======
PAUSE>NUL
EXIT