-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.bat
More file actions
58 lines (50 loc) · 1.99 KB
/
clean.bat
File metadata and controls
58 lines (50 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
setlocal EnableExtensions EnableDelayedExpansion
REM ===============================
REM Self-elevation check
REM ===============================
net session >nul 2>&1
if %errorlevel% neq 0 (
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"Start-Process '%~f0' -Verb RunAs"
exit /b
)
REM ===============================
REM Kill Python & mitmproxy processes
REM ===============================
taskkill /F /IM python.exe /T >nul 2>&1
taskkill /F /IM pythonw.exe /T >nul 2>&1
taskkill /F /IM mitmdump.exe /T >nul 2>&1
taskkill /F /IM mitmproxy.exe >nul 2>&1
taskkill /F /IM mitmweb.exe >nul 2>&1
REM ===============================
REM Remove WinINET proxy settings
REM ===============================
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /f >nul 2>&1
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /f >nul 2>&1
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /f >nul 2>&1
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /f >nul 2>&1
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^
/v ProxyEnable /t REG_DWORD /d 0 /f >nul 2>&1
REM ===============================
REM Reset WinHTTP proxy (system-wide)
REM ===============================
netsh winhttp reset proxy >nul 2>&1
REM ===============================
REM Clear proxy environment variables
REM ===============================
setx HTTP_PROXY "" >nul 2>&1
setx HTTPS_PROXY "" >nul 2>&1
setx ALL_PROXY "" >nul 2>&1
setx http_proxy "" >nul 2>&1
setx https_proxy "" >nul 2>&1
setx all_proxy "" >nul 2>&1
REM ===============================
REM Flush DNS
REM ===============================
ipconfig /flushdns >nul 2>&1
REM ===============================
REM Final (ONLY output)
REM ===============================
echo Finished.
pause