BATCH FILES
#privesc
#check current privileges
daniel@MARKUP C:\Users\daniel> whoami /priv
Privilege Name Description State
============================= ============================== =======
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Enabled
* nothing pertinent
daniel@MARKUP C:\Users\daniel> dir c:\
Volume in drive C has no label.
Volume Serial Number is BA76-B4E3
Directory of c:\
03/12/2020 03:56 AM <DIR> Log-Management
07/28/2021 03:38 AM 0 Recovery.txt
* these are the only two UNCOMMON files
- always analyze UNCOMMON files prior to going into a rabbit hole
daniel@MARKUP C:\Users\daniel> type c:\Recovery.txt
blank file
daniel@MARKUP C:\Users\daniel> dir c:\Log-Management
Volume in drive C has no label.
Volume Serial Number is BA76-B4E3
Directory of c:\Log-Management
03/06/2020 02:42 AM 346 job.bat
daniel@MARKUP C:\Users\daniel> type c:\Log-Management\job.bat
@echo off
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto noAdmin
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
echo.
echo Event Logs have been cleared!
goto theEnd
:do_clear
wevtutil.exe cl %1
goto :eof
:noAdmin
echo You must run this script as an Administrator!
:theEnd
exit
* understand the purpose of the batch file and what can be manipulated
Last updated