반응형
#!/bin/bash
read -p "Proxy On(1)? Off(2)? " ProxyOnOff
ProxyServerSetting() {
networksetup -setwebproxy Wi-Fi ${1} ${2}
networksetup -setwebproxystate Wi-Fi on
networksetup -setsecurewebproxy Wi-Fi ${1} ${2}
networksetup -setsecurewebproxystate Wi-Fi on
}
printProxyState() {
echo -e "\x1b[31m[ web proxy state ]\x1b[0m"
networksetup -getwebproxy Wi-Fi | head -3
echo -e "\n\x1b[31m[ web secure proxy state ]\x1b[0m"
networksetup -getsecurewebproxy Wi-Fi | head -3
}
if [[ ${ProxyOnOff} -eq 1 ]]
then
read -p "ProxyServer Default(1 or Enter) or Change(2)? " ProxyServer
if [[ ${ProxyServer} -eq 1 ]]||[[ ${ProxyServer} = "" ]]
then
ProxyServer="localhost"
read -p "ProxyPort Default(1 or Enter) or Change(2)?" ProxyPort
if [[ ${ProxyPort} -eq 1 ]]||[[ ${ProxyPort} = "" ]]
then
ProxyPort=8080
ProxyServerSetting ${ProxyServer} ${ProxyPort}
printProxyState
elif [[ ${ProxyPort} -eq 2 ]]
then
read -p "ProxyPort? " ProxyPort
ProxyServerSetting ${ProxyServer} ${ProxyPort}
printProxyState
fi
elif [[ ${ProxyServer} -eq 2 ]]
then
read -p "ProxyServer? " ProxyServer
read -p "ProxyPort Default(1 or Enter) or Change(2)?" ProxyPort
if [[ ${ProxyPort} -eq 1 ]]||[[ ${ProxyPort} = "" ]]
then
ProxyPort=8080
ProxyServerSetting ${ProxyServer} ${ProxyPort}
printProxyState
elif [[ ${ProxyPort} -eq 2 ]]
then
read -p "ProxyPort? " ProxyPort
ProxyServerSetting ${ProxyServer} ${ProxyPort}
printProxyState
fi
fi
elif [[ ${ProxyOnOff} -eq 2 ]]
then
networksetup -setwebproxystate Wi-Fi off
networksetup -setsecurewebproxystate Wi-Fi off
printProxyState
fi
◼︎Proxy On
◼︎Proxy Off
반응형
'Information Security > macOS' 카테고리의 다른 글
UTM으로 m1 mac에 Windows 11 arm 설치 시 문제 해결 (10) | 2022.06.01 |
---|---|
macOS frida SSL Pinning Bypass (0) | 2021.12.27 |
맥 현재 디렉터리에서 터미널 열기 (0) | 2021.12.11 |