Compare commits
21 Commits
v72.202601
...
v72.202602
| Author | SHA1 | Date | |
|---|---|---|---|
| fb0d960122 | |||
| c7d2fc573e | |||
| 43feda4a3a | |||
| 3b7c4215d8 | |||
| d1af6d60a3 | |||
| eedc0311d7 | |||
| d7b9063f57 | |||
| c679ebe08d | |||
| 9ccf899535 | |||
| 5ae03837e0 | |||
| 07d6b166e8 | |||
| 3059dd60fc | |||
| fe4e408901 | |||
| d7a2a2db9c | |||
| 3652a55f17 | |||
| a3e435f752 | |||
| 13b0f7e634 | |||
| dd7f797898 | |||
| fdf19d24c8 | |||
| 4cccfa7917 | |||
| 2e4b55def5 |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -122,6 +122,7 @@ jobs:
|
||||
build:
|
||||
needs: [ check, var ]
|
||||
#if: needs.check.outputs.is_active == 'true'
|
||||
name: "${{ matrix.branch }}: ${{ matrix.arch }}"
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@ -155,7 +156,6 @@ jobs:
|
||||
- mipsel_24kc_24kf
|
||||
- mipsel_74kc
|
||||
- mipsel_mips32
|
||||
- riscv64_riscv64
|
||||
- riscv64_generic
|
||||
- x86_64
|
||||
isTestOrFake:
|
||||
@ -165,8 +165,6 @@ jobs:
|
||||
arch: arm_cortex-a9_vfpv3-d16
|
||||
- branch: ${{ needs.var.outputs.APK_BRANCH }}
|
||||
arch: mips_4kec
|
||||
- branch: ${{ needs.var.outputs.APK_BRANCH }}
|
||||
arch: riscv64_riscv64
|
||||
- branch: ${{ needs.var.outputs.IPK_BRANCH }}
|
||||
arch: riscv64_generic
|
||||
- { isTestOrFake: true }
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-zapret
|
||||
PKG_VERSION:=72.20260131
|
||||
PKG_VERSION:=72.20260226
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
||||
|
||||
@ -43,7 +43,7 @@ return baseclass.extend({
|
||||
if (dns_ip && dns_ip != 'default') {
|
||||
cmd.push(...[ '-d', dns_ip.trim() ]);
|
||||
}
|
||||
cmd.push('-R'); // show recommendations
|
||||
//cmd.push('-R'); // show recommendations
|
||||
return tools.execAndRead({
|
||||
cmd: cmd,
|
||||
log: '/tmp/'+tools.appName+'_dwc.log',
|
||||
|
||||
@ -378,9 +378,9 @@ return view.extend({
|
||||
btn_diag.onclick = ui.createHandlerFn(this, () => { diagnost.openDiagnostDialog(this.pkg_arch) });
|
||||
layout_append('Diagnostic tools', null, [ btn_diag ] );
|
||||
|
||||
let btn_update = create_btn('btn_update', btn_style_action, _('Update'));
|
||||
let btn_update = create_btn('btn_update', btn_style_action, _('Upgrade…'));
|
||||
btn_update.onclick = ui.createHandlerFn(this, () => { updater.openUpdateDialog(this.pkg_arch) });
|
||||
layout_append(_('Update package'), null, [ btn_update ] );
|
||||
layout_append(_('Upgrading the package'), null, [ btn_update ] );
|
||||
|
||||
let elems = {
|
||||
"status": status_string,
|
||||
|
||||
@ -783,47 +783,78 @@ return baseclass.extend({
|
||||
const logFile = log; // file for reading: '/tmp/zapret_pkg_install.log'
|
||||
const rcFile = logFile + '.rc';
|
||||
try {
|
||||
await fs.exec('/bin/busybox', [ 'rm', '-f', logFile + '*' ], null);
|
||||
appendLog('Output file cleared!');
|
||||
await fs.exec('/bin/busybox', [ 'rm', '-f', logFile ], null);
|
||||
await fs.exec('/bin/busybox', [ 'rm', '-f', rcFile ], null);
|
||||
//appendLog('Output file cleared!');
|
||||
} catch (e) {
|
||||
return callback.call(ctx, 500, 'ERROR: Failed to clear output file');
|
||||
}
|
||||
let processStarted = false;
|
||||
let execRetCode = -1;
|
||||
let opt_list = [ logFile ];
|
||||
try {
|
||||
opt_list.push(...cmd);
|
||||
//console.log('script-exec.sh ... '+JSON.stringify(opt_list));
|
||||
let proc = new Promise((resolve) => {
|
||||
fs.exec(this.appDir+'/script-exec.sh', opt_list, null)
|
||||
.then (() => { resolve(); })
|
||||
.catch(() => { resolve(); });
|
||||
fs.exec(this.appDir+'/script-exec.sh', opt_list, null)
|
||||
.then( (res) => {
|
||||
if (execRetCode < 0) {
|
||||
execRetCode = res.code;
|
||||
fixLogEnd();
|
||||
if (res.code == 0) {
|
||||
appendLog('Process started....');
|
||||
} else {
|
||||
if (res.stdout) appendLog(res.stdout);
|
||||
appendLog('ERROR: process not executed! ret_code = '+res.code);
|
||||
}
|
||||
}
|
||||
}).catch( (e) => {
|
||||
console.log('ERROR: execAndRead: process not exec: '+e.message);
|
||||
execRetCode = -100;
|
||||
});
|
||||
} catch (e) {
|
||||
return callback.call(ctx, 520, 'ERROR: Failed on execute process: ' + e.message);
|
||||
}
|
||||
let lastLen = 0;
|
||||
let retCode = -1;
|
||||
let retCode = -2; // rc file not found
|
||||
return await new Promise(async (resolve, reject) => {
|
||||
let ticks = 0;
|
||||
async function epoll()
|
||||
{
|
||||
ticks += 1;
|
||||
try {
|
||||
if (retCode < 0) {
|
||||
let rc = await fs.exec('/bin/cat', [ rcFile ], null);
|
||||
if (rc.code != 0) {
|
||||
if (ticks >= 2) {
|
||||
console.log('ERROR: execAndRead: '+JSON.stringify(opt_list));
|
||||
fixLogEnd();
|
||||
resolve(callback.call(ctx, 542, 'ERROR: Failed on read process rc-file: code = ' + rc.code));
|
||||
return;
|
||||
}
|
||||
console.log('WARN: execAndRead: read rc-file res.code = '+rc.code);
|
||||
}
|
||||
if (rc.code == 0) {
|
||||
if (rc.stdout) {
|
||||
retCode = parseInt(rc.stdout.trim(), 10);
|
||||
} else {
|
||||
retCode = -1; // rc file exists, but empty
|
||||
}
|
||||
}
|
||||
if (retCode <= -2) {
|
||||
setTimeout(epoll, 500);
|
||||
return; // skip first step with error
|
||||
}
|
||||
}
|
||||
let res = await fs.exec('/bin/cat', [ logFile ], null);
|
||||
if (res.code != 0) {
|
||||
if (ticks > 1) {
|
||||
console.log('ERROR: execAndRead: '+JSON.stringify(opt_list));
|
||||
resolve(callback.call(ctx, 541, 'ERROR: Failed on read process log: code = ' + res.code));
|
||||
return;
|
||||
}
|
||||
setTimeout(epoll, 500);
|
||||
return; // skip first step with error
|
||||
fixLogEnd();
|
||||
resolve(callback.call(ctx, 546, 'ERROR: Failed on read process log: code = ' + res.code));
|
||||
return;
|
||||
}
|
||||
if (!processStarted) {
|
||||
if (execRetCode < 0) {
|
||||
execRetCode = 9999;
|
||||
appendLog('Process started...');
|
||||
processStarted = true;
|
||||
}
|
||||
if (res.stdout && res.stdout.length > lastLen) {
|
||||
if (res.code == 0 && res.stdout && res.stdout.length > lastLen) {
|
||||
let log = res.stdout.slice(lastLen);
|
||||
hide_rows.forEach(re => {
|
||||
log = log.replace(re, '');
|
||||
@ -831,17 +862,6 @@ return baseclass.extend({
|
||||
appendLog(log, '');
|
||||
lastLen = res.stdout.length;
|
||||
}
|
||||
if (retCode < 0) {
|
||||
let rc = await fs.exec('/bin/cat', [ rcFile ], null);
|
||||
if (rc.code != 0) {
|
||||
fixLogEnd();
|
||||
resolve(callback.call(ctx, 545, 'ERROR: cannot read file "' + rcFile + '"'));
|
||||
return;
|
||||
}
|
||||
if (rc.stdout) {
|
||||
retCode = parseInt(rc.stdout.trim(), 10);
|
||||
}
|
||||
}
|
||||
if (retCode >= 0) {
|
||||
fixLogEnd();
|
||||
if (retCode == 0 && res.stdout) {
|
||||
|
||||
@ -192,7 +192,7 @@ return baseclass.extend({
|
||||
|
||||
this.setStage(0);
|
||||
|
||||
ui.showModal(_('Check for updates and install'), [
|
||||
ui.showModal(_('Check for upgrades and installation'), [
|
||||
E('div', { 'class': 'cbi-section' }, [
|
||||
exclude_prereleases,
|
||||
E('br'), E('br'),
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret
|
||||
PKG_VERSION:=72.20260131
|
||||
PKG_VERSION:=72.20260226
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
@ -14,8 +14,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=119e243b3664d6a512ed8b6ab61dcba00987105c
|
||||
PKG_SOURCE_DATE:=2026-01-31
|
||||
PKG_SOURCE_VERSION:=f0b0d89f02f44bb047fbfde5d96e9a1fc38e46f0
|
||||
PKG_SOURCE_DATE:=2026-02-26
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
@ -50,10 +50,16 @@ endef
|
||||
#define Build/Configure
|
||||
#endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
SOURCE_DATE_EPOCH=$(shell date +%s) \
|
||||
CFLAGS="$(TARGET_CFLAGS) -DZAPRET_GH_VER=$(PKG_VERSION) -DZAPRET_GH_HASH=$(PKG_SOURCE_VERSION)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) $(TARGET_CONFIGURE_OPTS)
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/ip2net $(TARGET_CONFIGURE_OPTS)
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/mdig $(TARGET_CONFIGURE_OPTS)
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) $(MAKE_FLAGS)
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/ip2net $(MAKE_FLAGS)
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/mdig $(MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
ZAPRET_DIR := /opt/zapret
|
||||
|
||||
@ -229,7 +229,7 @@ function set_cfg_nfqws_strat
|
||||
--hostlist-exclude-domains=openwrt.org
|
||||
--dpi-desync=fake,fakeddisorder
|
||||
--dpi-desync-split-pos=10,midsld
|
||||
--dpi-desync-fake-tls=/opt/zapret/files/fake/max.bin
|
||||
--dpi-desync-fake-tls=/opt/zapret/files/fake/tls_clienthello_www_onetrust_com.bin
|
||||
--dpi-desync-fake-tls-mod=rnd,dupsid
|
||||
--dpi-desync-fake-tls=0x0F0F0F0F
|
||||
--dpi-desync-fake-tls-mod=none
|
||||
@ -307,6 +307,7 @@ function set_cfg_nfqws_strat
|
||||
--dpi-desync-fake-tls=0x0F0F0F0F
|
||||
--dpi-desync-fake-tls=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin
|
||||
--dpi-desync-fake-tls-mod=rnd,dupsid,sni=ggpht.com
|
||||
--dpi-desync-repeats=8
|
||||
--dpi-desync-split-seqovl=620
|
||||
--dpi-desync-split-seqovl-pattern=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin
|
||||
--dpi-desync-fooling=badsum,badseq
|
||||
@ -316,10 +317,59 @@ function set_cfg_nfqws_strat
|
||||
--dpi-desync=fake,multisplit
|
||||
--dpi-desync-split-seqovl=654
|
||||
--dpi-desync-split-pos=1
|
||||
--dpi-desync-fooling=ts
|
||||
--dpi-desync-fooling=badseq,badsum
|
||||
--dpi-desync-repeats=8
|
||||
--dpi-desync-split-seqovl-pattern=/opt/zapret/files/fake/max.bin
|
||||
--dpi-desync-fake-tls=/opt/zapret/files/fake/max.bin
|
||||
--dpi-desync-split-seqovl-pattern=/opt/zapret/files/fake/tls_clienthello_www_onetrust_com.bin
|
||||
--dpi-desync-fake-tls=/opt/zapret/files/fake/tls_clienthello_www_onetrust_com.bin
|
||||
--dpi-desync-badseq-increment=0
|
||||
|
||||
--new
|
||||
--filter-udp=443 <HOSTLIST_NOAUTO>
|
||||
--dpi-desync=fake
|
||||
--dpi-desync-repeats=6
|
||||
--dpi-desync-fake-quic=/opt/zapret/files/fake/quic_initial_www_google_com.bin
|
||||
|
||||
--new
|
||||
--filter-udp=19294-19344,50000-50100
|
||||
--filter-l7=discord,stun
|
||||
--dpi-desync=fake
|
||||
--dpi-desync-repeats=6
|
||||
|
||||
--new
|
||||
--filter-tcp=2053,2083,2087,2096,8443
|
||||
--hostlist-domains=discord.media
|
||||
--dpi-desync=multisplit
|
||||
--dpi-desync-split-seqovl=652
|
||||
--dpi-desync-split-pos=2
|
||||
--dpi-desync-split-seqovl-pattern=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin
|
||||
"
|
||||
commit $cfgname
|
||||
EOF
|
||||
fi
|
||||
if [ "$strat" = "v9_by_StressOzz" ]; then
|
||||
uci batch <<-EOF
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443,2053,2083,2087,2096,8443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443,19294-19344,50000-50100'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
--dpi-desync=fake,multisplit
|
||||
--dpi-desync-split-pos=2,sld
|
||||
--dpi-desync-fake-tls=0x0F0F0F0F
|
||||
--dpi-desync-fake-tls=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin
|
||||
--dpi-desync-fake-tls-mod=rnd,dupsid,sni=ggpht.com
|
||||
--dpi-desync-split-seqovl=620
|
||||
--dpi-desync-split-seqovl-pattern=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin
|
||||
--dpi-desync-fooling=badsum,badseq
|
||||
|
||||
--new
|
||||
--filter-tcp=443 <HOSTLIST>
|
||||
--dpi-desync=hostfakesplit
|
||||
--dpi-desync-fooling=badseq,badsum
|
||||
--dpi-desync-hostfakesplit-mod=host=mapgl.2gis.com
|
||||
--dpi-desync-badseq-increment=0
|
||||
|
||||
--new
|
||||
--filter-udp=443 <HOSTLIST_NOAUTO>
|
||||
|
||||
123
zapret/dwc.sh
123
zapret/dwc.sh
@ -26,7 +26,7 @@ TARGET_LIST_FILE="$ZAP_TMP_DIR/targets"
|
||||
[ -f "$TARGET_LIST_FILE" ] && rm -rf "$ZAP_TMP_DIR"
|
||||
[ -f "$TARGET_LIST_FILE" ] && exit 3
|
||||
|
||||
CURL_TIMEOUT=5
|
||||
CURL_TIMEOUT=7
|
||||
CURL_MAXBODY=65536
|
||||
CURL_NOCACHE='cache-control: no-cache'
|
||||
CURL_NOCACHE2='pragma: no-cache'
|
||||
@ -65,40 +65,39 @@ if [ -f /etc/openwrt_release ]; then
|
||||
return 15
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
mkdir -p "$ZAP_TMP_DIR"
|
||||
|
||||
#echo 'Original sources: https://github.com/hyperion-cs/dpi-checkers'
|
||||
#echo 'WEB-version: https://hyperion-cs.github.io/dpi-checkers/ru/tcp-16-20/'
|
||||
|
||||
TEST_SUITE='
|
||||
{ id: "US.CF-01", provider: "🇺🇸 Cloudflare", times: 1, url: "https://img.wzstats.gg/cleaver/gunFullDisplay" },
|
||||
{ id: "US.CF-02", provider: "🇺🇸 Cloudflare", times: 1, url: "https://genshin.jmp.blue/characters/all#" },
|
||||
{ id: "US.CF-03", provider: "🇺🇸 Cloudflare", times: 1, url: "https://api.frankfurter.dev/v1/2000-01-01..2002-12-31" },
|
||||
{ id: "US.CF-04", provider: "🇨🇦 Cloudflare", times: 1, url: "https://www.bigcartel.com/" },
|
||||
{ id: "US.DO-01", provider: "🇺🇸 DigitalOcean", times: 2, url: "https://genderize.io/" },
|
||||
{ id: "DE.HE-01", provider: "🇩🇪 Hetzner", times: 1, url: "https://j.dejure.org/jcg/doctrine/doctrine_banner.webp" },
|
||||
{ id: "DE.HE-02", provider: "🇩🇪 Hetzner", times: 1, url: "https://accesorioscelular.com/tienda/css/plugins.css" },
|
||||
{ id: "FI.HE-01", provider: "🇫🇮 Hetzner", times: 1, url: "https://251b5cd9.nip.io/1MB.bin" },
|
||||
{ id: "FI.HE-02", provider: "🇫🇮 Hetzner", times: 1, url: "https://nioges.com/libs/fontawesome/webfonts/fa-solid-900.woff2" },
|
||||
{ id: "FI.HE-03", provider: "🇫🇮 Hetzner", times: 1, url: "https://5fd8bdae.nip.io/1MB.bin" },
|
||||
{ id: "FI.HE-04", provider: "🇫🇮 Hetzner", times: 1, url: "https://5fd8bca5.nip.io/1MB.bin" },
|
||||
{ id: "FR.OVH-01", provider: "🇫🇷 OVH", times: 1, url: "https://eu.api.ovh.com/console/rapidoc-min.js" },
|
||||
{ id: "FR.OVH-02", provider: "🇫🇷 OVH", times: 1, url: "https://ovh.sfx.ovh/10M.bin" },
|
||||
{ id: "SE.OR-01", provider: "🇸🇪 Oracle", times: 1, url: "https://oracle.sfx.ovh/10M.bin" },
|
||||
{ id: "DE.AWS-01", provider: "🇩🇪 AWS", times: 1, url: "https://www.getscope.com/assets/fonts/fa-solid-900.woff2" },
|
||||
{ id: "US.AWS-01", provider: "🇺🇸 AWS", times: 1, url: "https://corp.kaltura.com/wp-content/cache/min/1/wp-content/themes/airfleet/dist/styles/theme.css" },
|
||||
{ id: "US.GC-01", provider: "🇺🇸 Google Cloud", times: 1, url: "https://api.usercentrics.eu/gvl/v3/en.json" },
|
||||
{ id: "US.FST-01", provider: "🇺🇸 Fastly", times: 1, url: "https://www.jetblue.com/footer/footer-element-es2015.js" },
|
||||
{ id: "CA.FST-01", provider: "🇨🇦 Fastly", times: 1, url: "https://ssl.p.jwpcdn.com/player/v/8.40.5/bidding.js" },
|
||||
{ id: "US.AKM-01", provider: "🇺🇸 Akamai", times: 1, url: "https://www.roxio.com/static/roxio/images/products/creator/nxt9/call-action-footer-bg.jpg" },
|
||||
{ id: "PL.AKM-01", provider: "🇵🇱 Akamai", times: 1, url: "https://media-assets.stryker.com/is/image/stryker/gateway_1?$max_width_1410$" },
|
||||
{ id: "US.CDN77-01", provider: "🇺🇸 CDN77", times: 1, url: "https://cdn.eso.org/images/banner1920/eso2520a.jpg" },
|
||||
{ id: "FR.CNTB-01", provider: "🇫🇷 Contabo", times: 1, url: "https://xdmarineshop.gr/index.php?route=index" },
|
||||
{ id: "NL.SW-01", provider: "🇳🇱 Scaleway", times: 1, url: "https://www.velivole.fr/img/header.jpg" },
|
||||
{ id: "US.CNST-01", provider: "🇺🇸 Constant", times: 1, url: "https://cdn.xuansiwei.com/common/lib/font-awesome/4.7.0/fontawesome-webfont.woff2?v=4.7.0" }
|
||||
'
|
||||
TEST_SUITE_URL="https://hyperion-cs.github.io/dpi-checkers/ru/tcp-16-20/suite.json"
|
||||
TEST_SUITE_FN="$ZAP_TMP_DIR/${TEST_SUITE_URL##*/}"
|
||||
TEST_SUITE_HDR="$TEST_SUITE_FN.hdr"
|
||||
rm -f "$TEST_SUITE_FN"
|
||||
rm -f "$TEST_SUITE_HDR"
|
||||
|
||||
if [ "$opt_sites" = true ]; then
|
||||
TEST_SUITE='
|
||||
#echo "Download $TEST_SUITE_URL ..."
|
||||
curl -s -L -D "$TEST_SUITE_HDR" -o "$TEST_SUITE_FN" --max-time 15 "$TEST_SUITE_URL" 2>/dev/null
|
||||
if [ ! -f "$TEST_SUITE_HDR" ] || [ -z "$TEST_SUITE_HDR" ] ; then
|
||||
echo "ERROR: Cannot download file \"$TEST_SUITE_URL\" (connection problem)"
|
||||
return 17
|
||||
fi
|
||||
RESP_STATUS=$( cat "$TEST_SUITE_HDR" | head -n 1 | awk '{print $2}' )
|
||||
if [ "$RESP_STATUS" != 200 ]; then
|
||||
echo "ERROR: Cannot download file \"$TEST_SUITE_URL\" (status = $RESP_STATUS)"
|
||||
return 18
|
||||
fi
|
||||
if [ ! -f "$TEST_SUITE_FN" ] || [ -z "$TEST_SUITE_FN" ] ; then
|
||||
echo "ERROR: Cannot download file \"$TEST_SUITE_URL\" (resp body empty)"
|
||||
return 19
|
||||
fi
|
||||
if [ "$(head -c 2 "$TEST_SUITE_FN" 2>/dev/null)" != "$(printf '[\n')" ]; then
|
||||
echo "ERROR: incorrect format of \"$TEST_SUITE_URL\""
|
||||
return 19
|
||||
fi
|
||||
|
||||
TEST_SUITE='
|
||||
gosuslugi.ru | @ | 40000 | https://gosuslugi.ru/__jsch/static/script.js
|
||||
esia.gosuslugi.ru | @ | 40000 | https://esia.gosuslugi.ru/__jsch/static/script.js
|
||||
gu-st.ru | | | https://gu-st.ru/portal-st/lib-assets/fonts/Lato-Regular-v3.woff2
|
||||
@ -106,6 +105,7 @@ if [ "$opt_sites" = true ]; then
|
||||
lkfl2.nalog.ru | | | https://lkfl2.nalog.ru/lkfl/static/assets/main-desktop-1920-CvJsHANg.jpg
|
||||
rutube.ru | @ | 40000 | https://static.rutube.ru/static/wdp/fonts/Semibold/OpenSans-Semibold.woff2?20231026
|
||||
youtube.com | @# | 300000 | https://youtube.com
|
||||
googlevideo.com | | 210000 | https://redirector.googlevideo.com/report_mapping
|
||||
instagram.com | @# | 300000 | https://instagram.com
|
||||
rutracker.org | @# | 80000 | https://rutracker.org
|
||||
nnmclub.to | @# | 120000 | https://nnmclub.to
|
||||
@ -124,8 +124,13 @@ if [ "$opt_sites" = true ]; then
|
||||
play.google.com | @# | 100000 | https://gstatic.com/feedback/js/help/prod/service/lazy.min.js
|
||||
genderize.io | @# | 210000 | https://genderize.io
|
||||
ottai.com | @ | 70000 | https://seas.static.ottai.com/ottai-website/public/images/new/home/banner/uk/banner.webp
|
||||
'
|
||||
'
|
||||
|
||||
if [ "$opt_sites" = true ]; then
|
||||
CURL_TIMEOUT=7
|
||||
else
|
||||
CURL_TIMEOUT=7
|
||||
TEST_SUITE=$( cat "$TEST_SUITE_FN" )
|
||||
fi
|
||||
|
||||
function trim
|
||||
@ -133,8 +138,6 @@ function trim
|
||||
echo "$1" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//'
|
||||
}
|
||||
|
||||
mkdir -p "$ZAP_TMP_DIR"
|
||||
|
||||
: > "$TARGET_LIST_FILE"
|
||||
IDX=0
|
||||
while IFS= read -r line; do
|
||||
@ -150,15 +153,14 @@ while IFS= read -r line; do
|
||||
continue
|
||||
fi
|
||||
case "$line" in
|
||||
*id:*provider:*url:*)
|
||||
*id*provider*thresholdBytes*url*)
|
||||
IDX=$((IDX + 1))
|
||||
TAG=$( printf '%s\n' "$line" | cut -d'"' -f2 )
|
||||
TAG=$( printf '%s\n' "$line" | cut -d'"' -f4 )
|
||||
COUNTRY="${TAG%%.*}"
|
||||
PROVIDER_RAW=$( printf '%s\n' "$line" | cut -d'"' -f4 )
|
||||
PROVIDER="${PROVIDER_RAW#* }"
|
||||
TIMES=$( printf '%s\n' "$line" | cut -d':' -f4 | cut -d',' -f1 | tr -d ' ')
|
||||
URL=$( printf '%s\n' "$line" | cut -d'"' -f6 )
|
||||
echo "${IDX}|${TAG}|${COUNTRY}|${PROVIDER}|${TIMES}|${URL}" >> "$TARGET_LIST_FILE"
|
||||
PROVIDER=$( printf '%s\n' "$line" | cut -d'"' -f8 )
|
||||
BYTES=$( printf '%s\n' "$line" | cut -d'"' -f15 | cut -d':' -f2 | cut -d',' -f1 | tr -d ' ')
|
||||
URL=$( printf '%s\n' "$line" | cut -d'"' -f20 )
|
||||
echo "${IDX}|${TAG}|${COUNTRY}|${PROVIDER}|${BYTES}|${URL}" >> "$TARGET_LIST_FILE"
|
||||
;;
|
||||
esac
|
||||
done <<EOF
|
||||
@ -169,7 +171,7 @@ CURL_CON_TIMEOUT=$((CURL_TIMEOUT-2))
|
||||
CURL_SPEED_TIME=$((CURL_TIMEOUT-2))
|
||||
CURL_SPEED_LIMIT=1
|
||||
|
||||
while IFS='|' read -r ID TAG COUNTRY PROVIDER TIMES URL; do
|
||||
while IFS='|' read -r ID TAG COUNTRY PROVIDER TSIZE URL; do
|
||||
[ -z "$TAG" ] && continue
|
||||
ID3=$( printf '%03d' "$ID" )
|
||||
RANGETO=""
|
||||
@ -177,14 +179,13 @@ while IFS='|' read -r ID TAG COUNTRY PROVIDER TIMES URL; do
|
||||
USERAGENT="$CURL_USERAGENT"
|
||||
if [ "$opt_sites" = true ]; then
|
||||
FLAGS="$PROVIDER"
|
||||
TSIZE="$TIMES"
|
||||
[ "$TSIZE" = "" ] && TSIZE=$CURL_MAXBODY
|
||||
if echo "$FLAGS" | grep -q '@'; then
|
||||
RANGETO=""
|
||||
else
|
||||
RANGETO="--range 0-$((TSIZE - 1))"
|
||||
fi
|
||||
PROVIDER="$TSIZE"
|
||||
PROVIDER="@"
|
||||
if echo "$FLAGS" | grep -q '#'; then
|
||||
REDIRECT="-L"
|
||||
fi
|
||||
@ -192,34 +193,47 @@ while IFS='|' read -r ID TAG COUNTRY PROVIDER TIMES URL; do
|
||||
USERAGENT="curl/8.12"
|
||||
fi
|
||||
else
|
||||
RANGETO="--range 0-$((CURL_MAXBODY - 1))"
|
||||
RANGETO="--range 0-$((TSIZE - 1))"
|
||||
COUNTRY=$( echo "$TAG" | cut -d. -f1 )
|
||||
CNTFLAG=$( echo "$PROVIDER" | awk '{print $1}' )
|
||||
fi
|
||||
URL_NO_PROTO="${URL#*://}"
|
||||
DOMAIN="${URL_NO_PROTO%%/*}"
|
||||
URLPATH="/${URL_NO_PROTO#*/}"
|
||||
[ "$URLPATH" = "/$URL_NO_PROTO" ] && URLPATH="/"
|
||||
#echo "TAG=$TAG , COUNTRY=$COUNTRY , PROVIDER=$PROVIDER , DOMAIN=$DOMAIN , URL=$URL"
|
||||
FNAME="$ZAP_TMP_DIR/$ID3=$TAG=$PROVIDER"
|
||||
FNAME="$ZAP_TMP_DIR/$ID3=$TAG=$PROVIDER=$TSIZE"
|
||||
(
|
||||
echo ">>>>> Request destination IP-addr"
|
||||
DST_IP=
|
||||
RESOLVE_OPT=
|
||||
if [ "$opt_dig" != "" ]; then
|
||||
DST_IP=$( dig +time=2 +retry=1 $OPT_DIG_DNS +short "$DOMAIN" 2>/dev/null | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' | head -n1 )
|
||||
RESP=$( dig +time=2 +retry=1 $OPT_DIG_DNS +short "$DOMAIN" 2>&1 )
|
||||
echo "$RESP"
|
||||
DST_IP=$( echo "$RESP" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' | head -n1 )
|
||||
else
|
||||
CURL_TIMEOUTS="--connect-timeout 2 --max-time 3 --speed-time 3 --speed-limit 1"
|
||||
DST_IP=$( curl -4 -I -s $CURL_TIMEOUTS -o /dev/null -w '%{remote_ip}\n' "$URL" )
|
||||
CURL_TIMEOUTS="--connect-timeout 3 --max-time 4 --speed-time 4 --speed-limit 1"
|
||||
RESP=$( curl -4 -I --no-progress-meter $CURL_TIMEOUTS -w '%{remote_ip}\n' "$URL" 2>&1 )
|
||||
echo "$RESP"
|
||||
DST_IP=$( echo "$RESP" | grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | tail -1 )
|
||||
if [ -z "$DST_IP" ]; then
|
||||
DST_IP=$( curl -4 -s $CURL_TIMEOUTS -o /dev/null -r 0-0 -w '%{remote_ip}\n' "$URL" )
|
||||
echo "----------------------------------"
|
||||
RESP=$( curl -4 --no-progress-meter $CURL_TIMEOUTS -r 0-0 -w '%{remote_ip}\n' "$URL" 2>&1 )
|
||||
echo "$RESP"
|
||||
DST_IP=$( echo "$RESP" | grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | tail -1 )
|
||||
fi
|
||||
fi
|
||||
if [ "$DST_IP" = "" ]; then
|
||||
DST_IP=$( ping -c1 "$DOMAIN" 2>/dev/null | sed -n '1s/.*(\([0-9.]*\)).*/\1/p' )
|
||||
echo ">>>>> PING"
|
||||
RESP=$( ping -c1 "$DOMAIN" 2>&1 )
|
||||
echo "$RESP"
|
||||
DST_IP=$( echo "$RESP" | sed -n '1s/.*(\([0-9.]*\)).*/\1/p' )
|
||||
fi
|
||||
echo ">>>>> Destination IP-addr:"
|
||||
echo "$DST_IP"
|
||||
[ "$DST_IP" != "" ] && RESOLVE_OPT="--resolve $DOMAIN:443:$DST_IP"
|
||||
echo "$DST_IP" > "$FNAME.ip"
|
||||
echo "$URL" > "$FNAME.url"
|
||||
echo ">>>>> Download target body"
|
||||
curl "$URL" \
|
||||
$RESOLVE_OPT \
|
||||
$REDIRECT \
|
||||
@ -246,9 +260,8 @@ printf '%s\n' "$ZAP_TMP_DIR"/*.log | sort | while IFS= read -r file; do
|
||||
ID=$( echo "$FILENAME" | cut -d= -f1)
|
||||
TAG=$( echo "$FILENAME" | cut -d= -f2)
|
||||
PROVIDER=$(echo "$FILENAME" | cut -d= -f3 )
|
||||
TSIZE=$(echo "$FILENAME" | cut -d= -f4 )
|
||||
FNAME="$ZAP_TMP_DIR/$FILENAME"
|
||||
REQ_SIZE=$CURL_MAXBODY
|
||||
[ "$opt_sites" = true ] && REQ_SIZE="$PROVIDER"
|
||||
BODY_SIZE=0
|
||||
[ -f "$FNAME.body" ] && BODY_SIZE=$( wc -c < "$FNAME.body" )
|
||||
IPADDR="x.x.x.x"
|
||||
@ -264,7 +277,7 @@ printf '%s\n' "$ZAP_TMP_DIR"/*.log | sort | while IFS= read -r file; do
|
||||
elif [ ! -s "$FNAME.body" ]; then
|
||||
status="Possibly detected"
|
||||
else
|
||||
if [ $BODY_SIZE -lt $REQ_SIZE ]; then
|
||||
if [ $BODY_SIZE -lt $TSIZE ]; then
|
||||
status="Failed (recv $BODY_SIZE bytes)"
|
||||
res=5
|
||||
else
|
||||
|
||||
BIN
zapret/files/fake/tls_clienthello_www_onetrust_com.bin
Normal file
BIN
zapret/files/fake/tls_clienthello_www_onetrust_com.bin
Normal file
Binary file not shown.
@ -19,6 +19,10 @@ ottai.com
|
||||
ipstream.one
|
||||
vkusvill.ru
|
||||
kinopoisk.ru
|
||||
vk.ru
|
||||
vk.com
|
||||
yandex.ru
|
||||
ya.ru
|
||||
#################################### Epicgames
|
||||
easy.ac
|
||||
fab.com
|
||||
@ -323,4 +327,14 @@ windowsupdate.com
|
||||
microsoftonline.com
|
||||
microsoftonline-p.com
|
||||
minecraftservices.com
|
||||
#################################### Arknights: Endfield
|
||||
skport.com
|
||||
hg-cdn.com
|
||||
helpshift.com
|
||||
gryphline.com
|
||||
#################################### Samsung
|
||||
samsungosp.com
|
||||
samsungqbe.com
|
||||
amazontrust.com
|
||||
samsungcloudsolution.com
|
||||
####################################
|
||||
|
||||
@ -1,22 +1,37 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 remittor
|
||||
PID_FILE=/tmp/zapret-script-exec.pid
|
||||
[ -f $PID_FILE ] && exit 70
|
||||
if [ -f $PID_FILE ]; then
|
||||
echo "ERROR: file $PID_FILE already exists!" | awk 'NR==1'
|
||||
exit 70
|
||||
fi
|
||||
LOG_FILE=$1
|
||||
RC_FILE=$1.rc
|
||||
SH_FILE=$2
|
||||
shift 2
|
||||
[ ! -f $SH_FILE ] && exit 71
|
||||
: > $LOG_FILE
|
||||
: > $RC_FILE
|
||||
if [ ! -e $SH_FILE ]; then
|
||||
echo "ERROR: script $SH_FILE not found!" | awk 'NR==1'
|
||||
exit 71
|
||||
fi
|
||||
if [ ! -x $SH_FILE ]; then
|
||||
echo "ERROR: script $SH_FILE not Found!" | awk 'NR==1'
|
||||
exit 72
|
||||
fi
|
||||
start-stop-daemon -S -b -p $PID_FILE -x /bin/sh -- -c '
|
||||
LOG_FILE=$1
|
||||
RC_FILE=$2
|
||||
SH_FILE=$3
|
||||
shift 3
|
||||
sh $SH_FILE "$@" > $LOG_FILE 2>&1
|
||||
printf "" > $LOG_FILE
|
||||
printf "" > $RC_FILE
|
||||
$SH_FILE "$@" >> $LOG_FILE 2>&1
|
||||
RET_CODE=$?
|
||||
sleep 1
|
||||
echo $RET_CODE > $RC_FILE
|
||||
' sh $LOG_FILE $RC_FILE $SH_FILE "$@"
|
||||
RET_CODE=$?
|
||||
if [ $RET_CODE != 0 ]; then
|
||||
echo "ERROR: script $SH_FILE not executed! ret_code = $RET_CODE" | awk 'NR==1'
|
||||
exit $RET_CODE
|
||||
fi
|
||||
echo "Script $SH_FILE running..." | awk 'NR==1'
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user