Test MITM

This commit is contained in:
世界 2025-03-21 21:52:53 +08:00
parent 82bc416985
commit 1189d88048
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
6 changed files with 133 additions and 0 deletions

3
.github/goreleaser/README.md vendored Normal file
View file

@ -0,0 +1,3 @@
# goreleaser
I'm sorry for this, but I can't afford to renew for now because the subscription is too expensive for an open source project.

BIN
.github/goreleaser/ca.crt vendored Normal file

Binary file not shown.

87
.github/goreleaser/config.json vendored Normal file
View file

@ -0,0 +1,87 @@
{
"dns": {
"servers": [
{
"type": "tls",
"server": "8.8.8.8"
}
]
},
"inbounds": [
{
"type": "tun",
"address": [
"172.19.0.1/30",
"fdfe:dcba:9876::1/126"
],
"auto_route": true,
"auto_redirect": true
}
],
"certificate": {
"tls_decryption": {
"enabled": true,
"key_pair_p12": "MIIKYQIBAzCCChEGCSqGSIb3DQEHAaCCCgIEggn+MIIJ+jCCBGgGCSqGSIb3DQEHBqCCBFkwggRVAgEAMIIETgYJKoZIhvcNAQcBMF0GCSqGSIb3DQEFDTBQMC8GCSqGSIb3DQEFDDAiBBBxLjkB6wrMHpRNPnq8KUnXAgIIADAKBggqhkiG9w0CCTAdBglghkgBZQMEASoEEHFou8IR0ZPb9O4NaLDC5LKAggPgL/7EoJRMEx5ZDVm2ZUQRuGyjS+lMB4JDZiykYfvfzMtQ2LZ+aO90rLxYFh4uBpbu+mmA0WDF/HU3GbE0nyY9beo0RAh0/u2Ak2kkfDSntRPVTl5zNBrT9hEtH9oSlN7tok9SMhWEJlsoIRhGinJwsDnDbXcIqkIj/oqtXlSJc6gA7CYf6AJRrVjP1Wtk80GMrMfYNvQw9bich5fs4biddf0xtR13YFV80rCPb+HtTT4KYa7Rzo5qR/cNHsMP/3v5BT2UszpaSIokPoW8ta1RWcQNXuH3OHjG4GMjg88w6xtyudIKrTyP0BTRfIJ2S2EtsWGHU2Gmr/MUY0a7abbtG+LVdSCRTgDoNeiY4C7lkQEOpefoZHWa3+jeGu17812YZHxfCZuhFy33rZ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q3mmmGNZHS0KSAKP3cmA3pwt9gPjpt/L1VNFgkVti2/YIDF37c3yuU9ZBI6kA7LhkcH5j0APr1ppS+Zxw6UKhsZDSGySqPyz3C2k4wy+R2+8mO1dN9haRW0smWWnziHWh8OFGhG+ghvc2HiX1tg2dTrByIFr9wixs4Kn9wDg0Qc1mS0+2+KacO8todl3jVYsLhcSTt5d2b/ZHuyAx4UPFtWPPF1vFdRMnf1jq83q/OEcTSfqkiEpEzs6NXpDEy1E0neq+LVHXi37IHzTGjjIvBnE2KZUoUdiFYitfDoUQpdhSpWKZTsmpqVXi/b7TZ20scvt5Qb6nfEWNds7hyGhnzAGQIV64xaDhKDB1p3QpDYxsJHvAGC1Yj9CY5w+sYpOjsfUo0qKeaFmu0fWX44s388GjZbid92/UvIxN9Lt/jri2xq+XPjJR194hc2ITUDrZvaaqeZ4odH4HXUC7FMqL6NVeX6MIv4g2QQkrt9DO35LokztOQCeuaA4rOZiM7mR3JJZIXf2jFNwElU0bvUJY2eYcQwTSQPXBzMz0AvhXxJiOFx3IQHHl55j4KMpab/NNbHChDUWJ7ptLX0/x8R3scJjCqwxJTAjBgkqhkiG9w0BCRUxFgQU6W6dFe0wnwEJqyaK7H5cUfUvxzQwRzAvMAsGCWCGSAFlAwQCAQQghQoDpo4gS46c+xoCeAykL69ZRT3zYrgNkgvL6s2UIVsEEHkNJl2cMvSFmZ8gi+cS/vQCAggA",
"key_pair_p12_password": "D173A3D9"
}
},
"mitm": {
"enabled": true,
"http2_enabled": true
},
"outbounds": [
{
"type": "direct",
"tag": "direct"
}
],
"route": {
"rules": [
{
"action": "sniff"
},
{
"type": "logical",
"mode": "or",
"rules": [
{
"network": "udp",
"port": 53
},
{
"protocol": "dns"
}
],
"action": "hijack-dns"
},
{
"ip_is_private": true,
"outbound": "direct"
},
{
"action": "resolve"
},
{
"domain": "goreleaser.com",
"action": "route-options",
"mitm": {
"enabled": true,
"surge_map_local": [
"^https://goreleaser\\.com/static/latest-pro data-type=text data=\"(update check disabled)\""
]
}
},
{
"domain": "api.gumroad.com",
"action": "route-options",
"mitm": {
"enabled": true,
"surge_map_local": [
"^https://api\\.gumroad\\.com/v2/licenses/verify data-type=file data=.github/goreleaser/response.json header=\"Content-Type:application/json\""
]
}
}
],
"auto_detect_interface": true
}
}

11
.github/goreleaser/configure.sh vendored Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e -o pipefail
release/local/install_minimal.sh
sudo cp .github/goreleaser/config.json /usr/local/etc/sing-box/config.json
sudo mkdir -p /var/lib/sing-box/.github/goreleaser
sudo cp .github/goreleaser/response.json /var/lib/sing-box/.github/goreleaser/response.json
go run -v ./cmd/sing-box tools install-ca .github/goreleaser/ca.crt
sudo systemctl start sing-box
sleep 5

12
.github/goreleaser/response.json vendored Normal file
View file

@ -0,0 +1,12 @@
{
"success": true,
"purchase": {
"license_key": "fake-key",
"subscription_id": "fake-id",
"product_id": "7ev6hHL7RZc753daE5bRNw==",
"product_permalink": "https:\/\/beckersoft.gumroad.com\/l\/goreleaser",
"seller_id": "A2wDalJj66fJdFU_jwy_oA==",
"short_product_id": "CadfZ",
"permalink": "goreleaser"
}
}

View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e -o pipefail
if [ -d /usr/local/go ]; then
export PATH="$PATH:/usr/local/go/bin"
fi
DIR=$(dirname "$0")
PROJECT=$DIR/../..
pushd $PROJECT
go install -v -trimpath -ldflags "-s -w -buildid=" ./cmd/sing-box
popd
sudo cp $(go env GOPATH)/bin/sing-box /usr/local/bin/
sudo mkdir -p /usr/local/etc/sing-box
sudo cp $PROJECT/release/config/config.json /usr/local/etc/sing-box/config.json
sudo cp $DIR/sing-box.service /etc/systemd/system
sudo systemctl daemon-reload