This commit is contained in:
Namhyeon Go 2020-08-09 18:14:05 +09:00
parent 1d602b6ad8
commit cb0594da31
8 changed files with 52 additions and 82 deletions

View File

@ -18,6 +18,7 @@ var loginSuccess = function(res) {
token: token
}, function(res) {
// 사용자 프로세스 조회
__global.processNames = [];
var $userProcesses = $("#userProcesses");
for (var i in res.processes) {
var row = res.processes[i];
@ -26,6 +27,7 @@ var loginSuccess = function(res) {
}
// 사용자 서버 조회
__global.serverNames = [];
var $userServers = $("#userServers");
for (var i in res.serverusers) {
var row = res.serverusers[i];

2
assignProxy.bat Normal file
View File

@ -0,0 +1,2 @@
@echo off
bin\shadow.exe -c config.json &

View File

@ -19,18 +19,21 @@ rmdir %BINPATH% /s /q
mkdir %BINPATH%
REM complie shadow-may.19.2020-modified
pushd %CD%\packages\shadow-may.19.2020-modified
windres -o main.syso main.rc
go build
copy %CD%\shadow.exe %BINPATH%\shadow.exe
popd
REM pushd %CD%\packages\shadow-may.19.2020-modified
REM windres -o main.syso main.rc
REM go build
REM copy %CD%\shadow.exe %BINPATH%\shadow.exe
REM popd
go get -v -ldflags="-s -w" -trimpath github.com/imgk/shadow/executive/shadow
REM copy required files
copy %CD%\packages\shadowsocks-libev-mingw-x86_64\ss-local.exe %BINPATH%\ss-local.exe
copy %CD%\packages\shadowsocks-libev-mingw-x86_64\*.dll %BINPATH%\
copy %CD%\packages\WinDivert-2.2.0-A\x64\WinDivert.dll %BINPATH%\WinDivert.dll
copy %CD%\packages\WinDivert-2.2.0-A\x64\WinDivert64.sys %BINPATH%\WinDivert64.sys
copy %CD%\packages\tun2socks-windows-4.0-amd64.exe %BINPATH%\tun2socks.exe
copy %CD%\packages\tap-windows-9.24.2-I601-Win10.exe %BINPATH%\tap-windows-9.24.2-I601-Win10.exe
REM copy %CD%\packages\tun2socks-windows-4.0-amd64.exe %BINPATH%\tun2socks.exe
REM copy %CD%\packages\tap-windows-9.24.2-I601-Win10.exe %BINPATH%\tap-windows-9.24.2-I601-Win10.exe
copy %CD%\packages\build\go\bin\shadow.exe %BINPATH%\shadow.exe
echo done

View File

@ -1,36 +1,24 @@
{
"Server": "socks://localhost:1080",
"Server": [
"socks://localhost:1080"
],
"NameServer": "https://1.1.1.1/dns-query",
"FilterString": "outbound and (ip ? ip.DstAddr != 1.1.1.1 : true)",
"IPRules": {
"Mode": false,
"IPCIDR": []
"FilterString": "outbound and (ip ? ip.DstAddr != 1.2.3.4 and ip.DstAddr != 1.1.1.1 : true)",
"IPCIDRRules": {
"Proxy": [
"198.18.0.0/16",
"8.8.8.8/32"
]
},
"AppRules": {
"Mode": true,
"Programs": [
"Proxy": [
"chrome.exe",
"nx.exe"
]
},
"DomainRules": {
"Proxy": [
"**.google.com",
"**.google.*",
"**.google.*.*",
"**.youtube.com",
"*.twitter.com",
"www.facebook.com",
"bing.com",
"**.amazon.*"
],
"Direct": [
"**.baidu.*",
"**.youku.*",
"**.*"
],
"Blocked": [
"ad.blocked.com"
]
"Proxy": [],
"Direct": [],
"Blocked": []
}
}

0
elevator.js Normal file
View File

View File

@ -57,3 +57,8 @@ exports.run = function(cmd, fork) {
WSH.Run(c, 0, !fork);
};
exports.elevatedRun = function(cmd, fork) {
var oShell = CreateObject("Shell.Application");
var c = exports.makeCmdLine(cmd);
oShell.shellExecute(c, null, null, "runas", 1);
};

View File

@ -9,36 +9,22 @@ var FILE = require("lib/file");
var SHELL = require("lib/shell");
var ssConfig = {
Server: "",
NameServer: "https://1.1.1.1/dns-query",
FilterString: "outbound and (ip ? ip.DstAddr != 1.1.1.1 : true)",
IPRules: {
Mode: false,
IPCIDR: []
},
AppRules: {
Mode: true,
Programs: []
},
DomainRules: {
Proxy: [
"**.google.com",
"**.google.*",
"**.google.*.*",
"**.youtube.com",
"*.twitter.com",
"www.facebook.com",
"bing.com",
"**.amazon.*"
],
Direct: [
"**.baidu.*",
"**.youku.*",
"**.*"
],
Blocked: [
"ad.blocked.com"
"Server": [],
"NameServer": "https://1.1.1.1/dns-query",
"FilterString": "outbound and (ip ? ip.DstAddr != 1.2.3.4 and ip.DstAddr != 1.1.1.1 : true)",
"IPCIDRRules": {
"Proxy": [
"198.18.0.0/16",
"8.8.8.8/32"
]
},
"AppRules": {
"Proxy":[]
},
"DomainRules": {
"Proxy": [],
"Direct": [],
"Blocked": []
}
};
@ -46,25 +32,13 @@ exports.main = function() {
// 내부 포트 결정
console.log("* Connecting to socket proxy...");
var listenPort = SS.connect();
ssConfig.Server = "socks://localhost:" + listenPort;
ssConfig.Server.push("socks://localhost:" + listenPort);
console.log("* Local listening port: " + listenPort);
// 네트워크 인터페이스 정보 조회
console.log("* Gethering network interfaces...");
var inets = SYS.getNetworkInterfaces();
for (var i = 0; i < inets.length; i++) {
console.log(" > " + inets[i].Caption);
}
// TAP 설치 여부 조회
console.log("* Gethering WindowsTAP interfaces...");
console.log(WINTAP.query("tap0901"));
//ssConfig.TunName = "TAP-Windows Adapter V9";
// 앱 규칙 설정
var processNames = __global.processNames;
for (var i in processNames) {
ssConfig.AppRules.Programs.push(processNames[i]);
ssConfig.AppRules.Proxy.push(processNames[i]);
}
// 설정 파일 저장
@ -76,12 +50,8 @@ exports.main = function() {
console.info("설정 파일 저장 완료!");
// 앱 프록시 실행
console.info("앱 프록시는 관리자 권한을 필요로 합니다. 확인을 눌러주세요.");
SHELL.run([
"bin/shadow.exe",
"-c",
"config.json"
]);
console.info("앱 프록시는 관리자 권한을 필요로 합니다. 권한 요청 시 확인을 눌러주세요.");
SHELL.elevatedRun("assignProxy.bat");
};
exports.ssConfig = ssConfig;

View File

@ -1 +1 @@
32fiJjwxNmDhSpLhqG1yKPt7qTxMFyno
EZWLCH1Lw4iP5QhRbzfCTuND4laAz4bA