@ECHO OFF
COLOR F0
SET akbver=r36
SET akbforcearch=0
REM Hey! You! User reading this! The two lines below this explanation can be used to manually configure the type of architecture your operating system runs on.
REM To figure out if you have a 64-bit or 32-bit architecture, hit start > run, then type "winver" without the quotes, and hit enter. If the window that pops up
REM mentions 64-bit (for example, Windows 7 Home Premium 64-bit), then you've got 64-bit. If it doesn't mention an architecture, then you likely have 32-bit. If
REM you are on Windows 95 or older, you might be on 16-bit, but then my advice is for you to get a new computer. This file likely won't work if you're not on at
REM least Windows XP. Anyhow, to uncomment a line, simply remove the "REM ", including the space, from the beginning of the line. That's it.
REM ONLY change these variables if this tools asks you to!
REM The very next two lines are what you want to change. Uncomment REM SET akbforcearch=32 for 32-bit, REM SET akbforcearch=64 for 64-bit.
REM SET akbforcearch=32
REM SET akbforcearch=64
IF NOT EXIST log.txt GOTO TIMESTAMP
ECHO. 1>>log.txt 2>>error.txt
ECHO. 1>>log.txt 2>>error.txt
ECHO. 1>>log.txt 2>>error.txt
:TIMESTAMP
ECHO ________________________________________________________________________________
_____________________ 1>>log.txt 2>>error.txt
ECHO.
ECHO Akamai Kneecap Buster %akbver% Log, beginning log at: %date% %time% 1>>log.txt 2>>error.txt
ECHO ________________________________________________________________________________
_____________________ 1>>log.txt 2>>error.txt
ECHO. 1>>log.txt 2>>error.txt
CLS
CALL :Title
ECHO If you don't know what Akamai is, you might still do well to run this tool to
ECHO protect yourself against it. I encourage you to read the article at:
ECHO.
ECHO
http://mpql.net/pages/akamai-kneecap-busterECHO.
ECHO to educate yourself on what Akamai is, and what this tool does. If you don't
ECHO -have- Akamai, however, this tool will not protect your system in all the ways
ECHO it would if you did have it installed. I may add such functionality in the
ECHO future, but, it's currently absent.
ECHO.
ECHO Do NOT put this in any of Akamai's folders. If you are not absolutely POSITIVE
ECHO that this file is somewhere safe, close this window, relocate this file,
ECHO (your desktop is a good example location), and run it again.
ECHO.
ECHO Otherwise, press any key to continue.
ECHO.
PAUSE 1>>log.txt 2>>error.txt
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"&&(
GOTO ISADMIN
)
CLS
CALL :Title
ECHO You are not running this as an administrator. This file will exit. 1>>log.txt 2>>error.txt
ECHO You are not running this as an administrator. This file will exit.
ECHO.
ECHO Please make sure you run this as an administrator! This file cannot perform
ECHO the operations necessary to disable Akamai without administrator access. After
ECHO this file closes, right-click it, and click "Run as administrator". If you do
ECHO not have this option available, or are not an administrator, you can either
ECHO ask for an administrator of your machine to run this file for you, give you
ECHO the permissions necessary to run it yourself, or just put up with Akamai
ECHO leeching your bandwidth and (to a lesser extent) system resources.
ECHO.
PAUSE
CLS
EXIT
:ISADMIN
CLS
CALL :Title
ECHO You are running this as an administrator, which is necessary for Akamai 1>>log.txt 2>>error.txt
ECHO Kneecap Buster to complete all operations. This is good. 1>>log.txt 2>>error.txt
ECHO You are running this as an administrator, which is necessary for Akamai
ECHO Kneecap Buster to complete all operations. This is good.
ECHO.
PAUSE
IF %akbforcearch%==32 (
SET akbcheck1=32
SET akbcheck2=32
ECHO Variable set, forcing 32-bit architecture check 1>>log.txt 2>>error.txt
GOTO ARCHSELECT
) ELSE IF %akbforcearch%==64 (
SET akbcheck1=64
SET akbcheck2=64
ECHO Variable set, forcing 64-bit architecture check 1>>log.txt 2>>error.txt
GOTO ARCHSELECT
)
IF %PROCESSOR_ARCHITECTURE%==x86 (
SET akbcheck1=32
ECHO Check 1 indicates 32-bit 1>>log.txt 2>>error.txt
) ELSE (
SET akbcheck1=64
ECHO Check 1 indicates 64-bit 1>>log.txt 2>>error.txt
)
FOR /f "skip=1 delims=" %%x in ('wmic cpu get addresswidth') do if not defined AddressWidth set AddressWidth=%%x
IF %AddressWidth%==64 (
SET akbcheck2=64
ECHO Check 2 indicates 64-bit 1>>log.txt 2>>error.txt
) ELSE (
SET akbcheck2=32
ECHO Check 2 indicates 32-bit 1>>log.txt 2>>error.txt
)
:ARCHSELECT
IF %akbcheck1%==%akbcheck2% (
IF %akbcheck1%==64 (
ECHO Both checks match, setting Common Files directory to 64-bit *32 location 1>>log.txt 2>>error.txt
SET akbcommondir="%commonprogramfiles(x86)%"
ECHO Common Files Directory set to "%commonprogramfiles(x86)%" 1>>log.txt 2>>error.txt
GOTO ARCHFOUND
) ELSE IF %akbcheck1%==32 (
ECHO Both checks match, setting Common Files directory to 32-bit location 1>>log.txt 2>>error.txt
SET akbcommondir="%commonprogramfiles%"
ECHO Common Files Directory set to "%commonprogramfiles%" 1>>log.txt 2>>error.txt
GOTO ARCHFOUND
)
) ELSE (
CLS
CALL :Title
ECHO Unable to determine system architecture. Quitting.
ECHO Unable to determine system architecture. Quitting. 1>>log.txt 2>>error.txt
ECHO If you know which architecture you have [32-bit/64-bit], you can
ECHO uncomment one of the lines setting the "akbforcearch" variable
ECHO at the beginning of this file. Don't worry, there are instructions.
ECHO.
ECHO If you aren't sure of what you're doing, then don't do anything!
ECHO Instead, come post on my blog, and I'll try to help you out. =]
ECHO.
ECHO
http://mpql.net/pages/akamai-kneecap-buster ECHO.
PAUSE
CLS
EXIT
)
:ARCHFOUND
CLS
CALL :Title
ECHO Akamai Kneecap Buster has determined your Operating System's architecture to
ECHO be %akbcheck1%-bit. If you -know- this to be incorrect, please exit this file.
ECHO You can then manually configure this file by uncommenting one of the lines
ECHO setting the "akbforcearch" variable at the beginning of this file. Don't worry,
ECHO there are instructions.
ECHO.
ECHO If you aren't sure of what you're doing, then don't do anything!
ECHO Instead, come post on my blog, and I'll try to help you out. =]
ECHO.
ECHO
http://mpql.net/pages/akamai-kneecap-busterECHO.
PAUSE
CLS
CALL :Title
ECHO Ending Akamai netsession process...
ECHO Ending Akamai netsession process... 1>>log.txt 2>>error.txt
TASKKILL /F /IM netsession_win.exe 1>>log.txt 2>>log.txt
ECHO Stopping Akamai service
ECHO Stopping Akamai service 1>>log.txt 2>>error.txt
sc stop akamai 1>>log.txt 2>>error.txt
ECHO Disabling Akamai service
ECHO Disabling Akamai service 1>>log.txt 2>>error.txt
sc config akamai start= disabled 1>>log.txt 2>>error.txt
sc config akamai depend= safdhsdjksd/hjdsagghjfd 1>>log.txt 2>>error.txt
ECHO Deleting Akamai cache
ECHO Deleting Akamai cache 1>>log.txt 2>>error.txt
DEL /F /S /Q "%akbcommondir%\Akamai\Cache\*" 1>>log.txt 2>>error.txt
ECHO Deleting Akamai logs
ECHO Deleting Akamai logs 1>>log.txt 2>>error.txt
DEL /F /S /Q "%akbcommondir%\Akamai\Logs\*" 1>>log.txt 2>>error.txt
CLS
for /f "tokens=*" %%G in ('dir /a-d /s /b ^"%akbcommondir%\Akamai\^"') do (
CALL :Title
ECHO Taking ownership of %%G...
ECHO Taking ownership of %%G... 1>>log.txt 2>>error.txt
TAKEOWN /F "%%G" 1>>log.txt 2>>error.txt
ECHO Resetting permissions on %%G...
ECHO Resetting permissions on %%G... 1>>log.txt 2>>error.txt
ICACLS "%%G" /reset 1>>log.txt 2>>error.txt
ATTRIB -R -S -H "%%G" 1>>log.txt 2>>error.txt
ECHO Blanking %%G...
ECHO Blanking %%G... 1>>log.txt 2>>error.txt
ECHO.>"%%G"
ECHO Locking %%G...
ECHO Locking %%G... 1>>log.txt 2>>error.txt
ATTRIB +R +S +H "%%G" 1>>log.txt 2>>error.txt
ICACLS "%%G" /inheritance:r 1>>log.txt 2>>error.txt
ICACLS "%%G" /deny "SYSTEM":F /C 1>>log.txt 2>>error.txt
ICACLS "%%G" /deny "Administrators":F /C 1>>log.txt 2>>error.txt
ICACLS "%%G" /deny "Users":F /C 1>>log.txt 2>>error.txt
ICACLS "%%G" /deny %username%:F /C 1>>log.txt 2>>error.txt
CLS
)
CALL :Title
ECHO Deleting Akamai appdata cache
ECHO Deleting Akamai appdata cache 1>>log.txt 2>>error.txt
DEL /F /S /Q "%appdata%\..\Local\Akamai\Cache\*" 1>>log.txt 2>>error.txt
ECHO Deleting Akamai appdata logs
ECHO Deleting Akamai appdata logs 1>>log.txt 2>>error.txt
DEL /F /S /Q "%appdata%\..\Local\Akamai\Logs\*" 1>>log.txt 2>>error.txt
CLS
for /f "tokens=*" %%G in ('dir /a-d /s /b ^"%appdata%\..\Local\Akamai\^"') do (
CALL :Title
ECHO Taking ownership of %%G...
ECHO Taking ownership of %%G... 1>>log.txt 2>>error.txt
TAKEOWN /F "%%G" 1>>log.txt 2>>error.txt
ECHO Resetting permissions on %%G...
ECHO Resetting permissions on %%G... 1>>log.txt 2>>error.txt
ICACLS "%%G" /reset 1>>log.txt 2>>error.txt
ATTRIB -R -S -H "%%G" 1>>log.txt 2>>error.txt
ECHO Blanking %%G...
ECHO Blanking %%G... 1>>log.txt 2>>error.txt
ECHO.>"%%G"
ECHO Locking %%G...
ECHO Locking %%G... 1>>log.txt 2>>error.txt
ATTRIB +R +S +H "%%G" 1>>log.txt 2>>error.txt
ICACLS "%%G" /inheritance:r 1>>log.txt 2>>error.txt
ICACLS "%%G" /deny "SYSTEM":F /C 1>>log.txt 2>>error.txt
ICACLS "%%G" /deny "Administrators":F /C 1>>log.txt 2>>error.txt
ICACLS "%%G" /deny "Users":F /C 1>>log.txt 2>>error.txt
ICACLS "%%G" /deny %username%:F /C 1>>log.txt 2>>error.txt
CLS
)
CALL :Title
ECHO Writing registry file to temp...
ECHO Writing registry file to temp... 1>>log.txt 2>>error.txt
>%temp%\akamaikneebuster.reg ECHO Windows Registry Editor Version 5.00
>>%temp%\akamaikneebuster.reg ECHO.
>>%temp%\akamaikneebuster.reg ECHO [-HKEY_CURRENT_USER\Software\Akamai]
ECHO Importing registry file to registry...
ECHO Importing registry file to registry... 1>>log.txt 2>>error.txt
REGEDIT /S %temp%\akamaikneebuster.reg 1>>log.txt 2>>error.txt
ECHO Deleting registry file from temp...
ECHO Deleting registry file from temp... 1>>log.txt 2>>error.txt
DEL /F /Q %temp%\akamaikneebuster.reg 1>>log.txt 2>>error.txt
CLS
CALL :Title
CALL :ENDING
CALL :ENDING 1>>log.txt 2>>error.txt
PAUSE 1>>log.txt 2>>error.txt
CLS
EXIT
:Title
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo ³ Akamai Kneecap Buster %akbver% ³
echo ³ Written and (c) by Mopquill 2011 - 2012 ³
echo ³ Last Updated Tuesday, January 10th, 2012 ³
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
echo.
GOTO:EOF
:ENDING
ECHO.
ECHO Done! This script has created two files, log.txt, and error.txt. These
ECHO two files have recorded all successful commands, and errors, respectively.
ECHO If you are satisfied that this script has done its job, and error.txt is
ECHO empty, you can go ahead and delete them. If, however, error.txt is not
ECHO empty, chances are, running the script again will not help, nor avoid
ECHO any errors. Any errors would likely be caused by a system misconfiguration,
ECHO a correct configuration that I did not anticipate, or a mistake in this
ECHO script. If you're having problems, feel free to report any errors to my
ECHO email, webmaster@mpql.net , with the subject line "Akamai Kneecap Buster".
ECHO Please make sure to attach the error.txt, and provide any information that
ECHO might be relevant. If you have any suggestions for improvements to this
ECHO script (code snippets are appreciated!), feel free to contact me at that
ECHO email as well.
ECHO.
ECHO You can press any key to exit.
GOTO:EOF