From b427f6d4cacfa0928564e14debf648f7a0da6260 Mon Sep 17 00:00:00 2001 From: xVRVx <63975481+xVRVx@users.noreply.github.com> Date: Thu, 22 May 2025 12:03:59 +0300 Subject: [PATCH] Add files via upload --- autoXRAY.sh | 253 +++++++++---------- autoXRAYno443.sh | 9 +- autoXRAYselfsteal.sh | 253 +++++++++---------- autoXRAYselfstealConfChina.sh | 456 ++++++++++++++++++++++++++++++++++ 4 files changed, 715 insertions(+), 256 deletions(-) create mode 100644 autoXRAYselfstealConfChina.sh diff --git a/autoXRAY.sh b/autoXRAY.sh index 1bbdd21..a87e764 100644 --- a/autoXRAY.sh +++ b/autoXRAY.sh @@ -41,136 +41,137 @@ export xray_uuid_vrv xray_dest_vrv xray_dest_vrv222 xray_privateKey_vrv xray_pub # Создаем JSON конфигурацию на основе шаблона и сохраняем в папку скрипта cat << 'EOF' | envsubst > "$SCRIPT_DIR/config.json" { - "dns": { - "servers": [ - "8.8.4.4", - "8.8.8.8" - ] - }, - "log": { - "access": "/var/lib/marzban/access.log", - "error": "/var/lib/marzban/error.log", - "loglevel": "none", - "dnsLog": false - }, - "routing": { - "rules": [ - { - "ip": [ - "geoip:private" - ], - "outboundTag": "BLOCK", - "type": "field" - } - ] - }, - "inbounds": [ - { - "tag": "VLESStcpREALITY", - "listen": "0.0.0.0", - "port": 443, - "protocol": "vless", - "settings": { - "clients": [ - { - "flow": "xtls-rprx-vision", - "id": "${xray_uuid_vrv}" - } - ], - "decryption": "none" - }, - "streamSettings": { - "network": "tcp", - "security": "reality", - "realitySettings": { - "show": false, - "dest": "${xray_dest_vrv}:443", - "xver": 0, - "serverNames": [ - "${xray_dest_vrv}" - ], - "privateKey": "${xray_privateKey_vrv}", - "publicKey": "${xray_publicKey_vrv}", - "shortIds": [ - "${xray_shortIds_vrv}" - ] - } - }, - "sniffing": { - "enabled": true, - "destOverride": [ - "http", - "tls", - "quic" + "dns": { + "servers": [ + "https+local://8.8.4.4/dns-query", + "https+local://8.8.8.8/dns-query", + "localhost" ] - } }, - { - "tag": "Vless8443", - "listen": "0.0.0.0", - "port": 8443, - "protocol": "vless", - "settings": { - "clients": [ - { - "flow": "xtls-rprx-vision", - "id": "${xray_uuid_vrv}" - } - ], - "decryption": "none" - }, - "streamSettings": { - "network": "tcp", - "security": "reality", - "realitySettings": { - "show": false, - "dest": "${xray_dest_vrv222}:443", - "xver": 0, - "serverNames": [ - "${xray_dest_vrv222}" - ], - "privateKey": "${xray_privateKey_vrv}", - "publicKey": "${xray_publicKey_vrv}", - "shortIds": [ - "${xray_shortIds_vrv}" - ] - } - }, - "sniffing": { - "enabled": true, - "destOverride": [ - "http", - "tls", - "quic" + "log": { + "access": "/var/lib/marzban/access.log", + "error": "/var/lib/marzban/error.log", + "loglevel": "none", + "dnsLog": false + }, + "routing": { + "rules": [ + { + "ip": [ + "geoip:private" + ], + "outboundTag": "BLOCK", + "type": "field" + } ] - } }, - { - "tag": "ShadowsocksTCP", - "listen": "0.0.0.0", - "port": 2040, - "protocol": "shadowsocks", - "settings": { - "clients": [ - { - "password": "${xray_sspasw_vrv}", - "method": "chacha20-ietf-poly1305" - } - ], - "network": "tcp,udp" - } - } - ], - "outbounds": [ - { - "protocol": "freedom", - "tag": "DIRECT" - }, - { - "protocol": "blackhole", - "tag": "BLOCK" - } - ] + "inbounds": [ + { + "tag": "VLESStcpREALITY", + "listen": "0.0.0.0", + "port": 443, + "protocol": "vless", + "settings": { + "clients": [ + { + "flow": "xtls-rprx-vision", + "id": "${xray_uuid_vrv}" + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "tcp", + "security": "reality", + "realitySettings": { + "show": false, + "dest": "${xray_dest_vrv}:443", + "xver": 0, + "serverNames": [ + "${xray_dest_vrv}" + ], + "privateKey": "${xray_privateKey_vrv}", + "publicKey": "${xray_publicKey_vrv}", + "shortIds": [ + "${xray_shortIds_vrv}" + ] + } + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + }, + { + "tag": "Vless8443", + "listen": "0.0.0.0", + "port": 8443, + "protocol": "vless", + "settings": { + "clients": [ + { + "flow": "xtls-rprx-vision", + "id": "${xray_uuid_vrv}" + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "tcp", + "security": "reality", + "realitySettings": { + "show": false, + "dest": "${xray_dest_vrv222}:443", + "xver": 0, + "serverNames": [ + "${xray_dest_vrv222}" + ], + "privateKey": "${xray_privateKey_vrv}", + "publicKey": "${xray_publicKey_vrv}", + "shortIds": [ + "${xray_shortIds_vrv}" + ] + } + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + }, + { + "tag": "ShadowsocksTCP", + "listen": "0.0.0.0", + "port": 2040, + "protocol": "shadowsocks", + "settings": { + "clients": [ + { + "password": "${xray_sspasw_vrv}", + "method": "chacha20-ietf-poly1305" + } + ], + "network": "tcp,udp" + } + } + ], + "outbounds": [ + { + "protocol": "freedom", + "tag": "DIRECT" + }, + { + "protocol": "blackhole", + "tag": "BLOCK" + } + ] } EOF diff --git a/autoXRAYno443.sh b/autoXRAYno443.sh index 0aed412..311cc1b 100644 --- a/autoXRAYno443.sh +++ b/autoXRAYno443.sh @@ -50,10 +50,11 @@ export xray_uuid_vrv xray_dest_vrv xray_dest_vrv222 xray_privateKey_vrv xray_pub cat << 'EOF' | envsubst > "$SCRIPT_DIR/config.json" { "dns": { - "servers": [ - "8.8.4.4", - "8.8.8.8" - ] + "servers": [ + "https+local://8.8.4.4/dns-query", + "https+local://8.8.8.8/dns-query", + "localhost" + ] }, "log": { "loglevel": "none", diff --git a/autoXRAYselfsteal.sh b/autoXRAYselfsteal.sh index 8d07cfc..eaab476 100644 --- a/autoXRAYselfsteal.sh +++ b/autoXRAYselfsteal.sh @@ -172,136 +172,137 @@ export xray_uuid_vrv xray_dest_vrv xray_dest_vrv222 xray_privateKey_vrv xray_pub # Создаем JSON конфигурацию на основе шаблона и сохраняем в папку скрипта cat << 'EOF' | envsubst > "$SCRIPT_DIR/config.json" { - "dns": { - "servers": [ - "8.8.4.4", - "8.8.8.8" - ] - }, - "log": { - "access": "/var/lib/marzban/access.log", - "error": "/var/lib/marzban/error.log", - "loglevel": "none", - "dnsLog": false - }, - "routing": { - "rules": [ - { - "ip": [ - "geoip:private" - ], - "outboundTag": "BLOCK", - "type": "field" - } - ] - }, - "inbounds": [ - { - "tag": "VtcpRself", - "listen": "0.0.0.0", - "port": 443, - "protocol": "vless", - "settings": { - "clients": [ - { - "flow": "xtls-rprx-vision", - "id": "${xray_uuid_vrv}" - } - ], - "decryption": "none" - }, - "streamSettings": { - "network": "tcp", - "security": "reality", - "realitySettings": { - "show": false, - "dest": "3333", - "xver": 0, - "serverNames": [ - "$DOMAIN" - ], - "privateKey": "${xray_privateKey_vrv}", - "publicKey": "${xray_publicKey_vrv}", - "shortIds": [ - "${xray_shortIds_vrv}" - ] - } - }, - "sniffing": { - "enabled": true, - "destOverride": [ - "http", - "tls", - "quic" + "dns": { + "servers": [ + "https+local://8.8.4.4/dns-query", + "https+local://8.8.8.8/dns-query", + "localhost" ] - } }, - { - "tag": "Vless8443self", - "listen": "0.0.0.0", - "port": 8443, - "protocol": "vless", - "settings": { - "clients": [ - { - "flow": "xtls-rprx-vision", - "id": "${xray_uuid_vrv}" - } - ], - "decryption": "none" - }, - "streamSettings": { - "network": "tcp", - "security": "reality", - "realitySettings": { - "show": false, - "dest": "3333", - "xver": 0, - "serverNames": [ - "$DOMAIN" - ], - "privateKey": "${xray_privateKey_vrv}", - "publicKey": "${xray_publicKey_vrv}", - "shortIds": [ - "${xray_shortIds_vrv}" - ] - } - }, - "sniffing": { - "enabled": true, - "destOverride": [ - "http", - "tls", - "quic" + "log": { + "access": "/var/lib/marzban/access.log", + "error": "/var/lib/marzban/error.log", + "loglevel": "none", + "dnsLog": false + }, + "routing": { + "rules": [ + { + "ip": [ + "geoip:private" + ], + "outboundTag": "BLOCK", + "type": "field" + } ] - } - }, - { - "tag": "ShadowsocksTCP", - "listen": "0.0.0.0", - "port": 2040, - "protocol": "shadowsocks", - "settings": { - "clients": [ - { - "password": "${xray_sspasw_vrv}", - "method": "chacha20-ietf-poly1305" - } - ], - "network": "tcp,udp" - } - } - ], - "outbounds": [ - { - "protocol": "freedom", - "tag": "DIRECT" }, - { - "protocol": "blackhole", - "tag": "BLOCK" - } - ] + "inbounds": [ + { + "tag": "VtcpRself", + "listen": "0.0.0.0", + "port": 443, + "protocol": "vless", + "settings": { + "clients": [ + { + "flow": "xtls-rprx-vision", + "id": "${xray_uuid_vrv}" + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "tcp", + "security": "reality", + "realitySettings": { + "show": false, + "dest": "3333", + "xver": 0, + "serverNames": [ + "$DOMAIN" + ], + "privateKey": "${xray_privateKey_vrv}", + "publicKey": "${xray_publicKey_vrv}", + "shortIds": [ + "${xray_shortIds_vrv}" + ] + } + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + }, + { + "tag": "Vless8443self", + "listen": "0.0.0.0", + "port": 8443, + "protocol": "vless", + "settings": { + "clients": [ + { + "flow": "xtls-rprx-vision", + "id": "${xray_uuid_vrv}" + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "tcp", + "security": "reality", + "realitySettings": { + "show": false, + "dest": "3333", + "xver": 0, + "serverNames": [ + "$DOMAIN" + ], + "privateKey": "${xray_privateKey_vrv}", + "publicKey": "${xray_publicKey_vrv}", + "shortIds": [ + "${xray_shortIds_vrv}" + ] + } + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + }, + { + "tag": "ShadowsocksTCP", + "listen": "0.0.0.0", + "port": 2040, + "protocol": "shadowsocks", + "settings": { + "clients": [ + { + "password": "${xray_sspasw_vrv}", + "method": "chacha20-ietf-poly1305" + } + ], + "network": "tcp,udp" + } + } + ], + "outbounds": [ + { + "protocol": "freedom", + "tag": "DIRECT" + }, + { + "protocol": "blackhole", + "tag": "BLOCK" + } + ] } EOF diff --git a/autoXRAYselfstealConfChina.sh b/autoXRAYselfstealConfChina.sh new file mode 100644 index 0000000..3eef41d --- /dev/null +++ b/autoXRAYselfstealConfChina.sh @@ -0,0 +1,456 @@ +#!/bin/bash + +DOMAIN=$1 + +if [ -z "$DOMAIN" ]; then + echo "❌ Ошибка: домен не задан." + exit 1 +fi + +echo "Обновление и установка необходимых пакетов..." +apt update && apt install sudo -y +#sudo apt update && sudo apt upgrade -y +sudo apt update && sudo apt install -y jq dnsutils + + +LOCAL_IP=$(hostname -I | awk '{print $1}') +DNS_IP=$(dig +short "$DOMAIN" | grep '^[0-9]') + +if [ "$LOCAL_IP" != "$DNS_IP" ]; then + echo "❌ Ошибка: IP-адрес ($LOCAL_IP) не совпадает с A-записью $DOMAIN ($DNS_IP). + Правильно укажите одну A-запись для вашего домена в ДНС - $LOCAL_IP" + exit 1 +fi + + +echo "Настройка DNS..." +echo -e "nameserver 8.8.4.4\nnameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null + +sudo apt install nginx -y + +sudo systemctl enable --now nginx + +sudo apt install certbot python3-certbot-nginx -y + +sudo certbot --nginx -d $DOMAIN --non-interactive --agree-tos --email mail@$DOMAIN + +CONFIG_PATH="/etc/nginx/sites-available/default" + +echo "✅ Записываем конфигурацию в $CONFIG_PATH для домена $DOMAIN" + +sudo bash -c "cat > $CONFIG_PATH" < "$WEB_PATH/index.html" < + + + + + $TITLE + + + + + +
+

