Skip to content

Commit

Permalink
update23-sept-2020
Browse files Browse the repository at this point in the history
  • Loading branch information
Zelone committed Sep 23, 2020
1 parent 6c958ea commit c444c6b
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 3 deletions.
25 changes: 25 additions & 0 deletions admin.bat
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"
:--------------------------------------
3 changes: 0 additions & 3 deletions continue.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
E:
cd JavaProjects\Nuxt\Project
start run
sleep 80
exit
3 changes: 3 additions & 0 deletions gitCRLFLF.cmd
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
1 change: 1 addition & 0 deletions gitit.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ git add *.exe
git add *.vbs
git add *.dll
git add *.keep
git add *.bat
git commit -m "%*"
git push -u origin master
cd /d %now%
72 changes: 72 additions & 0 deletions reboot/msdos.bat
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
29 changes: 29 additions & 0 deletions reboot/reboot.bat
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)
29 changes: 29 additions & 0 deletions reboot/win.bat
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.
1 change: 1 addition & 0 deletions zrails.cmd
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

0 comments on commit c444c6b

Please sign in to comment.