-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Zelone
committed
Sep 23, 2020
1 parent
6c958ea
commit c444c6b
Showing
8 changed files
with
160 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
:: BatchGotAdmin | ||
:------------------------------------- | ||
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" | ||
set params = %*:"="" | ||
echo UAC.ShellExecute "%*", "", "", "runas", 1 >> "%temp%\getadmin.vbs" | ||
|
||
"%temp%\getadmin.vbs" | ||
del "%temp%\getadmin.vbs" | ||
exit /B | ||
|
||
:gotAdmin | ||
pushd "%CD%" | ||
CD /D "%~dp0" | ||
:-------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
E: | ||
cd JavaProjects\Nuxt\Project | ||
start run | ||
sleep 80 | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
git config core.autocrlf false | ||
git rm --cached -r . | ||
git reset --hard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
@echo off | ||
echo MS-DOS Mode Implementation for Windows 10 by Endermanch (Elevation exploit by Matt) | ||
echo. | ||
echo =-=-=-=-=-=-=-=-=-=-=-=-= | ||
echo Waiting for elevation... | ||
echo =-=-=-=-=-=-=-=-=-=-=-=-= | ||
|
||
:init | ||
setlocal DisableDelayedExpansion | ||
set "batchPath=%~0" | ||
for %%k in (%0) do set batchName=%%~nk | ||
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs" | ||
setlocal EnableDelayedExpansion | ||
|
||
:checkPrivileges | ||
NET FILE 1>NUL 2>NUL | ||
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ) | ||
|
||
:getPrivileges | ||
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges) | ||
echo Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%" | ||
echo args = "ELEV " >> "%vbsGetPrivileges%" | ||
echo For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%" | ||
echo args = args ^& strArg ^& " " >> "%vbsGetPrivileges%" | ||
echo Next >> "%vbsGetPrivileges%" | ||
echo UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%" | ||
"%SystemRoot%\System32\WScript.exe" "%vbsGetPrivileges%" %* | ||
exit /B | ||
|
||
:gotPrivileges | ||
setlocal & pushd . | ||
cd /d %~dp0 | ||
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul & shift /1) | ||
|
||
REM ~-~-~-~-~-~-~-~ Batch file starts here | ||
echo. | ||
echo Starting the file... | ||
ping localhost -n 2 > nul | ||
echo Entering MS-DOS (recovery) mode... | ||
echo. | ||
echo Tweaking the registry... | ||
reg add HKLM\System\Setup /v CmdLine /t REG_SZ /d "cmd.exe /k C:\dosexec.bat" /f | ||
reg add HKLM\System\Setup /v SystemSetupInProgress /t REG_DWORD /d 1 /f > nul | ||
reg add HKLM\System\Setup /v SetupType /t REG_DWORD /d 2 /f > nul | ||
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableCursorSuppression /t REG_DWORD /d 0 /f > nul | ||
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f > nul | ||
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v VerboseStatus /t REG_DWORD /d 1 /f > nul | ||
echo. | ||
|
||
if not exist %systemdrive%\dosexec.bat ( | ||
echo Dosexec not present, creating a default file. | ||
@echo @echo off > %systemdrive%\dosexec.bat | ||
@echo echo This is a default dosexec file, you can add commands here to run on the next recovery startup. >> %systemdrive%\dosexec.bat | ||
@echo reg add HKLM\System\Setup /v SystemSetupInProgress /t REG_DWORD /d 0 /f >> %systemdrive%\dosexec.bat | ||
@echo net start >> %systemdrive%\dosexec.bat | ||
@echo start explorer >> %systemdrive%\dosexec.bat | ||
@echo ping localhost -n 3 >> %systemdrive%\dosexec.bat | ||
@echo start taskmgr >> %systemdrive%\dosexec.bat | ||
@echo taskkill /f /im explorer.exe >> %systemdrive%\dosexec.bat | ||
@echo cls >> %systemdrive%\dosexec.bat | ||
@echo echo The system runs in the recovery /so-called MS-DOS/ mode, type "win" to get back to Windows. >> %systemdrive%\dosexec.bat | ||
echo. | ||
echo =-=-=-=-=-= DOSEXEC.BAT =-=-=-=-=-= | ||
type %systemdrive%\dosexec.bat | ||
echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | ||
pause | ||
) | ||
|
||
echo. | ||
echo Done, rebooting. | ||
ping localhost -n 3 > nul | ||
shutdown -r -t 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@echo off | ||
echo MS-DOS Mode Implementation for Windows 10 by Endermanch (Elevation exploit by Matt) | ||
echo. | ||
echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | ||
echo Running as NT AUTHORITY, no elevation needed | ||
echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | ||
echo. | ||
echo Starting the file... | ||
ping localhost -n 2 > nul | ||
echo Rebooting to MS-DOS (recovery) mode... | ||
echo. | ||
echo Tweaking the registry... | ||
reg add HKLM\System\Setup /v CmdLine /t REG_SZ /d "cmd.exe /k C:\dosexec.bat" /f | ||
reg add HKLM\System\Setup /v SystemSetupInProgress /t REG_DWORD /d 1 /f > nul | ||
reg add HKLM\System\Setup /v SetupType /t REG_DWORD /d 2 /f > nul | ||
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableCursorSuppression /t REG_DWORD /d 0 /f > nul | ||
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f > nul | ||
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v VerboseStatus /t REG_DWORD /d 1 /f > nul | ||
echo. | ||
echo Done, rebooting. (3 attempts) | ||
echo Attempt #1 | ||
shutdown -r -t 0 | ||
ping localhost -n 3 > nul | ||
echo Failed. Attempt #2 | ||
shutdown -r -t 0 | ||
ping localhost -n 3 > nul | ||
echo Failed. Attempt #3 | ||
shutdown -r -t 0 | ||
echo Failed. If Windows hasn't rebooted yet, try resetting the machine. (If the system cannot execute the program, it will reboot shortly) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@echo off | ||
echo MS-DOS Mode Implementation for Windows 10 by Endermanch (Elevation exploit by Matt) | ||
echo. | ||
echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | ||
echo Running as NT AUTHORITY, no elevation needed | ||
echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | ||
echo. | ||
echo Starting the file... | ||
ping localhost -n 2 > nul | ||
echo Exiting MS-DOS (recovery) mode... | ||
echo. | ||
echo Tweaking the registry... | ||
reg add HKLM\System\Setup /v CmdLine /t REG_SZ /d "" /f | ||
reg add HKLM\System\Setup /v SystemSetupInProgress /t REG_DWORD /d 0 /f > nul | ||
reg add HKLM\System\Setup /v SetupType /t REG_DWORD /d 0 /f > nul | ||
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableCursorSuppression /t REG_DWORD /d 1 /f > nul | ||
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f > nul | ||
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v VerboseStatus /t REG_DWORD /d 0 /f > nul | ||
echo. | ||
echo Done, rebooting. (3 attempts) | ||
echo Attempt #1 | ||
shutdown -r -t 0 | ||
ping localhost -n 3 > nul | ||
echo Failed. Attempt #2 | ||
shutdown -r -t 0 | ||
ping localhost -n 3 > nul | ||
echo Failed. Attempt #3 | ||
shutdown -r -t 0 | ||
echo Failed. If Windows hasn't rebooted yet, try resetting the machine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
rails new %1 --db=%2 | ||
cd %1 | ||
pause | ||
rails db:create |