$HEADER

+
+
+ + +
+
+ + +
+ +
+
+ + +EOF + + + +# Установка Xray +bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install + + +# Определяем директорию скрипта +#SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) +SCRIPT_DIR=/usr/local/etc/xray + +# Генерируем переменные +xray_uuid_vrv=$(xray uuid) +domains=(www.theregister.com www.20minutes.fr www.dealabs.com www.manomano.fr www.caradisiac.com www.techadvisor.com www.computerworld.com teamdocs.su wikiportal.su docscenter.su www.bing.com github.com tradingview.com) +xray_dest_vrv=${domains[$RANDOM % ${#domains[@]}]} +xray_dest_vrv222=${domains[$RANDOM % ${#domains[@]}]} + +key_output=$(xray x25519) +xray_privateKey_vrv=$(echo "$key_output" | awk -F': ' '/Private key/ {print $2}') +xray_publicKey_vrv=$(echo "$key_output" | awk -F': ' '/Public key/ {print $2}') + +xray_shortIds_vrv=$(openssl rand -hex 8) + +xray_sspasw_vrv=$(openssl rand -base64 15 | tr -dc 'A-Za-z0-9' | head -c 20) + +path_subpage=$(openssl rand -base64 15 | tr -dc 'A-Za-z0-9' | head -c 20) + +ipserv=$(hostname -I | awk '{print $1}') + + + +# Экспортируем переменные для envsubst +export xray_uuid_vrv xray_dest_vrv xray_dest_vrv222 xray_privateKey_vrv xray_publicKey_vrv xray_shortIds_vrv xray_sspasw_vrv DOMAIN path_subpage WEB_PATH + +# Создаем JSON конфигурацию сервера +cat << 'EOF' | envsubst > "$SCRIPT_DIR/config.json" +{ + "dns": { + "servers": [ + "https+local://8.8.4.4/dns-query", + "localhost" + ] + }, + "log": { + "loglevel": "none", + "dnsLog": false + }, + "routing": { + "domainStrategy": "IPIfNonMatch", + "rules": [ + { + "ip": [ + "geoip:private", + "geoip:cn" + ], + "outboundTag": "block" + }, + { + "protocol": [ + "bittorrent" + ], + "outboundTag": "block" + }, + { + "domain": [ + "geosite:category-ads" + ], + "outboundTag": "block" + } + ] + }, + "inbounds": [ + { + "tag": "VtcpRself", + "listen": "0.0.0.0", + "port": 443, + "protocol": "vless", + "settings": { + "clients": [ + { + "flow": "xtls-rprx-vision", + "id": "${xray_uuid_vrv}" + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "tcp", + "security": "reality", + "realitySettings": { + "show": false, + "dest": "3333", + "xver": 0, + "serverNames": [ + "$DOMAIN" + ], + "privateKey": "${xray_privateKey_vrv}", + "publicKey": "${xray_publicKey_vrv}", + "shortIds": [ + "${xray_shortIds_vrv}" + ] + } + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + } + ], + "outbounds": [ + { + "protocol": "freedom", + "tag": "direct" + }, + { + "protocol": "blackhole", + "tag": "block" + } + ] +} + +EOF + +# Создаем JSON конфигурацию клиента +cat << 'EOF' | envsubst > "$WEB_PATH/$path_subpage.html" +{ + "log": { + "loglevel": "warning" + }, + "dns": { + "servers": [ + { + "address": "8.8.8.8", + "domains": [ + "geosite:geolocation-!cn" + ] + }, + { + "address": "223.5.5.5", + "domains": [ + "geosite:cn" + ], + "expectIPs": [ + "geoip:cn" + ] + }, + { + "address": "114.114.114.114", + "domains": [ + "geosite:cn" + ] + }, + "localhost" + ] + }, + "routing": { + "domainStrategy": "IPIfNonMatch", + "rules": [ + { + "domain": [ + "geosite:category-ads-all" + ], + "outboundTag": "block" + }, + { + "protocol": [ + "bittorrent" + ], + "outboundTag": "direct" + }, + { + "ip": [ + "geoip:cn" + ], + "outboundTag": "direct" + }, + { + "domain": [ + "geosite:geolocation-!cn" + ], + "outboundTag": "proxy" + }, + { + "ip": [ + "223.5.5.5" + ], + "outboundTag": "direct" + }, + { + "ip": [ + "geoip:cn", + "geoip:private" + ], + "outboundTag": "direct" + } + ] + }, + "inbounds": [ + { + "tag": "socks-in", + "protocol": "socks", + "listen": "127.0.0.1", + "port": 10808, + "settings": { + "udp": true + } + }, + { + "tag": "socks-sb", + "protocol": "socks", + "listen": "127.0.0.1", + "port": 2080, + "settings": { + "udp": true + } + }, + { + "tag": "socks-v2rayN", + "protocol": "socks", + "listen": "127.0.0.1", + "port": 1080, + "settings": { + "udp": true + } + }, + { + "tag": "http-in", + "protocol": "http", + "listen": "127.0.0.1", + "port": 10809 + } + ], + "outbounds": [ + { + "tag": "proxy", + "protocol": "vless", + "settings": { + "vnext": [ + { + "address": "$DOMAIN", + "port": 443, + "users": [ + { + "id": "${xray_uuid_vrv}", + "flow": "xtls-rprx-vision", + "encryption": "none", + "level": 0 + } + ] + } + ] + }, + "streamSettings": { + "network": "tcp", + "tcpSettings": { + "acceptProxyProtocol": false + }, + "security": "reality", + "realitySettings": { + "serverName": "$DOMAIN", + "publicKey": "${xray_publicKey_vrv}", + "shortId": "${xray_shortIds_vrv}" + } + } + }, + { + "tag": "direct", + "protocol": "freedom" + }, + { + "tag": "block", + "protocol": "blackhole" + } + ] +} + +EOF + +# Перезапуск Xray +echo "Перезапуск Xray..." +sudo systemctl restart xray + +echo "Готово! +" +# Формирование ссылок +subPageLink="https://$DOMAIN/$path_subpage.html" + +# Формирование ссылок +link1="vless://${xray_uuid_vrv}@$DOMAIN:443?security=reality&sni=$DOMAIN&fp=chrome&pbk=${xray_publicKey_vrv}&sid=${xray_shortIds_vrv}&type=tcp&flow=xtls-rprx-vision&encryption=none#useConfig" + +echo -e " +Скопируйте ссылку в специализированное приложение: +- iOS: Happ или v2rayTun или v2rayN +- Android: Happ или v2rayTun или v2rayNG +- Windows: v2rayN или Happ(alpha) или само ядро Xray + +Сайт с инструкциями: blog.skybridge.run" + +echo -e " +Для проверки работоспобоности: +$link1 + +Ваша страничка подписки: +\033[32m$subPageLink\033[0m + +Открыт локальный socks5 на порту 10808, 1080, 2080 и http на 10809. + +Поддержать автора: https://github.com/xVRVx/autoXRAY +"