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 token: token
}, function(res) { }, function(res) {
// 사용자 프로세스 조회 // 사용자 프로세스 조회
__global.processNames = [];
var $userProcesses = $("#userProcesses"); var $userProcesses = $("#userProcesses");
for (var i in res.processes) { for (var i in res.processes) {
var row = res.processes[i]; var row = res.processes[i];
@ -26,6 +27,7 @@ var loginSuccess = function(res) {
} }
// 사용자 서버 조회 // 사용자 서버 조회
__global.serverNames = [];
var $userServers = $("#userServers"); var $userServers = $("#userServers");
for (var i in res.serverusers) { for (var i in res.serverusers) {
var row = res.serverusers[i]; 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% mkdir %BINPATH%
REM complie shadow-may.19.2020-modified REM complie shadow-may.19.2020-modified
pushd %CD%\packages\shadow-may.19.2020-modified REM pushd %CD%\packages\shadow-may.19.2020-modified
windres -o main.syso main.rc REM windres -o main.syso main.rc
go build REM go build
copy %CD%\shadow.exe %BINPATH%\shadow.exe REM copy %CD%\shadow.exe %BINPATH%\shadow.exe
popd REM popd
go get -v -ldflags="-s -w" -trimpath github.com/imgk/shadow/executive/shadow
REM copy required files 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\ss-local.exe %BINPATH%\ss-local.exe
copy %CD%\packages\shadowsocks-libev-mingw-x86_64\*.dll %BINPATH%\ 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\WinDivert.dll %BINPATH%\WinDivert.dll
copy %CD%\packages\WinDivert-2.2.0-A\x64\WinDivert64.sys %BINPATH%\WinDivert64.sys 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 REM 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\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 echo done

View File

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

0
elevator.js Normal file
View File

View File

@ -57,3 +57,8 @@ exports.run = function(cmd, fork) {
WSH.Run(c, 0, !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 SHELL = require("lib/shell");
var ssConfig = { var ssConfig = {
Server: "", "Server": [],
NameServer: "https://1.1.1.1/dns-query", "NameServer": "https://1.1.1.1/dns-query",
FilterString: "outbound and (ip ? ip.DstAddr != 1.1.1.1 : true)", "FilterString": "outbound and (ip ? ip.DstAddr != 1.2.3.4 and ip.DstAddr != 1.1.1.1 : true)",
IPRules: { "IPCIDRRules": {
Mode: false, "Proxy": [
IPCIDR: [] "198.18.0.0/16",
}, "8.8.8.8/32"
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"
] ]
},
"AppRules": {
"Proxy":[]
},
"DomainRules": {
"Proxy": [],
"Direct": [],
"Blocked": []
} }
}; };
@ -46,25 +32,13 @@ exports.main = function() {
// 내부 포트 결정 // 내부 포트 결정
console.log("* Connecting to socket proxy..."); console.log("* Connecting to socket proxy...");
var listenPort = SS.connect(); var listenPort = SS.connect();
ssConfig.Server = "socks://localhost:" + listenPort; ssConfig.Server.push("socks://localhost:" + listenPort);
console.log("* Local listening port: " + 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; var processNames = __global.processNames;
for (var i in 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("설정 파일 저장 완료!");
// 앱 프록시 실행 // 앱 프록시 실행
console.info("앱 프록시는 관리자 권한을 필요로 합니다. 확인을 눌러주세요."); console.info("앱 프록시는 관리자 권한을 필요로 합니다. 권한 요청 시 확인을 눌러주세요.");
SHELL.run([ SHELL.elevatedRun("assignProxy.bat");
"bin/shadow.exe",
"-c",
"config.json"
]);
}; };
exports.ssConfig = ssConfig; exports.ssConfig = ssConfig;

View File

@ -1 +1 @@
32fiJjwxNmDhSpLhqG1yKPt7qTxMFyno EZWLCH1Lw4iP5QhRbzfCTuND4laAz4bA