Çetin 3 жил өмнө
parent
commit
e8e9c66853

+ 0 - 67
scripts/3proxy.sh

@@ -1,67 +0,0 @@
-install_3proxy() {
-    echo "installing 3proxy"
-    URL="https://github.com/z3APA3A/3proxy/archive/3proxy-0.8.6.tar.gz"
-    wget -qO- $URL | bsdtar -xvf-
-    cd 3proxy-3proxy-0.8.6
-    make -f Makefile.Linux
-    mkdir -p /usr/local/etc/3proxy/{bin,logs,stat}
-    cp src/3proxy /usr/local/etc/3proxy/bin/
-    cp ./scripts/rc.d/proxy.sh /etc/init.d/3proxy
-    chmod +x /etc/init.d/3proxy
-    chkconfig 3proxy on
-    cd $WORKDIR
-}
-
-gen_3proxy() {
-    cat <<EOF
-daemon
-maxconn 1000
-nscache 65536
-timeouts 1 5 30 60 180 1800 15 60
-setgid 65535
-setuid 65535
-flush
-auth strong
-
-users $(awk -F "/" 'BEGIN{ORS="";} {print $1 ":CL:" $2 " "}' ${WORKDATA})
-
-$(awk -F "/" '{print "auth strong\n" \
-"allow " $1 "\n" \
-"proxy -6 -n -a -p" $4 " -i" $3 " -e"$5"\n" \
-"flush\n"}' ${WORKDATA})
-EOF
-}
-
-gen_proxy_file_for_user() {
-    cat >proxy.txt <<EOF
-$(awk -F "/" '{print $3 ":" $4 ":" $1 ":" $2 }' ${WORKDATA})
-EOF
-}
-
-upload_proxy() {
-    local PASS=$(random)
-    zip --password $PASS proxy.zip proxy.txt
-    URL=$(curl -s --upload-file proxy.zip https://transfer.sh/proxy.zip)
-
-    echo "Proxy is ready! Format IP:PORT:LOGIN:PASS"
-    echo "Download zip archive from: ${URL}"
-    echo "Password: ${PASS}"
-
-}
-gen_data() {
-    seq $FIRST_PORT $LAST_PORT | while read port; do
-        echo "usr$(random)/pass$(random)/$IP4/$port/$(gen64 $IP6)"
-    done
-}
-
-gen_iptables() {
-    cat <<EOF
-    $(awk -F "/" '{print "iptables -I INPUT -p tcp --dport " $4 "  -m state --state NEW -j ACCEPT"}' ${WORKDATA}) 
-EOF
-}
-
-gen_ifconfig() {
-    cat <<EOF
-$(awk -F "/" '{print "ifconfig eth0 inet6 add " $5 "/64"}' ${WORKDATA})
-EOF
-}

+ 0 - 6
scripts/build.sh

@@ -1,6 +0,0 @@
-# Build for install
-echo "#!/bin/sh" >install.sh
-
-cat system.sh >>install.sh
-cat 3proxy.sh >>install.sh
-cat main.sh >>install.sh

+ 0 - 65
scripts/enable-ipv6.sh

@@ -1,65 +0,0 @@
-#!/bin/sh
-
-# centos 7
-# bash <(curl -s "https://raw.githubusercontent.com/MohistAttack/ipv4-ipv6-proxy/master/scripts/enable-ipv6.sh?r=$RANDOM")
-
-GREEN='\033[0;32m'
-ORANGE='\033[0;33m'
-BLUE='\033[0;34m'
-RED='\033[0;31m'
-CYAN='\033[0;36m'
-NC='\033[0m' # No Color
-
-eecho() {
-    echo -e "${GREEN}$1${NC}"
-}
-
-eecho "Getting IPv6 ..."
-IP6=$(curl -6 -s icanhazip.com -m 10)
-if [[ $IP6 != *:* ]]; then
-  IP6=
-fi
-
-if [ -n "$IP6" ]; then
-    eecho "IPv6 = ${IP6}"
-    echo -e "${RED}IPv6 Already Enbaled!${NC}"
-    exit
-fi
-
-
-while [ ! -n "$ETHNAME" ]; do
-  eecho "Please input network interface name: (eth0 as default)"
-  read ETHNAME
-  if [[ $ETHNAME == "" ]]; then
-    ETHNAME="eth0"
-  fi
-done
-
-while [ ! -n "$ADDR" ]; do
-  eecho "Please input ipv6 address: "
-  read ADDR
-done
-
-while [ ! -n "$GW" ]; do
-  eecho "Please input ipv6 gateway address: "
-  read GW
-done
-
-sed -i '/^NETWORKING_IPV6/d' /etc/sysconfig/network && echo 'NETWORKING_IPV6=yes' >> /etc/sysconfig/network
-
-IFCFGFILE=/etc/sysconfig/network-scripts/ifcfg-$ETHNAME
-
-sed -i '/^IPV6INIT/d' $IFCFGFILE && echo 'IPV6INIT=yes' >> $IFCFGFILE
-sed -i '/^IPV6ADDR/d' $IFCFGFILE && echo "IPV6ADDR=$ADDR" >> $IFCFGFILE
-sed -i '/^IPV6_DEFAULTGW/d' $IFCFGFILE && echo "IPV6_DEFAULTGW=$GW" >> $IFCFGFILE
-
-systemctl restart network
-
-eecho "IPv6 Enabled."
-
-eecho "Getting IPv6 ..."
-IP6=$(curl -6 -s icanhazip.com -m 10)
-if [[ $IP6 != *:* ]]; then
-  IP6=
-fi
-eecho "IPv6 = ${IP6}"

+ 0 - 130
scripts/install.sh

@@ -1,130 +0,0 @@
-#!/bin/sh
-random() {
-	tr </dev/urandom -dc A-Za-z0-9 | head -c5
-	echo
-}
-
-array=(1 2 3 4 5 6 7 8 9 0 a b c d e f)
-gen64() {
-	ip64() {
-		echo "${array[$RANDOM % 16]}${array[$RANDOM % 16]}${array[$RANDOM % 16]}${array[$RANDOM % 16]}"
-	}
-	echo "$1:$(ip64):$(ip64):$(ip64):$(ip64)"
-}
-install_3proxy() {
-    echo "installing 3proxy"
-    URL="https://github.com/z3APA3A/3proxy/archive/3proxy-0.8.6.tar.gz"
-    wget -qO- $URL | bsdtar -xvf-
-    cd 3proxy-3proxy-0.8.6
-    make -f Makefile.Linux
-    mkdir -p /usr/local/etc/3proxy/{bin,logs,stat}
-    cp src/3proxy /usr/local/etc/3proxy/bin/
-    cp ./scripts/rc.d/proxy.sh /etc/init.d/3proxy
-    chmod +x /etc/init.d/3proxy
-    chkconfig 3proxy on
-    cd $WORKDIR
-}
-
-gen_3proxy() {
-# users $(awk -F "/" 'BEGIN{ORS="";} {print $1 ":CL:" $2 " "}' ${WORKDATA})
-    cat <<EOF
-daemon
-maxconn 20000
-nscache 65536
-timeouts 1 5 30 60 180 1800 15 60
-setgid 65535
-setuid 65535
-flush
-auth strong
-
-users smile:CL:girl
-
-$(awk -F "/" '{print "auth strong\n" \
-"allow " $1 "\n" \
-"proxy -6 -n -a -p" $4 " -i" $3 " -e"$5"\n" \
-"flush\n"}' ${WORKDATA})
-EOF
-}
-
-gen_proxy_file_for_user() {
-    cat >proxy.txt <<EOF
-$(awk -F "/" '{print $3 ":" $4 ":" $1 ":" $2 }' ${WORKDATA})
-EOF
-}
-
-upload_proxy() {
-    local PASS=$(random)
-    zip --password $PASS proxy.zip proxy.txt
-    URL=$(curl -s --upload-file proxy.zip https://transfer.sh/proxy.zip)
-
-    echo "Proxy is ready! Format IP:PORT:LOGIN:PASS"
-    echo "Download zip archive from: ${URL}"
-    echo "Password: ${PASS}"
-
-}
-gen_data() {
-	# echo "usr$(random)/pass$(random)/$IP4/$port/$(gen64 $IP6)"
-    seq $FIRST_PORT $LAST_PORT | while read port; do
-        echo "smile/girl/$IP4/$port/$(gen64 $IP6)"
-    done
-}
-
-gen_iptables() {
-    cat <<EOF
-    $(awk -F "/" '{print "iptables -I INPUT -p tcp --dport " $4 "  -m state --state NEW -j ACCEPT"}' ${WORKDATA}) 
-EOF
-}
-
-# run `ifconifg -a` to get eth device name to replace ens3
-# or https://superuser.com/questions/203272/list-only-the-device-names-of-all-available-network-interfaces
-gen_ifconfig() {
-    cat <<EOF
-$(awk -F "/" '{print "ifconfig eth0 inet6 add " $5 "/64"}' ${WORKDATA})
-EOF
-}
-echo "installing apps"
-# yum -y install gcc net-tools bsdtar zip wget make >/dev/null
-yum -y install gcc net-tools bsdtar zip wget make
-
-install_3proxy
-
-echo "working folder = /home/proxy-installer"
-WORKDIR="/home/proxy-installer"
-WORKDATA="${WORKDIR}/data.txt"
-mkdir $WORKDIR && cd $_
-
-IP4=$(curl -4 -s icanhazip.com)
-IP6=$(curl -6 -s icanhazip.com | cut -f1-4 -d':')
-
-echo "Internal ip = ${IP4}. Exteranl sub for ip6 = ${IP6}"
-
-echo "How many proxy do you want to create? Example 500 Max 20000"
-read COUNT
-
-FIRST_PORT=10001
-LAST_PORT=$(($FIRST_PORT + $COUNT - 1))
-
-gen_data >$WORKDIR/data.txt
-gen_iptables >$WORKDIR/boot_iptables.sh
-gen_ifconfig >$WORKDIR/boot_ifconfig.sh
-chmod +x ${WORKDIR}/boot_*.sh /etc/rc.local
-
-gen_3proxy >/usr/local/etc/3proxy/3proxy.cfg
-
-cat >>/etc/rc.local <<EOF
-bash ${WORKDIR}/boot_iptables.sh
-bash ${WORKDIR}/boot_ifconfig.sh
-ulimit -n 50000
-service 3proxy start
-
-# systemctl stop firewalld
-# systemctl disable firewalld
-# systemctl disable firewalld.service
-EOF
-
-chmod +x ${WORKDIR}/boot_*.sh /etc/rc.local
-bash /etc/rc.local
-
-gen_proxy_file_for_user
-
-upload_proxy

+ 0 - 198
scripts/ipv4-ipv6-0.8.6.sh

@@ -1,198 +0,0 @@
-#!/bin/sh
-
-# bash <(curl -s "https://raw.githubusercontent.com/MohistAttack/ipv4-ipv6-proxy/master/scripts/ipv4-ipv6.sh")
-
-GREEN='\033[0;32m'
-ORANGE='\033[0;33m'
-BLUE='\033[0;34m'
-RED='\033[0;31m'
-CYAN='\033[0;36m'
-NC='\033[0m' # No Color
-
-eecho() {
-    echo -e "${GREEN}$1${NC}"
-}
-
-while [ ! $PROXYCOUNT ] || [[ $PROXYCOUNT -lt 1 ]] || [[ $PROXYCOUNT -gt 10000 ]]; do
-    eecho "How many proxy do you want to create? 1-10000"
-    read PROXYCOUNT
-done
-
-IP4=$(curl -4 -s icanhazip.com)
-IP6=$(curl -6 -s icanhazip.com)
-if [[ $IP6 != *:* ]]; then
-  IP6=
-fi
-
-eecho "IPv4 = ${IP4}. IPv6 = ${IP6}"
-
-if [ ! -n "$IP4" ]; then
-  eecho "IPv4 Nout Found. Exit"
-  exit
-fi
-
-while [[ $IP6 != *:* ]] || [ ! -n "$IP6" ]; do
-  eecho "Invalid IPv6, Please input it manually:"
-  read IP6
-done
-
-while [[ $IP6PREFIXLEN -ne 64 ]] && [[ $IP6PREFIXLEN -ne 112 ]]; do
-    eecho "Please input prefixlen for IPv6: (64/112, 112 as default)"
-    read IP6PREFIXLEN
-    if [ ! $IP6PREFIXLEN ]; then
-        IP6PREFIXLEN=112
-    fi
-done
-
-if [ $IP6PREFIXLEN -eq 64 ]; then
-    IP6PREFIX=$(echo $IP6 | cut -f1-4 -d':')
-fi
-if [ $IP6PREFIXLEN -eq 112 ]; then
-    IP6PREFIX=$(echo $IP6 | rev | cut -f2- -d':' | rev)
-fi
-eecho "IPv6 PrefixLen: $IP6PREFIXLEN --> Prefix: $IP6PREFIX"
-
-while [ ! -n "$ETHNAME" ]; do
-  eecho "Please input network interface name: (eth0 as default)"
-  read ETHNAME
-  if [[ $ETHNAME == "" ]]; then
-    ETHNAME="eth0"
-  fi
-done
-
-while [ ! -n "$PROXYUSER" ]; do
-    eecho "Please input username for proxy: (smile as default)"
-    read PROXYUSER
-    if [[ $PROXYUSER == "" ]]; then
-        PROXYUSER="smile"
-    fi
-done
-
-while [ ! -n "$PROXYPASS" ]; do
-    eecho "Please input password for proxy: (girl as default)"
-    read PROXYPASS
-    if [[ $PROXYPASS == "" ]]; then
-        PROXYPASS="girl"
-    fi
-done
-
-#################### functions ####################
-install_3proxy() {
-    eecho "Installing 3proxy ..."
-    URL="https://github.com/z3APA3A/3proxy/archive/3proxy-0.8.6.tar.gz"
-    wget -qO- $URL | bsdtar -xvf-
-    cd 3proxy-3proxy-0.8.6
-    make -f Makefile.Linux
-    mkdir -p /usr/local/etc/3proxy/{bin,logs,stat}
-    cp src/3proxy /usr/local/etc/3proxy/bin/
-    cp ./scripts/rc.d/proxy.sh /etc/init.d/3proxy
-    chmod +x /etc/init.d/3proxy
-    chkconfig 3proxy on
-    cd $WORKDIR
-}
-
-gen_data() {
-    array=(1 2 3 4 5 6 7 8 9 0 a b c d e f)
-    ip64() {
-		echo "${array[$RANDOM % 16]}${array[$RANDOM % 16]}${array[$RANDOM % 16]}${array[$RANDOM % 16]}"
-	}
-
-    seq 1 $PROXYCOUNT | while read idx; do
-        port=$(($idx+10000))
-        if [[ $IP6PREFIXLEN -eq 112 ]]; then
-            suffix=$(($idx+1))
-            suffix=$(printf '%x\n' $suffix)
-            echo "$PROXYUSER/$PROXYPASS/$IP4/$port/$IP6PREFIX:$suffix"
-        fi
-        if [[ $IP6PREFIXLEN -eq 64 ]]; then
-            echo "$PROXYUSER/$PROXYPASS/$IP4/$port/$IP6PREFIX:$(ip64):$(ip64):$(ip64):$(ip64)"
-        fi
-    done
-}
-
-gen_iptables() {
-    cat <<EOF
-$(awk -F "/" '{print "iptables -I INPUT -p tcp --dport " $4 "  -m state --state NEW -j ACCEPT"}' ${WORKDATA}) 
-EOF
-}
-
-gen_ifconfig() {
-    cat <<EOF
-$(awk -v ETHNAME="$ETHNAME" -v IP6PREFIXLEN="$IP6PREFIXLEN" -F "/" '{print "ifconfig " ETHNAME " inet6 add " $5 "/" IP6PREFIXLEN}' ${WORKDATA})
-EOF
-}
-
-gen_proxy_file() {
-    cat <<EOF
-$(awk -F "/" '{print $3 ":" $4 ":" $1 ":" $2 }' ${WORKDATA})
-EOF
-}
-
-# https://3proxy.ru/doc/man3/3proxy.cfg.3.html
-gen_3proxy() {
-# users $(awk -F "/" 'BEGIN{ORS="";} {print $1 ":CL:" $2 " "}' ${WORKDATA})
-    cat <<EOF
-daemon
-maxconn 250
-nscache 65536
-timeouts 1 5 30 60 180 1800 15 60
-setgid 65535
-setuid 65535
-flush
-auth strong
-
-users smile:CL:girl
-
-$(awk -F "/" '{print "auth strong\n" \
-"allow " $1 "\n" \
-"proxy -6 -n -a -p" $4 " -i" $3 " -e"$5"\n" \
-"flush\n"}' ${WORKDATA})
-EOF
-}
-
-####################
-eecho "Installing apps ... (yum)"
-yum -y install gcc net-tools bsdtar zip wget make
-
-###################
-install_3proxy 
-
-# ###################
-WORKDIR="$(pwd)/proxy-installer"
-WORKDATA="${WORKDIR}/data.txt"
-mkdir $WORKDIR && cd $_
-eecho "Working folder = $WORKDIR"
-
-gen_data >$WORKDATA
-gen_3proxy >/usr/local/etc/3proxy/3proxy.cfg
-gen_iptables >$WORKDIR/boot_iptables.sh
-gen_ifconfig >$WORKDIR/boot_ifconfig.sh
-cat >$WORKDIR/boot_3proxy_rc.sh <<EOF
-bash ${WORKDIR}/boot_iptables.sh
-bash ${WORKDIR}/boot_ifconfig.sh
-ulimit -n 50000
-service 3proxy start
-
-# systemctl stop firewalld
-# systemctl disable firewalld
-# systemctl disable firewalld.service
-EOF
-chmod +x ${WORKDIR}/boot_*.sh
-
-# qxF match whole line , we dont need it
-grep -qF '/boot_3proxy_rc.sh' /etc/rc.local || cat >>/etc/rc.local <<EOF 
-bash ${WORKDIR}/boot_3proxy_rc.sh
-EOF
-chmod +x /etc/rc.local
-bash /etc/rc.local
-
-PROXYFILE=proxy.txt
-gen_proxy_file >$PROXYFILE
-eecho "Done with $PROXYFILE"
-
-zip --password $PROXYPASS proxy.zip $PROXYFILE
-URL=$(curl -s --upload-file proxy.zip https://transfer.sh/proxy.zip)
-
-eecho "Proxy is ready! Format IP:PORT:LOGIN:PASS"
-eecho "Download zip archive from: ${URL}"
-eecho "Password: ${PROXYPASS}"

+ 0 - 276
scripts/ipv4-ipv6.sh

@@ -1,276 +0,0 @@
-#!/bin/sh
-
-# centos 7.5
-# bash <(curl -s -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' "https://raw.githubusercontent.com/MohistAttack/ipv4-ipv6-proxy/master/scripts/ipv4-ipv6.sh")
-
-GREEN='\033[0;32m'
-ORANGE='\033[0;33m'
-BLUE='\033[0;34m'
-RED='\033[0;31m'
-CYAN='\033[0;36m'
-NC='\033[0m' # No Color
-
-eecho() {
-    echo -e "${GREEN}$1${NC}"
-}
-
-eecho "Getting IPv4 ..."
-IP4=$(curl -4 -s icanhazip.com -m 10)
-
-eecho "Getting IPv6 ..."
-IP6=$(curl -6 -s icanhazip.com -m 10)
-if [[ $IP6 != *:* ]]; then
-  IP6=
-fi
-
-eecho "IPv4 = ${IP4}. IPv6 = ${IP6}"
-
-if [ ! -n "$IP4" ]; then
-  eecho "IPv4 Nout Found. Exit"
-  exit
-fi
-
-while [[ $IP6 != *:* ]] || [ ! -n "$IP6" ]; do
-    eecho "IPv6 Nout Found, Please check environment. Exit"
-    exit
-#   eecho "Invalid IPv6, Please input it manually:"
-#   read IP6
-done
-
-while [ ! $PROXYCOUNT ] || [[ $PROXYCOUNT -lt 1 ]] || [[ $PROXYCOUNT -gt 10000 ]]; do
-    eecho "How many proxy do you want to create? 1-10000"
-    read PROXYCOUNT
-done
-
-while [ ! -n "$STATIC" ]; do
-    eecho "Do you want to use static mode: (yes/no, no as default)"
-    read STATIC
-    if [[ $STATIC == "y" ]] || [[ $STATIC == "yes" ]]; then
-        STATIC="yes"
-    else
-        STATIC="no"
-    fi
-done
-
-while [[ $IP6PREFIXLEN -ne 48 ]] && [[ $IP6PREFIXLEN -ne 64 ]] && [[ $IP6PREFIXLEN -ne 112 ]]; do
-    eecho "Please input prefixlen for IPv6: (48/64/112, 112 as default)"
-    read IP6PREFIXLEN
-    if [ ! $IP6PREFIXLEN ]; then
-        IP6PREFIXLEN=112
-    fi
-done
-
-if [[ $IP6PREFIXLEN -eq 112 ]]; then
-    INCTAIL="yes"
-else
-    while [ ! -n "$INCTAIL" ]; do
-        eecho "Do you want to use [increasing tail] way to generate addresses: (yes/no, no as default)"
-        read INCTAIL
-        if [[ $INCTAIL == "y" ]] || [[ $INCTAIL == "yes" ]]; then
-            INCTAIL="yes"
-        else
-            INCTAIL="no"
-        fi
-    done
-fi
-
-if [[ $INCTAIL == "yes" ]]; then
-    while [ ! -n "$INCTAILSTEPS" ]; do
-        eecho "How many steps do you want for [increasing tail] way: (1 as default)"
-        read INCTAILSTEPS
-        if [[ $INCTAILSTEPS -lt 1 ]]; then
-            INCTAILSTEPS=1
-        fi
-    done
-fi
-
-if [[ $INCTAIL == "yes" ]]; then
-    IP6PREFIX=$(echo $IP6 | rev | cut -f2- -d':' | rev)
-else
-    if [ $IP6PREFIXLEN -eq 48 ]; then
-        IP6PREFIX=$(echo $IP6 | cut -f1-3 -d':')
-    fi
-    if [ $IP6PREFIXLEN -eq 64 ]; then
-        IP6PREFIX=$(echo $IP6 | cut -f1-4 -d':')
-    fi
-fi
-eecho "IPv6 PrefixLen: $IP6PREFIXLEN --> Prefix: $IP6PREFIX"
-
-while [ ! -n "$ETHNAME" ]; do
-  eecho "Please input network interface name: (eth0 as default)"
-  read ETHNAME
-  if [[ $ETHNAME == "" ]]; then
-    ETHNAME="eth0"
-  fi
-done
-
-while [ ! -n "$PROXYUSER" ]; do
-    eecho "Please input username for proxy: (smile as default)"
-    read PROXYUSER
-    if [[ $PROXYUSER == "" ]]; then
-        PROXYUSER="smile"
-    fi
-done
-
-while [ ! -n "$PROXYPASS" ]; do
-    eecho "Please input password for proxy: (girl as default)"
-    read PROXYPASS
-    if [[ $PROXYPASS == "" ]]; then
-        PROXYPASS="girl"
-    fi
-done
-
-#################### functions ####################
-gen_data() {
-    array=(1 2 3 4 5 6 7 8 9 0 a b c d e f)
-    ip64() {
-		echo "${array[$RANDOM % 16]}${array[$RANDOM % 16]}${array[$RANDOM % 16]}${array[$RANDOM % 16]}"
-	}
-
-    seq 1 $PROXYCOUNT | while read idx; do
-        port=$(($idx+10000))
-        if [[ $INCTAIL == "yes" ]] ; then
-            suffix=$((($idx)*$INCTAILSTEPS))
-            suffix=$(printf '%x\n' $suffix)
-            echo "$PROXYUSER/$PROXYPASS/$IP4/$port/$IP6PREFIX:$suffix"
-        else
-            if [[ $IP6PREFIXLEN -eq 64 ]]; then
-                echo "$PROXYUSER/$PROXYPASS/$IP4/$port/$IP6PREFIX:$(ip64):$(ip64):$(ip64):$(ip64)"
-            fi
-            if [[ $IP6PREFIXLEN -eq 48 ]]; then
-                echo "$PROXYUSER/$PROXYPASS/$IP4/$port/$IP6PREFIX:$(ip64):$(ip64):$(ip64):$(ip64):$(ip64)"
-            fi
-        fi
-    done
-}
-
-gen_iptables() {
-    cat <<EOF
-$(awk -F "/" '{print "iptables -I INPUT -p tcp --dport " $4 "  -m state --state NEW -j ACCEPT"}' ${WORKDATA}) 
-EOF
-}
-
-gen_ifconfig() {
-    cat <<EOF
-$(awk -v ETHNAME="$ETHNAME" -v IP6PREFIXLEN="$IP6PREFIXLEN" -F "/" '{print "ifconfig " ETHNAME " inet6 add " $5 "/" IP6PREFIXLEN}' ${WORKDATA})
-EOF
-}
-
-gen_static() {
-    NETWORK_FILE="/etc/sysconfig/network-scripts/ifcfg-$ETHNAME"
-    cat <<EOF
-    sed -i '/^IPV6ADDR_SECONDARIES/d' $NETWORK_FILE && echo 'IPV6ADDR_SECONDARIES="$(awk -v IP6PREFIXLEN="$IP6PREFIXLEN" -F "/" '{print $5 "/" IP6PREFIXLEN}' ${WORKDATA} | sed -z 's/\n/ /g')"' >> $NETWORK_FILE
-EOF
-}
-
-gen_proxy_file() {
-    cat <<EOF
-$(awk -F "/" '{print $3 ":" $4 ":" $1 ":" $2 }' ${WORKDATA})
-EOF
-}
-
-
-install_3proxy() {
-    eecho "Installing 3proxy ..."
-    git clone https://github.com/MohistAttack/3proxy
-    cd 3proxy
-    ln -s Makefile.Linux Makefile
-    make
-    make install
-    cd ..
-}
-
-# https://3proxy.ru/doc/man3/3proxy.cfg.3.html
-# https://github.com/3proxy/3proxy/blob/master/scripts/3proxy.cfg
-
-# log /logs/3proxy-%y%m%d.log D
-# rotate 30
-# if need , please add before cmd: counter /count/3proxy.3cf 
-
-gen_3proxy() {
-    cat <<EOF
-nscache 65536
-nserver 8.8.8.8
-nserver 8.8.4.4
-
-config /conf/3proxy.cfg
-monitor /conf/3proxy.cfg
-
-counter /count/3proxy.3cf
-
-include /conf/counters
-include /conf/bandlimiters
-
-users $(awk -F "/" '{print $1 ":CL:" $2}' ${WORKDATA} | uniq | sed -z 's/\n/ /g')
-
-flush
-
-$(awk -F "/" '{print "auth strong\n" \
-"allow " $1 "\n" \
-"proxy -6 -n -a -p" $4 " -i" $3 " -e"$5"\n" \
-"flush\n"}' ${WORKDATA})
-EOF
-}
-
-####################
-eecho "Installing apps ... (yum)"
-yum -y install gcc net-tools bsdtar zip git make
-
-###################
-install_3proxy 
-
-# ###################
-WORKDIR="/usr/local/3proxy/installer"
-WORKDATA="${WORKDIR}/data.txt"
-mkdir -p $WORKDIR
-eecho "Working folder = $WORKDIR"
-
-gen_data >$WORKDATA
-gen_3proxy >/usr/local/3proxy/conf/3proxy.cfg
-gen_iptables >$WORKDIR/boot_iptables.sh
-gen_ifconfig >$WORKDIR/boot_ifconfig.sh
-gen_static >$WORKDIR/boot_static.sh
-
-BOOTRCFILE="$WORKDIR/boot_rc.sh"
-
-REGISTER_LOGIC="systemctl restart network && bash ${WORKDIR}/boot_ifconfig.sh"
-if [[ $STATIC == "yes" ]]; then
-    REGISTER_LOGIC="bash ${WORKDIR}/boot_static.sh && systemctl restart network"
-fi
-
-cat >$BOOTRCFILE <<EOF
-bash ${WORKDIR}/boot_iptables.sh
-${REGISTER_LOGIC}
-systemctl restart 3proxy
-
-# systemctl stop firewalld
-# systemctl disable firewalld
-# systemctl disable firewalld.service
-EOF
-chmod +x ${WORKDIR}/boot_*.sh
-
-
-# change ulimit for too many open files
-grep -qxF '* soft nofile 1024000' /etc/security/limits.conf || cat >>/etc/security/limits.conf <<EOF 
-
-* soft nofile 1024000
-* hard nofile 1024000
-EOF
-
-# qxF match whole line
-grep -qxF "bash $BOOTRCFILE" /etc/rc.local || cat >>/etc/rc.local <<EOF 
-bash $BOOTRCFILE
-EOF
-chmod +x /etc/rc.local
-bash /etc/rc.local
-
-PROXYFILE=proxy.txt
-gen_proxy_file >$PROXYFILE
-eecho "Done with $PROXYFILE"
-
-zip --password $PROXYPASS proxy.zip $PROXYFILE
-URL=$(curl -s --upload-file proxy.zip http://transfer.sh/smile.zip)
-
-eecho "Proxy is ready! Format IP:PORT:LOGIN:PASS"
-eecho "Download zip archive from: ${URL}"
-eecho "Password: ${PROXYPASS}"

+ 0 - 40
scripts/main.sh

@@ -1,40 +0,0 @@
-echo "installing apps"
-yum -y install gcc net-tools bsdtar zip >/dev/null
-
-install_3proxy
-
-echo "working folder = /home/proxy-installer"
-WORKDIR="/home/proxy-installer"
-WORKDATA="${WORKDIR}/data.txt"
-mkdir $WORKDIR && cd $_
-
-IP4=$(curl -4 -s ifconfig.co)
-IP6=$(curl -6 -s ifconfig.co | cut -f1-4 -d':')
-
-echo "Internal ip = ${IP4}. Exteranl sub for ip6 = ${IP6}"
-
-echo "How many proxy do you want to create? Example 500"
-read COUNT
-
-FIRST_PORT=10000
-LAST_PORT=$(($FIRST_PORT + $COUNT))
-
-gen_data >$WORKDIR/data.txt
-gen_iptables >$WORKDIR/boot_iptables.sh
-gen_ifconfig >$WORKDIR/boot_ifconfig.sh
-chmod +x boot_*.sh /etc/rc.local
-
-gen_3proxy >/usr/local/etc/3proxy/3proxy.cfg
-
-cat >>/etc/rc.local <<EOF
-bash ${WORKDIR}/boot_iptables.sh
-bash ${WORKDIR}/boot_ifconfig.sh
-ulimit -n 2048
-service 3proxy start
-EOF
-
-bash /etc/rc.local
-
-gen_proxy_file_for_user
-
-upload_proxy

+ 0 - 12
scripts/system.sh

@@ -1,12 +0,0 @@
-random() {
-	tr </dev/urandom -dc A-Za-z0-9 | head -c5
-	echo
-}
-
-array=(1 2 3 4 5 6 7 8 9 0 a b c d e f)
-gen64() {
-	ip64() {
-		echo "${array[$RANDOM % 16]}${array[$RANDOM % 16]}${array[$RANDOM % 16]}${array[$RANDOM % 16]}"
-	}
-	echo "$1:$(ip64):$(ip64):$(ip64):$(ip64)"
-}