first main
This commit is contained in:
commit
82407c9abf
2
Complementos/.gitignore
vendored
Normal file
2
Complementos/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
root-pass
|
||||
baseinst
|
||||
2
Complementos/BaseInstall
Executable file
2
Complementos/BaseInstall
Executable file
File diff suppressed because one or more lines are too long
21
Complementos/free-men.sh
Normal file
21
Complementos/free-men.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
## 1 - "LIMPEZA DE DNS"
|
||||
ip -s -s neigh flush all &> /dev/null
|
||||
ip neigh flush dev $(ip route | grep default | awk '{print $5}' | head -1) &> /dev/null
|
||||
## 2 - "CACHE DO SISTEMA"
|
||||
echo 3 > /proc/sys/vm/drop_caches
|
||||
## 2 - "LIMPAR LOGS"
|
||||
echo > /var/log/messages
|
||||
echo > /var/log/kern.log
|
||||
echo > /var/log/daemon.log
|
||||
echo > /var/log/kern.log
|
||||
echo > /var/log/dpkg.log
|
||||
echo > /var/log/syslog
|
||||
#echo > /var/log/auth.log
|
||||
echo 3 > /proc/sys/vm/drop_caches 1> /dev/null 2> /dev/null
|
||||
swapoff -a && swapon -a 1> /dev/null 2> /dev/null
|
||||
killall usercodes > /dev/null 2>&1
|
||||
killall ferramentas > /dev/null 2>&1
|
||||
killall menu_inst > /dev/null 2>&1
|
||||
killall kswapd0 > /dev/null 2>&1
|
||||
echo $(free -h | grep Mem | sed 's/\s\+/,/g' | cut -d , -f4) > /bin/ejecutar/raml
|
||||
2
Complementos/funcao.sh
Executable file
2
Complementos/funcao.sh
Executable file
File diff suppressed because one or more lines are too long
140
Complementos/toolmaster
Normal file
140
Complementos/toolmaster
Normal file
@ -0,0 +1,140 @@
|
||||
#!/usr/bin/env python
|
||||
from urllib2 import *
|
||||
from platform import system
|
||||
import sys
|
||||
def clear():
|
||||
if system() == 'Linux':
|
||||
os.system("clear")
|
||||
if system() == 'Windows':
|
||||
os.system('cls')
|
||||
os.system('color a')
|
||||
else:
|
||||
pass
|
||||
def slowprint(s):
|
||||
for c in s + '\n':
|
||||
sys.stdout.write(c)
|
||||
sys.stdout.flush()
|
||||
time.sleep(4. / 100)
|
||||
banner = '''
|
||||
|
||||
========= ToolMaster =======\033[91m
|
||||
========== @drowkid01 =========\033[92m
|
||||
======= Telegram @drowkid01 ====\033[96m
|
||||
'''
|
||||
print banner
|
||||
def menu():
|
||||
print'''
|
||||
\033[91m 1 \033[92m)\033[96m DNS Lookup
|
||||
|
||||
\033[91m 2 \033[92m)\033[96m Whois Lookup
|
||||
|
||||
\033[91m 3 \033[92m)\033[96m Reverse IP Lookup
|
||||
|
||||
\033[91m 4 \033[92m)\033[96m GeoIP Lookup
|
||||
|
||||
\033[91m 5 \033[92m)\033[96m Subnet Lookup
|
||||
|
||||
\033[91m 6 \033[92m)\033[96m Port Scanner
|
||||
|
||||
\033[91m 7 \033[92m)\033[96m Extract Links
|
||||
|
||||
\033[91m 8 \033[92m)\033[96m Zone Transfer
|
||||
|
||||
\033[91m 9 \033[92m)\033[96m HTTP Header
|
||||
|
||||
\033[91m 10\033[92m)\033[96m Host Finder
|
||||
|
||||
\033[91m 11\033[92m)\033[96m Info
|
||||
|
||||
\033[91m 0 \033[92m)\033[96m Salir
|
||||
'''
|
||||
slowprint("\033[1;91mchumogh.xyz" + "\n - toolmaster")
|
||||
|
||||
menu()
|
||||
def ext():
|
||||
ex = raw_input ('\033[92mContinuar/Exit -=[C/E]=- -> ')
|
||||
if ex[0].upper() == 'E' :
|
||||
print 'Saliendo!!!'
|
||||
exit()
|
||||
else:
|
||||
clear()
|
||||
print banner
|
||||
menu()
|
||||
select()
|
||||
|
||||
def select():
|
||||
try:
|
||||
joker = input("\033[96mEscribe \033[92m0/\033[91m11 -> -> ")
|
||||
if joker == 2:
|
||||
dz = raw_input('\033[91mEscribe la IP o Dominio : \033[91m')
|
||||
whois = "http://api.hackertarget.com/whois/?q=" + dz
|
||||
dev = urlopen(whois).read()
|
||||
print (dev)
|
||||
ext()
|
||||
elif joker == 3:
|
||||
dz = raw_input('\033[92mEscribe la IP : \033[92m')
|
||||
revrse = "http://api.hackertarget.com/reverseiplookup/?q=" + dz
|
||||
lookup = urlopen(revrse).read()
|
||||
print (lookup)
|
||||
ext()
|
||||
elif joker == 1:
|
||||
dz = raw_input('\033[96mEscribe tu dominio :\033[96m')
|
||||
dns = "http://api.hackertarget.com/dnslookup/?q=" + dz
|
||||
joker = urlopen(dns).read()
|
||||
print (joker)
|
||||
ext()
|
||||
elif joker == 4:
|
||||
dz = raw_input('\033[91mEscribe la IP : \033[91m')
|
||||
geo = "http://api.hackertarget.com/geoip/?q=" + dz
|
||||
ip = urlopen(geo).read()
|
||||
print (ip)
|
||||
ext()
|
||||
elif joker == 5:
|
||||
dz = raw_input('\033[92mEscribe la IP : \033[92m')
|
||||
sub = "http://api.hackertarget.com/subnetcalc/?q=" + dz
|
||||
net = urlopen(sub).read()
|
||||
print (net)
|
||||
ext()
|
||||
elif joker == 6:
|
||||
dz = raw_input('\033[96mEscribe la IP : \033[96m')
|
||||
port = "http://api.hackertarget.com/nmap/?q=" + dz
|
||||
scan = urlopen(port).read()
|
||||
print (scan)
|
||||
ext()
|
||||
elif joker == 7:
|
||||
dz = raw_input('\033[91mEscribe tu dominio :\033[91m')
|
||||
get = "https://api.hackertarget.com/pagelinks/?q=" + dz
|
||||
page = urlopen(get).read()
|
||||
print(page)
|
||||
ext()
|
||||
elif joker == 8:
|
||||
dz = raw_input('\033[92mEscribe tu dominio :\033[92m')
|
||||
zon = "http://api.hackertarget.com/zonetransfer/?q=" + dz
|
||||
tran = urlopen(zon).read()
|
||||
print (tran)
|
||||
ext()
|
||||
elif joker == 9:
|
||||
dz = raw_input('\033[96mEscribe tu dominio :\033[96m')
|
||||
hea = "http://api.hackertarget.com/httpheaders/?q=" + dz
|
||||
der = urlopen(hea).read()
|
||||
print (der)
|
||||
ext()
|
||||
elif joker == 10:
|
||||
dz = raw_input('\033[91mEscribe tu dominio :\033[91m')
|
||||
host = "http://api.hackertarget.com/hostsearch/?q=" + dz
|
||||
finder = urlopen(host).read()
|
||||
print (finder)
|
||||
ext()
|
||||
elif joker == 11:
|
||||
slowprint("ToolMaster \033[92m")
|
||||
slowprint(".....................")
|
||||
slowprint("@drowkid01 \033[96m")
|
||||
slowprint(".........................")
|
||||
slowprint("website : chumogh.xyz \033[91m")
|
||||
ext()
|
||||
elif joker == 0:
|
||||
print "Exiting!!"
|
||||
ext()
|
||||
except(KeyboardInterrupt):
|
||||
print "\nCtrl + C -> Saliendo!!"
|
||||
select()
|
||||
5
Control/Control-BOT
Normal file
5
Control/Control-BOT
Normal file
@ -0,0 +1,5 @@
|
||||
144.202.37.211 | 01/01/2050 | @donpato_bot | @drowkid01
|
||||
149.56.110.115 | 01/01/2050 | @Dealer_Gen_Bot | @DealerServices235
|
||||
155.138.147.110 | 01/01/2050 | @tuputamadre | @jajajaja
|
||||
159.112.137.238 | 01/01/2050 | @BAAV09 | @script_mod1_bot
|
||||
45.56.112.117 | 01/01/2050 | @don_patobot | @drowkid1
|
||||
4
Control/Control-Bot.txt
Normal file
4
Control/Control-Bot.txt
Normal file
@ -0,0 +1,4 @@
|
||||
144.202.37.211 | 01/01/2050 | @donpato_bot | @drowkid01
|
||||
149.56.110.115 | 01/01/2050 | @Dealer_Gen_Bot | @DealerServices235
|
||||
155.138.147.110 | 01/01/2050 | @tuputamadre | @jajajaja
|
||||
159.112.137.238 | 01/01/2050 | @BAAV09 | @bot
|
||||
BIN
Control/chukk.tar
Normal file
BIN
Control/chukk.tar
Normal file
Binary file not shown.
1
Control/token.sh
Normal file
1
Control/token.sh
Normal file
@ -0,0 +1 @@
|
||||
6737010670:AAHLCAXetDPYy8Sqv1m_1c0wbJdDDYeEBcs 6234530051
|
||||
1
Lista/.gitignore
vendored
Normal file
1
Lista/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
elkid
|
||||
278
Lista/PDirect.py
Normal file
278
Lista/PDirect.py
Normal file
@ -0,0 +1,278 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import socket, threading, thread, select, signal, sys, time, getopt, argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-l", "--local", help="Nombre de archivo a procesar")
|
||||
parser.add_argument("-p", "--port", help="Nombre de archivo a procesar")
|
||||
parser.add_argument("-c", "--contr", help="Nombre de archivo a procesar")
|
||||
parser.add_argument("-r", "--response", help="Nombre de archivo a procesar")
|
||||
parser.add_argument("-t", "--texto", help="Nombre de archivo a procesar")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
#==================================
|
||||
LISTENING_ADDR = '0.0.0.0'
|
||||
|
||||
if args.port:
|
||||
LISTENING_PORT = int(args.port)
|
||||
else:
|
||||
print " Deve ingresar el puerto que usara como socks..."
|
||||
sys.exit()
|
||||
|
||||
if args.contr:
|
||||
PASS = str(args.contr)
|
||||
else:
|
||||
PASS = str()
|
||||
|
||||
BUFLEN = 4096 * 4
|
||||
TIMEOUT = 60
|
||||
|
||||
if args.local:
|
||||
DEFAULT_HOST = '127.0.0.1:' + args.local
|
||||
else:
|
||||
print " Deve seleccionar un puerto existente para redireccionar el trafico..."
|
||||
sys.exit()
|
||||
|
||||
if args.response:
|
||||
STATUS_RESP = args.response
|
||||
else:
|
||||
STATUS_RESP = '200'
|
||||
|
||||
if args.texto:
|
||||
STATUS_TXT = args.texto
|
||||
elif STATUS_RESP == '101':
|
||||
STATUS_TXT = '<font color="red">Switching Protocols</font>'
|
||||
else:
|
||||
STATUS_TXT = '<font color="red">Connection established</font>'
|
||||
|
||||
RESPONSE = str('HTTP/1.1 ' + STATUS_RESP + ' ' + STATUS_TXT + '\r\nContent-length: 0\r\n\r\nHTTP/1.1 200 Connection established\r\n\r\n')
|
||||
|
||||
class Server(threading.Thread):
|
||||
def __init__(self, host, port):
|
||||
threading.Thread.__init__(self)
|
||||
self.running = False
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.threads = []
|
||||
self.threadsLock = threading.Lock()
|
||||
self.logLock = threading.Lock()
|
||||
|
||||
def run(self):
|
||||
self.soc = socket.socket(socket.AF_INET)
|
||||
self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self.soc.settimeout(2)
|
||||
self.soc.bind((self.host, self.port))
|
||||
self.soc.listen(0)
|
||||
self.running = True
|
||||
|
||||
try:
|
||||
while self.running:
|
||||
try:
|
||||
c, addr = self.soc.accept()
|
||||
c.setblocking(1)
|
||||
except socket.timeout:
|
||||
continue
|
||||
|
||||
conn = ConnectionHandler(c, self, addr)
|
||||
conn.start()
|
||||
self.addConn(conn)
|
||||
finally:
|
||||
self.running = False
|
||||
self.soc.close()
|
||||
|
||||
def printLog(self, log):
|
||||
self.logLock.acquire()
|
||||
print log
|
||||
self.logLock.release()
|
||||
|
||||
def addConn(self, conn):
|
||||
try:
|
||||
self.threadsLock.acquire()
|
||||
if self.running:
|
||||
self.threads.append(conn)
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
def removeConn(self, conn):
|
||||
try:
|
||||
self.threadsLock.acquire()
|
||||
self.threads.remove(conn)
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
self.running = False
|
||||
self.threadsLock.acquire()
|
||||
|
||||
threads = list(self.threads)
|
||||
for c in threads:
|
||||
c.close()
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
|
||||
class ConnectionHandler(threading.Thread):
|
||||
def __init__(self, socClient, server, addr):
|
||||
threading.Thread.__init__(self)
|
||||
self.clientClosed = False
|
||||
self.targetClosed = True
|
||||
self.client = socClient
|
||||
self.client_buffer = ''
|
||||
self.server = server
|
||||
self.log = 'Connection: ' + str(addr)
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
if not self.clientClosed:
|
||||
self.client.shutdown(socket.SHUT_RDWR)
|
||||
self.client.close()
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
self.clientClosed = True
|
||||
|
||||
try:
|
||||
if not self.targetClosed:
|
||||
self.target.shutdown(socket.SHUT_RDWR)
|
||||
self.target.close()
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
self.targetClosed = True
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.client_buffer = self.client.recv(BUFLEN)
|
||||
|
||||
hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
|
||||
|
||||
if hostPort == '':
|
||||
hostPort = DEFAULT_HOST
|
||||
|
||||
split = self.findHeader(self.client_buffer, 'X-Split')
|
||||
|
||||
if split != '':
|
||||
self.client.recv(BUFLEN)
|
||||
|
||||
if hostPort != '':
|
||||
passwd = self.findHeader(self.client_buffer, 'X-Pass')
|
||||
|
||||
if len(PASS) != 0 and passwd == PASS:
|
||||
self.method_CONNECT(hostPort)
|
||||
elif len(PASS) != 0 and passwd != PASS:
|
||||
self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
|
||||
elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
|
||||
self.method_CONNECT(hostPort)
|
||||
else:
|
||||
self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
|
||||
else:
|
||||
print '- No X-Real-Host!'
|
||||
self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
|
||||
|
||||
except Exception as e:
|
||||
self.log += ' - error: ' + e.strerror
|
||||
self.server.printLog(self.log)
|
||||
pass
|
||||
finally:
|
||||
self.close()
|
||||
self.server.removeConn(self)
|
||||
|
||||
def findHeader(self, head, header):
|
||||
aux = head.find(header + ': ')
|
||||
|
||||
if aux == -1:
|
||||
return ''
|
||||
|
||||
aux = head.find(':', aux)
|
||||
head = head[aux+2:]
|
||||
aux = head.find('\r\n')
|
||||
|
||||
if aux == -1:
|
||||
return ''
|
||||
|
||||
return head[:aux];
|
||||
|
||||
def connect_target(self, host):
|
||||
i = host.find(':')
|
||||
if i != -1:
|
||||
port = int(host[i+1:])
|
||||
host = host[:i]
|
||||
else:
|
||||
if self.method=='CONNECT':
|
||||
port = 443
|
||||
else:
|
||||
port = 80
|
||||
port = 8080
|
||||
port = 8799
|
||||
port = 3128
|
||||
|
||||
(soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
|
||||
|
||||
self.target = socket.socket(soc_family, soc_type, proto)
|
||||
self.targetClosed = False
|
||||
self.target.connect(address)
|
||||
|
||||
def method_CONNECT(self, path):
|
||||
self.log += ' - CONNECT ' + path
|
||||
|
||||
self.connect_target(path)
|
||||
self.client.sendall(RESPONSE)
|
||||
self.client_buffer = ''
|
||||
|
||||
self.server.printLog(self.log)
|
||||
self.doCONNECT()
|
||||
|
||||
def doCONNECT(self):
|
||||
socs = [self.client, self.target]
|
||||
count = 0
|
||||
error = False
|
||||
while True:
|
||||
count += 1
|
||||
(recv, _, err) = select.select(socs, [], socs, 3)
|
||||
if err:
|
||||
error = True
|
||||
if recv:
|
||||
for in_ in recv:
|
||||
try:
|
||||
data = in_.recv(BUFLEN)
|
||||
if data:
|
||||
if in_ is self.target:
|
||||
self.client.send(data)
|
||||
else:
|
||||
while data:
|
||||
byte = self.target.send(data)
|
||||
data = data[byte:]
|
||||
|
||||
count = 0
|
||||
else:
|
||||
break
|
||||
except:
|
||||
error = True
|
||||
break
|
||||
if count == TIMEOUT:
|
||||
error = True
|
||||
|
||||
if error:
|
||||
break
|
||||
|
||||
def main(host=LISTENING_ADDR, port=LISTENING_PORT):
|
||||
|
||||
print "\n:-------PythonProxy-------:\n"
|
||||
print "Listening addr: " + LISTENING_ADDR
|
||||
print "Listening port: " + str(LISTENING_PORT) + "\n"
|
||||
print ":-------------------------:\n"
|
||||
|
||||
server = Server(LISTENING_ADDR, LISTENING_PORT)
|
||||
server.start()
|
||||
|
||||
while True:
|
||||
try:
|
||||
time.sleep(2)
|
||||
except KeyboardInterrupt:
|
||||
print 'Stopping...'
|
||||
server.close()
|
||||
break
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
682
Lista/PGet.py
Normal file
682
Lista/PGet.py
Normal file
@ -0,0 +1,682 @@
|
||||
import sys, time, getopt, socket, threading, base64
|
||||
|
||||
|
||||
# CONFIG
|
||||
CONFIG_LISTENING = '0.0.0.0:8799'
|
||||
CONFIG_PASS = 'pwd.pwd'
|
||||
|
||||
|
||||
class Logger:
|
||||
|
||||
logLock = threading.Lock()
|
||||
LOG_INFO = 1
|
||||
LOG_WARN = 2
|
||||
LOG_ERROR = 3
|
||||
|
||||
def printWarn(self, log):
|
||||
self.log(log)
|
||||
|
||||
def printInfo(self, log):
|
||||
self.log(log)
|
||||
|
||||
def printError(self, log):
|
||||
self.log(log)
|
||||
|
||||
def printLog(self, log, logLevel):
|
||||
if logLevel == Logger.LOG_INFO:
|
||||
self.printInfo('<-> ' + log)
|
||||
elif logLevel == Logger.LOG_WARN:
|
||||
self.printWarn('<!> ' + log)
|
||||
elif logLevel == Logger.LOG_ERROR:
|
||||
self.printError('<#> ' + log)
|
||||
|
||||
def log(self, log):
|
||||
with Logger.logLock:
|
||||
print log
|
||||
|
||||
|
||||
|
||||
class PasswordSet:
|
||||
FILE_EXEMPLE = 'master=passwd123\n127.0.0.1:22=pwd321;321pawd\n1.23.45.67:443=pass123'
|
||||
|
||||
def __init__(self, masterKey=None):
|
||||
self.masterKey = masterKey
|
||||
|
||||
def parseFile(self, fileName):
|
||||
isValid = False
|
||||
|
||||
with open(fileName) as f:
|
||||
content = f.readlines()
|
||||
|
||||
content = [x.strip() for x in content]
|
||||
content = [item for item in content if not str(item).startswith('#')]
|
||||
|
||||
if len(content) > 0:
|
||||
masterKey = content[0]
|
||||
|
||||
if self.splitParam(masterKey, '=') is not None and masterKey.startswith('master'):
|
||||
self.masterKey = self.splitParam(masterKey, '=')[1]
|
||||
|
||||
isValid = True
|
||||
self.map = dict()
|
||||
|
||||
for i, v in enumerate(content[1:]):
|
||||
hostAndPass = self.splitParam(v, '=')
|
||||
|
||||
if hostAndPass is not None:
|
||||
self.map[hostAndPass[0]] = hostAndPass[1].split(';')
|
||||
|
||||
return isValid
|
||||
|
||||
def isValidKey(self, key, target):
|
||||
valid = False
|
||||
|
||||
if not self.masterKey == key:
|
||||
if hasattr(self, 'map'):
|
||||
if self.map.has_key(target):
|
||||
valid = key in self.map[target]
|
||||
else:
|
||||
valid = True
|
||||
|
||||
return valid
|
||||
|
||||
|
||||
def splitParam(self, param, c):
|
||||
index = param.find(c)
|
||||
|
||||
ret = None
|
||||
|
||||
if index != -1:
|
||||
ret = []
|
||||
ret.append(param[0:index])
|
||||
ret.append(param[index+1:])
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
|
||||
|
||||
class ClientRequest:
|
||||
MAX_LEN_CLIENT_REQUEST = 1024 * 100
|
||||
HEADER_CONTENT_LENGTH = 'Content-Length'
|
||||
HEADER_ACTION = 'X-Action'
|
||||
ACTION_CLOSE = 'close'
|
||||
ACTION_DATA = 'data'
|
||||
|
||||
def __init__(self, socket):
|
||||
self.socket = socket
|
||||
self.readConent = False
|
||||
|
||||
def parse(self):
|
||||
line = ''
|
||||
count = 0
|
||||
self.isValid = False
|
||||
self.data = None
|
||||
self.contentLength = None
|
||||
self.action = None
|
||||
|
||||
while line != '\r\n' and count < ClientRequest.MAX_LEN_CLIENT_REQUEST:
|
||||
line = self.readHttpLine()
|
||||
|
||||
if line is None:
|
||||
break
|
||||
|
||||
if line.startswith(ClientRequest.HEADER_ACTION):
|
||||
self.action = self.getHeaderVal(line)
|
||||
|
||||
if not self.action is None:
|
||||
if self.action == ClientRequest.ACTION_CLOSE or self.action == ClientRequest.ACTION_DATA:
|
||||
self.isValid = True
|
||||
|
||||
count += len(line)
|
||||
|
||||
if self.readConent:
|
||||
if self.contentLength > 0 and self.contentLength < ClientRequest.MAX_LEN_CLIENT_REQUEST:
|
||||
self.data = self.readFully(self.contentLength)
|
||||
|
||||
return self.isValid
|
||||
|
||||
def readHttpLine(self):
|
||||
line = ''
|
||||
count = 0
|
||||
socket = self.socket
|
||||
|
||||
b = socket.recv(1)
|
||||
|
||||
if not b:
|
||||
return None
|
||||
|
||||
while count < ClientRequest.MAX_LEN_CLIENT_REQUEST:
|
||||
count += 1
|
||||
line += b
|
||||
|
||||
if b == '\r':
|
||||
b = socket.recv(1)
|
||||
count += 1
|
||||
|
||||
if not b:
|
||||
break
|
||||
|
||||
line += b
|
||||
|
||||
if b == '\n':
|
||||
break
|
||||
|
||||
b = socket.recv(1)
|
||||
|
||||
if not b:
|
||||
break
|
||||
|
||||
if not b:
|
||||
return None
|
||||
|
||||
return line
|
||||
|
||||
def getHeaderVal(self, header):
|
||||
ini = header.find(':')
|
||||
|
||||
if ini == -1:
|
||||
return None
|
||||
|
||||
ini += 2
|
||||
|
||||
fim = header.find('\r\n')
|
||||
|
||||
if fim == -1:
|
||||
header = header[ini:]
|
||||
|
||||
return header[ini:fim]
|
||||
|
||||
def readFully(self, n):
|
||||
count = 0
|
||||
data = ''
|
||||
|
||||
while count < n:
|
||||
packet = self.socket.recv(n - count)
|
||||
|
||||
if not packet:
|
||||
break
|
||||
|
||||
count += len(packet)
|
||||
data += packet
|
||||
|
||||
|
||||
|
||||
|
||||
class Client(threading.Thread):
|
||||
ACTION_DATA = 'data'
|
||||
BUFFER_SIZE = 4096
|
||||
|
||||
def __init__(self, id, readSocket, target):
|
||||
super(Client, self).__init__()
|
||||
self.targetHostPort = target
|
||||
self.id = id
|
||||
self.readSocket = readSocket
|
||||
self.logger = Logger()
|
||||
self.isStopped = False
|
||||
self.onCloseFunction = None
|
||||
self.closeLock = threading.Lock()
|
||||
self.threadEndCount = 0
|
||||
self.writeSocket = None
|
||||
|
||||
def connectTarget(self):
|
||||
aux = self.targetHostPort.find(':')
|
||||
|
||||
host = self.targetHostPort[:aux]
|
||||
port = int(self.targetHostPort[aux + 1:])
|
||||
|
||||
self.target = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.target.connect((host, port))
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.connectTarget()
|
||||
|
||||
request = ClientRequest(self.readSocket)
|
||||
request.readConent = False
|
||||
|
||||
if not request.parse() or not Client.ACTION_DATA == request.action:
|
||||
raise Exception('client sends invalid request')
|
||||
|
||||
threadRead = ThreadRelay(self.readSocket, self.target, self.finallyClose)
|
||||
threadRead.logFunction = self.log
|
||||
threadRead.start()
|
||||
|
||||
threadWrite = ThreadRelay(self.target, self.writeSocket, self.finallyClose)
|
||||
threadWrite.logFunction = self.log
|
||||
threadWrite.start()
|
||||
except Exception as e:
|
||||
self.log('connection error - ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
|
||||
self.close()
|
||||
|
||||
def finallyClose(self):
|
||||
with self.closeLock:
|
||||
self.threadEndCount += 1
|
||||
|
||||
if self.threadEndCount == 2:
|
||||
self.close()
|
||||
|
||||
def close(self):
|
||||
if not self.isStopped:
|
||||
self.isStopped = True
|
||||
|
||||
if hasattr(self, 'target'):
|
||||
try:
|
||||
self.target.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
if hasattr(self, 'writeSocket'):
|
||||
try:
|
||||
self.writeSocket.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
if hasattr(self, 'readSocket'):
|
||||
try:
|
||||
self.readSocket.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
self.onClose()
|
||||
self.log('closed', Logger.LOG_INFO)
|
||||
|
||||
def onClose(self):
|
||||
if not self.onCloseFunction is None:
|
||||
self.onCloseFunction(self)
|
||||
|
||||
def log(self, msg, logLevel):
|
||||
msg = 'Client ' + str(self.id) + ': ' + msg
|
||||
self.logger.printLog(msg, logLevel)
|
||||
|
||||
|
||||
class ThreadRelay(threading.Thread):
|
||||
def __init__(self, readSocket, writeSocket, closeFunction=None):
|
||||
super(ThreadRelay, self).__init__()
|
||||
self.readSocket = readSocket
|
||||
self.writeSocket = writeSocket
|
||||
self.logFunction = None
|
||||
self.closeFuntion = closeFunction
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
while True:
|
||||
data = self.readSocket.recv(Client.BUFFER_SIZE)
|
||||
if not data:
|
||||
break
|
||||
self.writeSocket.sendall(data)
|
||||
|
||||
self.writeSocket.shutdown(socket.SHUT_WR)
|
||||
except Exception as e:
|
||||
if not self.logFunction is None:
|
||||
self.logFunction('threadRelay error: ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
|
||||
finally:
|
||||
if not self.closeFuntion is None:
|
||||
self.closeFuntion()
|
||||
|
||||
|
||||
|
||||
|
||||
class AcceptClient(threading.Thread):
|
||||
MAX_QTD_BYTES = 5000
|
||||
HEADER_BODY = 'X-Body'
|
||||
HEADER_ACTION = 'X-Action'
|
||||
HEADER_TARGET = 'X-Target'
|
||||
HEADER_PASS = 'X-Pass'
|
||||
HEADER_ID = 'X-Id'
|
||||
ACTION_CREATE = 'create'
|
||||
ACTION_COMPLETE = 'complete'
|
||||
MSG_CONNECTION_CREATED = 'Created'
|
||||
MSG_CONNECTION_COMPLETED = 'Completed'
|
||||
|
||||
ID_COUNT = 0
|
||||
ID_LOCK = threading.Lock()
|
||||
|
||||
def __init__(self, socket, server, passwdSet=None):
|
||||
super(AcceptClient, self).__init__()
|
||||
self.server = server
|
||||
self.passwdSet = passwdSet
|
||||
self.socket = socket
|
||||
|
||||
def run(self):
|
||||
needClose = True
|
||||
|
||||
try:
|
||||
head = self.readHttpRequest()
|
||||
|
||||
bodyLen = self.getHeaderVal(head, AcceptClient.HEADER_BODY)
|
||||
if not bodyLen is None:
|
||||
try:
|
||||
self.readFully(int(bodyLen))
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
action = self.getHeaderVal(head, AcceptClient.HEADER_ACTION)
|
||||
|
||||
if action is None:
|
||||
self.log('client sends no action header', Logger.LOG_WARN)
|
||||
self.socket.sendall('HTTP/1.1 400 NoActionHeader!\r\nServer: GetTunnelServer\r\n\r\n')
|
||||
return
|
||||
|
||||
if action == AcceptClient.ACTION_CREATE:
|
||||
target = self.getHeaderVal(head, AcceptClient.HEADER_TARGET)
|
||||
|
||||
if not self.passwdSet is None:
|
||||
passwd = self.getHeaderVal(head, AcceptClient.HEADER_PASS)
|
||||
|
||||
try:
|
||||
passwd = base64.b64decode(passwd)
|
||||
except:
|
||||
passwd = None
|
||||
pass
|
||||
|
||||
if passwd is None or not self.passwdSet.isValidKey(passwd, target):
|
||||
self.log('client sends wrong key', Logger.LOG_WARN)
|
||||
self.socket.sendall('HTTP/1.1 403 Forbidden\r\nServer: GetTunnelServer\r\n\r\n')
|
||||
return
|
||||
|
||||
if target is not None and self.isValidHostPort(target):
|
||||
id = self.generateId()
|
||||
|
||||
client = Client(id, self.socket, target)
|
||||
client.onCloseFunction = self.server.removeClient
|
||||
self.server.addClient(client)
|
||||
self.socket.sendall('HTTP/1.1 200 '+ AcceptClient.MSG_CONNECTION_CREATED + '\r\nServer: GetTunnelServer\r\nX-Id: ' + str(id) + '\r\nContent-Type: text/plain\r\nContent-Length: 0\r\nConnection: Keep-Alive\r\n\r\n')
|
||||
self.log('connection created - ' + str(id), Logger.LOG_INFO)
|
||||
needClose = False
|
||||
else:
|
||||
self.log('client sends no valid target', Logger.LOG_WARN)
|
||||
self.socket.sendall('HTTP/1.1 400 Target!\r\nServer: GetTunnelServer\r\n\r\n')
|
||||
|
||||
elif action == AcceptClient.ACTION_COMPLETE:
|
||||
id = self.getHeaderVal(head, AcceptClient.HEADER_ID)
|
||||
|
||||
if not id is None:
|
||||
client = self.server.getClient(id)
|
||||
|
||||
if not client is None:
|
||||
client.writeSocket = self.socket
|
||||
|
||||
self.log('connection completed - ' + str(id), Logger.LOG_INFO)
|
||||
self.socket.sendall('HTTP/1.1 200 ' + AcceptClient.MSG_CONNECTION_COMPLETED + '\r\nServer: GetTunnelServer\r\nConnection: Keep-Alive\r\n\r\n')
|
||||
|
||||
client.start()
|
||||
needClose = False
|
||||
else:
|
||||
self.log('client try to complete non existing connection', Logger.LOG_WARN)
|
||||
self.socket.sendall('HTTP/1.1 400 CreateFirst!\r\nServer: GetTunnelServer\r\n\r\n')
|
||||
else:
|
||||
self.log('client sends no id header', Logger.LOG_WARN)
|
||||
self.socket.sendall('HTTP/1.1 400 NoID!\r\nServer: GetTunnelServer\r\n\r\n')
|
||||
else:
|
||||
self.log('client sends invalid action', Logger.LOG_WARN)
|
||||
self.socket.sendall('HTTP/1.1 400 InvalidAction!\r\nServer: GetTunnelServer\r\n\r\n')
|
||||
|
||||
except Exception as e:
|
||||
self.log('connection error - ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
|
||||
finally:
|
||||
if needClose:
|
||||
try:
|
||||
self.socket.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
def log(self, msg, logLevel):
|
||||
self.server.log(msg, logLevel)
|
||||
|
||||
def readHttpRequest(self):
|
||||
request = ''
|
||||
linha = ''
|
||||
count = 0
|
||||
|
||||
while linha != '\r\n' and count < AcceptClient.MAX_QTD_BYTES:
|
||||
linha = self.readHttpLine()
|
||||
|
||||
if linha is None:
|
||||
break
|
||||
|
||||
request += linha
|
||||
count += len(linha)
|
||||
|
||||
return request
|
||||
|
||||
def readHttpLine(self):
|
||||
line = ''
|
||||
count = 0
|
||||
socket = self.socket
|
||||
|
||||
b = socket.recv(1)
|
||||
|
||||
if not b:
|
||||
return None
|
||||
|
||||
while count < AcceptClient.MAX_QTD_BYTES:
|
||||
count += 1
|
||||
line += b
|
||||
|
||||
if b == '\r':
|
||||
b = socket.recv(1)
|
||||
count += 1
|
||||
|
||||
if not b:
|
||||
break
|
||||
|
||||
line += b
|
||||
|
||||
if b == '\n':
|
||||
break
|
||||
|
||||
b = socket.recv(1)
|
||||
|
||||
if not b:
|
||||
break
|
||||
|
||||
if not b:
|
||||
return None
|
||||
|
||||
return line
|
||||
|
||||
def getHeaderVal(self, head, header):
|
||||
if not head.startswith('\r\n'):
|
||||
header = '\r\n' + header
|
||||
|
||||
if not header.endswith(': '):
|
||||
header = header + ': '
|
||||
|
||||
ini = head.find(header)
|
||||
|
||||
if ini == -1:
|
||||
return None
|
||||
|
||||
end = head.find('\r\n', ini+2)
|
||||
|
||||
ini += len(header)
|
||||
|
||||
if end == -1 or ini > end or ini >= len(head):
|
||||
return None
|
||||
|
||||
return head[ini:end]
|
||||
|
||||
def readFully(self, n):
|
||||
count = 0
|
||||
|
||||
while count < n:
|
||||
packet = self.socket.recv(n - count)
|
||||
|
||||
if not packet:
|
||||
break
|
||||
|
||||
count += len(packet)
|
||||
|
||||
def isValidHostPort(self, hostPort):
|
||||
aux = hostPort.find(':')
|
||||
|
||||
if aux == -1 or aux >= len(hostPort) -1:
|
||||
return False
|
||||
|
||||
try:
|
||||
int(hostPort[aux+1:])
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def generateId(self):
|
||||
with AcceptClient.ID_LOCK:
|
||||
AcceptClient.ID_COUNT += 1
|
||||
return AcceptClient.ID_COUNT
|
||||
|
||||
|
||||
|
||||
class Server(threading.Thread):
|
||||
|
||||
def __init__(self, listening, passwdSet=None):
|
||||
super(Server, self).__init__()
|
||||
self.listening = listening
|
||||
self.passwdSet = passwdSet
|
||||
self.running = False
|
||||
self.logger = Logger()
|
||||
self.isStopped = False
|
||||
self.clientsLock = threading.Lock()
|
||||
self.clients = []
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.soc = socket.socket(socket.AF_INET)
|
||||
self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self.soc.settimeout(2)
|
||||
self.soc.bind((self.listening[:self.listening.find(':')], int(self.listening[self.listening.find(':') + 1:])))
|
||||
self.soc.listen(0)
|
||||
|
||||
self.log('running on ' + self.listening, Logger.LOG_INFO)
|
||||
|
||||
self.running = True
|
||||
while self.running:
|
||||
try:
|
||||
c, addr = self.soc.accept()
|
||||
c.setblocking(1)
|
||||
|
||||
self.log('opennig connection - ' + str(addr), Logger.LOG_INFO)
|
||||
self.acceptClient(c)
|
||||
except socket.timeout:
|
||||
continue
|
||||
except Exception as e:
|
||||
self.log('connection error - ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
|
||||
finally:
|
||||
self.running = False
|
||||
self.close()
|
||||
|
||||
def acceptClient(self, socket):
|
||||
accept = AcceptClient(socket, self, self.passwdSet)
|
||||
accept.start()
|
||||
|
||||
def addClient(self, client):
|
||||
with self.clientsLock:
|
||||
self.clients.append(client)
|
||||
|
||||
def removeClient(self, client):
|
||||
with self.clientsLock:
|
||||
self.clients.remove(client)
|
||||
|
||||
def getClient(self, id):
|
||||
client = None
|
||||
with self.clientsLock:
|
||||
for c in self.clients:
|
||||
if str(c.id) == str(id):
|
||||
client = c
|
||||
break
|
||||
return client
|
||||
|
||||
def close(self):
|
||||
if not self.isStopped:
|
||||
self.isStopped = True
|
||||
|
||||
if hasattr(self, 'soc'):
|
||||
try:
|
||||
self.soc.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
with self.clientsLock:
|
||||
clientsCopy = self.clients[:]
|
||||
|
||||
for c in clientsCopy:
|
||||
c.close()
|
||||
|
||||
self.log('closed', Logger.LOG_INFO)
|
||||
|
||||
def log(self, msg, logLevel):
|
||||
msg = 'Server: ' + msg
|
||||
self.logger.printLog(msg, logLevel)
|
||||
|
||||
|
||||
|
||||
|
||||
def print_usage():
|
||||
print '\nUsage : python get.py -b listening -p pass'
|
||||
print 'Ex. : python get.py -b 0.0.0.0:80 -p pass123'
|
||||
print ' : python get.py -b 0.0.0.0:80 -p passFile.pwd\n'
|
||||
print '___Password file ex.:___'
|
||||
print PasswordSet.FILE_EXEMPLE
|
||||
|
||||
def parse_args(argv):
|
||||
global CONFIG_LISTENING
|
||||
global CONFIG_PASS
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(argv, "hb:p:", ["bind=", "pass="])
|
||||
except getopt.GetoptError:
|
||||
print_usage()
|
||||
sys.exit(2)
|
||||
for opt, arg in opts:
|
||||
if opt == '-h':
|
||||
print_usage()
|
||||
sys.exit()
|
||||
elif opt in ('-b', '--bind'):
|
||||
CONFIG_LISTENING = arg
|
||||
elif opt in ('-p', '--pass'):
|
||||
CONFIG_PASS = arg
|
||||
|
||||
def main():
|
||||
print '\n-->GetTunnelPy - Server v.' + '25/06/2017' + '\n'
|
||||
print '-->Listening: ' + CONFIG_LISTENING
|
||||
|
||||
pwdSet = None
|
||||
|
||||
if not CONFIG_PASS is None:
|
||||
if CONFIG_PASS.endswith('.pwd'):
|
||||
pwdSet = PasswordSet()
|
||||
|
||||
try:
|
||||
isValidFile = pwdSet.parseFile(CONFIG_PASS)
|
||||
except IOError as e:
|
||||
print '--#Error reading file: ' + str(type(e)) + ' - ' + str(e)
|
||||
sys.exit()
|
||||
|
||||
if not isValidFile:
|
||||
print '--#Error on parsing file!\n'
|
||||
print_usage()
|
||||
return
|
||||
|
||||
print '-->Pass file: ' + CONFIG_PASS + '\n'
|
||||
else:
|
||||
if (len(CONFIG_PASS) > 0):
|
||||
print '-->Pass : yes\n'
|
||||
pwdSet = PasswordSet(CONFIG_PASS)
|
||||
else:
|
||||
print '-->Pass : no\n'
|
||||
|
||||
server = Server(CONFIG_LISTENING)
|
||||
server.passwdSet = pwdSet
|
||||
server.start()
|
||||
|
||||
while True:
|
||||
try:
|
||||
time.sleep(2)
|
||||
except KeyboardInterrupt:
|
||||
print '<-> Stopping server...'
|
||||
server.running = False
|
||||
break
|
||||
|
||||
if __name__ == '__main__':
|
||||
parse_args(sys.argv[1:])
|
||||
main()
|
||||
313
Lista/POpen.py
Normal file
313
Lista/POpen.py
Normal file
@ -0,0 +1,313 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import httplib
|
||||
from SocketServer import ThreadingMixIn
|
||||
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
|
||||
from threading import Lock, Timer
|
||||
from cStringIO import StringIO
|
||||
from urlparse import urlsplit
|
||||
import socket
|
||||
import select
|
||||
import gzip
|
||||
import zlib
|
||||
import re
|
||||
import traceback
|
||||
|
||||
|
||||
class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
|
||||
|
||||
address_family = socket.AF_INET
|
||||
|
||||
def handle_error(self, request, client_address):
|
||||
|
||||
print >>sys.stderr, '-'*40
|
||||
print >>sys.stderr, 'Exception happened during processing of request from', client_address
|
||||
traceback.print_exc()
|
||||
print >>sys.stderr, '-'*40
|
||||
|
||||
|
||||
class ThreadingHTTPServer6(ThreadingHTTPServer):
|
||||
|
||||
address_family = socket.AF_INET6
|
||||
|
||||
|
||||
class SimpleHTTPProxyHandler(BaseHTTPRequestHandler):
|
||||
global_lock = Lock()
|
||||
conn_table = {}
|
||||
timeout = 300
|
||||
upstream_timeout = 300
|
||||
proxy_via = None
|
||||
|
||||
def log_error(self, format, *args):
|
||||
if format == "Request timed out: %r":
|
||||
return
|
||||
self.log_message(format, *args)
|
||||
|
||||
def do_CONNECT(self):
|
||||
|
||||
|
||||
req = self
|
||||
reqbody = None
|
||||
req.path = "https://%s/" % req.path.replace(':443', '')
|
||||
|
||||
replaced_reqbody = self.request_handler(req, reqbody)
|
||||
if replaced_reqbody is True:
|
||||
return
|
||||
|
||||
u = urlsplit(req.path)
|
||||
address = (u.hostname, u.port or 443)
|
||||
try:
|
||||
conn = socket.create_connection(address)
|
||||
except socket.error:
|
||||
return
|
||||
self.send_response(200, 'SOCKS5')
|
||||
self.send_header('Connection', 'close')
|
||||
self.end_headers()
|
||||
|
||||
conns = [self.connection, conn]
|
||||
keep_connection = True
|
||||
while keep_connection:
|
||||
keep_connection = False
|
||||
rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
|
||||
if xlist:
|
||||
break
|
||||
for r in rlist:
|
||||
other = conns[1] if r is conns[0] else conns[0]
|
||||
data = r.recv(8192)
|
||||
if data:
|
||||
other.sendall(data)
|
||||
keep_connection = True
|
||||
conn.close()
|
||||
|
||||
def do_HEAD(self):
|
||||
self.do_SPAM()
|
||||
|
||||
def do_GET(self):
|
||||
self.do_SPAM()
|
||||
|
||||
def do_POST(self):
|
||||
self.do_SPAM()
|
||||
|
||||
def do_SPAM(self):
|
||||
req = self
|
||||
content_length = int(req.headers.get('Content-Length', 0))
|
||||
if content_length > 0:
|
||||
reqbody = self.rfile.read(content_length)
|
||||
else:
|
||||
reqbody = None
|
||||
|
||||
replaced_reqbody = self.request_handler(req, reqbody)
|
||||
if replaced_reqbody is True:
|
||||
return
|
||||
elif replaced_reqbody is not None:
|
||||
reqbody = replaced_reqbody
|
||||
if 'Content-Length' in req.headers:
|
||||
req.headers['Content-Length'] = str(len(reqbody))
|
||||
|
||||
|
||||
self.remove_hop_by_hop_headers(req.headers)
|
||||
if self.upstream_timeout:
|
||||
req.headers['Connection'] = 'Keep-Alive'
|
||||
else:
|
||||
req.headers['Connection'] = 'close'
|
||||
if self.proxy_via:
|
||||
self.modify_via_header(req.headers)
|
||||
|
||||
try:
|
||||
res, resdata = self.request_to_upstream_server(req, reqbody)
|
||||
except socket.error:
|
||||
return
|
||||
|
||||
content_encoding = res.headers.get('Content-Encoding', 'identity')
|
||||
resbody = self.decode_content_body(resdata, content_encoding)
|
||||
|
||||
replaced_resbody = self.response_handler(req, reqbody, res, resbody)
|
||||
if replaced_resbody is True:
|
||||
return
|
||||
elif replaced_resbody is not None:
|
||||
resdata = self.encode_content_body(replaced_resbody, content_encoding)
|
||||
if 'Content-Length' in res.headers:
|
||||
res.headers['Content-Length'] = str(len(resdata))
|
||||
resbody = replaced_resbody
|
||||
|
||||
self.remove_hop_by_hop_headers(res.headers)
|
||||
if self.timeout:
|
||||
res.headers['Connection'] = 'Keep-Alive'
|
||||
else:
|
||||
res.headers['Connection'] = 'close'
|
||||
if self.proxy_via:
|
||||
self.modify_via_header(res.headers)
|
||||
|
||||
self.send_response(res.status, res.reason)
|
||||
for k, v in res.headers.items():
|
||||
if k == 'set-cookie':
|
||||
|
||||
for value in self.split_set_cookie_header(v):
|
||||
self.send_header(k, value)
|
||||
else:
|
||||
self.send_header(k, v)
|
||||
self.end_headers()
|
||||
|
||||
if self.command != 'HEAD':
|
||||
self.wfile.write(resdata)
|
||||
with self.global_lock:
|
||||
self.save_handler(req, reqbody, res, resbody)
|
||||
|
||||
def request_to_upstream_server(self, req, reqbody):
|
||||
u = urlsplit(req.path)
|
||||
origin = (u.scheme, u.netloc)
|
||||
|
||||
|
||||
req.headers['Host'] = u.netloc
|
||||
selector = "%s?%s" % (u.path, u.query) if u.query else u.path
|
||||
|
||||
while True:
|
||||
with self.lock_origin(origin):
|
||||
conn = self.open_origin(origin)
|
||||
try:
|
||||
conn.request(req.command, selector, reqbody, headers=dict(req.headers))
|
||||
except socket.error:
|
||||
|
||||
self.close_origin(origin)
|
||||
raise
|
||||
try:
|
||||
res = conn.getresponse(buffering=True)
|
||||
except httplib.BadStatusLine as e:
|
||||
if e.line == "''":
|
||||
|
||||
self.close_origin(origin)
|
||||
continue
|
||||
else:
|
||||
raise
|
||||
resdata = res.read()
|
||||
res.headers = res.msg
|
||||
if not self.upstream_timeout or 'close' in res.headers.get('Connection', ''):
|
||||
self.close_origin(origin)
|
||||
else:
|
||||
self.reset_timer(origin)
|
||||
return res, resdata
|
||||
|
||||
def lock_origin(self, origin):
|
||||
d = self.conn_table.setdefault(origin, {})
|
||||
if not 'lock' in d:
|
||||
d['lock'] = Lock()
|
||||
return d['lock']
|
||||
|
||||
def open_origin(self, origin):
|
||||
conn = self.conn_table[origin].get('connection')
|
||||
if not conn:
|
||||
scheme, netloc = origin
|
||||
if scheme == 'https':
|
||||
conn = httplib.HTTPSConnection(netloc)
|
||||
else:
|
||||
conn = httplib.HTTPConnection(netloc)
|
||||
self.reset_timer(origin)
|
||||
self.conn_table[origin]['connection'] = conn
|
||||
return conn
|
||||
|
||||
def reset_timer(self, origin):
|
||||
timer = self.conn_table[origin].get('timer')
|
||||
if timer:
|
||||
timer.cancel()
|
||||
if self.upstream_timeout:
|
||||
timer = Timer(self.upstream_timeout, self.close_origin, args=[origin])
|
||||
timer.daemon = True
|
||||
timer.start()
|
||||
else:
|
||||
timer = None
|
||||
self.conn_table[origin]['timer'] = timer
|
||||
|
||||
def close_origin(self, origin):
|
||||
timer = self.conn_table[origin]['timer']
|
||||
if timer:
|
||||
timer.cancel()
|
||||
conn = self.conn_table[origin]['connection']
|
||||
conn.close()
|
||||
del self.conn_table[origin]['connection']
|
||||
|
||||
def remove_hop_by_hop_headers(self, headers):
|
||||
hop_by_hop_headers = ['Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', 'TE', 'Trailers', 'Trailer', 'Transfer-Encoding', 'Upgrade']
|
||||
connection = headers.get('Connection')
|
||||
if connection:
|
||||
keys = re.split(r',\s*', connection)
|
||||
hop_by_hop_headers.extend(keys)
|
||||
|
||||
for k in hop_by_hop_headers:
|
||||
if k in headers:
|
||||
del headers[k]
|
||||
|
||||
def modify_via_header(self, headers):
|
||||
via_string = "%s %s" % (self.protocol_version, self.proxy_via)
|
||||
via_string = re.sub(r'^HTTP/', '', via_string)
|
||||
|
||||
original = headers.get('Via')
|
||||
if original:
|
||||
headers['Via'] = original + ', ' + via_string
|
||||
else:
|
||||
headers['Via'] = via_string
|
||||
|
||||
def decode_content_body(self, data, content_encoding):
|
||||
if content_encoding in ('gzip', 'x-gzip'):
|
||||
io = StringIO(data)
|
||||
with gzip.GzipFile(fileobj=io) as f:
|
||||
body = f.read()
|
||||
elif content_encoding == 'deflate':
|
||||
body = zlib.decompress(data)
|
||||
elif content_encoding == 'identity':
|
||||
body = data
|
||||
else:
|
||||
raise Exception("Unknown Content-Encoding: %s" % content_encoding)
|
||||
return body
|
||||
|
||||
def encode_content_body(self, body, content_encoding):
|
||||
if content_encoding in ('gzip', 'x-gzip'):
|
||||
io = StringIO()
|
||||
with gzip.GzipFile(fileobj=io, mode='wb') as f:
|
||||
f.write(body)
|
||||
data = io.getvalue()
|
||||
elif content_encoding == 'deflate':
|
||||
data = zlib.compress(body)
|
||||
elif content_encoding == 'identity':
|
||||
data = body
|
||||
else:
|
||||
raise Exception("Unknown Content-Encoding: %s" % content_encoding)
|
||||
return data
|
||||
|
||||
def split_set_cookie_header(self, value):
|
||||
re_cookies = r'([^=]+=[^,;]+(?:;\s*Expires=[^,]+,[^,;]+|;[^,;]+)*)(?:,\s*)?'
|
||||
return re.findall(re_cookies, value, flags=re.IGNORECASE)
|
||||
|
||||
def request_handler(self, req, reqbody):
|
||||
|
||||
pass
|
||||
|
||||
def response_handler(self, req, reqbody, res, resbody):
|
||||
|
||||
pass
|
||||
|
||||
def save_handler(self, req, reqbody, res, resbody):
|
||||
|
||||
pass
|
||||
|
||||
|
||||
# Port
|
||||
|
||||
def test(HandlerClass=SimpleHTTPProxyHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
|
||||
if sys.argv[1:]:
|
||||
port = int(sys.argv[1])
|
||||
else:
|
||||
port = 80
|
||||
server_address = ('', port)
|
||||
|
||||
HandlerClass.protocol_version = protocol
|
||||
httpd = ServerClass(server_address, HandlerClass)
|
||||
|
||||
sa = httpd.socket.getsockname()
|
||||
print "Serving HTTP on", sa[0], "port", sa[1], "..."
|
||||
httpd.serve_forever()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
|
||||
335
Lista/PPriv.py
Normal file
335
Lista/PPriv.py
Normal file
@ -0,0 +1,335 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
# Edit By GlEmYsSoN & @e8th4ever
|
||||
|
||||
from pprint import pprint
|
||||
import sys
|
||||
import http.client
|
||||
from socketserver import ThreadingMixIn
|
||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||
from threading import Lock, Timer
|
||||
from io import StringIO
|
||||
from urllib.parse import urlsplit
|
||||
import socket
|
||||
import select
|
||||
import gzip
|
||||
import zlib
|
||||
import re
|
||||
import traceback
|
||||
import subprocess
|
||||
subprocess.call("clear",shell=True)
|
||||
|
||||
if sys.argv[2:]:
|
||||
msg1 = sys.argv[2]
|
||||
else:
|
||||
msg1 = 'ADM-ULTIMATE'
|
||||
|
||||
if sys.argv[3:]:
|
||||
server = sys.argv[3]
|
||||
else:
|
||||
server = "127.0.0.1"
|
||||
|
||||
msg2 = 'Server Forbidden'
|
||||
|
||||
class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
|
||||
|
||||
address_family = socket.AF_INET
|
||||
|
||||
def handle_error(self, request, client_address):
|
||||
|
||||
print('-'*40, file=sys.stderr)
|
||||
print('Exception happened during processing of request from', client_address, file=sys.stderr)
|
||||
traceback.print_exc()
|
||||
print('-'*40, file=sys.stderr)
|
||||
|
||||
|
||||
class ThreadingHTTPServer6(ThreadingHTTPServer):
|
||||
|
||||
address_family = socket.AF_INET6
|
||||
|
||||
|
||||
class SimpleHTTPProxyHandler(BaseHTTPRequestHandler):
|
||||
global_lock = Lock()
|
||||
conn_table = {}
|
||||
timeout = 300
|
||||
upstream_timeout = 300
|
||||
proxy_via = None
|
||||
|
||||
def log_error(self, format, *args):
|
||||
if format == "Request timed out: %r":
|
||||
return
|
||||
self.log_message(format, *args)
|
||||
|
||||
def do_CONNECT(self):
|
||||
|
||||
req = self
|
||||
reqbody = None
|
||||
if ':22' in req.path:
|
||||
hostip = req.path.replace(':22', '')
|
||||
elif ':443' in req.path:
|
||||
hostip = req.path.replace(':443', '')
|
||||
req.path = "https://%s/" % req.path.replace(':443', '')
|
||||
|
||||
replaced_reqbody = self.request_handler(req, reqbody)
|
||||
if replaced_reqbody is True:
|
||||
return
|
||||
|
||||
u = urlsplit(req.path)
|
||||
address = (u.hostname, u.port or 443)
|
||||
try:
|
||||
conn = socket.create_connection(address)
|
||||
except socket.error:
|
||||
return
|
||||
|
||||
self.send_response(200, msg1)
|
||||
self.send_header('Connection', 'close')
|
||||
self.end_headers()
|
||||
|
||||
conns = [self.connection, conn]
|
||||
keep_connection = True
|
||||
while keep_connection:
|
||||
if not server.find(hostip) != -1:
|
||||
self.send_error(403, msg2)
|
||||
self.close_connection
|
||||
keep_connection = False
|
||||
rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
|
||||
if xlist:
|
||||
break
|
||||
for r in rlist:
|
||||
other = conns[1] if r is conns[0] else conns[0]
|
||||
data = r.recv(8192)
|
||||
if data:
|
||||
other.sendall(data)
|
||||
keep_connection = True
|
||||
conn.close()
|
||||
|
||||
def do_HEAD(self):
|
||||
self.do_SPAM()
|
||||
|
||||
def do_GET(self):
|
||||
self.do_SPAM()
|
||||
|
||||
def do_POST(self):
|
||||
self.do_SPAM()
|
||||
|
||||
def do_SPAM(self):
|
||||
req = self
|
||||
|
||||
content_length = int(req.headers.get('Content-Length', 0))
|
||||
if content_length > 0:
|
||||
reqbody = self.rfile.read(content_length)
|
||||
else:
|
||||
reqbody = None
|
||||
|
||||
replaced_reqbody = self.request_handler(req, reqbody)
|
||||
if replaced_reqbody is True:
|
||||
return
|
||||
elif replaced_reqbody is not None:
|
||||
reqbody = replaced_reqbody
|
||||
if 'Content-Length' in req.headers:
|
||||
req.headers['Content-Length'] = str(len(reqbody))
|
||||
|
||||
|
||||
self.remove_hop_by_hop_headers(req.headers)
|
||||
if self.upstream_timeout:
|
||||
req.headers['Connection'] = 'Keep-Alive'
|
||||
else:
|
||||
req.headers['Connection'] = 'close'
|
||||
if self.proxy_via:
|
||||
self.modify_via_header(req.headers)
|
||||
|
||||
try:
|
||||
res, resdata = self.request_to_upstream_server(req, reqbody)
|
||||
except socket.error:
|
||||
return
|
||||
|
||||
content_encoding = res.headers.get('Content-Encoding', 'identity')
|
||||
resbody = self.decode_content_body(resdata, content_encoding)
|
||||
|
||||
replaced_resbody = self.response_handler(req, reqbody, res, resbody)
|
||||
if replaced_resbody is True:
|
||||
return
|
||||
elif replaced_resbody is not None:
|
||||
resdata = self.encode_content_body(replaced_resbody, content_encoding)
|
||||
if 'Content-Length' in res.headers:
|
||||
res.headers['Content-Length'] = str(len(resdata))
|
||||
resbody = replaced_resbody
|
||||
|
||||
self.remove_hop_by_hop_headers(res.headers)
|
||||
if self.timeout:
|
||||
res.headers['Connection'] = 'Keep-Alive'
|
||||
else:
|
||||
res.headers['Connection'] = 'close'
|
||||
if self.proxy_via:
|
||||
self.modify_via_header(res.headers)
|
||||
|
||||
self.send_response(res.status, res.reason)
|
||||
for k, v in list(res.headers.items()):
|
||||
if k == 'set-cookie':
|
||||
|
||||
for value in self.split_set_cookie_header(v):
|
||||
self.send_header(k, value)
|
||||
else:
|
||||
self.send_header(k, v)
|
||||
self.end_headers()
|
||||
|
||||
if self.command != 'HEAD':
|
||||
self.wfile.write(resdata)
|
||||
with self.global_lock:
|
||||
self.save_handler(req, reqbody, res, resbody)
|
||||
|
||||
def request_to_upstream_server(self, req, reqbody):
|
||||
u = urlsplit(req.path)
|
||||
|
||||
origin = (u.scheme, u.netloc)
|
||||
|
||||
|
||||
req.headers['Host'] = u.netloc
|
||||
selector = "%s?%s" % (u.path, u.query) if u.query else u.path
|
||||
|
||||
while True:
|
||||
with self.lock_origin(origin):
|
||||
conn = self.open_origin(origin)
|
||||
try:
|
||||
conn.request(req.command, selector, reqbody, headers=dict(req.headers))
|
||||
except socket.error:
|
||||
|
||||
self.close_origin(origin)
|
||||
raise
|
||||
try:
|
||||
res = conn.getresponse(buffering=True)
|
||||
except http.client.BadStatusLine as e:
|
||||
if e.line == "''":
|
||||
|
||||
self.close_origin(origin)
|
||||
continue
|
||||
else:
|
||||
raise
|
||||
resdata = res.read()
|
||||
res.headers = res.msg
|
||||
if not self.upstream_timeout or 'close' in res.headers.get('Connection', ''):
|
||||
self.close_origin(origin)
|
||||
else:
|
||||
self.reset_timer(origin)
|
||||
return res, resdata
|
||||
|
||||
def lock_origin(self, origin):
|
||||
d = self.conn_table.setdefault(origin, {})
|
||||
if not 'lock' in d:
|
||||
d['lock'] = Lock()
|
||||
return d['lock']
|
||||
|
||||
def open_origin(self, origin):
|
||||
conn = self.conn_table[origin].get('connection')
|
||||
if not conn:
|
||||
scheme, netloc = origin
|
||||
if scheme == 'https':
|
||||
conn = http.client.HTTPSConnection(netloc)
|
||||
else:
|
||||
conn = http.client.HTTPConnection(netloc)
|
||||
self.reset_timer(origin)
|
||||
self.conn_table[origin]['connection'] = conn
|
||||
return conn
|
||||
|
||||
def reset_timer(self, origin):
|
||||
timer = self.conn_table[origin].get('timer')
|
||||
if timer:
|
||||
timer.cancel()
|
||||
if self.upstream_timeout:
|
||||
timer = Timer(self.upstream_timeout, self.close_origin, args=[origin])
|
||||
timer.daemon = True
|
||||
timer.start()
|
||||
else:
|
||||
timer = None
|
||||
self.conn_table[origin]['timer'] = timer
|
||||
|
||||
def close_origin(self, origin):
|
||||
timer = self.conn_table[origin]['timer']
|
||||
if timer:
|
||||
timer.cancel()
|
||||
conn = self.conn_table[origin]['connection']
|
||||
conn.close()
|
||||
del self.conn_table[origin]['connection']
|
||||
|
||||
def remove_hop_by_hop_headers(self, headers):
|
||||
hop_by_hop_headers = ['Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', 'TE', 'Trailers', 'Trailer', 'Transfer-Encoding', 'Upgrade']
|
||||
connection = headers.get('Connection')
|
||||
if connection:
|
||||
keys = re.split(r',\s*', connection)
|
||||
hop_by_hop_headers.extend(keys)
|
||||
|
||||
for k in hop_by_hop_headers:
|
||||
if k in headers:
|
||||
del headers[k]
|
||||
|
||||
def modify_via_header(self, headers):
|
||||
via_string = "%s %s" % (self.protocol_version, self.proxy_via)
|
||||
via_string = re.sub(r'^HTTP/', '', via_string)
|
||||
|
||||
original = headers.get('Via')
|
||||
if original:
|
||||
headers['Via'] = original + ', ' + via_string
|
||||
else:
|
||||
headers['Via'] = via_string
|
||||
|
||||
def decode_content_body(self, data, content_encoding):
|
||||
if content_encoding in ('gzip', 'x-gzip'):
|
||||
io = StringIO(data)
|
||||
with gzip.GzipFile(fileobj=io) as f:
|
||||
body = f.read()
|
||||
elif content_encoding == 'deflate':
|
||||
body = zlib.decompress(data)
|
||||
elif content_encoding == 'identity':
|
||||
body = data
|
||||
else:
|
||||
raise Exception("Unknown Content-Encoding: %s" % content_encoding)
|
||||
return body
|
||||
|
||||
def encode_content_body(self, body, content_encoding):
|
||||
if content_encoding in ('gzip', 'x-gzip'):
|
||||
io = StringIO()
|
||||
with gzip.GzipFile(fileobj=io, mode='wb') as f:
|
||||
f.write(body)
|
||||
data = io.getvalue()
|
||||
elif content_encoding == 'deflate':
|
||||
data = zlib.compress(body)
|
||||
elif content_encoding == 'identity':
|
||||
data = body
|
||||
else:
|
||||
raise Exception("Unknown Content-Encoding: %s" % content_encoding)
|
||||
return data
|
||||
|
||||
def split_set_cookie_header(self, value):
|
||||
re_cookies = r'([^=]+=[^,;]+(?:;\s*Expires=[^,]+,[^,;]+|;[^,;]+)*)(?:,\s*)?'
|
||||
return re.findall(re_cookies, value, flags=re.IGNORECASE)
|
||||
|
||||
def request_handler(self, req, reqbody):
|
||||
|
||||
pass
|
||||
|
||||
def response_handler(self, req, reqbody, res, resbody):
|
||||
|
||||
pass
|
||||
|
||||
def save_handler(self, req, reqbody, res, resbody):
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
def test(HandlerClass=SimpleHTTPProxyHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
|
||||
port = int(sys.argv[1])
|
||||
server_address = ('', port)
|
||||
|
||||
HandlerClass.protocol_version = protocol
|
||||
httpd = ServerClass(server_address, HandlerClass)
|
||||
|
||||
sa = httpd.socket.getsockname()
|
||||
print("Servidor: " + str(sa[0]) + " Porta " + str(sa[1]))
|
||||
httpd.serve_forever()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
318
Lista/PPub.py
Normal file
318
Lista/PPub.py
Normal file
@ -0,0 +1,318 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import httplib
|
||||
from SocketServer import ThreadingMixIn
|
||||
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
|
||||
from threading import Lock, Timer
|
||||
from cStringIO import StringIO
|
||||
from urlparse import urlsplit
|
||||
import socket
|
||||
import select
|
||||
import gzip
|
||||
import zlib
|
||||
import re
|
||||
import traceback
|
||||
|
||||
if sys.argv[2:]:
|
||||
msg1 = sys.argv[2]
|
||||
else:
|
||||
msg1 = "ADM-ULTIMATE"
|
||||
|
||||
|
||||
class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
|
||||
|
||||
address_family = socket.AF_INET
|
||||
|
||||
def handle_error(self, request, client_address):
|
||||
|
||||
print >>sys.stderr, '-'*40
|
||||
print >>sys.stderr, 'Exception happened during processing of request from', client_address
|
||||
traceback.print_exc()
|
||||
print >>sys.stderr, '-'*40
|
||||
|
||||
|
||||
class ThreadingHTTPServer6(ThreadingHTTPServer):
|
||||
|
||||
address_family = socket.AF_INET6
|
||||
|
||||
|
||||
class SimpleHTTPProxyHandler(BaseHTTPRequestHandler):
|
||||
global_lock = Lock()
|
||||
conn_table = {}
|
||||
timeout = 300
|
||||
upstream_timeout = 300
|
||||
proxy_via = None
|
||||
|
||||
def log_error(self, format, *args):
|
||||
if format == "Request timed out: %r":
|
||||
return
|
||||
self.log_message(format, *args)
|
||||
|
||||
def do_CONNECT(self):
|
||||
|
||||
|
||||
req = self
|
||||
reqbody = None
|
||||
req.path = "https://%s/" % req.path.replace(':443', '')
|
||||
|
||||
replaced_reqbody = self.request_handler(req, reqbody)
|
||||
if replaced_reqbody is True:
|
||||
return
|
||||
|
||||
u = urlsplit(req.path)
|
||||
address = (u.hostname, u.port or 443)
|
||||
try:
|
||||
conn = socket.create_connection(address)
|
||||
except socket.error:
|
||||
return
|
||||
self.send_response(200, msg1)
|
||||
self.send_header('Connection', 'close')
|
||||
self.end_headers()
|
||||
|
||||
conns = [self.connection, conn]
|
||||
keep_connection = True
|
||||
while keep_connection:
|
||||
keep_connection = False
|
||||
rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
|
||||
if xlist:
|
||||
break
|
||||
for r in rlist:
|
||||
other = conns[1] if r is conns[0] else conns[0]
|
||||
data = r.recv(8192)
|
||||
if data:
|
||||
other.sendall(data)
|
||||
keep_connection = True
|
||||
conn.close()
|
||||
|
||||
def do_HEAD(self):
|
||||
self.do_SPAM()
|
||||
|
||||
def do_GET(self):
|
||||
self.do_SPAM()
|
||||
|
||||
def do_POST(self):
|
||||
self.do_SPAM()
|
||||
|
||||
def do_SPAM(self):
|
||||
req = self
|
||||
content_length = int(req.headers.get('Content-Length', 0))
|
||||
if content_length > 0:
|
||||
reqbody = self.rfile.read(content_length)
|
||||
else:
|
||||
reqbody = None
|
||||
|
||||
replaced_reqbody = self.request_handler(req, reqbody)
|
||||
if replaced_reqbody is True:
|
||||
return
|
||||
elif replaced_reqbody is not None:
|
||||
reqbody = replaced_reqbody
|
||||
if 'Content-Length' in req.headers:
|
||||
req.headers['Content-Length'] = str(len(reqbody))
|
||||
|
||||
|
||||
self.remove_hop_by_hop_headers(req.headers)
|
||||
if self.upstream_timeout:
|
||||
req.headers['Connection'] = 'Keep-Alive'
|
||||
else:
|
||||
req.headers['Connection'] = 'close'
|
||||
if self.proxy_via:
|
||||
self.modify_via_header(req.headers)
|
||||
|
||||
try:
|
||||
res, resdata = self.request_to_upstream_server(req, reqbody)
|
||||
except socket.error:
|
||||
return
|
||||
|
||||
content_encoding = res.headers.get('Content-Encoding', 'identity')
|
||||
resbody = self.decode_content_body(resdata, content_encoding)
|
||||
|
||||
replaced_resbody = self.response_handler(req, reqbody, res, resbody)
|
||||
if replaced_resbody is True:
|
||||
return
|
||||
elif replaced_resbody is not None:
|
||||
resdata = self.encode_content_body(replaced_resbody, content_encoding)
|
||||
if 'Content-Length' in res.headers:
|
||||
res.headers['Content-Length'] = str(len(resdata))
|
||||
resbody = replaced_resbody
|
||||
|
||||
self.remove_hop_by_hop_headers(res.headers)
|
||||
if self.timeout:
|
||||
res.headers['Connection'] = 'Keep-Alive'
|
||||
else:
|
||||
res.headers['Connection'] = 'close'
|
||||
if self.proxy_via:
|
||||
self.modify_via_header(res.headers)
|
||||
|
||||
self.send_response(res.status, res.reason)
|
||||
for k, v in res.headers.items():
|
||||
if k == 'set-cookie':
|
||||
|
||||
for value in self.split_set_cookie_header(v):
|
||||
self.send_header(k, value)
|
||||
else:
|
||||
self.send_header(k, v)
|
||||
self.end_headers()
|
||||
|
||||
if self.command != 'HEAD':
|
||||
self.wfile.write(resdata)
|
||||
with self.global_lock:
|
||||
self.save_handler(req, reqbody, res, resbody)
|
||||
|
||||
def request_to_upstream_server(self, req, reqbody):
|
||||
u = urlsplit(req.path)
|
||||
origin = (u.scheme, u.netloc)
|
||||
|
||||
|
||||
req.headers['Host'] = u.netloc
|
||||
selector = "%s?%s" % (u.path, u.query) if u.query else u.path
|
||||
|
||||
while True:
|
||||
with self.lock_origin(origin):
|
||||
conn = self.open_origin(origin)
|
||||
try:
|
||||
conn.request(req.command, selector, reqbody, headers=dict(req.headers))
|
||||
except socket.error:
|
||||
|
||||
self.close_origin(origin)
|
||||
raise
|
||||
try:
|
||||
res = conn.getresponse(buffering=True)
|
||||
except httplib.BadStatusLine as e:
|
||||
if e.line == "''":
|
||||
|
||||
self.close_origin(origin)
|
||||
continue
|
||||
else:
|
||||
raise
|
||||
resdata = res.read()
|
||||
res.headers = res.msg
|
||||
if not self.upstream_timeout or 'close' in res.headers.get('Connection', ''):
|
||||
self.close_origin(origin)
|
||||
else:
|
||||
self.reset_timer(origin)
|
||||
return res, resdata
|
||||
|
||||
def lock_origin(self, origin):
|
||||
d = self.conn_table.setdefault(origin, {})
|
||||
if not 'lock' in d:
|
||||
d['lock'] = Lock()
|
||||
return d['lock']
|
||||
|
||||
def open_origin(self, origin):
|
||||
conn = self.conn_table[origin].get('connection')
|
||||
if not conn:
|
||||
scheme, netloc = origin
|
||||
if scheme == 'https':
|
||||
conn = httplib.HTTPSConnection(netloc)
|
||||
else:
|
||||
conn = httplib.HTTPConnection(netloc)
|
||||
self.reset_timer(origin)
|
||||
self.conn_table[origin]['connection'] = conn
|
||||
return conn
|
||||
|
||||
def reset_timer(self, origin):
|
||||
timer = self.conn_table[origin].get('timer')
|
||||
if timer:
|
||||
timer.cancel()
|
||||
if self.upstream_timeout:
|
||||
timer = Timer(self.upstream_timeout, self.close_origin, args=[origin])
|
||||
timer.daemon = True
|
||||
timer.start()
|
||||
else:
|
||||
timer = None
|
||||
self.conn_table[origin]['timer'] = timer
|
||||
|
||||
def close_origin(self, origin):
|
||||
timer = self.conn_table[origin]['timer']
|
||||
if timer:
|
||||
timer.cancel()
|
||||
conn = self.conn_table[origin]['connection']
|
||||
conn.close()
|
||||
del self.conn_table[origin]['connection']
|
||||
|
||||
def remove_hop_by_hop_headers(self, headers):
|
||||
hop_by_hop_headers = ['Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', 'TE', 'Trailers', 'Trailer', 'Transfer-Encoding', 'Upgrade']
|
||||
connection = headers.get('Connection')
|
||||
if connection:
|
||||
keys = re.split(r',\s*', connection)
|
||||
hop_by_hop_headers.extend(keys)
|
||||
|
||||
for k in hop_by_hop_headers:
|
||||
if k in headers:
|
||||
del headers[k]
|
||||
|
||||
def modify_via_header(self, headers):
|
||||
via_string = "%s %s" % (self.protocol_version, self.proxy_via)
|
||||
via_string = re.sub(r'^HTTP/', '', via_string)
|
||||
|
||||
original = headers.get('Via')
|
||||
if original:
|
||||
headers['Via'] = original + ', ' + via_string
|
||||
else:
|
||||
headers['Via'] = via_string
|
||||
|
||||
def decode_content_body(self, data, content_encoding):
|
||||
if content_encoding in ('gzip', 'x-gzip'):
|
||||
io = StringIO(data)
|
||||
with gzip.GzipFile(fileobj=io) as f:
|
||||
body = f.read()
|
||||
elif content_encoding == 'deflate':
|
||||
body = zlib.decompress(data)
|
||||
elif content_encoding == 'identity':
|
||||
body = data
|
||||
else:
|
||||
raise Exception("Unknown Content-Encoding: %s" % content_encoding)
|
||||
return body
|
||||
|
||||
def encode_content_body(self, body, content_encoding):
|
||||
if content_encoding in ('gzip', 'x-gzip'):
|
||||
io = StringIO()
|
||||
with gzip.GzipFile(fileobj=io, mode='wb') as f:
|
||||
f.write(body)
|
||||
data = io.getvalue()
|
||||
elif content_encoding == 'deflate':
|
||||
data = zlib.compress(body)
|
||||
elif content_encoding == 'identity':
|
||||
data = body
|
||||
else:
|
||||
raise Exception("Unknown Content-Encoding: %s" % content_encoding)
|
||||
return data
|
||||
|
||||
def split_set_cookie_header(self, value):
|
||||
re_cookies = r'([^=]+=[^,;]+(?:;\s*Expires=[^,]+,[^,;]+|;[^,;]+)*)(?:,\s*)?'
|
||||
return re.findall(re_cookies, value, flags=re.IGNORECASE)
|
||||
|
||||
def request_handler(self, req, reqbody):
|
||||
|
||||
pass
|
||||
|
||||
def response_handler(self, req, reqbody, res, resbody):
|
||||
|
||||
pass
|
||||
|
||||
def save_handler(self, req, reqbody, res, resbody):
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
def test(HandlerClass=SimpleHTTPProxyHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
|
||||
if sys.argv[1:]:
|
||||
port = int(sys.argv[1])
|
||||
else:
|
||||
port = 8799
|
||||
server_address = ('', port)
|
||||
|
||||
HandlerClass.protocol_version = protocol
|
||||
httpd = ServerClass(server_address, HandlerClass)
|
||||
|
||||
sa = httpd.socket.getsockname()
|
||||
print "Serving HTTP on", sa[0], "port", sa[1], "..."
|
||||
httpd.serve_forever()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
|
||||
2
Lista/cabecalho
Executable file
2
Lista/cabecalho
Executable file
File diff suppressed because one or more lines are too long
2
Lista/ferramentas
Executable file
2
Lista/ferramentas
Executable file
File diff suppressed because one or more lines are too long
2
Lista/menu
Executable file
2
Lista/menu
Executable file
File diff suppressed because one or more lines are too long
1
Lista/menu_credito
Normal file
1
Lista/menu_credito
Normal file
@ -0,0 +1 @@
|
||||
✧ | ᴅʀᴏᴡᴋɪᴅ | ✧
|
||||
2
Lista/menu_inst
Executable file
2
Lista/menu_inst
Executable file
File diff suppressed because one or more lines are too long
755
Lista/payloads
Normal file
755
Lista/payloads
Normal file
@ -0,0 +1,755 @@
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
|
||||
[auth][auth]get http://ssh.proxy.ip/<ponte_conection_>mhost/
|
||||
User-Agent: YES
|
||||
[lf][raw][method] mhost:443 HTTP/1.1
|
||||
Proxy-Authorization: Keep-Alive
|
||||
Connection: Close
|
||||
[realData][crlf]get mhost/ HTTP/1.1[crlf]CONNECT mhost[crlf][crlf][delay_split][auth][auth][auth][auth]GET mhost/ HTTP/1.1[crlf][method] mhost[crlf][crlf][delay_split]GET mhost/ HTTP/1.1[crlf][method] mhost[crlf][crlf][delay_split]GET mhost/ HTTP/1.1[crlf][method] mhost[crlf][crlf][delay_split]GET mhost/ HTTP/1.1[crlf][method] ecob.claro.com.br[crlf][crlf][delay_split]get mhost/ HTTP/1.1[crlf][method] mhost[crlf][crlf][delay_split]GET http://ecob.claro.com.br/ HTTP/1.1
|
||||
User-Agent: YES
|
||||
[lf][raw][method] mhost:443 HTTP/1.1
|
||||
Proxy-Authorization: Keep-Alive
|
||||
Connection: Close
|
||||
[realData][crlf]get mhost/ HTTP/1.1[crlf]CONNECT ecob.claro.com.br[crlf][crlf][delay_split]
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
|
||||
[auth][auth][auth][auth]get http://mhost/ HTTP/1.1[crlf][method] mhost[crlf][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf][method] mhost[crlf][crlf][delay_split]GET http://mhost/<ponte_conection_>mhost/ HTTP/1.1[crlf][method] mhost[crlf][crlf][delay_split]get http://mhost/<ponte_conection_>mhost/ HTTP/1.1[crlf][method] mhost[crlf][crlf][delay_split]GET http://mhost/<ponte_conection_>mhost/ HTTP/1.1[crlf][method] mhost[crlf][crlf][delay_split]GET http://mhost/ HTTP/1.1
|
||||
User-Agent: YES
|
||||
[lf][raw][method] mhost:443 HTTP/1.1
|
||||
Proxy-Authorization: Keep-Alive
|
||||
Connection: Close
|
||||
[realData][crlf][auth][auth][auth][auth][auth][auth][auth][auth][auth][auth][auth][lf]
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get http://mhost/ HTTP/1.1
|
||||
User-Agent: [ua][crlf][host][crlf][crlf][split]CONNECT ip da. Vps :443 HTTP/1.0[crlf][crlf]CONNECT mhost:443 HTTP/1.1[crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf]GET http://mhost/ HTTP/1.0
|
||||
Host: mhost
|
||||
Proxy-Authorization: basic: mhost
|
||||
User-Agent: [ua]
|
||||
Connection: close
|
||||
Proxy-Connection: Keep-Alive [crlf][host][crlf][crlf][split]CONNECT [host_port] HTTP/1.0[crlf][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost/[crlf][host][crlf][crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf][realData][crlf][crlf][crlf]
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
[method] mhost:443 HTTP/1.1[lf]CONNECT [host_port] [protocol][lf][lf]GET http://mhost/ HTTP/1.1\nHost: mhost\nConnection: close\nConnection: close\nUser-Agent:[ua][lf]Proxy-Connection: Keep-Alive[lf][host][crlf][lf][delay_split]CONNECT [host_port] [protocol][lf][lf]CONNECT [host_port] [protocol][crlf][realData][crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[lf]User-Agent: KDDI[lf][host][lf][lf][lf][raw]CONNECT [host_port] [protocol][lf]CONNECT [ssh] HTTP/1.1[lf]CONNECT [host_port] [protocol][lf][lf]DELETE http://mhost/HTTP/1.1[lf]Host: m.opera.com[lf]Proxy-Authorization: basic: *[lf]User-Agent: KDDI[lf]Connection: close[lf]Proxy-Connection: Direct[lf][host][lf][lf][raw]CONNECT [host_port] [protocol][lf][lf][lf][raw][method] http://mhost[port] HTTP/1.1[lf]Host: [auth][lf][host][lf][lf]CONNECT [host] [protocol][lf][lf][raw]CONNECT [host] [protocol][lf][lf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][lf]__[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][lf]__[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][lf]__[crlf]X-Online-Host: mhost[crlf]Packet Length: Authorization[crlf]Packet Content: Authorization[crlf]Transfer-Encoding: chunked[crlf]Referer: mhost[lf]__[crlf]
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
|
||||
[lf][lf]CONNECT [host_port]@mhost [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][lf][host]@mhost [protocol][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
|
||||
[immutable][method] [host_port] [delay_split]GET http://mhost HTTP/1.1[netData][crlf]HTTP:mip:80[crlf]X-GreenArrow-MtaID: smtp1-1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.0[crlf][split]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
[method] [host_port]?[split]GET http://mhost:8080/[crlf][crlf]get [host_port]?[split]OPTIONS http://mhost/[crlf]Connection: Keep-Alive[crlf]User-Agent: Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0[crlf]CONNECT [host_port] [crlf]GET [host_port]?[split]get http://mhost/[crlf][crlf][method] mip:80[split]GET mhost/[crlf][crlf]: Cache-Control:no-store,no-cache,must-revalidate,post-check=0,pre-check=0[crlf]Connection:close[crlf]CONNECT [host_port]?[split]GET http://mhost:/[crlf][crlf]POST [host_port]?[split]GET
|
||||
mhost:/[crlf]Content-Length: 999999999\r\n\r\n
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
CONNECT [host_port] [protocol][crlf][delay_split]get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Referer: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol][crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port]GET http://mhost/ [protocol][lf][split]get mhost/ HTTP/1.1[lf][lf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port]get http://mhost/ [protocol][lf][split]GET http://mhost/ HTTP/1.1[lf]Host: navegue.vivo.ddivulga.com/pacote[lf][host_port]get http://mhost/ [protocol][lf][split]GET http://mhost/ HTTP/1.1[lf]Host: mhost[lf][host_port]GET http://mhost/ [protocol][lf][split]get http://mhost/ HTTP/1.1[lf]Host: mhost[lf][host_port]GET http://mhost/ [protocol][lf][split]get http://mhost/ HTTP/1.1[lf]Host: mhost[lf][host_port]GET http://mhost/ [protocol][lf][split]CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost/[crlf]GET mhost/ HTTP/1.1[crlf]HEAD mhost HTTP/1.1[crlf]TRACE mhost HTTP/1.1[crlf]OPTIONS mhost HTTP/1.1[crlf]PATCH mhost/ HTTP/1.1[crlf]PROPATCH mhost/ HTTP/1.1[crlf]DELETE mhost HTTP/1.1[crlf]PUT mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]Host: mhost/[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]X-Forwarded-For: mhost[protocol][crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port][split]get http://mhost HTTP/1.1[crlf]Host: mhost/[crlf]X-Forward-Host: mhost/[crlf]Connection: Keep-Alive[crlf]Connection: Close[crlf]User-Agent: [ua][crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port][split]get mhost/ HTTP/1.1[crlf] [crlf][immutable]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port] [split]get http://mhost/ EHTTP/1.1 200 OK[crlf]HTTP Host: speedtest.net;m.whatsapp.com;sonymobile.com.br;caixa.sp.gov;mhost.co.id;vivo.com.br;[crlf]Forwarded-For: m.whatsapp.com/speedtest.bet[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][instant_split]get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Online-Host: mhost[crlf]ping-server: www.google.com[crlf]Connection: Close[crlf]Bandwith-Speed: 10GBps,lock,Keep-Alive[crlf]User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)[crlf][crlf]ping m.facebook.com[crlf]Content-Type: text/html; charset=utf-8X-[crlf]Content-Type: OptionsnosniffAccess-Control-Allow-Credentialstrueaccess-control-allow[split][method] OPTIONSExpiresSat, 01 Jan 2000 00:00:00 GMT0„2(6317d ago)X-FB-Debug1d4XXullTOxJZaZVk8PkrdpTcsyCcqDpHzZ6bFycC+ELii5hc8/lFzWhQ98EO/Cq2VJDnK2l5VTKEJISC++PbQ[crlf]Connection: close[crlf]Connection: Keep-Alive[crlf]Content-Length: 999999999999[crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port]@mhost [instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]get mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port] [protocol][crlf][crlf][immutable]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port][split]GET mhost/ HTTP/1.1[crlf][crlf][immutable]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port]@mhost/ [instant_split]get http://mhost/ HTTP/1.1[crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
[immutable]get [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port] [instant_split]get http://mhost/ HTTP/1.1[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][instant_split]get http://mhost/
|
||||
HTTP/1.1[ua][crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTPS/2.0[auth][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [auth][crlf][crlf][delay_split]CONNECT [host_port] [protocol][crlf]JAZZ http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol][crlf][crlf][delay_split]CONNECT [host_port] [method][cr]?[lf][crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
CONNECT [host_port] [protocol]\r
|
||||
\r
|
||||
get http://mhost HTTP/1.1\r
|
||||
Host: mhost\r
|
||||
X-Online-Host: mhost\r
|
||||
X-Forward-Host: mhost\r
|
||||
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP\r
|
||||
\r
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[lf]Host: mhost
|
||||
User-Agent: Yes
|
||||
Connection: close
|
||||
Proxy-Connection: Keep-Alive
|
||||
[crlf][crlf]CONNECT [host_port][protocol][crlf][crlf][immutable]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get [host_port][protocol][crlf][split]get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]UseDNS: Yes[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
|
||||
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[lf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[lf] Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[lf] Age: 8, 8[lf] Cache-Control: max-age=86400[lf] public[lf] Connection: keep-alive[lf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]UseDNS: Yes[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[lf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[lf] Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[lf] Age: 8, 8[lf] Cache-Control: max-age=86400[lf] public[lf] Connection: keep-alive[lf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
[netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
GET http://mhost/ HTTP/1.1
|
||||
Host: mhost/
|
||||
User-Agent: Yes
|
||||
Connection: close
|
||||
Proxy-Connection: update
|
||||
[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port] [protocol][crlf][crlf][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get [host_port][protocol][crlf][split]get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf][crlf]User-Agent: [ua][crlf]Connection: Close[crlf]Proxy-connection: Close[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf]Connection: Keep-Alive[crlf][raw][crlf] [crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Connection: close[crlf][crlf][crlf]User-Agent: [ua][crlf][crlf]Referer: mhost[crlf]Cookie: mhost[crlf]Proxy-Connection: Keep-Alive [crlf][crlf]CONNECT [host_port] [protocol][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1
|
||||
Host: mhost
|
||||
Upgrade-Insecure-Requests: 1
|
||||
User-Agent: Mozilla/5.0 (Linux; Android 5.1; LG-X220 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36
|
||||
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
|
||||
Referer: http://mhost
|
||||
Accept-Encoding: gzip, deflate, sdch
|
||||
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
|
||||
Cookie: _ga=GA1.2.2045323091.1494102805; _gid=GA1.2.1482137697.1494102805; tfp=80bcf53934df3482b37b54c954bd53ab; tpctmp=1494102806975; pnahc=0; _parsely_visitor={%22id%22:%22719d5f49-e168-4c56-b7c7-afdce6daef18%22%2C%22session_count%22:1%2C%22last_session_ts%22:1494102810109}; sc_is_visitor_unique=rx10046506.1494105143.4F070B22E5E94FC564C94CB6DE2D8F78.1.1.1.1.1.1.1.1.1
|
||||
Connection: close
|
||||
Proxy-Connection: Keep-Alive
|
||||
[crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
get [host_port][protocol][crlf][split]get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost[crlf] HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]Connection: close [crlf]
|
||||
Referer:http://mhost[crlf]
|
||||
Content-Type: text/html; charset=iso-8859-1[crlf]Content-Length:0[crlf]Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[crlf][raw][crlf] [crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[lf]Host: mhost
|
||||
User-Agent: null
|
||||
Connection: close
|
||||
Proxy-Connection: x-online-host
|
||||
[lf][lf] CONNECT [host_port] [protocol] [netData][lf]Content-Length: 130 [lf][lf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf]User-Agent: Yes[lf]Accept-Encoding: gzip,deflate[lf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[lf]Connection: Basic[lf]Referer: mhost[lf]Cookie: mhost [lf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf][raw][crlf] [crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[lf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]CONNECT [host_port][method]HTTP/1.1[lf]HEAD http://mhost/ [protocol][lf]Host: mhost[lf]CONNECT [lf]DELETE http://mhost/ HTTP/1.1[crlf]CONNECT mhost [crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf]@mip [crlf][crlf]http://mhost/ HTTP/1.1[crlf]mip[crlf][crlf] [crlf][crlf]http://mhost/ HTTP/1.1[crlf]Host@mip[crlf][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf]Host mhost/[crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[cr][lf] [crlf][crlf][netData][cr][lf] [crlf][crlf]CONNECT mip:22@http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
get [host_port]@mhost HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]get http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get https://mhost/ HTTP/1.1
|
||||
Host: mhost[crlf]User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
|
||||
Accept-Language: en-us,en;q=0.5
|
||||
Accept-Encoding: gzip,deflate
|
||||
Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7
|
||||
Keep-Alive: 115
|
||||
Connection: keep-alive
|
||||
Referer: mhost
|
||||
Cookie: mhost Proxy-Connection: Keep-Alive [crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[lf]Host: mhost[crlf]User-Agent: Yes[lf]Accept-Encoding: gzip,deflate[lf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[lf]Connection: Basic[lf]Referer: mhost[lf]Cookie: mhost [lf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][delay_split]CONNECT [host_port]@mhost [protocol][crlf][crlf]
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[lf]DATA: 2048B[lf]Host: mhost[lf]User-Agent: Yes[lf]Connection: close[lf]Accept-Encoding: gzip[lf]Non-Buffer: true[lf]Proxy: false[lf][lf][netData][lf] [lf][lf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]Host: http://mhost/[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: http://mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol][crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1
|
||||
Host: mhost
|
||||
Cache-Control=max-age=0
|
||||
[crlf][crlf]CONNECT [host_port] [protocol][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]@mhost [protocol][crlf]X-Online-Host: mhost[crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Referer: mhost[crlf]GET /HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][raw][crlf]Referer: mhost[crlf][crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1\nHost: mhost/\nUser-Agent: Yes\nConnection: close\nProxy-Connection: Keep-Alive\n\r\n\r\n[netData]\r\n \r\n\r\n
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port] [protocol][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][split]CONNECT mhost@[host_port] [protocol][crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][lf][realData][lf][lf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][split]CONNECT [host_port][protocol][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port][protocol][crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
[netData][crlf]
|
||||
get http://mhost/[crlf]
|
||||
Host: mhost[crlf][crlf]
|
||||
CONNECT mhost[protocol][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1\r\n
|
||||
Host: mhost\r\nConnection: Keep-Alive\r\n
|
||||
\r\n
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]
|
||||
Host: mhost[crlf]
|
||||
X-Online-Host: mhost[crlf][crlf]
|
||||
CONNECT mhost [protocol][crlf]
|
||||
[crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
[netData][crlf]
|
||||
get http://mhost/ HTTP/1.1[crlf]
|
||||
Host: mhost[crlf]
|
||||
CONNECT mhost[protocol][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
[netData] HTTP/1.0\r\n\r\n
|
||||
get http://mhost/ HTTP/1.1\r\n
|
||||
Host: mhost\r\n
|
||||
Connection: Keep-Alive\r\n
|
||||
CONNECT mhost\r\n
|
||||
\r\n
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol][crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]@mhost HTTP/1.1[crlf]X-Real-IP:mip[crlf]X-Forwarded-For:http://mhost/ http://mhost/[crlf]X-Forwarded-Port:mhost[crlf]X-Forwarded-Proto:http[crlf]Connection:Keep-Alive[crlf][crlf][instant_split]CONNECT [ssh]HTTP/1.0[crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host:
|
||||
mhost[crlf]Connection: Keep-Alive[crlf][crlf]
|
||||
[lf][realData][crlf]CONNECT mhost HTTP/1.1[lf][lf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]User-Agent: [ua][crlf][raw][crlf]
|
||||
[crlf]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]http://mhost/[protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf]CONNECT [host_port] [protocol][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]CONNECT mhost[crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host:
|
||||
http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1\r\nHost:
|
||||
mhost\r\n\r\n[netData]
|
||||
\r\n\r\n\r\n
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1\r\nX-Online-Host:mhost\r\n\r\nCONNECT mip:443
|
||||
HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1\r\nGET: mhost\n\r\nCONNECT mip:443
|
||||
HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf]CONNECT [host_port][protocol][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost [host_port] [protocol][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port][method]HTTP/1.1[crlf]mhost[lf]HEAD http://mhost[protocol][lf]Host: mhost [lf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port][method]HTTP/1.1[crlf]Forward-Host: mhost[lf]HEAD http://mhost[protocol][lf]Host: mhost [lf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port][method]HTTP/1.1[crlf]Connection: http://mhost[lf]HEAD http://mhost[protocol][lf]Host: mhost [lf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port][method]HTTP/1.1[crlf]CONNECT mhost@[port][protocol][lf]HEAD http://mhost[protocol][lf]Host: mhost [lf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port][method]HTTP/1.1[crlf]Connection: Keep-Alive[crlf]mhost@[host_port][lf]HEAD http://mhost[protocol][lf]Host: mhost [lf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf]get http://mhost/[protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][netdata][crlf] [crlf]-Agent: mhost[ua][crlf]CONNECT mhost [host_port] [protocol][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf]get http://mhost/[protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: mhost[ua][crlf]CONNECT mhost [host_port] [protocol][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf][split]get http://mhost/[protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: mhost[ua][crlf]Connection: close[crlf]CONNECT mhost [host_port] [protocol][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost [host_port] [protocol][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf]get http://mhost/[protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf]CONNECT http://mhost[protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf]get http://mhost/[protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netData][crlf] [crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf]get http://mhost/[protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]CONNECT mhost@[host_port][protocol][crlf] [crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf]GET http://mhost/[protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]CONNECT mhost@[host_port][protocol][crlf] [crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf]CONNECT http://mhost/[protocol]@[host_port][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netdata][crlf] [crlf][split]Connection: close[crlf]Content-Lenght: 20624[crlf]
|
||||
[crlf][netData][crlf] [crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port] HTTP/1.1[crlf][crlf][crlf]GET http://mhost/[protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]
|
||||
[crlf][netData][crlf] [crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]mhost\r\nHost:mhost\r\n\r\n[netData]\r\n \r\n\r\n
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/[host_port][method]HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][lf]HEAD http://mhost[protocol][lf]Host: mhost lf]CONNECT mhost [lf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf][crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost [crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][raw][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][realData][crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost [host_port][protocol][crlf] [crlf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]mhost[lf]Host: mhost[lf][lf]CONNECT mhost [host_port][lf]CONNECT mhost [lf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]mhost[lf]Host: mhost[lf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][lf]CONNECT mhost [host_port][lf]CONNECT mhost [lf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
[realData][crlf][split]get http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]mhost[lf]Host: mhost[lf][lf]CONNECT mhost [host_port][lf]get mhost [lf]
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
get [host_port]@mhost" HTTP/1.1[crlf][crlf]GET http://mhost"/ [protocol][crlf]Host: mhost"[crlf]X-Forward-Host: mhost"[crlf]CONNECT [host_port] [protocol][crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get [host_port] [protocol][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port] [protocol][crlf]X-Online-Host: mhost HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol][crlf]X-Online-Host: mhost[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[lf][lf][netData][lf] [lf][lf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
get http://mhost HTTP/1.1[crlf]host:frontend.claro.com.br[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol][crlf] [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf]CONNECT [host_port] [protocol][crlf] [crlf][crlf]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[lf]Host: mhost [lf][lf]CONNECT [host_port][lf]CONNECT [lf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[lf][lf][netData][lf] [lf][lf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]@mhost [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]@mhost [protocol][crlf]Host: mhost[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port] [protocol][crlf]X-Online-Host: mhost[crlf][crlf]CONNECT [host_port] [protocol][crlf]X-Online-Host: mhost [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port] [protocol][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]@mhost HTTP/1.1[crlf]Connect mip:443 [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]@mhost[protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf][split]get mhost HTTP/1.1[cr][lf][raw][crlf] [crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]@mhost [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]@mhost [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]get mip:443@mhost HTTP/1.1[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost User-Agent: Yes
|
||||
Connection: close
|
||||
Proxy-Connection: Keep-Alive Connection: Transfer-Encoding
|
||||
[protocol][ua][port][auth][lf][lf][netData][lf] [lf][lf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
get [host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
2
Lista/shadowsocks.sh
Executable file
2
Lista/shadowsocks.sh
Executable file
File diff suppressed because one or more lines are too long
2
Lista/ultrahost
Executable file
2
Lista/ultrahost
Executable file
File diff suppressed because one or more lines are too long
2
Lista/usercodes
Executable file
2
Lista/usercodes
Executable file
File diff suppressed because one or more lines are too long
1
Lista/v-local.log
Normal file
1
Lista/v-local.log
Normal file
@ -0,0 +1 @@
|
||||
1.2
|
||||
15
README.md
Normal file
15
README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# scriptcgh
|
||||
|
||||
script instalación free sin key [modificas el ress y el nombre del server]
|
||||
```
|
||||
wget https://darix.ooguy.com/drowkid01/scriptdk1/raw/branch/main/setup.free; chmod 777 setup.free; ./setup.free --chukk
|
||||
```
|
||||
|
||||
script instalación con key <a href='https://t.me/donpatobot'>@donpatobot</a>
|
||||
```
|
||||
wget -q https://darix.ooguy.com/drowkid01/scriptdk1/raw/branch/main/setup; chmod 777 setup; ./setup --ADMcgh
|
||||
```
|
||||
|
||||
by @drowkid01
|
||||
|
||||
bais
|
||||
1
Recursos/.gitignore
vendored
Normal file
1
Recursos/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
up
|
||||
2076
Recursos/C-SSR.sh
Normal file
2076
Recursos/C-SSR.sh
Normal file
File diff suppressed because it is too large
Load Diff
2280
Recursos/ClashForAndroidGLOBAL.sh
Normal file
2280
Recursos/ClashForAndroidGLOBAL.sh
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Recursos/backsocz.zip
Normal file
BIN
Recursos/backsocz.zip
Normal file
Binary file not shown.
BIN
Recursos/binarios/Psiphond-Epro/psiphond
Normal file
BIN
Recursos/binarios/Psiphond-Epro/psiphond
Normal file
Binary file not shown.
BIN
Recursos/binarios/SlowDNS/autoStart-ARM
Normal file
BIN
Recursos/binarios/SlowDNS/autoStart-ARM
Normal file
Binary file not shown.
BIN
Recursos/binarios/SlowDNS/autoStart-x86-64
Normal file
BIN
Recursos/binarios/SlowDNS/autoStart-x86-64
Normal file
Binary file not shown.
BIN
Recursos/binarios/SockWS/autoStart
Normal file
BIN
Recursos/binarios/SockWS/autoStart
Normal file
Binary file not shown.
6
Recursos/binarios/UDP/config.json
Normal file
6
Recursos/binarios/UDP/config.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"listen": ":36712",
|
||||
"auth": {
|
||||
"mode": "passwords"
|
||||
}
|
||||
}
|
||||
BIN
Recursos/binarios/UDP/udp-amd64.bin
Normal file
BIN
Recursos/binarios/UDP/udp-amd64.bin
Normal file
Binary file not shown.
BIN
Recursos/binarios/UDP/udp-arm64.bin
Normal file
BIN
Recursos/binarios/UDP/udp-arm64.bin
Normal file
Binary file not shown.
1
Recursos/binarios/ws-epro/readme.md
Normal file
1
Recursos/binarios/ws-epro/readme.md
Normal file
@ -0,0 +1 @@
|
||||
# un ws-epro que me robé de lacasitamx10 para mi mod de lacasita🤣🤣🤣
|
||||
BIN
Recursos/binarios/ws-epro/ws-epro
Normal file
BIN
Recursos/binarios/ws-epro/ws-epro
Normal file
Binary file not shown.
531
Recursos/blockT.sh
Normal file
531
Recursos/blockT.sh
Normal file
@ -0,0 +1,531 @@
|
||||
#!/bin/bash
|
||||
#19/12/19
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
|
||||
SCPfrm="/etc/adm-lite" && [[ ! -d ${SCPfrm} ]] && exit
|
||||
SCPinst="/etc/adm-lite" && [[ ! -d ${SCPinst} ]] && exit
|
||||
|
||||
sh_ver="1.0.11"
|
||||
Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
|
||||
Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
|
||||
Error="${Red_font_prefix}[Error]${Font_color_suffix}"
|
||||
|
||||
smtp_port="25,26,465,587"
|
||||
pop3_port="109,110,995"
|
||||
imap_port="143,218,220,993"
|
||||
other_port="24,50,57,105,106,158,209,1109,24554,60177,60179"
|
||||
bt_key_word="torrent
|
||||
.torrent
|
||||
peer_id=
|
||||
announce
|
||||
info_hash
|
||||
get_peers
|
||||
find_node
|
||||
BitTorrent
|
||||
announce_peer
|
||||
BitTorrent protocol
|
||||
announce.php?passkey=
|
||||
magnet:
|
||||
xunlei
|
||||
sandai
|
||||
Thunder
|
||||
XLLiveUD"
|
||||
|
||||
check_sys(){
|
||||
if [[ -f /etc/redhat-release ]]; then
|
||||
release="centos"
|
||||
elif cat /etc/issue | grep -q -E -i "debian"; then
|
||||
release="debian"
|
||||
elif cat /etc/issue | grep -q -E -i "ubuntu"; then
|
||||
release="ubuntu"
|
||||
elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
|
||||
release="centos"
|
||||
elif cat /proc/version | grep -q -E -i "debian"; then
|
||||
release="debian"
|
||||
elif cat /proc/version | grep -q -E -i "ubuntu"; then
|
||||
release="ubuntu"
|
||||
elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
|
||||
release="centos"
|
||||
fi
|
||||
bit=`uname -m`
|
||||
}
|
||||
check_BT(){
|
||||
Cat_KEY_WORDS
|
||||
BT_KEY_WORDS=$(echo -e "$Ban_KEY_WORDS_list"|grep "torrent")
|
||||
}
|
||||
check_SPAM(){
|
||||
Cat_PORT
|
||||
SPAM_PORT=$(echo -e "$Ban_PORT_list"|grep "${smtp_port}")
|
||||
}
|
||||
Cat_PORT(){
|
||||
Ban_PORT_list=$(iptables -t filter -L OUTPUT -nvx --line-numbers|grep "REJECT"|awk '{print $13}')
|
||||
}
|
||||
Cat_KEY_WORDS(){
|
||||
Ban_KEY_WORDS_list=""
|
||||
Ban_KEY_WORDS_v6_list=""
|
||||
if [[ ! -z ${v6iptables} ]]; then
|
||||
Ban_KEY_WORDS_v6_text=$(${v6iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
|
||||
Ban_KEY_WORDS_v6_list=$(echo -e "${Ban_KEY_WORDS_v6_text}"|sed -r 's/.*\"(.+)\".*/\1/')
|
||||
fi
|
||||
Ban_KEY_WORDS_text=$(${v4iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
|
||||
Ban_KEY_WORDS_list=$(echo -e "${Ban_KEY_WORDS_text}"|sed -r 's/.*\"(.+)\".*/\1/')
|
||||
}
|
||||
View_PORT(){
|
||||
Cat_PORT
|
||||
echo -e "========${Red_background_prefix} Puerto Bloqueado Actualmente ${Font_color_suffix}========="
|
||||
echo -e "$Ban_PORT_list" && echo && echo -e "==============================================="
|
||||
}
|
||||
View_KEY_WORDS(){
|
||||
Cat_KEY_WORDS
|
||||
echo -e "============${Red_background_prefix} Actualmente Prohibido ${Font_color_suffix}============"
|
||||
echo -e "$Ban_KEY_WORDS_list" && echo -e "==============================================="
|
||||
}
|
||||
View_ALL(){
|
||||
echo
|
||||
View_PORT
|
||||
View_KEY_WORDS
|
||||
echo
|
||||
msg -bar2
|
||||
}
|
||||
Save_iptables_v4_v6(){
|
||||
if [[ ${release} == "centos" ]]; then
|
||||
if [[ ! -z "$v6iptables" ]]; then
|
||||
service ip6tables save
|
||||
chkconfig --level 2345 ip6tables on
|
||||
fi
|
||||
service iptables save
|
||||
chkconfig --level 2345 iptables on
|
||||
else
|
||||
if [[ ! -z "$v6iptables" ]]; then
|
||||
ip6tables-save > /etc/ip6tables.up.rules
|
||||
echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules\n/sbin/ip6tables-restore < /etc/ip6tables.up.rules" > /etc/network/if-pre-up.d/iptables
|
||||
else
|
||||
echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules" > /etc/network/if-pre-up.d/iptables
|
||||
fi
|
||||
iptables-save > /etc/iptables.up.rules
|
||||
chmod +x /etc/network/if-pre-up.d/iptables
|
||||
fi
|
||||
}
|
||||
Set_key_word() { $1 -t mangle -$3 OUTPUT -m string --string "$2" --algo bm --to 65535 -j DROP; }
|
||||
Set_tcp_port() {
|
||||
[[ "$1" = "$v4iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with icmp-port-unreachable
|
||||
[[ "$1" = "$v6iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with tcp-reset
|
||||
}
|
||||
Set_udp_port() { $1 -t filter -$3 OUTPUT -p udp -m multiport --dports "$2" -j DROP; }
|
||||
Set_SPAM_Code_v4(){
|
||||
for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
|
||||
do
|
||||
Set_tcp_port $v4iptables "$i" $s
|
||||
Set_udp_port $v4iptables "$i" $s
|
||||
done
|
||||
}
|
||||
Set_SPAM_Code_v4_v6(){
|
||||
for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
|
||||
do
|
||||
for j in $v4iptables $v6iptables
|
||||
do
|
||||
Set_tcp_port $j "$i" $s
|
||||
Set_udp_port $j "$i" $s
|
||||
done
|
||||
done
|
||||
}
|
||||
Set_PORT(){
|
||||
if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
|
||||
Set_tcp_port $v4iptables $PORT $s
|
||||
Set_udp_port $v4iptables $PORT $s
|
||||
Set_tcp_port $v6iptables $PORT $s
|
||||
Set_udp_port $v6iptables $PORT $s
|
||||
elif [[ -n "$v4iptables" ]]; then
|
||||
Set_tcp_port $v4iptables $PORT $s
|
||||
Set_udp_port $v4iptables $PORT $s
|
||||
fi
|
||||
Save_iptables_v4_v6
|
||||
}
|
||||
Set_KEY_WORDS(){
|
||||
key_word_num=$(echo -e "${key_word}"|wc -l)
|
||||
for((integer = 1; integer <= ${key_word_num}; integer++))
|
||||
do
|
||||
i=$(echo -e "${key_word}"|sed -n "${integer}p")
|
||||
Set_key_word $v4iptables "$i" $s
|
||||
[[ ! -z "$v6iptables" ]] && Set_key_word $v6iptables "$i" $s
|
||||
done
|
||||
Save_iptables_v4_v6
|
||||
}
|
||||
Set_BT(){
|
||||
key_word=${bt_key_word}
|
||||
Set_KEY_WORDS
|
||||
Save_iptables_v4_v6
|
||||
}
|
||||
Set_SPAM(){
|
||||
if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
|
||||
Set_SPAM_Code_v4_v6
|
||||
elif [[ -n "$v4iptables" ]]; then
|
||||
Set_SPAM_Code_v4
|
||||
fi
|
||||
Save_iptables_v4_v6
|
||||
}
|
||||
Set_ALL(){
|
||||
Set_BT
|
||||
Set_SPAM
|
||||
}
|
||||
Ban_BT(){
|
||||
check_BT
|
||||
[[ ! -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent bloqueados y Palabras Claves, no es\nnecesario volver a prohibirlas !" && msg -bar2 && exit 0
|
||||
s="A"
|
||||
Set_BT
|
||||
View_ALL
|
||||
echo -e "${Info} Torrent bloqueados y Palabras Claves !"
|
||||
msg -bar2
|
||||
}
|
||||
Ban_SPAM(){
|
||||
check_SPAM
|
||||
[[ ! -z ${SPAM_PORT} ]] && echo -e "${Error} Se detectó un puerto SPAM bloqueado, no es\nnecesario volver a bloquear !" && msg -bar2 && exit 0
|
||||
s="A"
|
||||
Set_SPAM
|
||||
View_ALL
|
||||
echo -e "${Info} Puertos SPAM Bloqueados !"
|
||||
msg -bar2
|
||||
}
|
||||
Ban_ALL(){
|
||||
check_BT
|
||||
check_SPAM
|
||||
s="A"
|
||||
if [[ -z ${BT_KEY_WORDS} ]]; then
|
||||
if [[ -z ${SPAM_PORT} ]]; then
|
||||
Set_ALL
|
||||
View_ALL
|
||||
echo -e "${Info} Torrent bloqueados, Palabras Claves y Puertos SPAM !"
|
||||
msg -bar2
|
||||
else
|
||||
Set_BT
|
||||
View_ALL
|
||||
echo -e "${Info} Torrent bloqueados y Palabras Claves !"
|
||||
fi
|
||||
else
|
||||
if [[ -z ${SPAM_PORT} ]]; then
|
||||
Set_SPAM
|
||||
View_ALL
|
||||
echo -e "${Info} Puerto SPAM (spam) prohibido !"
|
||||
else
|
||||
echo -e "${Error} Torrent Bloqueados, Palabras Claves y Puertos SPAM,\nno es necesario volver a prohibir !" && msg -bar2 && exit 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
UnBan_BT(){
|
||||
check_BT
|
||||
[[ -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent y Palabras Claves no bloqueadas, verifique !"&& msg -bar2 && exit 0
|
||||
s="D"
|
||||
Set_BT
|
||||
View_ALL
|
||||
echo -e "${Info} Torrent Desbloqueados y Palabras Claves !"
|
||||
msg -bar2
|
||||
}
|
||||
UnBan_SPAM(){
|
||||
check_SPAM
|
||||
[[ -z ${SPAM_PORT} ]] && echo -e "${Error} Puerto SPAM no detectados, verifique !" && msg -bar2 && exit 0
|
||||
s="D"
|
||||
Set_SPAM
|
||||
View_ALL
|
||||
echo -e "${Info} Puertos de SPAM Desbloqueados !"
|
||||
msg -bar2
|
||||
}
|
||||
UnBan_ALL(){
|
||||
check_BT
|
||||
check_SPAM
|
||||
s="D"
|
||||
if [[ ! -z ${BT_KEY_WORDS} ]]; then
|
||||
if [[ ! -z ${SPAM_PORT} ]]; then
|
||||
Set_ALL
|
||||
View_ALL
|
||||
echo -e "${Info} Torrent, Palabras Claves y Puertos SPAM Desbloqueados !"
|
||||
msg -bar2
|
||||
else
|
||||
Set_BT
|
||||
View_ALL
|
||||
echo -e "${Info} Torrent, Palabras Claves Desbloqueados !"
|
||||
msg -bar2
|
||||
fi
|
||||
else
|
||||
if [[ ! -z ${SPAM_PORT} ]]; then
|
||||
Set_SPAM
|
||||
View_ALL
|
||||
echo -e "${Info} Puertos SPAM Desbloqueados !"
|
||||
msg -bar2
|
||||
else
|
||||
echo -e "${Error} No se detectan Torrent, Palabras Claves y Puertos SPAM Bloqueados, verifique !" && msg -bar2 && exit 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
ENTER_Ban_KEY_WORDS_type(){
|
||||
Type=$1
|
||||
Type_1=$2
|
||||
if [[ $Type_1 != "ban_1" ]]; then
|
||||
echo -e "Por favor seleccione un tipo de entrada:
|
||||
|
||||
1. Entrada manual (solo se admiten palabras clave únicas)
|
||||
|
||||
2. Lectura local de archivos (admite lectura por lotes de palabras clave, una palabra clave por línea)
|
||||
|
||||
3. Lectura de dirección de red (admite lectura por lotes de palabras clave, una palabra clave por línea)" && echo
|
||||
read -e -p "(Por defecto: 1. Entrada manual):" key_word_type
|
||||
fi
|
||||
[[ -z "${key_word_type}" ]] && key_word_type="1"
|
||||
if [[ ${key_word_type} == "1" ]]; then
|
||||
if [[ $Type == "ban" ]]; then
|
||||
ENTER_Ban_KEY_WORDS
|
||||
else
|
||||
ENTER_UnBan_KEY_WORDS
|
||||
fi
|
||||
elif [[ ${key_word_type} == "2" ]]; then
|
||||
ENTER_Ban_KEY_WORDS_file
|
||||
elif [[ ${key_word_type} == "3" ]]; then
|
||||
ENTER_Ban_KEY_WORDS_url
|
||||
else
|
||||
if [[ $Type == "ban" ]]; then
|
||||
ENTER_Ban_KEY_WORDS
|
||||
else
|
||||
ENTER_UnBan_KEY_WORDS
|
||||
fi
|
||||
fi
|
||||
}
|
||||
ENTER_Ban_PORT(){
|
||||
echo -e "Ingrese el puerto que Bloqueará:\n(segmento de Puerto único / Puerto múltiple / Puerto continuo)\n"
|
||||
if [[ ${Ban_PORT_Type_1} != "1" ]]; then
|
||||
echo -e "
|
||||
${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
|
||||
|
||||
-Puerto único: 25 (puerto único)
|
||||
|
||||
-Multipuerto: 25, 26, 465, 587 (varios puertos están separados por comas)
|
||||
|
||||
-Segmento de puerto continuo: 25: 587 (todos los puertos entre 25-587)" && echo
|
||||
fi
|
||||
read -e -p "(Intro se cancela por defecto):" PORT
|
||||
[[ -z "${PORT}" ]] && echo "Cancelado..." && View_ALL && exit 0
|
||||
}
|
||||
ENTER_Ban_KEY_WORDS(){
|
||||
msg -bar2
|
||||
echo -e "Ingrese las palabras clave que se prohibirán\n(nombre de dominio, etc., solo admite una sola palabra clave)"
|
||||
if [[ ${Type_1} != "ban_1" ]]; then
|
||||
echo ""
|
||||
echo -e "${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
|
||||
|
||||
-Palabras clave: youtube, que prohíbe el acceso a cualquier nombre de dominio que contenga la palabra clave youtube.
|
||||
|
||||
-Palabras clave: youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de nombre de pan-dominio) que contenga la palabra clave youtube.com.
|
||||
|
||||
-Palabras clave: www.youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de subdominio) que contenga la palabra clave www.youtube.com.
|
||||
|
||||
-Autoevaluación de más efectos (como la palabra clave .zip se puede usar para deshabilitar la descarga de cualquier archivo de sufijo .zip)." && echo
|
||||
fi
|
||||
read -e -p "(Intro se cancela por defecto):" key_word
|
||||
[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
|
||||
}
|
||||
ENTER_Ban_KEY_WORDS_file(){
|
||||
echo -e "Ingrese el archivo local de palabras clave que se prohibirá / desbloqueará (utilice la ruta absoluta)" && echo
|
||||
read -e -p "(El valor predeterminado es leer key_word.txt en el mismo directorio que el script):" key_word
|
||||
[[ -z "${key_word}" ]] && key_word="key_word.txt"
|
||||
if [[ -e "${key_word}" ]]; then
|
||||
key_word=$(cat "${key_word}")
|
||||
[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo está vacío. !" && View_ALL && exit 0
|
||||
else
|
||||
echo -e "${Error} Archivo no encontrado ${key_word} !" && View_ALL && exit 0
|
||||
fi
|
||||
}
|
||||
ENTER_Ban_KEY_WORDS_url(){
|
||||
echo -e "Ingrese la dirección del archivo de red de palabras clave que se prohibirá / desbloqueará (por ejemplo, http: //xxx.xx/key_word.txt)" && echo
|
||||
read -e -p "(Intro se cancela por defecto):" key_word
|
||||
[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
|
||||
key_word=$(wget --no-check-certificate -t3 -T5 -qO- "${key_word}")
|
||||
[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo de red está vacío o se agotó el tiempo de acceso !" && View_ALL && exit 0
|
||||
}
|
||||
ENTER_UnBan_KEY_WORDS(){
|
||||
View_KEY_WORDS
|
||||
echo -e "Ingrese la palabra clave que desea desbloquear (ingrese la palabra clave completa y precisa de acuerdo con la lista anterior)" && echo
|
||||
read -e -p "(Intro se cancela por defecto):" key_word
|
||||
[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
|
||||
}
|
||||
ENTER_UnBan_PORT(){
|
||||
echo -e "Ingrese el puerto que desea desempaquetar:\n(ingrese el puerto completo y preciso de acuerdo con la lista anterior, incluyendo comas, dos puntos)" && echo
|
||||
read -e -p "(Intro se cancela por defecto):" PORT
|
||||
[[ -z "${PORT}" ]] && echo "Cancelado ..." && View_ALL && exit 0
|
||||
}
|
||||
Ban_PORT(){
|
||||
s="A"
|
||||
ENTER_Ban_PORT
|
||||
Set_PORT
|
||||
echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
|
||||
Ban_PORT_Type_1="1"
|
||||
while true
|
||||
do
|
||||
ENTER_Ban_PORT
|
||||
Set_PORT
|
||||
echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
|
||||
done
|
||||
View_ALL
|
||||
}
|
||||
Ban_KEY_WORDS(){
|
||||
s="A"
|
||||
ENTER_Ban_KEY_WORDS_type "ban"
|
||||
Set_KEY_WORDS
|
||||
echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
|
||||
while true
|
||||
do
|
||||
ENTER_Ban_KEY_WORDS_type "ban" "ban_1"
|
||||
Set_KEY_WORDS
|
||||
echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
|
||||
done
|
||||
View_ALL
|
||||
}
|
||||
UnBan_PORT(){
|
||||
s="D"
|
||||
View_PORT
|
||||
[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} Se detecta cualquier puerto no bloqueado !" && exit 0
|
||||
ENTER_UnBan_PORT
|
||||
Set_PORT
|
||||
echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
|
||||
while true
|
||||
do
|
||||
View_PORT
|
||||
[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} No se detecta puertos bloqueados !" && msg -bar2 && exit 0
|
||||
ENTER_UnBan_PORT
|
||||
Set_PORT
|
||||
echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
|
||||
done
|
||||
View_ALL
|
||||
}
|
||||
UnBan_KEY_WORDS(){
|
||||
s="D"
|
||||
Cat_KEY_WORDS
|
||||
[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && exit 0
|
||||
ENTER_Ban_KEY_WORDS_type "unban"
|
||||
Set_KEY_WORDS
|
||||
echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
|
||||
while true
|
||||
do
|
||||
Cat_KEY_WORDS
|
||||
[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && msg -bar2 && exit 0
|
||||
ENTER_Ban_KEY_WORDS_type "unban" "ban_1"
|
||||
Set_KEY_WORDS
|
||||
echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
|
||||
done
|
||||
View_ALL
|
||||
}
|
||||
UnBan_KEY_WORDS_ALL(){
|
||||
Cat_KEY_WORDS
|
||||
[[ -z ${Ban_KEY_WORDS_text} ]] && echo -e "${Error} No se detectó ninguna clave, verifique !" && msg -bar2 && exit 0
|
||||
if [[ ! -z "${v6iptables}" ]]; then
|
||||
Ban_KEY_WORDS_v6_num=$(echo -e "${Ban_KEY_WORDS_v6_list}"|wc -l)
|
||||
for((integer = 1; integer <= ${Ban_KEY_WORDS_v6_num}; integer++))
|
||||
do
|
||||
${v6iptables} -t mangle -D OUTPUT 1
|
||||
done
|
||||
fi
|
||||
Ban_KEY_WORDS_num=$(echo -e "${Ban_KEY_WORDS_list}"|wc -l)
|
||||
for((integer = 1; integer <= ${Ban_KEY_WORDS_num}; integer++))
|
||||
do
|
||||
${v4iptables} -t mangle -D OUTPUT 1
|
||||
done
|
||||
Save_iptables_v4_v6
|
||||
View_ALL
|
||||
echo -e "${Info} Todas las palabras clave han sido desbloqueadas !"
|
||||
}
|
||||
check_iptables(){
|
||||
v4iptables=`iptables -V`
|
||||
v6iptables=`ip6tables -V`
|
||||
if [[ ! -z ${v4iptables} ]]; then
|
||||
v4iptables="iptables"
|
||||
if [[ ! -z ${v6iptables} ]]; then
|
||||
v6iptables="ip6tables"
|
||||
fi
|
||||
else
|
||||
echo -e "${Error} El firewall de iptables no está instalado !
|
||||
Por favor, instale el firewall de iptables:
|
||||
CentOS Sistema: yum install iptables -y
|
||||
Debian / Ubuntu Sistema: apt-get install iptables -y"
|
||||
fi
|
||||
}
|
||||
Update_Shell(){
|
||||
sh_new_ver=$(wget --no-check-certificate -qO- -t1 -T3 "https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/blockT.sh"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1)
|
||||
[[ -z ${sh_new_ver} ]] && echo -e "${Error} No se puede vincular a Github !" && exit 0
|
||||
wget https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/blockT.sh -O /etc/ger-frm/blockBT.sh &> /dev/null
|
||||
chmod +x /etc/ger-frm/blockBT.sh
|
||||
echo -e "El script ha sido actualizado a la última versión.[ ${sh_new_ver} ]"
|
||||
msg -bar2
|
||||
exit 0
|
||||
}
|
||||
check_sys
|
||||
check_iptables
|
||||
action=$1
|
||||
if [[ ! -z $action ]]; then
|
||||
[[ $action = "banbt" ]] && Ban_BT && exit 0
|
||||
[[ $action = "banspam" ]] && Ban_SPAM && exit 0
|
||||
[[ $action = "banall" ]] && Ban_ALL && exit 0
|
||||
[[ $action = "unbanbt" ]] && UnBan_BT && exit 0
|
||||
[[ $action = "unbanspam" ]] && UnBan_SPAM && exit 0
|
||||
[[ $action = "unbanall" ]] && UnBan_ALL && exit 0
|
||||
fi
|
||||
echo -e " Panel de Firewall ChumoGH By ADM 2021 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}"
|
||||
msg -bar2
|
||||
echo -e " ${Green_font_prefix}0.${Font_color_suffix} Ver la lista actual de prohibidos
|
||||
————————————
|
||||
${Green_font_prefix}1.${Font_color_suffix} Bloquear Torrent, Palabras Clave
|
||||
${Green_font_prefix}2.${Font_color_suffix} Bloquear Puertos SPAM
|
||||
${Green_font_prefix}3.${Font_color_suffix} Bloquear Torrent, Palabras Clave + Puertos SPAM
|
||||
${Green_font_prefix}4.${Font_color_suffix} Bloquear Puerto personalizado
|
||||
${Green_font_prefix}5.${Font_color_suffix} Bloquear Palabras Clave Personalizadas
|
||||
————————————
|
||||
${Green_font_prefix}6.${Font_color_suffix} Desbloquear Torrent, Palabras Clave
|
||||
${Green_font_prefix}7.${Font_color_suffix} Desbloquear Puertos SPAM
|
||||
${Green_font_prefix}8.${Font_color_suffix} Desbloquear Torrent, Palabras Clave , Puertos SPAM
|
||||
${Green_font_prefix}9.${Font_color_suffix} Desbloquear Puerto Personalizado
|
||||
${Green_font_prefix}10.${Font_color_suffix} Desbloquear Palabra Clave Personalizadas
|
||||
${Green_font_prefix}11.${Font_color_suffix} Desbloquear Todas las palabras Clave Personalizadas
|
||||
————————————
|
||||
${Green_font_prefix}12.${Font_color_suffix} Actualizar script" && msg -bar2
|
||||
read -e -p " Por favor ingrese un número [0-12]:" num && msg -bar2
|
||||
case "$num" in
|
||||
0)
|
||||
View_ALL
|
||||
;;
|
||||
1)
|
||||
Ban_BT
|
||||
;;
|
||||
2)
|
||||
Ban_SPAM
|
||||
;;
|
||||
3)
|
||||
Ban_ALL
|
||||
;;
|
||||
4)
|
||||
Ban_PORT
|
||||
;;
|
||||
5)
|
||||
Ban_KEY_WORDS
|
||||
;;
|
||||
6)
|
||||
UnBan_BT
|
||||
;;
|
||||
7)
|
||||
UnBan_SPAM
|
||||
;;
|
||||
8)
|
||||
UnBan_ALL
|
||||
;;
|
||||
9)
|
||||
UnBan_PORT
|
||||
;;
|
||||
10)
|
||||
UnBan_KEY_WORDS
|
||||
;;
|
||||
11)
|
||||
UnBan_KEY_WORDS_ALL
|
||||
;;
|
||||
12)
|
||||
Update_Shell
|
||||
;;
|
||||
*)
|
||||
echo "Por favor ingrese el número correcto [0-12]"
|
||||
;;
|
||||
esac
|
||||
274
Recursos/cabecalho/changelogs.fix
Normal file
274
Recursos/cabecalho/changelogs.fix
Normal file
@ -0,0 +1,274 @@
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V5.6a
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● ESTABILIZANDO FOR DESCONTINUAR ADM-LITE ( V5 )
|
||||
|
||||
● Añadido autoreboot de protocolos
|
||||
|
||||
● reconstruido reiniciador de protocolos python,badvpn,slowdns
|
||||
|
||||
● fixeado socks python en el reactivador
|
||||
|
||||
● fixeado v2ray y xray en v5
|
||||
|
||||
● añadido token nuevo de subdominios en certificado
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
Ultimos Cambios Version ADM V5.5
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● ESTABILIZANDO FOR DESCONTINUAR ADM-LITE ( V-final )
|
||||
|
||||
● FIXEADO PythonSocks Oficial
|
||||
|
||||
● RECONSTRUIDO LOG DE PUERTOS
|
||||
|
||||
● FIXEADO MENUS DE V2RAY
|
||||
|
||||
● CORREJIDO PROBLEMA DE KILLMULTILOGIN
|
||||
|
||||
● RESPUESTA DEL LIMITADOR AUMENTADA A 30 SEGUNDOS
|
||||
|
||||
ULTIMOS CAMBIOS ChumoGH - ADM V5.4bt
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● ESTABILIZANDO FOR DESCONTINUAR ADM-LITE ( V-final )
|
||||
|
||||
● AÑADIDO FUNCION DE Socks Python ( BETA )
|
||||
|
||||
● AÑADIDO STUNNEL4 Y STUNNEL5
|
||||
|
||||
● RECONSTRUIDO Contador de Usuarios en cabecera
|
||||
|
||||
● COREJIDO ERROR V2RAY
|
||||
|
||||
● AÑADIDA FUNCION DE ENCENDIDO DE CONTROL DE CONSUMO Y TIEMPO
|
||||
|
||||
################################################################
|
||||
|
||||
ULTIMOS CAMBIOS ChumoGH - ADM V5.3
|
||||
################################################################
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● RECONSTRUIDO MENU
|
||||
|
||||
● REESTRUCTURADO AUTOPTIMIZADOR
|
||||
|
||||
● REESTRUCTURADO BadVPN (arm/arm64) - SYSTEM
|
||||
|
||||
● RECONSTRUIDO LIMITADOR SSH/DROPBEAR (KillSSH)
|
||||
|
||||
● VERIIFICADOR DE KEYS OFICIALES EN VERSION EXISTENTE
|
||||
|
||||
|
||||
################################################################
|
||||
Ultimos Cambios Version ADM V4.5
|
||||
|
||||
------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● RECONSTRUIDO MENU
|
||||
|
||||
● REESTRUCTURADO INTERVALOS DE PUERTOS ACTIVOS
|
||||
|
||||
● CORRECCION DE MENU TROJAN ( ALTERNO SNI )
|
||||
|
||||
● CONTROL DE DIAS DE USUARIOS ( AÑADIR / QUITAR )
|
||||
|
||||
● MOTOR V2RAY CON CONTADOR DE USUARIOS EXISTENTES
|
||||
|
||||
● REFORMA DE INSTALADOR
|
||||
|
||||
● UPDATE REFORMADO ( SOLO CON KEY )
|
||||
|
||||
|
||||
|
||||
################################################################
|
||||
Ultimos Cambios Version ADM V4.8
|
||||
|
||||
------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● RECONSTRUIDO MENU DE PROTOCOLOS
|
||||
|
||||
● REESTRUCTURADO INTERVALOS DE PUERTOS ACTIVOS
|
||||
|
||||
● CORRECCION DE MENU TROJAN ( ALTERNO SNI )
|
||||
|
||||
● CONTROL DE DIAS DE USUARIOS ( AÑADIR / QUITAR )
|
||||
|
||||
● AÑADIDO CREADOR DE CUENTA VMESS CON USUARIO SSH
|
||||
|
||||
● REFORMA DE INSTALADOR
|
||||
|
||||
● UPDATE REFORMADO ( SOLO CON KEY )
|
||||
|
||||
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.7d
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● Añadido Certificado con Dominio ( SSL - TROJAN - V2-UI )
|
||||
|
||||
● REESTRUCTURADO DROPBEAR
|
||||
|
||||
● AÑADIDO MENU SSL BY @KILLSHITO
|
||||
|
||||
● REDUCIDO TIEMPO DE ESPERA DE INICIO
|
||||
|
||||
● SCRIPT OPTIMIZADO AL ESPAÑOL ( 86 % )
|
||||
|
||||
● REFORMA DE INSTALADOR
|
||||
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.7
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● MENU PRINCIPAL REFORMADO ( OPTIMIZADO )
|
||||
|
||||
● REESTRUCTURADO INSTALADOR
|
||||
|
||||
● REFORMADO BANNER DE SOPORTE DROPBEAR
|
||||
|
||||
● MENU V2RAY INICIAL REDUCIDO
|
||||
|
||||
● ELIMINADO EN 80% INTERFAZ DEL DINO
|
||||
|
||||
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.6C
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● MENU REFORMADO ( OPTIMIZADO )
|
||||
|
||||
● ELIMINADO LAG DE LOGIN
|
||||
|
||||
● REFORMA DE INSTALACION DE PROTOCOLOS
|
||||
|
||||
● FIX Version
|
||||
|
||||
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.6b
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● V2-UI Reestructurado
|
||||
|
||||
● Solucion Espacio en VPS ( Optimizar VPS )
|
||||
|
||||
● Mejoramiento de Trojan-GO
|
||||
|
||||
● FIX Key LIMPIA
|
||||
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.6a
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● Añadido Certificado WEB ( Trojan )
|
||||
|
||||
● Añadido Certificado SSL Normal ( WEB )
|
||||
|
||||
● REMOVIDO AutOptimizador de Python SSL
|
||||
|
||||
● RESTRUCTURACIÓN DE INSTALADOR PRIMARIO
|
||||
|
||||
● Añadido Carga SSL en WebSocket CDN
|
||||
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.6a
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● Reestructurado Menú Block Torrent ( Menú 2, Opción 1)
|
||||
|
||||
● Reestructurado Pay + SSL AutoConfig
|
||||
|
||||
● Agregado AutoOptimizador de Python SSL
|
||||
|
||||
● RESTRUCTURACIÓN DE PYTHON SSL
|
||||
|
||||
● Reestructurado Certificado SSL Normal
|
||||
|
||||
● Reestructurado WebSocket SSL (HTTPS)
|
||||
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.6
|
||||
|
||||
------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
Añadido Menú Block Torrent ( Menú 7, Opción 16)
|
||||
|
||||
Reestructurado Pay + SSL Autogonnfig
|
||||
|
||||
RESTRUCTURACIÓN DE PYTHON SSL
|
||||
|
||||
Ofuscado SHC
|
||||
|
||||
Añadido WebSocket SSL (HTTPS)
|
||||
|
||||
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.5.1b
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● Añadido Menú Block Torrent ( Menú 7, Opción 16)
|
||||
|
||||
● Reestructurado Pay + SSL Autogonnfig
|
||||
|
||||
● RESTRUCTURACIÓN DE PYTHON SSL
|
||||
|
||||
● Ofuscado SHC
|
||||
|
||||
################################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.5.1a 26-07-2021
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● Añadido Menú Block Torrent ( Menú 7, Opción 16)
|
||||
|
||||
● Reestructurado PaySSL Autogonnfig
|
||||
|
||||
● RESTRUCTURACIÓN DE PYTHON SSL
|
||||
|
||||
###############################################################
|
||||
|
||||
Ultimos Cambios Version ADM V4.5.1a
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
● Añadido Menú Trojan (Experimental, Menú 7, Opción 20)
|
||||
|
||||
● RESTRUCTURADO CERTIFICADO SSL TROJAN
|
||||
|
||||
● RESTRUCTURACIÓN DE PYTHON SSL
|
||||
|
||||
● (AHORA PODRAS CAMBIAR EL RESPONSE STATUS DE CONEXION PYTHON)
|
||||
|
||||
● Añadido Submenú Clash. (Podrás escojer el Usuario V2RAY Y TROJAN CREADO)!
|
||||
|
||||
● Source Update Reestructurado!
|
||||
|
||||
● Nuevo Protocolo Experimental (SSH OVER WEBSOCKET) Menu 9, Opcion 18 !
|
||||
|
||||
● ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
|
||||
################################################################
|
||||
24
Recursos/cabecalho/changelogs.log
Normal file
24
Recursos/cabecalho/changelogs.log
Normal file
@ -0,0 +1,24 @@
|
||||
\033[1;38m################################################################\033[1;37m
|
||||
|
||||
\033[1;42m Ultimos Cambios Version ADM V5.7U \033[0m
|
||||
|
||||
\033[1;35m●\033[1;37m ------- ------- ------- ------- ------- ------- -------
|
||||
|
||||
\033[1;35m●\033[1;31m FIX PARA UPDATE EN MENU ADM-LITE ( V6 )
|
||||
|
||||
\033[1;35m●\033[1;31m FIXEADO NOMBRE DE USUARIO EN NUMEROS DE RENOVACIONES
|
||||
|
||||
\033[1;35m●\033[1;31m RENOVADO TOKEN DE SUBDOMINIOS TIPO ( A & NS )
|
||||
|
||||
\033[1;35m●\033[1;31m AÑADIDO SLOWDNS + ( PROTOCOLOS NUEVOS )
|
||||
|
||||
\033[1;35m●\033[1;31m FIXEADO OPTIMIZADOR VIA RSYSLOG
|
||||
|
||||
\033[1;35m●\033[1;31m BLOQUEO DE USUARIOS CADUCADOS EN DROPBEAR
|
||||
|
||||
\033[1;35m●\033[1;31m REPARADO AUTOCONFIG DE SSL + (PAYLOAD / DIRECTO)
|
||||
|
||||
\033[1;38m################################################################\033[1;37m
|
||||
\033[1;42m Revisa el Historial de cambios \033[0m
|
||||
\033[1;42m En : https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/cabecalho/changelogs.fix \033[0m
|
||||
\033[1;38m################################################################\033[1;37m
|
||||
21
Recursos/cabecalho/free-men.sh
Normal file
21
Recursos/cabecalho/free-men.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
## 1 - "LIMPEZA DE DNS"
|
||||
ip -s -s neigh flush all &> /dev/null
|
||||
ip neigh flush dev $(ip route | grep default | awk '{print $5}' | head -1) &> /dev/null
|
||||
## 2 - "CACHE DO SISTEMA"
|
||||
echo 3 > /proc/sys/vm/drop_caches
|
||||
## 2 - "LIMPAR LOGS"
|
||||
echo > /var/log/messages
|
||||
echo > /var/log/kern.log
|
||||
echo > /var/log/daemon.log
|
||||
echo > /var/log/kern.log
|
||||
echo > /var/log/dpkg.log
|
||||
echo > /var/log/syslog
|
||||
#echo > /var/log/auth.log
|
||||
echo 3 > /proc/sys/vm/drop_caches 1> /dev/null 2> /dev/null
|
||||
swapoff -a && swapon -a 1> /dev/null 2> /dev/null
|
||||
killall usercodes > /dev/null 2>&1
|
||||
killall ferramentas > /dev/null 2>&1
|
||||
killall menu_inst > /dev/null 2>&1
|
||||
killall kswapd0 > /dev/null 2>&1
|
||||
echo $(free -h | grep Mem | sed 's/\s\+/,/g' | cut -d , -f4) > /bin/ejecutar/raml
|
||||
1
Recursos/cabecalho/passwd
Normal file
1
Recursos/cabecalho/passwd
Normal file
@ -0,0 +1 @@
|
||||
0000
|
||||
328
Recursos/cabecalho/updateadm
Normal file
328
Recursos/cabecalho/updateadm
Normal file
@ -0,0 +1,328 @@
|
||||
#!/bin/bash
|
||||
[[ -e /etc/adm-lite/v-local.log ]] && _Va=$(cat /etc/adm-lite/v-local.log)
|
||||
_double=$(curl -sSL "https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/Control-BOT")
|
||||
killall apt >/dev/null 2>&1 &
|
||||
service dropbear stop > /dev/null 2>&1
|
||||
service sshd restart > /dev/null 2>&1
|
||||
service dropbear restart > /dev/null 2>&1
|
||||
sudo dpkg --configure -a
|
||||
apt update -y && apt upgrade -y
|
||||
apt autoremove -y && apt autoclean -y
|
||||
clear&&clear
|
||||
[[ -d /etc/alx ]] || mkdir /etc/alx
|
||||
foxvalid="/etc/$1" && [[ ! -d ${foxvalid} ]] && exit
|
||||
print_center(){
|
||||
local x
|
||||
local y
|
||||
text="$*"
|
||||
x=$(( ($(tput cols) - ${#text}) / 2))
|
||||
echo -ne "\E[6n";read -sdR y; y=$(echo -ne "${y#*[}" | cut -d';' -f1)
|
||||
echo -ne "\033[${y};${x}f$*"
|
||||
}
|
||||
verificar_arq () {
|
||||
echo "$1" >> $HOME/log.txt
|
||||
echo -e "$1"
|
||||
}
|
||||
fun_limpram() {
|
||||
sync
|
||||
echo 3 >/proc/sys/vm/drop_caches
|
||||
sync && sysctl -w vm.drop_caches=3
|
||||
sysctl -w vm.drop_caches=0
|
||||
swapoff -a
|
||||
swapon -a
|
||||
rm -f /tmp/*
|
||||
killall kswapd0
|
||||
killall tcpdump
|
||||
killall ksoftirqd
|
||||
systemctl restart rsyslog.service
|
||||
systemctl restart systemd-journald.service
|
||||
[[ -e /etc/adm-lite/modulos ]] && rm -f /etc/adm-lite/modulos
|
||||
[[ -e /etc/folteto ]] && rm -f /etc/folteto
|
||||
echo " @drowkid01 " > /var/log/auth.log
|
||||
sleep 5s
|
||||
}
|
||||
function aguarde() {
|
||||
helice() {
|
||||
fun_limpram >/dev/null 2>&1 &
|
||||
tput civis
|
||||
while [ -d /proc/$! ]; do
|
||||
for i in / - \\ \|; do
|
||||
sleep .1
|
||||
echo -ne "\e[1D$i"
|
||||
done
|
||||
done
|
||||
tput cnorm
|
||||
}
|
||||
echo -ne "\033[1;37m VALIDANDO Y OPTIMIZANDO UPDATE \033[1;32m ${_Va} \033[1;37ma \033[1;32m$(cat /bin/ejecutar/v-new.log)\033[1;32m.\033[1;33m.\033[1;31m. \033[1;33m"
|
||||
helice
|
||||
echo -e "\e[1DOk"
|
||||
sleep 4s
|
||||
}
|
||||
invalid_key () {
|
||||
[[ $1 == '--ban' ]] && {
|
||||
cd $HOME
|
||||
service ssh stop
|
||||
[[ -d $HOME/chumogh ]] && rm -rf $HOME/chumogh
|
||||
[[ -d /etc/adm-lite ]] && rm -rf /etc/adm-lite
|
||||
[[ -e /etc/cghkey ]] && rm -f /etc/cghkey
|
||||
[[ -e /bin/menu ]] && rm /bin/menu
|
||||
[[ -e $HOME/log.txt ]] && rm -f $HOME/log.txt
|
||||
[[ -e /bin/troj.sh ]] && rm -f /bin/troj.sh
|
||||
[[ -e /bin/v2r.sh ]] && rm -f /bin/v2r.sh
|
||||
[[ -e /bin/xr.sh ]] && rm -f /bin/xr.sh
|
||||
[[ -e /bin/clash.sh ]] && rm -f /bin/clash.sh
|
||||
rm -f instala.* > /dev/null
|
||||
rm -f /bin/cgh > /dev/null
|
||||
rm -rf /bin/ejecutar > /dev/null
|
||||
figlet " Key Invalida" | boxes -d stone -p a2v1 > error.log
|
||||
echo -e "$(msg -bar)" >> error.log
|
||||
echo " KEY NO PERMITIDA, ADQUIERE UN RESELLER OFICIAL" >> error.log
|
||||
echo " ----------------------------------------------" >> error.log
|
||||
echo " KEY NO PERMITIDA, ADQUIERE UN RESELLER OFICIAL" >> error.log
|
||||
echo " ----------------------------------------------" >> error.log
|
||||
echo -e ' https://t.me/ChumoGH - @drowkid01' >> error.log
|
||||
echo -e "$(msg -bar)" >> error.log
|
||||
cat error.log | lolcat
|
||||
echo 'clear&&clear
|
||||
echo -e "\n\n\n \033[0;31m==================================================
|
||||
¡ 🚫 DROPLET BANEADA 🚫 ! KEY USADA O REGISTRADA NO OFICIAL
|
||||
================================================== \n\n
|
||||
SI CONSIDERA QUE FUE UN ERROR, TECLEA ** cgh **
|
||||
"
|
||||
' > /bin/menu
|
||||
exit&&exit&&exit&&exit
|
||||
}
|
||||
}
|
||||
valid(){
|
||||
[[ -e $HOME/log.txt ]] && rm -f $HOME/log.txt
|
||||
[[ -e /etc/adm-lite/PDirect.py ]] && mv /etc/adm-lite/PDirect.py /bin/ejecutar/PDirect.py
|
||||
Key=$1
|
||||
echo " $Key "
|
||||
_sys="$(lsb_release -si)-$(lsb_release -sr)"
|
||||
new_id=$(uuidgen)
|
||||
wget --no-check-certificate -O $HOME/lista-arq $(ofus "$Key")/$(wget -qO- ipv4.icanhazip.com)/UPDATE/${new_id} > /dev/null 2>&1 && {
|
||||
chmod 777 $HOME/lista-arq
|
||||
}
|
||||
[[ $(cat < $HOME/lista-arq) = "KEY INVALIDA!" || $(cat < $HOME/lista-arq) = "" ]] && {
|
||||
echo "KEY INVALIDA O CADUCADA"
|
||||
} || {
|
||||
n=1
|
||||
IP=$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') && echo "$IP" > /usr/bin/vendor_code
|
||||
_checkBT="$(echo -e "$_double"|grep "$IP")"
|
||||
if [ -z "${_checkBT}" ]; then
|
||||
rm -f $HOME/lista*
|
||||
tput cuu1 && tput dl1
|
||||
echo -e "\n\e[3;31mRECHAZADA, POR GENERADOR NO AUTORIZADO!!\e[0m\n" && sleep 1s
|
||||
echo
|
||||
echo -e "\e[3;31mESTE USUARIO NO ESTA AUTORIZADO !!\e[0m" && sleep 1s
|
||||
invalid_key "--ban"
|
||||
exit
|
||||
tput cuu1 && tput dl1
|
||||
fi
|
||||
SCPinstal="./update"
|
||||
REQUEST=$(ofus "$Key"|cut -d'/' -f2)
|
||||
[[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal}
|
||||
pontos="."
|
||||
stopping=" COMPROBANDO "|sed -e 's/[^a-z -]//ig'
|
||||
for arqx in $(cat $HOME/lista-arq); do
|
||||
msg -verm "${stopping} ${pontos}" && sleep 0.2s
|
||||
wget --no-check-certificate -O $HOME/update/${arqx} ${IP}:81/${REQUEST}/${arqx} > /dev/null 2>&1 && verificar_arq "${arqx}"
|
||||
tput cuu1 && tput dl1
|
||||
pontos+="."
|
||||
n=$(($n + 1))
|
||||
done
|
||||
echo "$(cat < $HOME/log.txt | wc -l)"
|
||||
for arqs in `ls $HOME/update`; do
|
||||
fun_filez $arqs
|
||||
sleep 1s
|
||||
tput cuu1 && tput dl1
|
||||
done
|
||||
echo ${Key} > /etc/cghkey
|
||||
echo -e "$(cat /etc/adm-lite/menu_credito|head -1)" > /bin/ejecutar/menu_credito && chmod +x /bin/ejecutar/menu_credito
|
||||
[[ -e /etc/adm-lite/vencidos ]] && rm /etc/adm-lite/vencidos
|
||||
[[ -e /etc/adm-lite/onlines ]] && rm /etc/adm-lite/onlines
|
||||
[[ -e /bin/ejecutar/uskill ]] && ukk=$(cat /bin/ejecutar/uskill) || echo 0 > /bin/ejecutar/uskill
|
||||
[[ $ukk = "" ]] && echo 0 > /bin/ejecutar/uskill
|
||||
[[ -e $HOME/lista-arq ]] && rm $HOME/lista-arq
|
||||
[[ -d $HOME/update ]] && rm -rf $HOME/update
|
||||
[[ -e /bin/ejecutar/PDirect.py ]] && mv /bin/ejecutar/PDirect.py /etc/adm-lite/PDirect.py
|
||||
[[ -e /bin/ejecutar/usCONEXT ]] && rm -f /bin/ejecutar/usCONEXT
|
||||
[[ -e /bin/ejecutar/usCONEXC ]] && rm -f /bin/ejecutar/usCONEXC
|
||||
[[ "$lista_atualizados" != "" ]] && echo -e "${cor[5]} $lista_atualizados ${txt[206]}" && {
|
||||
tput cuu1 && tput dl1 && echo -e " ${_upd}"
|
||||
echo -e "$(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/cabecalho/changelogs.log)"
|
||||
[[ $(cat < $HOME/log.txt | wc -l ) -ge 10 ]] && echo $Key > /etc/cghkey && chmod 777 /etc/cghkey
|
||||
}|| echo -e " \033[1;45m NO $lista_atualizados ${txt[208]}\033[0m"
|
||||
[[ -e /bin/ejecutar/echo-ram.sh ]] && bash /bin/ejecutar/echo-ram.sh > /dev/null 2>&1
|
||||
}
|
||||
}
|
||||
ofus () {
|
||||
unset txtofus
|
||||
number=$(expr length $1)
|
||||
for((i=1; i<$number+1; i++)); do
|
||||
txt[$i]=$(echo "$1" | cut -b $i)
|
||||
case ${txt[$i]} in
|
||||
".")txt[$i]="x";;
|
||||
"x")txt[$i]=".";;
|
||||
"5")txt[$i]="s";;
|
||||
"s")txt[$i]="5";;
|
||||
"1")txt[$i]="@";;
|
||||
"@")txt[$i]="1";;
|
||||
"2")txt[$i]="?";;
|
||||
"?")txt[$i]="2";;
|
||||
"4")txt[$i]="0";;
|
||||
"0")txt[$i]="4";;
|
||||
"/")txt[$i]="K";;
|
||||
"K")txt[$i]="/";;
|
||||
esac
|
||||
txtofus+="${txt[$i]}"
|
||||
done
|
||||
echo "$txtofus" | rev
|
||||
}
|
||||
fun_filez () {
|
||||
arq="/etc/adm-lite/$1"
|
||||
arq2="$HOME/update/$1"
|
||||
[[ ! -e "/etc/adm-lite/$1" ]] && {
|
||||
mv -f $arq2 $arq
|
||||
return
|
||||
}
|
||||
equal=$(diff -q $arq $arq2)
|
||||
[[ "$equal" = "" ]] && rm $arq2 || {
|
||||
mv -f $arq2 $arq
|
||||
chmod +x $arq
|
||||
lista_atualizados=$(($lista_atualizados + 1))
|
||||
echo -e " \033[1;32m ♳ ➢ $1 - ${txt[205]}!"
|
||||
_upd+="FILE ${lista_atualizados} : /bin/$1 -> FIXED \n"
|
||||
tput cuu1 && tput dl1
|
||||
sleep 0.2s
|
||||
}
|
||||
}
|
||||
namsobin ()
|
||||
{
|
||||
echo -e "\033[1;37m 〠★ ACTUALIZADOR ChumoGH ADM ★ 】\033[0m"
|
||||
msg -bar
|
||||
echo -e "$barra"
|
||||
echo -e "\033[92m -- INSTALANDO PAQUETES AÑADIDOS -- "
|
||||
echo -e "$barra"
|
||||
echo -ne "\033[97m # REPACK BUILD MOD .................... "
|
||||
(
|
||||
wget -q -O /bin/ejecutar/msg https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg
|
||||
[[ $(dpkg --get-selections|grep -w "bsdmainutils"|head -1) ]] || apt-get install bsdmainutils -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "psmisc"|head -1) ]] || apt-get install psmisc -y &>/dev/null
|
||||
) && ESTATUS=`echo -e "\033[92m FIXED"` &>/dev/null || ESTATUS=`echo -e "\033[91mERROR AL PARCHAR"` &>/dev/null
|
||||
echo -e "$ESTATUS "
|
||||
apt install bc -y &>/dev/null
|
||||
echo -ne "\033[97m # REPACK NEW FUNCION ..................."
|
||||
(echo 'source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/cabecalho/free-men.sh)' > /bin/ejecutar/echo-ram.sh
|
||||
wget -q -O /var/www/html/index.html https://gitea.com/drowkid01/scriptdk1/raw/branch/main/html/index.html && cp /var/www/html/index.html /var/www/index.html
|
||||
wget https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/killSSH.sh &>/dev/null -O /bin/killssh &>/dev/null
|
||||
echo 'wget --no-check-certificate -q -O /bin/ejecutar/v-new.log https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/cabecalho/v-new.log' >> /bin/ejecutar/echo-ram.sh && bash /bin/ejecutar/echo-ram.sh) && ESTATUS=`echo -e "\033[92mAGREGADAS"` &>/dev/null || ESTATUS=`echo -e "\033[91mFALLO EN AÑADIR"` &>/dev/null
|
||||
echo -e "$ESTATUS "
|
||||
clavlink="$(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/cabecalho/passwd)"
|
||||
msg -bar
|
||||
echo -e " SI DESEAS MANTENER TU VERSION \n SOLO PRESIONA ENTER"
|
||||
msg -bar
|
||||
[[ -z $entrada ]] && read -p " PEGA TU KEY: " passw
|
||||
if [[ -z $passw ]]; then
|
||||
permited="$clavlink"
|
||||
else
|
||||
keyupdate=$passw
|
||||
permited=$(ofus $passw)
|
||||
passw=$permited
|
||||
fi
|
||||
if [[ $permited = $passw ]]; then
|
||||
clear
|
||||
[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m =====>>►► 🲠New ChumoGH��VPS 🲠◄◄<<===== \033[0m"
|
||||
echo -e "\033[1;37m 〠★ Reseller : $(cat < /bin/ejecutar/menu_credito) 2022 ★ 】\033[0m"
|
||||
msg -bar
|
||||
echo -e " \033[41m-- Arch : $(lscpu | grep "Vendor ID" | awk '{print $3}') SISTEMA $(lsb_release -si) $(lsb_release -sr) --"
|
||||
msg -bar
|
||||
echo -e "\033[1;37m VERIFICANDO TU KEY DE ACTUALIZACION......" | pv -qL 40
|
||||
msg -bar
|
||||
cd $HOME
|
||||
[[ -d $HOME/update ]] && rm -rf $HOME/update
|
||||
[[ -e $HOME/lista ]] && rm $HOME/lista
|
||||
cd $HOME
|
||||
[[ -z $keyupdate ]] && permited=$(cat < /etc/cghkey) || permited=$keyupdate
|
||||
echo -e "\033[1;37m TU KEY RESGISTRADA "
|
||||
[[ -e /etc/cghkey ]] && echo -e "\033[1;36m\033[1;33mã€$(cat /etc/cghkey)】" | pv -qL 25 || echo "qra-atsil$(date | md5sum | head -c10)8888:$(ofus $(wget -qO- ifconfig.me))" > /etc/cghkey
|
||||
[[ $(cat < /etc/cghkey) = $permited ]] && {
|
||||
echo -e "\033[1;36m\033[1;33m 〠KEY INVALIDA PARA UPDATE 】"
|
||||
unset permited
|
||||
[[ -z $permited ]] && wget --no-check-certificate -O lista https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/cabecalho/lista -o /dev/null && atualiza_fun
|
||||
} || {
|
||||
echo -e "\033[1;36m\033[1;33m 〠REG KEY NUEVA PARA UPDATE 】"
|
||||
[[ ! -z $permited ]] && valid "$keyupdate"
|
||||
}
|
||||
else
|
||||
clear
|
||||
msg -bar
|
||||
echo -e "\033[1;37m LA CONTRASEÑA o KEY NO COINCIDE "
|
||||
echo -e "\033[1;37m ACTUALIZACION NO AUTORIZADA !"
|
||||
echo -e "\033[1;37m Contacte con Vendedor de la KEY"
|
||||
msg -bar
|
||||
sleep 1
|
||||
fi
|
||||
}
|
||||
atualiza_fun () {
|
||||
echo -e " UPDATE LOCAL "
|
||||
tput cuu1 && tput dl1
|
||||
msg -bar
|
||||
cd $HOME
|
||||
[[ ! -d ./update ]] && mkdir ./update
|
||||
cd ./update
|
||||
wget -i $HOME/lista -o /dev/null
|
||||
[[ -e gerar.sh ]] && rm -f gerar.sh
|
||||
for arqs in `ls $HOME/update`; do
|
||||
fun_filez $arqs
|
||||
sleep 1.5s
|
||||
done
|
||||
[[ -e /etc/adm-lite/vencidos ]] && rm /etc/adm-lite/vencidos
|
||||
[[ -e /etc/adm-lite/onlines ]] && rm /etc/adm-lite/onlines
|
||||
[[ -e /bin/ejecutar/uskill ]] && ukk=$(cat /bin/ejecutar/uskill) || echo 0 > /bin/ejecutar/uskill
|
||||
[[ $ukk = "" ]] && echo 0 > /bin/ejecutar/uskill
|
||||
[[ -e $HOME/lista ]] && rm $HOME/lista
|
||||
[[ -d $HOME/update ]] && rm -rf $HOME/update
|
||||
[[ "$lista_atualizados" != "" ]] && echo -e "${cor[5]} $lista_atualizados ${txt[206]}" && echo -e "$(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/cabecalho/changelogs.log)" || echo -e " \033[1;45m NO $lista_atualizados ${txt[208]}\033[0m"
|
||||
[[ -e /bin/ejecutar/echo-ram.sh ]] && bash /bin/ejecutar/echo-ram.sh > /dev/null 2>&1
|
||||
[[ -e /etc/adm-lite/idioma ]] && rm /etc/adm-lite/idioma
|
||||
}
|
||||
cor[1]="\033[1;36m"
|
||||
cor[2]="\033[1;32m"
|
||||
cor[3]="\033[1;31m"
|
||||
cor[4]="\033[1;33m"
|
||||
cor[0]="\033[1;37m"
|
||||
txt[206]="Actualizado(s)!"
|
||||
txt[208]="Existe Actualizacion Pendiente!"
|
||||
txt[207]="Valid!!!"
|
||||
txt[203]="⊘ ➢"
|
||||
txt[204]="♳ ➢"
|
||||
txt[205]="✓"
|
||||
[[ -e /bin/ejecutar/menu_credito ]] && echo "" || echo "$(cat /etc/adm-lite/menu_credito|head -1))" > /bin/ejecutar/menu_credito && chmod +x /bin/ejecutar/menu_credito
|
||||
catress=$(cat < /bin/ejecutar/menu_credito)
|
||||
[[ -z $catress ]] && echo "Verified〠New @drowkid01 2021" > /bin/ejecutar/menu_credito
|
||||
namsobin
|
||||
echo "Verified〠$(cat /bin/ejecutar/menu_credito)" > /bin/ejecutar/exito
|
||||
[[ -z $(cat /etc/adm-lite/menu_credito|head -1) ]] && echo "Verified〠New @drowkid01 2021" > /root/exito
|
||||
sleep 0.5s
|
||||
msg -bar
|
||||
echo -e " \033[1;45m $(cat < /bin/ejecutar/exito)© 】 $(cat /bin/ejecutar/v-new.log)\033[0m"
|
||||
[[ -e $HOME/name ]] && mv /root/name /bin/ejecutar/
|
||||
msg -bar
|
||||
cd $HOME
|
||||
for _pids_ in `atq | awk '{print $1}'`; do
|
||||
atrm $_pids_
|
||||
done
|
||||
echo -e " ESPERE MIENTRAS VALIDAMOS SU KEY "
|
||||
echo ""
|
||||
aguarde
|
||||
echo ""
|
||||
echo -e " VUELVA A INGRESAR PARA VALIDAR ACTUALIZACION"
|
||||
msg -bar
|
||||
killall kswapd0 > /dev/null 2>&1
|
||||
killall ksoftirqd > /dev/null 2>&1
|
||||
killall menu_inst > /dev/null 2>&1
|
||||
killall -y 5s tcpdump > /dev/null 2>&1
|
||||
echo -e "${cor[0]} SALIENDO " | pv -qL 50
|
||||
sleep 2s
|
||||
exit&&exit
|
||||
1
Recursos/cabecalho/v-new.log
Normal file
1
Recursos/cabecalho/v-new.log
Normal file
@ -0,0 +1 @@
|
||||
V1
|
||||
336
Recursos/certificadossl.sh
Normal file
336
Recursos/certificadossl.sh
Normal file
@ -0,0 +1,336 @@
|
||||
#!/bin/bash
|
||||
#====FUNCIONES==========
|
||||
|
||||
# SI USAS ESTE FORMATO, RECUERDA CAMBIAR TUS ZONAS ID DE TU DOMINIO #
|
||||
# INCLUIDO CON EL TOKEN DE TU ZONA DIRIGIDO A TU DOMINIO #
|
||||
# NO SEAS RATA Y CONFIERE SOLICITUD DIRECTO CON EL DESARROLLADOR !! #
|
||||
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/module)
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg)
|
||||
ADM_crt=''
|
||||
Key="$(cat /etc/cghkey)"
|
||||
#jq
|
||||
|
||||
fssl() {
|
||||
msg -bar
|
||||
echo ""
|
||||
echo -e " INSTALL SERVICIOS NECESARIOS "
|
||||
echo ""
|
||||
msg -bar
|
||||
[[ $(dpkg --get-selections|grep -w "jq"|head -1) ]] || apt-get install jq -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "jq"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "jq"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install jq ................. $ESTATUS "
|
||||
[[ $(dpkg --get-selections|grep -w "nodejs"|head -1) ]] || apt-get install nodejs -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "nodejs"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "nodejs"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install nodejs .............. $ESTATUS "
|
||||
[[ $(dpkg --get-selections|grep -w "npm"|head -1) ]] || apt-get install npm -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "npm"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "npm"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install npm ................ $ESTATUS "
|
||||
echo "" > /etc/fixcssl
|
||||
}
|
||||
|
||||
[[ -e /etc/fixcssl ]] || fssl
|
||||
|
||||
cert_install(){
|
||||
#apt install socat netcat -y
|
||||
if [[ ! -e $HOME/.acme.sh/acme.sh ]];then
|
||||
msg -bar3
|
||||
msg -ama " Instalando script acme.sh"
|
||||
curl -s "https://get.acme.sh" | sh &>/dev/null
|
||||
fi
|
||||
if [[ ! -z "${mail}" ]]; then
|
||||
title "LOGEANDO EN Zerossl"
|
||||
sleep 3
|
||||
$HOME/.acme.sh/acme.sh --register-account -m ${mail} --server zerossl
|
||||
$HOME/.acme.sh/acme.sh --set-default-ca --server zerossl
|
||||
enter
|
||||
else
|
||||
title "APLICANDO SERVIDOR letsencrypt"
|
||||
sleep 3
|
||||
$HOME/.acme.sh/acme.sh --set-default-ca --server letsencrypt
|
||||
enter
|
||||
fi
|
||||
title "GENERANDO CERTIFICADO SSL"
|
||||
sleep 3
|
||||
if "$HOME"/.acme.sh/acme.sh --issue -d "${domain}" --standalone -k ec-256 --force; then
|
||||
"$HOME"/.acme.sh/acme.sh --installcert -d "${domain}" --fullchainpath ${ADM_crt}/${domain}.crt --keypath ${ADM_crt}/${domain}.key --ecc --force &>/dev/null
|
||||
[[ ! -d /data ]] && mkdir /data
|
||||
[[ -e ${ADM_crt}/${domain}.crt ]] && cp ${ADM_crt}/${domain}.crt /data/cert.crt
|
||||
[[ -e ${ADM_crt}/${domain}.key ]] && cp ${ADM_crt}/${domain}.key /data/cert.key
|
||||
[[ -e ${ADM_crt}/ca.cer ]] && cp ${ADM_crt}/ca.cer /data/ca.crt
|
||||
rm -rf $HOME/.acme.sh/${domain}_ecc
|
||||
msg -bar
|
||||
print_center -verd "Certificado SSL se genero con éxito"
|
||||
#echo "${ADM_crt}/${domain}.crt "
|
||||
_mssBOT "CERTIFICADO EMTIDO EXITOSAMENTE" "$domain"
|
||||
enter
|
||||
else
|
||||
rm -rf "$HOME/.acme.sh/${domain}_ecc"
|
||||
msg -bar
|
||||
print_center -verm2 "Error al generar el certificado SSL"
|
||||
_mssBOT " ERROR AL EMITIR CERTIFICADO " "$domain"
|
||||
msg -bar
|
||||
msg -ama " verifique los posibles error"
|
||||
msg -ama " e intente de nuevo"
|
||||
enter
|
||||
fi
|
||||
}
|
||||
|
||||
ext_cert(){
|
||||
unset cert
|
||||
declare -A cert
|
||||
title "INTALADOR DE CERTIFICADO EXTERNO"
|
||||
print_center -azu "Requiere tener a mano su certificado ssl"
|
||||
print_center -azu "junto a su correspondiente clave privada"
|
||||
msg -bar
|
||||
msg -ne " Continuar...[S/N]: "
|
||||
read opcion
|
||||
[[ $opcion != @(S|s|Y|y) ]] && return 1
|
||||
|
||||
|
||||
title "INGRESE EL CONTENIDO DE SU CERTIFICADO SSL"
|
||||
msg -ama ' a continuacion se abrira el editor de texto nano
|
||||
ingrese el contenido de su certificado
|
||||
guardar precionando "CTRL+x"
|
||||
luego "S o Y" segun el idioma
|
||||
y por ultimo "enter"'
|
||||
msg -bar
|
||||
msg -ne " Continuar...[S/N]: "
|
||||
read opcion
|
||||
[[ $opcion != @(S|s|Y|y) ]] && return 1
|
||||
rm -rf ${ADM_tmp}/tmp.crt
|
||||
clear
|
||||
nano ${ADM_tmp}/tmp.crt
|
||||
|
||||
title "INGRESE EL CONTENIDO DE CLAVE PRIVADA"
|
||||
msg -ama ' a continuacion se abrira el editor de texto nano
|
||||
ingrese el contenido de su clave privada.
|
||||
guardar precionando "CTRL+x"
|
||||
luego "S o Y" segun el idioma
|
||||
y por ultimo "enter"'
|
||||
msg -bar
|
||||
msg -ne " Continuar...[S/N]: "
|
||||
read opcion
|
||||
[[ $opcion != @(S|s|Y|y) ]] && return 1
|
||||
${ADM_tmp}/tmp.key
|
||||
clear
|
||||
nano ${ADM_tmp}/tmp.key
|
||||
|
||||
if openssl x509 -in ${ADM_tmp}/tmp.crt -text -noout &>/dev/null ; then
|
||||
DNS=$(openssl x509 -in ${ADM_tmp}/tmp.crt -text -noout | grep 'DNS:'|sed 's/, /\n/g'|sed 's/DNS:\| //g')
|
||||
rm -rf ${ADM_crt}/*
|
||||
if [[ $(echo "$DNS"|wc -l) -gt "1" ]]; then
|
||||
DNS="multi-domain"
|
||||
fi
|
||||
mv ${ADM_tmp}/tmp.crt ${ADM_crt}/$DNS.crt
|
||||
mv ${ADM_tmp}/tmp.key ${ADM_crt}/$DNS.key
|
||||
|
||||
title "INSTALACION COMPLETA"
|
||||
echo -e "$(msg -verm2 "Domi: ")$(msg -ama "$DNS")"
|
||||
echo -e "$(msg -verm2 "Emit: ")$(msg -ama "$(openssl x509 -noout -in ${ADM_crt}/$DNS.crt -startdate|sed 's/notBefore=//g')")"
|
||||
echo -e "$(msg -verm2 "Expi: ")$(msg -ama "$(openssl x509 -noout -in ${ADM_crt}/$DNS.crt -enddate|sed 's/notAfter=//g')")"
|
||||
echo -e "$(msg -verm2 "Cert: ")$(msg -ama "$(openssl x509 -noout -in ${ADM_crt}/$DNS.crt -issuer|sed 's/issuer=//g'|sed 's/ = /=/g'|sed 's/, /\n /g')")"
|
||||
msg -bar
|
||||
echo "$DNS" > ${ADM_src}/dominio.txt
|
||||
read foo
|
||||
else
|
||||
rm -rf ${ADM_tmp}/tmp.crt
|
||||
rm -rf ${ADM_tmp}/tmp.key
|
||||
clear
|
||||
msg -bar
|
||||
print_center -verm2 "ERROR DE DATOS"
|
||||
msg -bar
|
||||
msg -ama " Los datos ingresados no son validos.\n por favor verifique.\n e intente de nuevo!!"
|
||||
msg -bar
|
||||
read foo
|
||||
fi
|
||||
}
|
||||
|
||||
stop_port(){
|
||||
msg -bar3
|
||||
msg -ama " Comprovando puertos..."
|
||||
ports=('80' '443')
|
||||
|
||||
for i in ${ports[@]}; do
|
||||
if [[ 0 -ne $(lsof -i:$i | grep -i -c "listen") ]]; then
|
||||
msg -bar3
|
||||
echo -ne "$(msg -ama " Liberando puerto: $i")"
|
||||
lsof -i:$i | awk '{print $2}' | grep -v "PID" | xargs kill -9
|
||||
sleep 2s
|
||||
if [[ 0 -ne $(lsof -i:$i | grep -i -c "listen") ]];then
|
||||
tput cuu1 && tput dl1
|
||||
print_center -verm2 "ERROR AL LIBERAR PURTO $i"
|
||||
msg -bar3
|
||||
msg -ama " Puerto $i en uso."
|
||||
msg -ama " auto-liberacion fallida"
|
||||
msg -ama " detenga el puerto $i manualmente"
|
||||
msg -ama " e intentar nuevamente..."
|
||||
msg -bar
|
||||
read foo
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
ger_cert(){
|
||||
clear
|
||||
case $1 in
|
||||
1) title "Generador De Certificado Let's Encrypt";;
|
||||
2) title "Generador De Certificado Zerossl";;
|
||||
esac
|
||||
print_center -ama "Requiere ingresar un dominio."
|
||||
print_center -ama "el mismo solo deve resolver DNS, y apuntar"
|
||||
print_center -ama "a la direccion ip de este servidor."
|
||||
msg -bar3
|
||||
print_center -ama "Temporalmente requiere tener"
|
||||
print_center -ama "los puertos 80 y 443 libres."
|
||||
if [[ $1 = 2 ]]; then
|
||||
msg -bar3
|
||||
print_center -ama "Requiere tener una cuenta Zerossl."
|
||||
fi
|
||||
msg -bar
|
||||
msg -ne " Continuar [S/N]: "
|
||||
read opcion
|
||||
[[ $opcion != @(s|S|y|Y) ]] && return 1
|
||||
|
||||
if [[ $1 = 2 ]]; then
|
||||
while [[ -z $mail ]]; do
|
||||
clear
|
||||
msg -bar
|
||||
print_center -ama "ingresa tu correo usado en zerossl"
|
||||
msg -bar3
|
||||
msg -ne " >>> "
|
||||
read mail
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -e ${ADM_src}/dominio.txt ]]; then
|
||||
domain=$(cat ${ADM_src}/dominio.txt)
|
||||
[[ $domain = "multi-domain" ]] && unset domain
|
||||
if [[ ! -z $domain ]]; then
|
||||
clear
|
||||
msg -bar
|
||||
print_center -azu "Dominio asociado a esta ip"
|
||||
msg -bar3
|
||||
echo -e "$(msg -verm2 " >>> ") $(msg -ama "$domain")"
|
||||
msg -ne "Continuar, usando este dominio? [S/N]: "
|
||||
read opcion
|
||||
tput cuu1 && tput dl1
|
||||
[[ $opcion != @(S|s|Y|y) ]] && unset domain
|
||||
fi
|
||||
fi
|
||||
|
||||
while [[ -z $domain ]]; do
|
||||
clear
|
||||
msg -bar
|
||||
print_center -ama "ingresa tu dominio"
|
||||
msg -bar3
|
||||
msg -ne " >>> "
|
||||
read domain
|
||||
done
|
||||
msg -bar3
|
||||
msg -ama " Comprovando direccion IP ..."
|
||||
local_ip=$(wget -qO- ipv4.icanhazip.com)
|
||||
domain_ip=$(ping "${domain}" -c 1 | sed '1{s/[^(]*(//;s/).*//;q}')
|
||||
sleep 3
|
||||
[[ -z "${domain_ip}" ]] && domain_ip="ip no encontrada"
|
||||
if [[ $(echo "${local_ip}" | tr '.' '+' | bc) -ne $(echo "${domain_ip}" | tr '.' '+' | bc) ]]; then
|
||||
clear
|
||||
msg -bar
|
||||
print_center -verm2 "ERROR DE DIRECCION IP"
|
||||
msg -bar
|
||||
msg -ama " La direccion ip de su dominio\n no coincide con la de su servidor."
|
||||
msg -bar3
|
||||
echo -e " $(msg -azu "IP dominio: ")$(msg -verm2 "${domain_ip}")"
|
||||
echo -e " $(msg -azu "IP servidor: ")$(msg -verm2 "${local_ip}")"
|
||||
msg -bar3
|
||||
msg -ama " Verifique su dominio, e intente de nuevo."
|
||||
msg -bar
|
||||
read foo
|
||||
fi
|
||||
stop_port
|
||||
cert_install
|
||||
echo "$domain" > ${ADM_src}/dominio.txt
|
||||
}
|
||||
|
||||
_mssBOT () {
|
||||
xyz=$(curl -sSL "https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/token.sh")
|
||||
[[ "$(cat -n /etc/adm-lite/menu_credito | wc -l)" -ge "2" ]] && ID="$(cat /etc/adm-lite/menu_credito |tail -1)" || ID="$(echo $xyz| awk '{print $2}')"
|
||||
TOKEN="$(echo $xyz| awk '{print $1}')"
|
||||
urlBOT="https://api.telegram.org/bot$TOKEN/sendMessage"
|
||||
data=$1
|
||||
dm=$2
|
||||
_ns=$3
|
||||
MENSAJE="${TTini}${m3ssg}MSG RECIVIDO${m3ssg}${TTfin}\n"
|
||||
MENSAJE+="$(msg -br)\n"
|
||||
MENSAJE+=" ${data} \n"
|
||||
MENSAJE+=" IP : $(wget -qO- ifconfig.me) -> ${dm}\n"
|
||||
[[ -z ${_ns} ]] || MENSAJE+=" TIPO A :-> ${dm} \n TIPO NS :-> ${_ns}\n"
|
||||
MENSAJE+="$(msg -br)\n"
|
||||
MENSAJE+=" KEY : ${Key}\n"
|
||||
MENSAJE+="$(msg -br)\n"
|
||||
MENSAJE+=" HORA : $(printf '%(%D-%H:%M:%S)T')\n"
|
||||
MENSAJE+=" ${rUlq} Bot generador de key ${rUlq}\n"
|
||||
MENSAJE+=" ${pUn5A} By @drowkid01 ${pUn5A} \n"
|
||||
MENSAJE+="$(msg -br)\n"
|
||||
curl -s --max-time 10 -d "chat_id=$ID&disable_web_page_preview=1&text=$(echo -e "$MENSAJE")" $urlBOT &>/dev/null
|
||||
}
|
||||
|
||||
gen_domi(){
|
||||
msg -bar
|
||||
echo -e "ESTA FUNCION FUE REMOVIDA DEVIDO A LA VIOLACION DE TOKENS"
|
||||
echo -e " AHORA PARA GENERAR SUBDOMINIOS TIPO A Y NS"
|
||||
echo -e " DEBEN SER GENERADOS DESDE EL BOT OFICIAL "
|
||||
echo -e " DONDE ADQUIRISTE ESTE KEY U ACCESO!!! "
|
||||
msg -bar
|
||||
enter
|
||||
}
|
||||
|
||||
ger_cert_z(){
|
||||
echo ""
|
||||
|
||||
}
|
||||
chandom_cert_z(){
|
||||
echo ""
|
||||
[[ -e ${ADM_src}/dominio.txt ]] && echo -e "TU DOMINIO ACTUAL ES : $(cat ${ADM_src}/dominio.txt)" || echo -e " NO EXISTE DOMINIO REGISTRADO"
|
||||
echo -e ""
|
||||
msg -bar
|
||||
read -p "INGRESSA NUEVO DOMINIO :" dom
|
||||
[[ -z $dom ]] && return
|
||||
[[ $dom = 0 ]] && return
|
||||
echo "$dom" > ${ADM_src}/dominio.txt && echo -e "DOMINIO CAMBIADO EXITOSAMENTE" || echo -e "ERROR AL CAMBIAR DOMINIO"
|
||||
}
|
||||
|
||||
|
||||
#======MENU======
|
||||
menu_cert(){
|
||||
|
||||
while true; do
|
||||
msg -bar
|
||||
tittle
|
||||
msg -ama " SUB-DOMINIO Y CERTIFICADO SSL | @drowkid01"
|
||||
msg -bar #
|
||||
[[ -e ${ADM_src}/dominio.txt ]] && echo -e " DOMAIN Tipo A -> @ : $(cat < ${ADM_src}/dominio.txt)" && msg -bar
|
||||
[[ -e ${ADM_src}/dominio_NS.txt ]] && echo -e " DOMAIN Tipo NS : $(cat < ${ADM_src}/dominio_NS.txt)" && msg -bar
|
||||
menu_func "CERT SSL (Let's Encrypt)" "CERT SSL (Zerossl)" "CARGAR CERT SSL EXTERNO" "GENERAR SUB-DOMINIO CloudFlare " "CAMBIAR DOMINIO" "VERIFICAR DOMINIOS"
|
||||
back
|
||||
in_opcion "Opcion"
|
||||
|
||||
case $opcion in
|
||||
1)ger_cert 1;;
|
||||
2)ger_cert 2;;
|
||||
3)ext_cert;;
|
||||
4)gen_domi;;
|
||||
5)chandom_cert_z;;
|
||||
6)verific
|
||||
domain_ls;;
|
||||
0)break;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
menu_cert
|
||||
|
||||
2266
Recursos/clash-beta.sh
Normal file
2266
Recursos/clash-beta.sh
Normal file
File diff suppressed because it is too large
Load Diff
174
Recursos/down-vxray.sh
Normal file
174
Recursos/down-vxray.sh
Normal file
@ -0,0 +1,174 @@
|
||||
#!/bin/bash
|
||||
source msg
|
||||
BEIJING_UPDATE_TIME=3
|
||||
BEGIN_PATH=$(pwd)
|
||||
INSTALL_WAY=0
|
||||
HELP=0
|
||||
REMOVE=0
|
||||
CHINESE=0
|
||||
BASE_SOURCE_PATH="https://multi.netlify.app"
|
||||
UTIL_PATH="/etc/v2ray_util/util.cfg"
|
||||
UTIL_CFG="$BASE_SOURCE_PATH/v2ray_util/util_core/util.cfg"
|
||||
BASH_COMPLETION_SHELL="$BASE_SOURCE_PATH/v2ray"
|
||||
CLEAN_IPTABLES_SHELL="$BASE_SOURCE_PATH/v2ray_util/global_setting/clean_iptables.sh"
|
||||
#Centos 临时取消别名
|
||||
[[ -f /etc/redhat-release && -z $(echo $SHELL|grep zsh) ]] && unalias -a
|
||||
[[ -z $(echo $SHELL|grep zsh) ]] && ENV_FILE=".bashrc" || ENV_FILE=".zshrc"
|
||||
|
||||
[[ $(whoami) != 'root' ]] && {
|
||||
msg -verm 'se requiere ser usuario root para ejecutar el svript!'
|
||||
rm -rf `pwd`/$0
|
||||
exit
|
||||
} || {
|
||||
[[ ! -e /var/ins ]] && {
|
||||
if [[ `command -v apt-get` ]];then
|
||||
PACKAGE_MANAGER='apt-get'
|
||||
elif [[ `command -v dnf` ]];then
|
||||
PACKAGE_MANAGER='dnf'
|
||||
elif [[ `command -v yum` ]];then
|
||||
PACKAGE_MANAGER='yum'
|
||||
else
|
||||
msg -verm 'sistema operativo no soportado'
|
||||
exit 1
|
||||
fi
|
||||
touch /var/ins
|
||||
}
|
||||
}
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
echo -e "\e[1;97muso: \e[1;93m$0 \e[1;97m[\e[35m-h\e[1;97m|\e[35m--help\e[1;97m] [\e[35m-k\e[1;97m|\e[35m--keep\e[1;97m] [\e[35m--remove\e[1;97m]\n \e[93mEjemplos:"
|
||||
echo -e " \e[35m-h, --help \e[1;97m| Menú de ayuda"
|
||||
echo -e " \e[35m-k, --keep \e[1;97m| Restaurar archivo de instalación."
|
||||
echo -e " \e[35m --remove \e[1;97m| Remover configuraciones v2ray/xray."
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
-k | --keep);;
|
||||
-h | --help);;
|
||||
--instal)
|
||||
if [ -s /etc/selinux/config ] && grep 'SELINUX=enforcing' /etc/selinux/config; then
|
||||
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
|
||||
setenforce 0
|
||||
fi
|
||||
echo -e "${Info} Sincronizando tiempo!.. ${Font}"
|
||||
if [[ `command -v ntpdate` ]];then
|
||||
ntpdate pool.ntp.org
|
||||
elif [[ `command -v chronyc` ]];then
|
||||
chronyc -a makestep
|
||||
fi
|
||||
|
||||
if [[ $? -eq 0 ]];then
|
||||
echo -e "${OK} Tiempo Sync Exitosamente ${Font}"
|
||||
echo -e "${OK} Ahora: `date -R`${Font}"
|
||||
fi
|
||||
[[ ! $(type pip 2>/dev/null) ]] && colorEcho $RED "pip no install!" && exit 1
|
||||
|
||||
[[ -e /etc/profile.d/iptables.sh ]] && rm -f /etc/profile.d/iptables.sh
|
||||
|
||||
RC_SERVICE=`systemctl status rc-local|grep loaded|egrep -o "[A-Za-z/]+/rc-local.service"`
|
||||
|
||||
RC_FILE=`cat $RC_SERVICE|grep ExecStart|awk '{print $1}'|cut -d = -f2`
|
||||
|
||||
if [[ ! -e $RC_FILE || -z `cat $RC_FILE|grep iptables` ]];then
|
||||
LOCAL_IP=`curl -s http://api.ipify.org 2>/dev/null`
|
||||
[[ `echo $LOCAL_IP|grep :` ]] && IPTABLE_WAY="ip6tables" || IPTABLE_WAY="iptables"
|
||||
if [[ ! -e $RC_FILE || -z `cat $RC_FILE|grep "/bin/bash"` ]];then
|
||||
echo "#!/bin/bash" >> $RC_FILE
|
||||
fi
|
||||
if [[ -z `cat $RC_SERVICE|grep "\[Install\]"` ]];then
|
||||
cat >> $RC_SERVICE << EOF
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
echo "[[ -e /root/.iptables ]] && $IPTABLE_WAY-restore -c < /root/.iptables" >> $RC_FILE
|
||||
chmod +x $RC_FILE
|
||||
systemctl restart rc-local
|
||||
systemctl enable rc-local
|
||||
|
||||
$IPTABLE_WAY-save -c > /root/.iptables
|
||||
fi
|
||||
pip install -U v2ray_util
|
||||
if [[ -e $UTIL_PATH ]];then
|
||||
[[ -z $(cat $UTIL_PATH|grep lang) ]] && echo "lang=en" >> $UTIL_PATH
|
||||
else
|
||||
mkdir -p /etc/v2ray_util
|
||||
curl $UTIL_CFG > $UTIL_PATH
|
||||
fi
|
||||
[[ $CHINESE == 1 ]] && sed -i "s/lang=en/lang=zh/g" $UTIL_PATH
|
||||
rm -f /usr/local/bin/v2ray >/dev/null 2>&1
|
||||
ln -s $(which v2ray-util) /usr/local/bin/v2ray
|
||||
rm -f /usr/local/bin/xray >/dev/null 2>&1
|
||||
ln -s $(which v2ray-util) /usr/local/bin/xray
|
||||
[[ -e /etc/bash_completion.d/v2ray.bash ]] && rm -f /etc/bash_completion.d/v2ray.bash
|
||||
[[ -e /usr/share/bash-completion/completions/v2ray.bash ]] && rm -f /usr/share/bash-completion/completions/v2ray.bash
|
||||
curl $BASH_COMPLETION_SHELL > /usr/share/bash-completion/completions/v2ray
|
||||
curl $BASH_COMPLETION_SHELL > /usr/share/bash-completion/completions/xray
|
||||
if [[ -z $(echo $SHELL|grep zsh) ]];then
|
||||
source /usr/share/bash-completion/completions/v2ray
|
||||
source /usr/share/bash-completion/completions/xray
|
||||
fi
|
||||
bash <(curl -L -s https://multi.netlify.app/go.sh) --version v4.45.2
|
||||
[[ $(grep v2ray ~/$ENV_FILE) ]] && sed -i '/v2ray/d' ~/$ENV_FILE && source ~/$ENV_FILE
|
||||
[[ -z $(grep PYTHONIOENCODING=utf-8 ~/$ENV_FILE) ]] && echo "export PYTHONIOENCODING=utf-8" >> ~/$ENV_FILE && source ~/$ENV_FILE
|
||||
v2ray new
|
||||
|
||||
echo ""
|
||||
clear&&clear
|
||||
config='/etc/v2ray/config.json'
|
||||
tmp='/etc/v2ray/temp.json'
|
||||
[[ ! -e $config ]] && touch $config
|
||||
chmod 777 $config
|
||||
msg -bar
|
||||
if [[ $(v2ray restart|grep success) ]]; then
|
||||
[[ $(which v2ray) ]] && v2ray info
|
||||
msg -bar
|
||||
echo -e "\033[1;32mINSTALACION FINALIZADA"
|
||||
else
|
||||
[[ $(which v2ray) ]] && v2ray info
|
||||
msg -bar
|
||||
print_center -verm2 "INSTALACION FINALIZADA"
|
||||
echo -e "\033[1;31m " 'Pero fallo el reinicio del servicio v2ray'
|
||||
echo -e " LEA DETALLADAMENTE LOS MENSAJES "
|
||||
echo -e ""
|
||||
fi
|
||||
cd ${BEGIN_PATH}
|
||||
msg -verd "multi-v2ray install success!\n"
|
||||
echo -e "Por favor verifique el log"
|
||||
enter
|
||||
;;
|
||||
--remove)
|
||||
bash <(curl -L -s https://multi.netlify.app/go.sh) --remove >/dev/null 2>&1
|
||||
bash <(curl -L -s https://multi.netlify.app/go.sh) --remove -x >/dev/null 2>&1
|
||||
for delete in `echo "/etc/v2ray /var/log/v2ray /etc/xray /var/log/xray"`; do
|
||||
(
|
||||
rm -rf "$delete"
|
||||
) &> /dev/null
|
||||
done
|
||||
bash <(curl -L -s https://multi.netlify.app/v2ray_util/global_setting/clean_iptables.sh)
|
||||
pip uninstall v2ray_util -y
|
||||
for delete in `echo "/usr/share/bash-completion/completions/v2ray.bash /usr/share/bash-completion/completions/v2ray /usr/share/bash-completion/completions/xray /etc/bash_completion.d/v2ray.bash /usr/local/bin/v2ray /etc/v2ray_util /etc/profile.d/iptables.sh /root/.iptables"`; do
|
||||
(
|
||||
rm -rf "$delete"
|
||||
) &> /dev/null
|
||||
done
|
||||
crontab -l|sed '/SHELL=/d;/v2ray/d'|sed '/SHELL=/d;/xray/d' > crontab.txt
|
||||
crontab crontab.txt >/dev/null 2>&1
|
||||
rm -f crontab.txt >/dev/null 2>&1
|
||||
if [[ ${PACKAGE_MANAGER} == 'dnf' || ${PACKAGE_MANAGER} == 'yum' ]];then
|
||||
systemctl restart crond >/dev/null 2>&1
|
||||
else
|
||||
systemctl restart cron >/dev/null 2>&1
|
||||
fi
|
||||
sed -i '/v2ray/d' ~/$ENV_FILE
|
||||
sed -i '/xray/d' ~/$ENV_FILE
|
||||
source ~/$ENV_FILE
|
||||
RC_SERVICE=`systemctl status rc-local|grep loaded|egrep -o "[A-Za-z/]+/rc-local.service"`
|
||||
RC_FILE=`cat $RC_SERVICE|grep ExecStart|awk '{print $1}'|cut -d = -f2`
|
||||
sed -i '/iptables/d' ~/$RC_FILE
|
||||
msg -bar&&echo -e " $(msg -verd '[✓] módulo v2ray/xray desinstalado correctamente! [✓] ')"
|
||||
;;
|
||||
esac
|
||||
|
||||
BIN
Recursos/ferramentas/badvpn-udpgw-arm
Normal file
BIN
Recursos/ferramentas/badvpn-udpgw-arm
Normal file
Binary file not shown.
BIN
Recursos/ferramentas/badvpn-udpgw-plus
Normal file
BIN
Recursos/ferramentas/badvpn-udpgw-plus
Normal file
Binary file not shown.
184
Recursos/ferramentas/budp.sh
Normal file
184
Recursos/ferramentas/budp.sh
Normal file
@ -0,0 +1,184 @@
|
||||
#!/bin/bash
|
||||
#01/06/2022
|
||||
# UPDATE 26/11/2023
|
||||
#By @drowkid01|Plus
|
||||
|
||||
function chekKEY {
|
||||
[[ -z ${IP} ]] && IP=$(cat < /bin/ejecutar/IPcgh)
|
||||
[[ -z ${IP} ]] && IP=$(wget -qO- ifconfig.me)
|
||||
Key="$(cat /etc/cghkey)"
|
||||
_double=$(curl -sSL "https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/Control-BOT")
|
||||
IiP="$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
|
||||
[[ -e /file ]] && _double=$(cat < /file) || {
|
||||
wget -q -O /file https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/Control-BOT
|
||||
_double=$(cat < /file)
|
||||
}
|
||||
_check2="$(echo -e "$_double" | grep ${IiP})"
|
||||
[[ ! -e /etc/folteto ]] && {
|
||||
wget --no-check-certificate -O /etc/folteto $IiP:81/ChumoGH/checkIP.log
|
||||
cheklist="$(cat /etc/folteto)"
|
||||
echo -e "$(echo -e "$cheklist" | grep ${IP})" > /etc/folteto
|
||||
}
|
||||
[[ -z ${_check2} ]] && {
|
||||
mss_='\n BotGEN NO AUTORIZADO POR @drowkid01 '
|
||||
cat <<EOF >/bin/menu
|
||||
clear && clear
|
||||
echo -e "\n\n\033[1;31m==================================================\n ¡¡ 🚫 KEY BANEADA 🚫 ! CONTACTE Su ADMINISTRADOR! \n==================================================\n ¡¡ FECHA DE BANEO :$(date +%d/%m/%Y) HORA :$(date +%H:%M:%S) \n==================================================\n\n¡¡ ${mss_} \n\n==================================================\n"
|
||||
echo -e " \e[1;32m --- SI CONSIDERA QUE FUE UN ERROR --- " | pv -qL 60
|
||||
echo -e " \e[1;32m -- ${mss_} -- " | pv -qL 60
|
||||
echo -e "\n \e[1;93m --- TECLEA \e[1;93m --- \e[1;97mcgh -fix\e[1;93m --- " | pv -qL 50
|
||||
echo -e "\n\033[1;31m==================================================\n\n"
|
||||
#echo "/etc/adm-lite/menu" > /bin/menu && chmod +x /bin/menu
|
||||
EOF
|
||||
|
||||
rm -f /etc/folteto
|
||||
rm -f /etc/adm-lite/menu*
|
||||
MENSAJE="${TTini}${m3ssg}MSG RECIVIDO${m3ssg}${TTfin}\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" IP Clon: ${IP} Rechazada\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" INSECTO DETECTADO EN BadVPN Plus\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" Key : ${Key}\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" HORA : $(printf '%(%D-%H:%M:%S)T')\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" ${rUlq} Bot ADMcgh de keyS ${rUlq}\n"
|
||||
MENSAJE+=" ${pUn5A} By @drowkid01 ${pUn5A} \n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
curl -s --max-time 10 -d "chat_id=$ID&disable_web_page_preview=1&text=$(echo -e "$MENSAJE")" $urlBOT &>/dev/null
|
||||
exit && exit
|
||||
}
|
||||
}
|
||||
|
||||
BadVPN () {
|
||||
msg -bar
|
||||
pid_badvpn=$(ps x | grep badvpn | grep -v grep | awk '{print $1}')
|
||||
unset bot_ini
|
||||
if [ "$pid_badvpn" = "" ]; then
|
||||
msg -ama " FUNCION EXPERIMENTAL AGREGARA PUERTO 7300 en BADVPN-UDP"
|
||||
msg -ama " ADICIONAL APERTURARENOS EL 7200 PARA UN DUAL CHANNEL"
|
||||
#msg -ama " MAXIMO DE 100 CONEXIONES POR CLIENTE"
|
||||
msg -bar
|
||||
[[ $(dpkg --get-selections|grep -w "toilet"|head -1) ]] || apt-get install toilet -y &>/dev/null
|
||||
if [[ ! -e /bin/badvpn-udpgw ]]; then
|
||||
echo -ne " DESCARGANDO BINARIO UDP .."
|
||||
[[ $(uname -m 2> /dev/null) != x86_64 ]] && {
|
||||
chekKEY &> /dev/null 2>&1
|
||||
if wget -O /bin/badvpn-udpgw https://github.com/emirjorge/Script-Z/raw/master/CHUMO/Recursos/ferramentas/badvpn-udpgw-arm &>/dev/null ; then
|
||||
chmod 777 /bin/badvpn-udpgw
|
||||
msg -verd "[OK]"
|
||||
else
|
||||
msg -verm "[fail]"
|
||||
msg -bar
|
||||
msg -ama "No se pudo descargar el binario"
|
||||
msg -verm "Instalacion canselada"
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
exit 0
|
||||
fi
|
||||
} || {
|
||||
chekKEY &> /dev/null 2>&1
|
||||
if wget -O /bin/badvpn-udpgw https://github.com/emirjorge/Script-Z/raw/master/CHUMO/Recursos/ferramentas/badvpn-udpgw-plus &>/dev/null ; then
|
||||
chmod 777 /bin/badvpn-udpgw
|
||||
msg -verd "[OK]"
|
||||
else
|
||||
msg -verm "[fail]"
|
||||
msg -bar
|
||||
msg -ama "No se pudo descargar el binario"
|
||||
msg -verm "Instalacion canselada"
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
msg -ama " ACTIVANDO BADVPN Plus"
|
||||
msg -bar
|
||||
tput cuu1 && tput dl1
|
||||
tput cuu1 && tput dl1
|
||||
fi
|
||||
(
|
||||
screen -dmS badvpn $(which badvpn-udpgw) --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10 #--client-socket-sndbuf 10000
|
||||
screen -dmS badUDP72 $(which badvpn-udpgw) --listen-addr 127.0.0.1:7200 --max-clients 1000 --max-connections-for-client 10 #--client-socket-sndbuf 10000
|
||||
# screen -dmS badvpn $(which badvpn-udpgw) --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10
|
||||
# screen -dmS badUDP72 $(which badvpn-udpgw) --listen-addr 127.0.0.1:7200 --max-clients 1000 --max-connections-for-client 10
|
||||
) || msg -ama " Error al Activar BadVPN"
|
||||
sleep 2s
|
||||
msg -bar
|
||||
[[ ! -z $(ps x | grep badvpn | grep -v grep ) ]] && {
|
||||
msg -verd " ACTIVADO CON EXITO"
|
||||
msg -bar
|
||||
echo -e " PREGUNTA PREVIA POR 15 SEGUNDOS !!!"
|
||||
msg -bar
|
||||
read -t 15 -p " $(echo -e "\033[1;97m Poner en linea despues de un reinicio [s/n]: ")" -e -i "s" bot_ini
|
||||
msg -bar
|
||||
tput cuu1 && tput dl1
|
||||
tput cuu1 && tput dl1
|
||||
tput cuu1 && tput dl1
|
||||
tput cuu1 && tput dl1
|
||||
tput cuu1 && tput dl1
|
||||
[[ $bot_ini = @(s|S|y|Y) ]] && {
|
||||
[[ $(grep -wc "badvpn" /bin/autoboot) = '0' ]] && {
|
||||
echo -e " AUTOREINICIO EN INACTIVIDAD PREACTIVADO !! " && sleep 2s
|
||||
tput cuu1 && tput dl1
|
||||
echo -e "netstat -tlpn | grep -w 7300 > /dev/null || { screen -r -S 'badvpn' -X quit; screen -dmS badvpn $(which badvpn-udpgw) --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10; }" >>/bin/autoboot
|
||||
echo -e "netstat -tlpn | grep -w 7200 > /dev/null || { screen -r -S 'badUDP72' -X quit; screen -dmS badUDP72 $(which badvpn-udpgw) --listen-addr 127.0.0.1:7200 --max-clients 10000 --max-connections-for-client 10; }" >>/bin/autoboot
|
||||
} || {
|
||||
sed -i '/badvpn/d' /bin/autoboot
|
||||
echo -e " AUTOREINICIO EN INACTIVIDAD REACTIVADO !! " && sleep 2s
|
||||
tput cuu1 && tput dl1
|
||||
echo -e "netstat -tlpn | grep -w 7300 > /dev/null || { screen -r -S 'badvpn' -X quit; screen -dmS badvpn $(which badvpn-udpgw) --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10; }" >>/bin/autoboot
|
||||
echo -e "netstat -tlpn | grep -w 7200 > /dev/null || { screen -r -S 'badUDP72' -X quit; screen -dmS badUDP72 $(which badvpn-udpgw) --listen-addr 127.0.0.1:7200 --max-clients 1000 --max-connections-for-client 10; }" >>/bin/autoboot
|
||||
}
|
||||
#-------------------------
|
||||
} || sed -i '/badvpn-udpgw/d' /bin/autoboot
|
||||
}
|
||||
|
||||
else
|
||||
clear&&clear
|
||||
msg -bar
|
||||
msg -ama " Administrador BadVPN UDP | @drowkid01•Plus"
|
||||
msg -bar
|
||||
menu_func "AÑADIR 1+ PUERTO BadVPN $_pid" "$(msg -verm2 "Detener BadVPN")" #"$(msg -ama "Reiniciar BadVPN")"
|
||||
echo -ne "$(msg -verd " [0]") $(msg -verm2 "=>>") " && msg -bra "\033[1;41m Volver "
|
||||
msg -bar
|
||||
opcion=$(selection_fun 2)
|
||||
case $opcion in
|
||||
1)
|
||||
msg -bar
|
||||
msg -ama " FUNCION EXPERIMENTAL AGREGARA PUERTO en BADVPN-UDP"
|
||||
#msg -ama " ADICIONAL APERTURARENOS EL 7200 PARA UN DUAL CHANNEL"
|
||||
#msg -ama " MAXIMO DE 100 CONEXIONES POR CLIENTE"
|
||||
msg -bar
|
||||
read -p " DIJITA TU PUERTO CUSTOM PARA BADVPN :" -e -i "7100" port
|
||||
echo -e " VERIFICANDO BADVPN "
|
||||
msg -bar
|
||||
screen -dmS badvpn$port /bin/badvpn-udpgw --listen-addr 127.0.0.1:${port} --max-clients 1000 --max-connections-for-client 10 && msg -ama " BadVPN ACTIVADA CON EXITO" || msg -ama " Error al Activar BadVPN"
|
||||
echo -e "netstat -tlpn | grep -w ${port} > /dev/null || { screen -r -S 'badvpn'$port -X quit; screen -dmS badvpn $(which badvpn-udpgw) --listen-addr 127.0.0.1:${port} --max-clients 1000 --max-connections-for-client 10; }" >>/bin/autoboot
|
||||
msg -bar
|
||||
return
|
||||
;;
|
||||
2)
|
||||
msg -ama " DESACTIVANDO BADVPN"
|
||||
msg -bar
|
||||
kill -9 $(ps x | grep badvpn | grep -v grep | awk '{print $1'}) > /dev/null 2>&1
|
||||
killall badvpn-udpgw > /dev/null 2>&1
|
||||
sed -i '/badvpn/d' /bin/autoboot
|
||||
echo -e " AUTOREINICIO EN INACTIVIDAD ELIMINADO !! " && sleep 2s
|
||||
tput cuu1 && tput dl1
|
||||
[[ ! "$(ps x | grep badvpn | grep -v grep | awk '{print $1}')" ]] && msg -ama " APAGADO EXITOSAMENTE \n" || msg -verm " ERROR AL DETENER BadVPN!! \n"
|
||||
unset pid_badvpn
|
||||
msg -bar
|
||||
return
|
||||
;;
|
||||
3) exit;;
|
||||
0) exit;;
|
||||
esac
|
||||
fi
|
||||
unset pid_badvpn
|
||||
}
|
||||
BadVPN
|
||||
msg -bar
|
||||
clear&&clear
|
||||
msg -bar
|
||||
toilet -f pagga "ChuKK-SCRIPT" | lolcat
|
||||
msg -bar
|
||||
return
|
||||
462
Recursos/ferramentas/fai2ban.sh
Normal file
462
Recursos/ferramentas/fai2ban.sh
Normal file
@ -0,0 +1,462 @@
|
||||
#!/bin/bash
|
||||
souece msg
|
||||
failtwoban=$(dpkg -l | grep fail2ban | grep ii)
|
||||
apache=$(dpkg -l | grep apache2 | grep ii)
|
||||
squid=$(dpkg -l | grep squid | grep ii)
|
||||
dropbear=$(dpkg -l | grep dropbear | grep ii)
|
||||
openssh=$(dpkg -l | grep openssh | grep ii)
|
||||
|
||||
[[ -z $openssh ]] || s1="SSH"
|
||||
[[ -z $squid ]] || s2="SQUID"
|
||||
[[ -z $dropbear ]] || s3="DROPBEAR"
|
||||
[[ -z $apache ]] || s4="APACHE2"
|
||||
|
||||
msg -bar
|
||||
|
||||
#FUN_BAR
|
||||
fun_bar () {
|
||||
comando="$1"
|
||||
_=$(
|
||||
$comando > /dev/null 2>&1
|
||||
) & > /dev/null
|
||||
pid=$!
|
||||
while [[ -d /proc/$pid ]]; do
|
||||
echo -ne " \033[1;33m["
|
||||
for((i=0; i<10; i++)); do
|
||||
echo -ne "\033[1;31m##"
|
||||
sleep 0.2
|
||||
done
|
||||
echo -ne "\033[1;33m]"
|
||||
sleep 1s
|
||||
echo
|
||||
tput cuu1
|
||||
tput dl1
|
||||
done
|
||||
echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
|
||||
sleep 1s
|
||||
}
|
||||
|
||||
fail2ban_function () {
|
||||
if [ "$failtwoban" != "" ]; then
|
||||
echo -e "${cor[4]} ${txt[143]}"
|
||||
echo -e "${cor[2]} |1| >${cor[3]} DESINSTALAR SERVICIO"
|
||||
echo -e "${cor[2]} |2| >${cor[3]} VER REGISTRO DE EVENTOS"
|
||||
msg -bar
|
||||
read -p " [1|2]: " lo_og
|
||||
if [ "$lo_og" = "2" ]; then
|
||||
cat /var/log/fail2ban.log
|
||||
fi
|
||||
if [ "$lo_og" = "1" ]; then
|
||||
msg -bar
|
||||
fun_bar "apt-get remove fail2ban -y"
|
||||
fi
|
||||
msg -bar
|
||||
return
|
||||
fi
|
||||
|
||||
echo -e "${cor[5]} Este es el FAILBAN PROTECTION"
|
||||
echo -e "${cor[5]} Hecho únicamente para proteger la seguridad del"
|
||||
echo -e "${cor[5]} Sistema, su objetivo es analizar"
|
||||
echo -e "${cor[5]} LOGS DE ACCESO y bloquear toda"
|
||||
echo -e "${cor[5]} acción sospechosa CONTRA EL SERVIDOR"
|
||||
echo -e "${cor[5]} aumentando en un 90% de su seguridad."
|
||||
echo -e "${cor[5]} ¿Desea instalar Fail2Ban?"
|
||||
|
||||
msg -bar
|
||||
read -p " [S/N]: " fail2ban
|
||||
if [[ "$fail2ban" = "s" || "$fail2ban" = "S" ]]; then
|
||||
msg -bar
|
||||
fun_bar "apt-get install fail2ban -y"
|
||||
cd $HOME
|
||||
wget -O fail2ban https://github.com/emirjorge/Script-Z/raw/master/CHUMO/Recursos/ferramentas/fail2ban-0.9.4.tar.gz -o /dev/null
|
||||
tar -xf $HOME/fail2ban
|
||||
cd $HOME/fail2ban-0.9.4
|
||||
fun_bar "./setup.py install"
|
||||
echo '[INCLUDES]
|
||||
before = paths-debian.conf
|
||||
[DEFAULT]
|
||||
ignoreip = 127.0.0.1/8
|
||||
# ignorecommand = /path/to/command <ip>
|
||||
ignorecommand =
|
||||
bantime = 1036800
|
||||
findtime = 3600
|
||||
maxretry = 5
|
||||
backend = auto
|
||||
usedns = warn
|
||||
logencoding = auto
|
||||
enabled = false
|
||||
filter = %(__name__)s
|
||||
destemail = root@localhost
|
||||
sender = root@localhost
|
||||
mta = sendmail
|
||||
protocol = tcp
|
||||
chain = INPUT
|
||||
port = 0:65535
|
||||
fail2ban_agent = Fail2Ban/%(fail2ban_version)s
|
||||
banaction = iptables-multiport
|
||||
banaction_allports = iptables-allports
|
||||
action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
%(mta)s-whois[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
action_mwl = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
%(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
|
||||
action_xarf = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
xarf-login-attack[service=%(__name__)s, sender="%(sender)s", logpath=%(logpath)s, port="%(port)s"]
|
||||
action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"]
|
||||
%(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
|
||||
action_blocklist_de = blocklist_de[email="%(sender)s", service=%(filter)s, apikey="%(blocklist_de_apikey)s", agent="%(fail2ban_agent)s"]
|
||||
action_badips = badips.py[category="%(__name__)s", banaction="%(banaction)s", agent="%(fail2ban_agent)s"]
|
||||
action_badips_report = badips[category="%(__name__)s", agent="%(fail2ban_agent)s"]
|
||||
action = %(action_)s' > /etc/fail2ban/jail.local
|
||||
msg -bar
|
||||
echo -e "${cor[5]} Fail2ban Sera Instalado"
|
||||
echo -e "${cor[5]} Siguientes Servicios"
|
||||
[[ -z $s1 ]] || echo -ne " $s1"
|
||||
[[ -z $s2 ]] || echo -ne " $s2"
|
||||
[[ -z $s3 ]] || echo -ne " $s3"
|
||||
[[ -z $s4 ]] || echo -ne " $s4"
|
||||
echo -e ""
|
||||
msg -bar
|
||||
echo -e "${cor[5]} ¿Confirma la elección?"
|
||||
read -p " [S/N]: " sim_nao
|
||||
if [[ "$sim_nao" = "s" || "$sim_nao" = "S" ]]; then
|
||||
[[ ! -z $s1 ]] && {
|
||||
echo '[sshd]
|
||||
enabled = true
|
||||
port = ssh
|
||||
logpath = %(sshd_log)s
|
||||
backend = %(sshd_backend)s
|
||||
[sshd-ddos]
|
||||
enabled = true
|
||||
port = ssh
|
||||
logpath = %(sshd_log)s
|
||||
backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
|
||||
} || {
|
||||
echo '[sshd]
|
||||
port = ssh
|
||||
logpath = %(sshd_log)s
|
||||
backend = %(sshd_backend)s
|
||||
[sshd-ddos]
|
||||
port = ssh
|
||||
logpath = %(sshd_log)s
|
||||
backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
|
||||
}
|
||||
|
||||
[[ ! -z $s2 ]] && {
|
||||
echo '[squid]
|
||||
enabled = true
|
||||
port = 80,443,3128,8080
|
||||
logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
|
||||
} || {
|
||||
echo '[squid]
|
||||
port = 80,443,3128,8080
|
||||
logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
|
||||
}
|
||||
[[ ! -z $s3 ]] && {
|
||||
echo '[dropbear]
|
||||
enabled = true
|
||||
port = ssh
|
||||
logpath = %(dropbear_log)s
|
||||
backend = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
|
||||
} || {
|
||||
echo '[dropbear]
|
||||
port = ssh
|
||||
logpath = %(dropbear_log)s
|
||||
backend = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
|
||||
}
|
||||
[[ ! -z $s4 ]] && {
|
||||
echo '[apache-auth]
|
||||
enabled = true
|
||||
port = http,https
|
||||
logpath = %(apache_error_log)s' >> /etc/fail2ban/jail.local
|
||||
} || {
|
||||
echo '[apache-auth]
|
||||
port = http,https
|
||||
logpath = %(apache_error_log)s' >> /etc/fail2ban/jail.local
|
||||
}
|
||||
echo '[selinux-ssh]
|
||||
port = ssh
|
||||
logpath = %(auditd_log)s
|
||||
[apache-badbots]
|
||||
port = http,https
|
||||
logpath = %(apache_access_log)s
|
||||
bantime = 172800
|
||||
maxretry = 1
|
||||
[apache-noscript]
|
||||
port = http,https
|
||||
logpath = %(apache_error_log)s
|
||||
[apache-overflows]
|
||||
port = http,https
|
||||
logpath = %(apache_error_log)s
|
||||
maxretry = 2
|
||||
[apache-nohome]
|
||||
port = http,https
|
||||
logpath = %(apache_error_log)s
|
||||
maxretry = 2
|
||||
[apache-botsearch]
|
||||
port = http,https
|
||||
logpath = %(apache_error_log)s
|
||||
maxretry = 2
|
||||
[apache-fakegooglebot]
|
||||
port = http,https
|
||||
logpath = %(apache_access_log)s
|
||||
maxretry = 1
|
||||
ignorecommand = %(ignorecommands_dir)s/apache-fakegooglebot <ip>
|
||||
[apache-modsecurity]
|
||||
port = http,https
|
||||
logpath = %(apache_error_log)s
|
||||
maxretry = 2
|
||||
[apache-shellshock]
|
||||
port = http,https
|
||||
logpath = %(apache_error_log)s
|
||||
maxretry = 1
|
||||
[openhab-auth]
|
||||
filter = openhab
|
||||
action = iptables-allports[name=NoAuthFailures]
|
||||
logpath = /opt/openhab/logs/request.log
|
||||
[nginx-http-auth]
|
||||
port = http,https
|
||||
logpath = %(nginx_error_log)s
|
||||
[nginx-limit-req]
|
||||
port = http,https
|
||||
logpath = %(nginx_error_log)s
|
||||
[nginx-botsearch]
|
||||
port = http,https
|
||||
logpath = %(nginx_error_log)s
|
||||
maxretry = 2
|
||||
[php-url-fopen]
|
||||
port = http,https
|
||||
logpath = %(nginx_access_log)s
|
||||
%(apache_access_log)s
|
||||
[suhosin]
|
||||
port = http,https
|
||||
logpath = %(suhosin_log)s
|
||||
[lighttpd-auth]
|
||||
port = http,https
|
||||
logpath = %(lighttpd_error_log)s
|
||||
[roundcube-auth]
|
||||
port = http,https
|
||||
logpath = %(roundcube_errors_log)s
|
||||
[openwebmail]
|
||||
port = http,https
|
||||
logpath = /var/log/openwebmail.log
|
||||
[horde]
|
||||
port = http,https
|
||||
logpath = /var/log/horde/horde.log
|
||||
[groupoffice]
|
||||
port = http,https
|
||||
logpath = /home/groupoffice/log/info.log
|
||||
[sogo-auth]
|
||||
port = http,https
|
||||
logpath = /var/log/sogo/sogo.log
|
||||
[tine20]
|
||||
logpath = /var/log/tine20/tine20.log
|
||||
port = http,https
|
||||
[drupal-auth]
|
||||
port = http,https
|
||||
logpath = %(syslog_daemon)s
|
||||
backend = %(syslog_backend)s
|
||||
[guacamole]
|
||||
port = http,https
|
||||
logpath = /var/log/tomcat*/catalina.out
|
||||
[monit]
|
||||
#Ban clients brute-forcing the monit gui login
|
||||
port = 2812
|
||||
logpath = /var/log/monit
|
||||
[webmin-auth]
|
||||
port = 10000
|
||||
logpath = %(syslog_authpriv)s
|
||||
backend = %(syslog_backend)s
|
||||
[froxlor-auth]
|
||||
port = http,https
|
||||
logpath = %(syslog_authpriv)s
|
||||
backend = %(syslog_backend)s
|
||||
[3proxy]
|
||||
port = 3128
|
||||
logpath = /var/log/3proxy.log
|
||||
[proftpd]
|
||||
port = ftp,ftp-data,ftps,ftps-data
|
||||
logpath = %(proftpd_log)s
|
||||
backend = %(proftpd_backend)s
|
||||
[pure-ftpd]
|
||||
port = ftp,ftp-data,ftps,ftps-data
|
||||
logpath = %(pureftpd_log)s
|
||||
backend = %(pureftpd_backend)s
|
||||
[gssftpd]
|
||||
port = ftp,ftp-data,ftps,ftps-data
|
||||
logpath = %(syslog_daemon)s
|
||||
backend = %(syslog_backend)s
|
||||
[wuftpd]
|
||||
port = ftp,ftp-data,ftps,ftps-data
|
||||
logpath = %(wuftpd_log)s
|
||||
backend = %(wuftpd_backend)s
|
||||
[vsftpd]
|
||||
port = ftp,ftp-data,ftps,ftps-data
|
||||
logpath = %(vsftpd_log)s
|
||||
[assp]
|
||||
port = smtp,465,submission
|
||||
logpath = /root/path/to/assp/logs/maillog.txt
|
||||
[courier-smtp]
|
||||
port = smtp,465,submission
|
||||
logpath = %(syslog_mail)s
|
||||
backend = %(syslog_backend)s
|
||||
[postfix]
|
||||
port = smtp,465,submission
|
||||
logpath = %(postfix_log)s
|
||||
backend = %(postfix_backend)s
|
||||
[postfix-rbl]
|
||||
port = smtp,465,submission
|
||||
logpath = %(postfix_log)s
|
||||
backend = %(postfix_backend)s
|
||||
maxretry = 1
|
||||
[sendmail-auth]
|
||||
port = submission,465,smtp
|
||||
logpath = %(syslog_mail)s
|
||||
backend = %(syslog_backend)s
|
||||
[sendmail-reject]
|
||||
port = smtp,465,submission
|
||||
logpath = %(syslog_mail)s
|
||||
backend = %(syslog_backend)s
|
||||
[qmail-rbl]
|
||||
filter = qmail
|
||||
port = smtp,465,submission
|
||||
logpath = /service/qmail/log/main/current
|
||||
[dovecot]
|
||||
port = pop3,pop3s,imap,imaps,submission,465,sieve
|
||||
logpath = %(dovecot_log)s
|
||||
backend = %(dovecot_backend)s
|
||||
[sieve]
|
||||
port = smtp,465,submission
|
||||
logpath = %(dovecot_log)s
|
||||
backend = %(dovecot_backend)s
|
||||
[solid-pop3d]
|
||||
port = pop3,pop3s
|
||||
logpath = %(solidpop3d_log)s
|
||||
[exim]
|
||||
port = smtp,465,submission
|
||||
logpath = %(exim_main_log)s
|
||||
[exim-spam]
|
||||
port = smtp,465,submission
|
||||
logpath = %(exim_main_log)s
|
||||
[kerio]
|
||||
port = imap,smtp,imaps,465
|
||||
logpath = /opt/kerio/mailserver/store/logs/security.log
|
||||
[courier-auth]
|
||||
port = smtp,465,submission,imap3,imaps,pop3,pop3s
|
||||
logpath = %(syslog_mail)s
|
||||
backend = %(syslog_backend)s
|
||||
[postfix-sasl]
|
||||
port = smtp,465,submission,imap3,imaps,pop3,pop3s
|
||||
logpath = %(postfix_log)s
|
||||
backend = %(postfix_backend)s
|
||||
[perdition]
|
||||
port = imap3,imaps,pop3,pop3s
|
||||
logpath = %(syslog_mail)s
|
||||
backend = %(syslog_backend)s
|
||||
[squirrelmail]
|
||||
port = smtp,465,submission,imap2,imap3,imaps,pop3,pop3s,http,https,socks
|
||||
logpath = /var/lib/squirrelmail/prefs/squirrelmail_access_log
|
||||
[cyrus-imap]
|
||||
port = imap3,imaps
|
||||
logpath = %(syslog_mail)s
|
||||
backend = %(syslog_backend)s
|
||||
[uwimap-auth]
|
||||
port = imap3,imaps
|
||||
logpath = %(syslog_mail)s
|
||||
backend = %(syslog_backend)s
|
||||
[named-refused]
|
||||
port = domain,953
|
||||
logpath = /var/log/named/security.log
|
||||
[nsd]
|
||||
port = 53
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
logpath = /var/log/nsd.log
|
||||
[asterisk]
|
||||
port = 5060,5061
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
|
||||
logpath = /var/log/asterisk/messages
|
||||
maxretry = 10
|
||||
[freeswitch]
|
||||
port = 5060,5061
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
|
||||
logpath = /var/log/freeswitch.log
|
||||
maxretry = 10
|
||||
[mysqld-auth]
|
||||
port = 3306
|
||||
logpath = %(mysql_log)s
|
||||
backend = %(mysql_backend)s
|
||||
[recidive]
|
||||
logpath = /var/log/fail2ban.log
|
||||
banaction = %(banaction_allports)s
|
||||
bantime = 604800 ; 1 week
|
||||
findtime = 86400 ; 1 day
|
||||
[pam-generic]
|
||||
banaction = %(banaction_allports)s
|
||||
logpath = %(syslog_authpriv)s
|
||||
backend = %(syslog_backend)s
|
||||
[xinetd-fail]
|
||||
banaction = iptables-multiport-log
|
||||
logpath = %(syslog_daemon)s
|
||||
backend = %(syslog_backend)s
|
||||
maxretry = 2
|
||||
[stunnel]
|
||||
logpath = /var/log/stunnel4/stunnel.log
|
||||
[ejabberd-auth]
|
||||
port = 5222
|
||||
logpath = /var/log/ejabberd/ejabberd.log
|
||||
[counter-strike]
|
||||
logpath = /opt/cstrike/logs/L[0-9]*.log
|
||||
# Firewall: http://www.cstrike-planet.com/faq/6
|
||||
tcpport = 27030,27031,27032,27033,27034,27035,27036,27037,27038,27039
|
||||
udpport = 1200,27000,27001,27002,27003,27004,27005,27006,27007,27008,27009,27010,27011,27012,27013,27014,27015
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(tcpport)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(udpport)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
[nagios]
|
||||
logpath = %(syslog_daemon)s ; nrpe.cfg may define a different log_facility
|
||||
backend = %(syslog_backend)s
|
||||
maxretry = 1
|
||||
[directadmin]
|
||||
logpath = /var/log/directadmin/login.log
|
||||
port = 2222
|
||||
[portsentry]
|
||||
logpath = /var/lib/portsentry/portsentry.history
|
||||
maxretry = 1
|
||||
[pass2allow-ftp]
|
||||
# this pass2allow example allows FTP traffic after successful HTTP authentication
|
||||
port = ftp,ftp-data,ftps,ftps-data
|
||||
# knocking_url variable must be overridden to some secret value in filter.d/apache-pass.local
|
||||
filter = apache-pass
|
||||
# access log of the website with HTTP auth
|
||||
logpath = %(apache_access_log)s
|
||||
blocktype = RETURN
|
||||
returntype = DROP
|
||||
bantime = 3600
|
||||
maxretry = 1
|
||||
findtime = 1
|
||||
[murmur]
|
||||
port = 64738
|
||||
action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol=tcp, chain="%(chain)s", actname=%(banaction)s-tcp]
|
||||
%(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol=udp, chain="%(chain)s", actname=%(banaction)s-udp]
|
||||
logpath = /var/log/mumble-server/mumble-server.log
|
||||
[screensharingd]
|
||||
logpath = /var/log/system.log
|
||||
logencoding = utf-8
|
||||
[haproxy-http-auth]
|
||||
logpath = /var/log/haproxy.log' >> /etc/fail2ban/jail.local
|
||||
service fail2ban restart > /dev/null 2>&1
|
||||
echo -e "${cor[5]} INSTALACION TERMINADA CON EXITO"
|
||||
fi
|
||||
fi
|
||||
msg -bar
|
||||
return
|
||||
}
|
||||
|
||||
fail2ban_function
|
||||
[[ -e $HOME/fail2ban ]] && rm $HOME/fail2ban
|
||||
[[ -d $HOME/fail2ban-0.9.4 ]] && rm -rf $HOME/fail2ban-0.9.4
|
||||
|
||||
BIN
Recursos/ferramentas/fail2ban-0.9.4.tar.gz
Normal file
BIN
Recursos/ferramentas/fail2ban-0.9.4.tar.gz
Normal file
Binary file not shown.
533
Recursos/ferramentas/filebrowser.sh
Normal file
533
Recursos/ferramentas/filebrowser.sh
Normal file
@ -0,0 +1,533 @@
|
||||
#!/bin/bash
|
||||
# by @Rufu99 [rudi9999]
|
||||
# https://github.com/rudi9999/ADMRufu
|
||||
source msg
|
||||
install_file(){
|
||||
filemanager_os="unsupported"
|
||||
filemanager_arch="unknown"
|
||||
|
||||
filemanager_bin="filebrowser"
|
||||
filemanager_dl_ext=".tar.gz"
|
||||
|
||||
unamem="$(uname -m)"
|
||||
case $unamem in
|
||||
*64*)filemanager_arch="amd64";;
|
||||
*86*)filemanager_arch="386";;
|
||||
*) clear
|
||||
msg -bar
|
||||
print_center -ama "INSTALACIÓN CANCELADA\nARQUITECTURA NO SOPORTADA"
|
||||
enter
|
||||
return;;
|
||||
esac
|
||||
|
||||
unameu="$(tr '[:lower:]' '[:upper:]' <<<$(uname))"
|
||||
if [[ $unameu == *LINUX* ]]; then
|
||||
filemanager_os="linux"
|
||||
else
|
||||
clear
|
||||
msg -bar
|
||||
print_center -ama "instalacion conselada\nSistema $unameu no soportada"
|
||||
enter
|
||||
return
|
||||
fi
|
||||
|
||||
if type -p curl >/dev/null 2>&1; then
|
||||
net_getter="curl -fsSL"
|
||||
elif type -p wget >/dev/null 2>&1; then
|
||||
net_getter="wget -qO-"
|
||||
else
|
||||
clear
|
||||
print_center -ama "instalacion canselada\nNo se encontro curl o wget"
|
||||
return
|
||||
fi
|
||||
|
||||
filemanager_file="${filemanager_os}-$filemanager_arch-filebrowser$filemanager_dl_ext"
|
||||
filemanager_tag="$(${net_getter} https://api.github.com/repos/filebrowser/filebrowser/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g' | sed 's/tag_name: //g')"
|
||||
filemanager_url="https://github.com/filebrowser/filebrowser/releases/download/$filemanager_tag/$filemanager_file"
|
||||
|
||||
rm -rf "/tmp/$filemanager_file"
|
||||
|
||||
${net_getter} "$filemanager_url" > "/tmp/$filemanager_file"
|
||||
|
||||
tar -xzf "/tmp/$filemanager_file" -C "/tmp/" "$filemanager_bin"
|
||||
|
||||
chmod +x "/tmp/$filemanager_bin"
|
||||
|
||||
mv "/tmp/$filemanager_bin" "$install_path/$filemanager_bin"
|
||||
|
||||
if setcap_cmd=$(PATH+=$PATH:/sbin type -p setcap); then
|
||||
$sudo_cmd $setcap_cmd cap_net_bind_service=+ep "$install_path/$filemanager_bin"
|
||||
fi
|
||||
|
||||
rm -- "/tmp/$filemanager_file"
|
||||
|
||||
if [[ -d /etc/filebrowser ]]; then
|
||||
rm -rf /etc/filebrowser
|
||||
fi
|
||||
|
||||
adduser --system --group --HOME /etc/filebrowser/ --shell /usr/sbin/nologin --no-create-home filebrowser &>/dev/null
|
||||
mkdir -p /etc/filebrowser/style
|
||||
chown -Rc filebrowser:filebrowser /etc/filebrowser &>/dev/null
|
||||
chmod -R +x /etc/filebrowser
|
||||
touch /etc/filebrowser/filebrowser.log
|
||||
chown -c filebrowser:filebrowser /etc/filebrowser/filebrowser.log &>/dev/null
|
||||
|
||||
ip=$(ip -4 addr | grep inet | grep -vE '127(\.[0-9]{1,3}){3}' | cut -d '/' -f 1 | grep -oE '[0-9]{1,3}(\.[0-9]{1,3}){3}' | sed -n 1p)
|
||||
|
||||
cat <<EOF > /etc/filebrowser/.filebrowser.toml
|
||||
address = "$ip"
|
||||
port = 8000
|
||||
root = "/root"
|
||||
database = "/etc/filebrowser/filebrowser.db"
|
||||
log = "/etc/filebrowser/filebrowser.log"
|
||||
EOF
|
||||
|
||||
cat <<EOF > /etc/filebrowser/style/custom.css
|
||||
:root {
|
||||
--background: #141D24;
|
||||
--surfacePrimary: #20292F;
|
||||
--surfaceSecondary: #3A4147;
|
||||
--divider: rgba(255, 255, 255, 0.12);
|
||||
--icon: #ffffff;
|
||||
--textPrimary: rgba(255, 255, 255, 0.87);
|
||||
--textSecondary: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
body {
|
||||
background: var(--background);
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
|
||||
#loading {
|
||||
background: var(--background);
|
||||
}
|
||||
#loading .spinner div, main .spinner div {
|
||||
background: var(--icon);
|
||||
}
|
||||
|
||||
#login {
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
header {
|
||||
background: var(--surfacePrimary);
|
||||
}
|
||||
|
||||
#search #input {
|
||||
background: var(--surfaceSecondary);
|
||||
border-color: var(--surfacePrimary);
|
||||
}
|
||||
#search #input input::placeholder {
|
||||
color: var(--textSecondary);
|
||||
}
|
||||
#search.active #input {
|
||||
background: var(--surfacePrimary);
|
||||
}
|
||||
#search.active input {
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
#search #result {
|
||||
background: var(--background);
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
#search .boxes {
|
||||
background: var(--surfaceSecondary);
|
||||
}
|
||||
#search .boxes h3 {
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
|
||||
.action {
|
||||
color: var(--textPrimary) !important;
|
||||
}
|
||||
.action:hover {
|
||||
background-color: rgba(255, 255, 255, .1);
|
||||
}
|
||||
.action i {
|
||||
color: var(--icon) !important;
|
||||
}
|
||||
.action .counter {
|
||||
border-color: var(--surfacePrimary);
|
||||
}
|
||||
|
||||
nav > div {
|
||||
border-color: var(--divider);
|
||||
}
|
||||
|
||||
.breadcrumbs {
|
||||
border-color: var(--divider);
|
||||
color: var(--textPrimary) !important;
|
||||
}
|
||||
.breadcrumbs span {
|
||||
color: var(--textPrimary) !important;
|
||||
}
|
||||
.breadcrumbs a:hover {
|
||||
background-color: rgba(255, 255, 255, .1);
|
||||
}
|
||||
|
||||
#listing .item {
|
||||
background: var(--surfacePrimary);
|
||||
color: var(--textPrimary);
|
||||
border-color: var(--divider) !important;
|
||||
}
|
||||
#listing .item i {
|
||||
color: var(--icon);
|
||||
}
|
||||
#listing .item .modified {
|
||||
color: var(--textSecondary);
|
||||
}
|
||||
#listing h2,
|
||||
#listing.list .header span {
|
||||
color: var(--textPrimary) !important;
|
||||
}
|
||||
#listing.list .header span {
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
#listing.list .header i {
|
||||
color: var(--icon);
|
||||
}
|
||||
#listing.list .item.header {
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
.message {
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--surfacePrimary);
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
.button--flat:hover {
|
||||
background: var(--surfaceSecondary);
|
||||
}
|
||||
|
||||
.dashboard #nav ul li {
|
||||
color: var(--textSecondary);
|
||||
}
|
||||
.dashboard #nav ul li:hover {
|
||||
background: var(--surfaceSecondary);
|
||||
}
|
||||
|
||||
.card h3,
|
||||
.dashboard #nav,
|
||||
.dashboard p label {
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
.card#share input,
|
||||
.card#share select,
|
||||
.input {
|
||||
background: var(--surfaceSecondary);
|
||||
color: var(--textPrimary);
|
||||
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
.input:hover,
|
||||
.input:focus {
|
||||
border-color: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
.input--red {
|
||||
background: #73302D;
|
||||
}
|
||||
|
||||
.input--green {
|
||||
background: #147A41;
|
||||
}
|
||||
|
||||
.dashboard #nav .wrapper,
|
||||
.collapsible {
|
||||
border-color: var(--divider);
|
||||
}
|
||||
.collapsible > label * {
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
|
||||
table th {
|
||||
color: var(--textSecondary);
|
||||
}
|
||||
|
||||
.file-list li:hover {
|
||||
background: var(--surfaceSecondary);
|
||||
}
|
||||
.file-list li:before {
|
||||
color: var(--textSecondary);
|
||||
}
|
||||
.file-list li[aria-selected=true]:before {
|
||||
color: var(--icon);
|
||||
}
|
||||
|
||||
.shell {
|
||||
background: var(--surfacePrimary);
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
.shell__result {
|
||||
border-top: 1px solid var(--divider);
|
||||
}
|
||||
|
||||
#editor-container {
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
#editor-container .bar {
|
||||
background: var(--surfacePrimary);
|
||||
}
|
||||
|
||||
@media (max-width: 736px) {
|
||||
#file-selection {
|
||||
background: var(--surfaceSecondary) !important;
|
||||
}
|
||||
#file-selection span {
|
||||
color: var(--textPrimary) !important;
|
||||
}
|
||||
nav {
|
||||
background: var(--surfaceSecondary) !important;
|
||||
}
|
||||
#dropdown {
|
||||
background: var(--surfaceSecondary) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.share__box {
|
||||
background: var(--surfacePrimary) !important;
|
||||
color: var(--textPrimary);
|
||||
}
|
||||
|
||||
.share__box__element {
|
||||
border-top-color: var(--divider);
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<EOF > /etc/systemd/system/filebrowser.service
|
||||
[Unit]
|
||||
Description=Web File Browser
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
SuccessExitStatus=1
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/filebrowser
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
chmod +x /etc/filebrowser/.filebrowser.toml
|
||||
chmod +x /etc/filebrowser/style/custom.css
|
||||
chmod +x /etc/systemd/system/filebrowser.service
|
||||
|
||||
if type -p $filemanager_bin >/dev/null 2>&1; then
|
||||
set_autoport
|
||||
set_user
|
||||
set_password
|
||||
filebrowser config init --branding.name 'ChuKK-SCRIPT' --locale es --branding.disableExternal --branding.files '/etc/filebrowser/style' &>/dev/null
|
||||
filebrowser users add "$user" "$pass" --locale es --perm.admin &>/dev/null
|
||||
systemctl enable filebrowser &>/dev/null
|
||||
systemctl start filebrowser &>/dev/null
|
||||
ufw allow $port_f/tcp &>/dev/null
|
||||
#print_center -verd "instalacion completa!!!"
|
||||
echo -e "\e[1;32m [✓] FILEBROWSER INSTALADO CORRECTAMENTE [✓]"
|
||||
else
|
||||
rm -rf /etc/filebrowser
|
||||
rm -rf /usr/local/bin/filebrowser
|
||||
rm -rf /etc/systemd/system/filebrowser.service
|
||||
echo -e " $(msg -verm 'ERROR AL INSTALAR')"
|
||||
fi
|
||||
enter
|
||||
}
|
||||
|
||||
set_user(){
|
||||
while [[ -z $user ]]; do
|
||||
#in_opcion -nama "Nombre de usuario [admin]"
|
||||
msg -ne 'Ingresa un usuario [admin]: '&&read user
|
||||
if [[ -z $user ]]; then
|
||||
tput cuu1 && tput dl1
|
||||
msg -ama "USUARIO DEFAULT: \e[1;92madmin"
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
set_password(){
|
||||
while [[ -z $pass ]]; do
|
||||
#in_opcion -nama "Nombre de usuario [admin]"
|
||||
msg -ne 'Ingresa una contraseña [admin]: '&&read pass
|
||||
if [[ -z $pass ]]; then
|
||||
tput cuu1 && tput dl1
|
||||
msg -ama "CONTRASEÑA DEFAULT: \e[1;92madmin"
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
set_autoport(){
|
||||
port_f=8000
|
||||
while [[ -z $opc ]]; do
|
||||
if [[ $(mportas|grep -w "$port_f") = '' ]]; then
|
||||
opc=$port_f
|
||||
else
|
||||
let port_f++
|
||||
fi
|
||||
done
|
||||
port_f=$port_f
|
||||
oldP=$(grep 'port' /etc/filebrowser/.filebrowser.toml)
|
||||
sed -i "s/$oldP/port = $port_f/g" /etc/filebrowser/.filebrowser.toml
|
||||
}
|
||||
|
||||
desinstal_file(){
|
||||
if [[ $(systemctl is-active filebrowser) = 'active' ]]; then
|
||||
systemctl stop filebrowser &>/dev/null
|
||||
fi
|
||||
if [[ $(systemctl is-enabled filebrowser) = 'enabled' ]]; then
|
||||
systemctl disable filebrowser &>/dev/null
|
||||
fi
|
||||
userdel filebrowser &>/dev/null
|
||||
rm -rf /etc/filebrowser
|
||||
rm -rf /usr/local/bin/filebrowser
|
||||
rm -rf /etc/systemd/system/filebrowser.service
|
||||
print_center -ama "filebrowser desinstalado!!!!"
|
||||
enter
|
||||
}
|
||||
|
||||
on(){
|
||||
set_autoport
|
||||
systemctl start filebrowser &>/dev/null
|
||||
ufw allow $port_f/tcp &>/dev/null
|
||||
if [[ $(systemctl is-enabled filebrowser) = 'disabled' ]]; then
|
||||
systemctl enable filebrowser &>/dev/null
|
||||
fi
|
||||
print_center -verd "filebrowser iniciado!!!"
|
||||
}
|
||||
|
||||
off(){
|
||||
systemctl stop filebrowser &>/dev/null
|
||||
if [[ $(systemctl is-enabled filebrowser) = 'enabled' ]]; then
|
||||
systemctl disable filebrowser &>/dev/null
|
||||
fi
|
||||
print_center -ama "filebrowser detenido!!!"
|
||||
}
|
||||
|
||||
on_off_file(){
|
||||
sta=$(systemctl is-active filebrowser)
|
||||
case $sta in
|
||||
active)off;;
|
||||
failed|inactive)on;;
|
||||
esac
|
||||
enter
|
||||
}
|
||||
|
||||
reload_file(){
|
||||
set_autoport
|
||||
systemctl restart filebrowser &>/dev/null
|
||||
ufw allow $port_f/tcp &>/dev/null
|
||||
print_center -ama "servicio filebrowser reiniciado!!!"
|
||||
enter
|
||||
}
|
||||
|
||||
set_name_user(){
|
||||
set_user
|
||||
act=0
|
||||
if [[ $(systemctl is-active filebrowser) = 'active' ]]; then
|
||||
systemctl stop filebrowser &>/dev/null
|
||||
act=1
|
||||
fi
|
||||
filebrowser users update 1 --username "$user" &>/dev/null
|
||||
if [[ $act = 1 ]]; then
|
||||
systemctl start filebrowser &>/dev/null
|
||||
fi
|
||||
print_center -ama "nombre actualizado!!!"
|
||||
enter
|
||||
}
|
||||
|
||||
set_pass(){
|
||||
set_password
|
||||
act=0
|
||||
if [[ $(systemctl is-active filebrowser) = 'active' ]]; then
|
||||
systemctl stop filebrowser &>/dev/null
|
||||
act=1
|
||||
fi
|
||||
filebrowser users update 1 --password "$pass" &>/dev/null
|
||||
if [[ $act = 1 ]]; then
|
||||
systemctl start filebrowser &>/dev/null
|
||||
fi
|
||||
print_center -ama "Contraseña actualizada!!!"
|
||||
enter
|
||||
}
|
||||
|
||||
act_root(){
|
||||
act=0
|
||||
if [[ $(systemctl is-active filebrowser) = 'active' ]]; then
|
||||
systemctl stop filebrowser &>/dev/null
|
||||
act=1
|
||||
fi
|
||||
opcion=$(filebrowser users ls|grep '1'|awk -F ' ' '{print $3}')
|
||||
case $opcion in
|
||||
.)filebrowser users update 1 --scope '/' &>/dev/null
|
||||
print_center -verd 'acceso root activo!!!!';;
|
||||
/)filebrowser users update 1 --scope '.' &>/dev/null
|
||||
print_center -ama 'acceso root desavilitado!!!!';;
|
||||
esac
|
||||
if [[ $act = 1 ]]; then
|
||||
systemctl start filebrowser &>/dev/null
|
||||
fi
|
||||
enter
|
||||
}
|
||||
|
||||
menu_file(){
|
||||
install_path="/usr/local/bin"
|
||||
if [[ ! -d $install_path ]]; then
|
||||
install_path="/usr/bin"
|
||||
fi
|
||||
|
||||
#title "ADMINISTRADOR DE ARCHIVOS WEB"
|
||||
clear
|
||||
rufu=$(printext 'by @Rufu99')
|
||||
cat <<< "┏━╸╻╻ ┏━╸┏┓ ┏━┓┏━┓╻ ╻┏━┓┏━╸┏━┓
|
||||
┣╸ ┃┃ ┣╸ ┣┻┓┣┳┛┃ ┃┃╻┃┗━┓┣╸ ┣┳┛ ${rufu}
|
||||
╹ ╹┗━╸┗━╸┗━┛╹┗╸┗━┛┗┻┛┗━┛┗━╸╹┗╸"|lolcat
|
||||
msg -bar
|
||||
nu=1
|
||||
if [[ -e "$install_path/filebrowser" ]]; then
|
||||
|
||||
std='\e[1m\e[32mINICIAR FILEBROWSER'
|
||||
if [[ $(systemctl is-active filebrowser) = 'active' ]]; then
|
||||
port=$(grep 'port' /etc/filebrowser/.filebrowser.toml|cut -d ' ' -f3)
|
||||
print_center -ama 'En tu navegador web usa este url'
|
||||
print_center -teal "http://$(mip):$port"
|
||||
msg -bar
|
||||
std='\e[1;31mDETENER FILEBROWSER'
|
||||
fi
|
||||
#echo " $(msg -verd '[1]') $(msg -verm2 '>') $(msg -verm2 'DESINSTALAR FILEBROWSER')"
|
||||
#echo -e " $(msg -verd '[2]') $(msg -verm2 '>') $(msg -verd 'INICIAR')$(msg -ama '/')$(msg -verm2 'DETENER') $std"
|
||||
#echo " $(msg -verd '[3]') $(msg -verm2 '>') $(msg -azu 'REINICIAR')"
|
||||
#msg -bar3
|
||||
#echo " $(msg -verd '[4]') $(msg -verm2 '>') $(msg -ama 'MODIFICAR NOMBRE DE USUARIO')"
|
||||
#echo " $(msg -verd '[5]') $(msg -verm2 '>') $(msg -ama 'MODIFICAR CONTRASEÑA')"
|
||||
#msg -bar3
|
||||
#echo " $(msg -verd '[6]') $(msg -verm2 '>') $(msg -verd 'ACTIVAR')$(msg -ama '/')$(msg -verm2 'DESACTIVAR') $(msg -azu 'ACCESO ROOT')"
|
||||
de="$nu"; in='a'&& nu=6
|
||||
menu_func "-vm DESINSTALAR FILEBROWSER" \
|
||||
"${std}" "-bar REINICIAR" \
|
||||
"MODIFICAR NOMBRE DE USUARIO" "MODIFICAR CONTRASEÑA/PASS " \
|
||||
"\e[1;32mACTIVAR\e[1;33m/\e[1;31mDESACTIVAR \e[1;97m ACCESO ROOT"
|
||||
else
|
||||
#echo " $(msg -verd '[1]') $(msg -verm2 '>') $(msg -verd 'INSTALAR FILEBROWSER')" && in="$nu"; de='a'
|
||||
menu_func 'INSTALAR FILEBROWSER'&&in="$nu"&&de='a'
|
||||
fi
|
||||
back
|
||||
opcion=$(selection_fun $nu)
|
||||
case $opcion in
|
||||
"$in")install_file;;
|
||||
"$de")desinstal_file;;
|
||||
2)on_off_file;;
|
||||
3)reload_file;;
|
||||
4)set_name_user;;
|
||||
5)set_pass;;
|
||||
6)act_root;;
|
||||
0)return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
while [[ $? -eq 0 ]]; do
|
||||
menu_file
|
||||
done
|
||||
73
Recursos/ferramentas/gen-pays.sh
Normal file
73
Recursos/ferramentas/gen-pays.sh
Normal file
@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
source msg
|
||||
|
||||
mr=(GET CONNECT PUT OPTIONS DELETE HEAD TRACE PROPATCH PATH)
|
||||
xr=(realData netData raw)
|
||||
|
||||
value=$IP
|
||||
[[ -z $value ]] && value='127.0.0.1'
|
||||
cat <<< '┏━┓┏━┓╻ ╻╻ ┏━┓┏━┓╺┳┓┏━┓
|
||||
┣━┛┣━┫┗┳┛┃ ┃ ┃┣━┫ ┃┃┗━┓
|
||||
╹ ╹ ╹ ╹ ┗━╸┗━┛╹ ╹╺┻┛┗━┛'
|
||||
msg -bar
|
||||
while [[ -z $host ]]; do
|
||||
msg -ne 'Ingresa tu host: '&&read host
|
||||
if [[ -z $host ]]; then
|
||||
msg -verm 'INGRESA UN HOST VÁLIDO'
|
||||
sleep 2&&tput cuu1&&tput dl1&&unset host
|
||||
else
|
||||
host=$(echo $host|tr -d '[[:space:]]')
|
||||
fi
|
||||
done
|
||||
tput cuu1&&tput dl1
|
||||
echo -e "$(msg -ama 'HOST:')\e[1;97m $host"
|
||||
msg -bar
|
||||
echo -e " $(msg -ne 'ELIJA UN MÉTODO DE RESPUESTA')"
|
||||
msg -bar
|
||||
menu_func 'GET' 'CONNECT' 'PUT' 'OPTIONS' 'DELETE' 'HEAD' 'TRACE' 'PROPATCH' 'PATH'
|
||||
back
|
||||
echo -ne "\033[1;30m╰► Seleccione su opción: \e[92m"&&read rr
|
||||
[[ $rr == @([1-9]) ]] && {
|
||||
rr=$(( $rr - 1 ))
|
||||
met=${mr[$rr]}
|
||||
del 14
|
||||
msg -ama "método: \e[1;97m$met"
|
||||
}
|
||||
msg -bar
|
||||
echo -e " $(msg -ne 'ELIJA UN MÉTODO DE INYECCIÓN')"
|
||||
msg -bar
|
||||
menu_func 'realData' 'netData' 'raw'
|
||||
back
|
||||
echo -ne "\033[1;30m╰► Seleccione su opción: \e[92m"&&read zz
|
||||
[[ $zz == @([1-3]) ]] && {
|
||||
zz=$(( $zz - 1 ))
|
||||
mxt=${xr[$zz]}&&del 8
|
||||
msg -ama "inject: \e[1;97m$mxt"
|
||||
}
|
||||
msg -bar
|
||||
echo -e " $(printext 'GENERANDO PAYLOADS')"
|
||||
if [[ -e ${sdir[0]}/payloads ]]; then
|
||||
cat ${sdir[0]}/payloads > ~/pays.txt
|
||||
else
|
||||
wget -O ~/pays.txt https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Lista/payloads &> /dev/null
|
||||
fi
|
||||
|
||||
if [[ -e ~/pays.txt ]]; then
|
||||
sed -s "s;realData;abc;g" ~/pays.txt > $HOME/xd.txt
|
||||
mv -f ~/xd.txt ~/pays.txt
|
||||
sed -i "s;netData;abc;g" ~/pays.txt
|
||||
sed -i "s;raw;abc;g" ~/pays.txt
|
||||
sed -i "s;abc;$mxt;g" ~/pays.txt
|
||||
sed -i "s;get;$met;g" ~/pays.txt
|
||||
sed -i "s;mhost;$host;g" ~/pays.txt
|
||||
sed -i "s;mip;$value;g" ~/pays.txt
|
||||
msg -bar
|
||||
msg -verd "[✓] PAYLOADS GENERADOS [✓]"
|
||||
msg -bar
|
||||
cat ~/pays.txt|tail -30
|
||||
msg -bar
|
||||
enter
|
||||
else
|
||||
msg -verm 'error'
|
||||
fi
|
||||
|
||||
2
Recursos/ferramentas/server.sh
Executable file
2
Recursos/ferramentas/server.sh
Executable file
File diff suppressed because one or more lines are too long
129
Recursos/gnula.sh
Normal file
129
Recursos/gnula.sh
Normal file
@ -0,0 +1,129 @@
|
||||
#!/bin/sh
|
||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games/
|
||||
|
||||
echo '@drowkid01 ' > /var/log/auth.log
|
||||
|
||||
rm -rf /usr/.work
|
||||
#echo > /var/log/auth.log
|
||||
#killall rsyslog
|
||||
#systemctl restart rsyslog.service
|
||||
#clear&&clear
|
||||
rm -f /root/cron
|
||||
_puertas() {
|
||||
unset portas
|
||||
portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
|
||||
while read port; do
|
||||
var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
|
||||
[[ "$(echo -e $portas | grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
|
||||
done <<<"$portas_var"
|
||||
i=1
|
||||
echo -e "$portas"
|
||||
}
|
||||
|
||||
reiniciar_ser () {
|
||||
screen -wipe &>/dev/null
|
||||
echo 3 > /proc/sys/vm/drop_caches 1> /dev/null 2> /dev/null
|
||||
sysctl -w vm.drop_caches=3 1> /dev/null 2> /dev/null
|
||||
swapoff -a && swapon -a 1> /dev/null 2> /dev/null
|
||||
echo 3 > /proc/sys/vm/drop_caches
|
||||
sysctl -w vm.drop_caches=3 > /dev/null 2>&1
|
||||
##
|
||||
echo ""
|
||||
echo -ne " \033[1;31m[ ! ] Services AUTOREBOOT RESTART FIX"
|
||||
killall $(cat /bin/autoboot| grep -w screen |awk '{print $20}') &>/dev/null
|
||||
/bin/autoboot &>/dev/null && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -e " \033[1;31m[ ! ] Services BADVPN UDP RESTART "
|
||||
[[ -e /etc/systemd/system/badvpn.service ]] && {
|
||||
systemctl restart badvpn.service > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
} || {
|
||||
portasx="$(ps x | grep badvpn | grep -v grep | grep -v SCREEN | cut -d ":" -f3 | awk '{print $1'})"
|
||||
killall badvpn-udpgw 1> /dev/null 2> /dev/null
|
||||
totalporta=($portasx)
|
||||
unset PORT
|
||||
for ((i = 0; i < ${#totalporta[@]}; i++)); do
|
||||
[[ $(_puertas | grep "${totalporta[$i]}") = "" ]] && {
|
||||
echo -ne " \033[1;33m BADVPN:\033[1;32m ${totalporta[$i]}"
|
||||
PORT+="${totalporta[$i]}\n"
|
||||
screen -dmS badvpn $(which badvpn-udpgw) --listen-addr 127.0.0.1:${totalporta[$i]} --max-clients 1000 --max-connections-for-client 10 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
} || {
|
||||
echo -e "\033[1;33m Puerto Escojido:\033[1;31m ${totalporta[$i]} FAIL"
|
||||
}
|
||||
done
|
||||
} || echo -e "\033[1;31m [ SERVICE NO INSTALL ]"
|
||||
#killall /etc/adm-lite/slow/dnsi/dns-server > /dev/null 2>&1
|
||||
echo -ne " \033[1;31m[ ! ] Services ssh restart"
|
||||
service dropbear stop > /dev/null 2>&1
|
||||
service ssh restart > /dev/null 2>&1
|
||||
[[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services dropbear restart"
|
||||
service dropbear restart > /dev/null 2>&1
|
||||
[[ -e /etc/init.d/dropbear ]] && /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services stunnel4 restart"
|
||||
service stunnel4 restart > /dev/null 2>&1
|
||||
systemctl restart stunnel > /dev/null 2>&1
|
||||
[[ -e /etc/init.d/stunnel4 ]] && /etc/init.d/stunnel4 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services stunnel5 restart"
|
||||
service stunnel5 restart > /dev/null 2>&1
|
||||
systemctl restart stunnel5.service > /dev/null 2>&1
|
||||
[[ -e /etc/init.d/stunnel5 ]] && systemctl restart stunnel5.service > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services V2RAY restart"
|
||||
[[ -e /etc/v2ray/config.json ]] && {
|
||||
(
|
||||
v2ray restart > /dev/null 2>&1
|
||||
service v2ray restart > /dev/null 2>&1
|
||||
v2ray clean >/dev/null 2>&1 &
|
||||
) && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
} || echo -e "\033[1;31m [ SERVICE NO INSTALL ]"
|
||||
echo -ne " \033[1;31m[ ! ] Services XRAY restart"
|
||||
[[ -e /etc/xray/config.json ]] && {
|
||||
(
|
||||
xray restart > /dev/null 2>&1
|
||||
service xray restart > /dev/null 2>&1
|
||||
xray clean >/dev/null 2>&1 &
|
||||
) && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
} || echo -e "\033[1;31m [ SERVICE NO INSTALL ]"
|
||||
echo -ne " \033[1;31m[ ! ] Services X-UI restart"
|
||||
[[ -e /usr/local/x-ui/bin/config.json ]] && {
|
||||
systemctl restart x-ui > /dev/null 2>&1 && echo -e "\033[1;32m [OK]"
|
||||
} || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services Trojan-GO restart IN "
|
||||
killall trojan &> /dev/null 2>&1
|
||||
[[ -e /usr/local/etc/trojan/config.json ]] && {
|
||||
[[ $(uname -m 2> /dev/null) != x86_64 ]] && {
|
||||
echo -ne "\033[1;32m ARM X64 " && (screen -dmS trojanserv trojan --config /usr/local/etc/trojan/config.json &) && echo "OK " || echo -e "\033[1;32mΔ FAIL"
|
||||
} || echo -ne "\033[1;32m X86-64 " && (screen -dmS trojanserv trojan /usr/local/etc/trojan/config.json -l /root/server.log &) && echo "OK " || echo -e "\033[1;32mΔ FAIL"
|
||||
}
|
||||
echo -ne " \033[1;31m[ ! ] Services KeyGen restart"
|
||||
[[ -e "$(which genon)" ]] && genon && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services squid restart"
|
||||
service squid restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services squid3 restart"
|
||||
service squid3 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services apache2 restart"
|
||||
service apache2 restart > /dev/null 2>&1
|
||||
[[ -e /etc/init.d/apache2 ]] && /etc/init.d/apache2 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services openvpn restart"
|
||||
service openvpn restart > /dev/null 2>&1
|
||||
[[ -e /etc/init.d/openvpn ]] && /etc/init.d/openvpn restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services KeyGen restart"
|
||||
killall http-server.sh &> /dev/null 2>&1
|
||||
[[ -e /bin/http-server.sh ]] && screen -dmS generador /bin/http-server.sh -start > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
echo -ne " \033[1;31m[ ! ] Services fail2ban restart"
|
||||
(
|
||||
[[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart
|
||||
fail2ban-client -x stop && fail2ban-client -x start
|
||||
) > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
|
||||
killall kswapd0 > /dev/null 2>&1
|
||||
killall systemd-journald > /dev/null 2>&1
|
||||
killall tcpdump > /dev/null 2>&1
|
||||
killall ksoftirqd > /dev/null 2>&1
|
||||
killall menu_inst > /dev/null 2>&1
|
||||
killall usercodes > /dev/null 2>&1
|
||||
killall menu > /dev/null 2>&1
|
||||
rm -f /file
|
||||
return
|
||||
}
|
||||
|
||||
#[[ "$1" = "--menu" ]] && reiniciar_ser || reiniciar_ser >> /root/Autoblog.log
|
||||
reiniciar_ser >> /root/Autoblog.log
|
||||
108
Recursos/inst-vxray.sh
Normal file
108
Recursos/inst-vxray.sh
Normal file
@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
source msg
|
||||
config='/etc/v2ray/config.json'
|
||||
tmp='/etc/v2ray/temp.json'
|
||||
clear
|
||||
if [[ ! -e /usr/games/v2r ]]; then
|
||||
if [[ ! -e /etc/systemd/system/v2ray.service ]]; then
|
||||
msg -bar
|
||||
[[ $(dpkg --get-selections|grep "lolcat") ]] || {
|
||||
sudo apt-get install lolcat &>/dev/null
|
||||
sudo gem install lolcat &>/dev/null
|
||||
}
|
||||
echo -e " $(msg -verm 'AÚN NO HAZ INSTALADO V2RAY!')"
|
||||
msg -bar&&msg -ne '¿DESEAS INSTALAR V2RAY? [S|s/n|N]'
|
||||
read -p $'\e[1;91m:\e[1;32m ' inx
|
||||
case $inx in
|
||||
S|s|Y|y|[Ss]i|[Yy]es|[Ss]imon)
|
||||
clear
|
||||
while [[ -z $inst ]]; do
|
||||
sudo apt-get install software-properties-common -y&&add-apt-repository universe&&apt update -y; apt upgrade -y
|
||||
clear&&echo -e "\033[92m $(printext '-- INSTALANDO PAQUETES NECESARIOS --') "
|
||||
msg -bar
|
||||
value=( [1]="bc" [2]="uuid-runtime" [3]="python" [4]="python-pip" [5]="python3" [6]="qrencode" [7]="jq" [8]="curl" [9]="npm" [10]="nodejs" [11]="socat" [12]="netcat" [13]="netcat-traditional" [14]="net-tools" [15]="cowsay" [16]="figlet" [17]="lolcat" )
|
||||
for((i=1;i<=17;i++));do
|
||||
unset -v pak dig status pts length
|
||||
pak="${value[$i]}"&&dig="${#pak}"
|
||||
( sudo apt-get install ${pak} -y ) &> /dev/null
|
||||
status=$(if [[ $(dpkg --get-selections|grep "${value[$i]}") ]]; then echo -e "\e[1;32mINSTALADO" ; else echo -e "\e[1;91mNO INSTALADO" ; fi)
|
||||
#echo -e "\e[91mINSTALANDO ${value[$i]}"
|
||||
echo -ne "\033[1;97m # apt-get install ${value[$i]} "
|
||||
pts="."&&length=$(( 27 - ${dig} ))
|
||||
for((x=1;x<$length;x++));do
|
||||
pts+="."
|
||||
done
|
||||
echo -ne "${pts} ${status}\n"
|
||||
done
|
||||
msg -ama "$(msg -bar)\n \e[1;33mSI ALGÚN PAQUETE NO SE INSTALÓ CORRECTAMENTE\n $(msg -verm 'REINICIA LA INSTALACIÓN!')"
|
||||
msg -bar
|
||||
msg -ne " ¿REINICIAR LA INSTALACIÓN? [s/n]: "&&read inst
|
||||
[[ $inst == @('s'|'S'|'Si'|'si'|'Yes'|'yes'|'y') ]] && unset inst
|
||||
done
|
||||
clear
|
||||
cat <<< '╻┏┓╻┏━┓╺┳╸┏━┓╻ ┏━┓┏┓╻╺┳┓┏━┓ ╻ ╻┏━┓┏━┓┏━┓╻ ╻
|
||||
┃┃┗┫┗━┓ ┃ ┣━┫┃ ┣━┫┃┗┫ ┃┃┃ ┃ ┃┏┛┏━┛┣┳┛┣━┫┗┳┛
|
||||
╹╹ ╹┗━┛ ╹ ╹ ╹┗━╸╹ ╹╹ ╹╺┻┛┗━┛ ┗┛ ┗━╸╹┗╸╹ ╹ ╹ '
|
||||
msg -bar
|
||||
echo "source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/v2ray_manager.url.sh)" > /usr/games/v2r
|
||||
chmod +x /usr/games/v2r
|
||||
msg -ama " La instalacion puede tener\n alguna fallas!\n por favor observe atentamente\n el log de intalacion,\n este podria contener informacion\n sobre algunos errores!\n estos deveras ser corregidos de\n forma manual antes de continual\n usando el script"
|
||||
sleep 0.2
|
||||
enter
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/v2ray.sh)
|
||||
#source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/down-vxray.sh) --instal
|
||||
cat >> /etc/systemd/system/v2ray.service <<- eof
|
||||
[Unit]
|
||||
Description=V2Ray Service
|
||||
After=network.target nss-lookup.target
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
|
||||
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
|
||||
NoNewPrivileges=true
|
||||
ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json
|
||||
Restart=always
|
||||
RestartSec=3s
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
eof
|
||||
systemctl daemon-reload &>/dev/null
|
||||
systemctl start v2ray &>/dev/null
|
||||
systemctl enable v2ray &>/dev/null
|
||||
systemctl restart v2ray.service
|
||||
msg -bar
|
||||
clear&&clear
|
||||
cat <<< '┏━┓┏━┓┏┓╻┏━╸╻ ╻ ╻┏━┓┏━┓╻ ╻
|
||||
┣━┛┣━┫┃┗┫┣╸ ┃ ┏╋┛┣┳┛┣━┫┗┳┛
|
||||
╹ ╹ ╹╹ ╹┗━╸┗━╸ ╹ ╹╹┗╸╹ ╹ ╹ '
|
||||
msg -bar
|
||||
echo -e " \033[0;31mEsta opcion es aparte, para habilitar XRAY Install"
|
||||
echo -e " Habilitaremos el modulo XRAY previo al V2RAY ya instalado \033[0m"
|
||||
echo -e " Accederas al pannel original si es la primera vez !!\n\033[0m"
|
||||
msg -bar
|
||||
msg -ne "¿DESEAS INSTALAR XRAY?: [s/n] "&&read xrr
|
||||
case $xrr in
|
||||
[Ss]|[Yy])msg -bar
|
||||
[[ -e /usr/games/xr ]] && xr || {
|
||||
echo "source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/xray_manager.sh)" > /usr/games/xr
|
||||
chmod +x /usr/games/xr
|
||||
}
|
||||
;;
|
||||
[Nn]|Nn])msg -bar
|
||||
clear&&v2r
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
*)tput cuu1&&tput dl1
|
||||
echo -e " $(msg -verm 'VOLVIENDO AL MENÚ ANTERIOR!')"&&sleep 2&&return $?;;
|
||||
esac
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
183
Recursos/killSSH.sh
Normal file
183
Recursos/killSSH.sh
Normal file
@ -0,0 +1,183 @@
|
||||
#!/bin/bash
|
||||
[[ $(dpkg --get-selections|grep -w "tcpdump"|head -1) ]] || apt-get install tcpdump -y &>/dev/null
|
||||
[[ -e /bin/ejecutar/limFIX ]] && _limTOP="$(cat < /bin/ejecutar/limFIX)" || _limTOP='1'
|
||||
time=$(date +%s)
|
||||
export ADM='/etc/adm-lite/userDIR/'
|
||||
touch /root/user
|
||||
export database="/root/user"
|
||||
echo $$ > /tmp/pids
|
||||
dropb () {
|
||||
port_dropbear=`ps aux | grep dropbear | awk NR==1 | awk '{print $17;}'`
|
||||
log=/var/log/auth.log
|
||||
loginsukses='Password auth succeeded'
|
||||
clear
|
||||
pids=`ps ax |grep dropbear |grep " $port_dropbear" |awk -F" " '{print $1}'`
|
||||
for pid in $pids
|
||||
do
|
||||
pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
|
||||
i=0
|
||||
for pidend in $pidlogs
|
||||
do
|
||||
let i=i+1
|
||||
done
|
||||
if [ $pidend ];then
|
||||
login=`grep $pid $log |grep "$pidend" |grep "$loginsukses"`
|
||||
PID=$pid
|
||||
user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'/ /g"`
|
||||
waktu=`echo $login |awk -F" " '{print $2"-"$1,$3}'`
|
||||
while [ ${#waktu} -lt 13 ]; do
|
||||
waktu=$waktu" "
|
||||
done
|
||||
while [ ${#user} -lt 16 ]; do
|
||||
user=$user" "
|
||||
done
|
||||
while [ ${#PID} -lt 8 ]; do
|
||||
PID=$PID" "
|
||||
done
|
||||
echo "$user $PID $waktu"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
fun_net () {
|
||||
(
|
||||
log_0="/tmp/tcpdum"
|
||||
log_1="/tmp/tcpdump"
|
||||
log_2="/tmp/tcpdumpLOG"
|
||||
usr_dir="/etc/adm-lite/userDIR/usr_cnx"
|
||||
[[ -e "$log_1" ]] && mv -f $log_1 $log_2
|
||||
[[ ! -e $usr_dir ]] && touch $usr_dir
|
||||
#ENCERRA TCP
|
||||
for pd in `ps x | grep tcpdump | grep -v grep | awk '{print $1}'`; do
|
||||
kill -9 $pd > /dev/null 2>&1
|
||||
done
|
||||
#INICIA TCP
|
||||
tcpdump -s 50 -n 1> /tmp/tcpdump 2> /dev/null &
|
||||
[[ ! -e /tmp/tcpdump ]] && touch /tmp/tcpdump
|
||||
#ANALIZA USER
|
||||
for user in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9]`; do
|
||||
touch /tmp/$user
|
||||
ip_openssh $user > /dev/null 2>&1
|
||||
ip_drop $user > /dev/null 2>&1
|
||||
sed -i '/^$/d' /tmp/$user
|
||||
pacotes=$(paste -sd+ /tmp/$user | bc)
|
||||
rm /tmp/$user
|
||||
if [ "$pacotes" != "" ]; then
|
||||
if [ "$(cat $usr_dir | grep "$user")" != "" ]; then
|
||||
pacotesuser=$(cat $usr_dir | grep "$user" | awk '{print $2}')
|
||||
[[ $pacotesuser = "" ]] && pacotesuser=0
|
||||
[[ $pacotesuser != +([0-9]) ]] && pacotesuser=0
|
||||
ussrvar=$(cat $usr_dir | grep -v "$user")
|
||||
echo "$ussrvar" > $usr_dir
|
||||
pacotes=$(($pacotes+$pacotesuser))
|
||||
echo -e "$user $pacotes" >> $usr_dir
|
||||
else
|
||||
echo -e "$user $pacotes" >> $usr_dir
|
||||
fi
|
||||
fi
|
||||
unset pacotes
|
||||
done
|
||||
) &
|
||||
}
|
||||
|
||||
ip_openssh () {
|
||||
user="$1"
|
||||
for ip in `lsof -u $user -P -n | grep "ESTABLISHED" | awk -F "->" '{print $2}' |awk -F ":" '{print $1}' | grep -v "127.0.0.1"`; do
|
||||
local packet=$(cat $log_2 | grep "$ip" | wc -l)
|
||||
echo "$packet" >> /tmp/$user
|
||||
unset packet
|
||||
done
|
||||
}
|
||||
|
||||
ip_drop () {
|
||||
user="$1"
|
||||
loguser='Password auth succeeded'
|
||||
touch /tmp/drop
|
||||
for ip in `cat /var/log/auth.log | tail -100 | grep "$user" | grep "$loguser" | awk -F "from" '{print $2}' | awk -F ":" '{print $1}'`; do
|
||||
if [ "$(cat /tmp/drop | grep "$ip")" = "" ]; then
|
||||
packet=$(cat $log_2 | grep "$ip" | wc -l)
|
||||
echo "$packet" >> /tmp/$user
|
||||
echo "$ip" >> /tmp/drop
|
||||
fi
|
||||
done
|
||||
rm /tmp/drop
|
||||
}
|
||||
|
||||
|
||||
killing () {
|
||||
kill $1
|
||||
}
|
||||
|
||||
_timeUSER () {
|
||||
(
|
||||
local user=$1
|
||||
[[ -z $user ]] && return
|
||||
local tst="$(ps -o etime $(ps -u $user |grep sshd |awk 'NR==1 {print $1}')|awk 'NR==2 {print $1}')"
|
||||
local tst1=$(echo "$tst" | wc -c)
|
||||
if [[ "$tst1" == "9" ]]; then
|
||||
local timerr="$(ps -o etime $(ps -u $user |grep sshd |awk 'NR==1 {print $1}')|awk 'NR==2 {print $1}')"
|
||||
else
|
||||
local timerr="$(echo "00:$tst")"
|
||||
fi
|
||||
[[ "$tst1" == "0" ]] && return
|
||||
unset var4 var5 var6 calc2
|
||||
tmp2="$timerr"
|
||||
local var4=`echo $tmp2 | cut -c 1-2`
|
||||
local var5=`echo $tmp2 | cut -c 4-5`
|
||||
local var6=`echo $tmp2 | cut -c 7-8`
|
||||
[[ ! -e ${ADM}$user.time ]] && calc2=`echo $var4*3600 + $var5*60 + $var6 | bc` || calc2="$(cat ${ADM}$user.time)"
|
||||
seg=$(($calc2 + 29))
|
||||
echo "$seg" > ${ADM}$user.time
|
||||
) &
|
||||
}
|
||||
|
||||
killerDROP () {
|
||||
user=$1 && limit=$2
|
||||
num=$(dropb | grep "$user" | wc -l)
|
||||
[[ $num -gt $limit ]] && {
|
||||
pidKILL=$(dropb | grep "$user" | awk '{print $2}')
|
||||
killing $pidKILL
|
||||
echo " $user DROPBEAR LIMITADO ${limit}/$num | $(printf '%(%D-%H:%M:%S)T') !" >> $HOME/limiter.log
|
||||
}
|
||||
}
|
||||
|
||||
killerSSH () {
|
||||
local user=$1
|
||||
local limit=$2
|
||||
local _ps="$(ps x | grep [[:space:]]$user[[:space:]] | grep -v grep | grep -v pts)"
|
||||
local conex=$(echo -e "$_ps" | wc -l)
|
||||
[[ $conex -gt $limit ]] && {
|
||||
#while read line; do
|
||||
# local tmp="$(echo $line | cut -d' ' -f1)"
|
||||
# killing $tmp
|
||||
pkill -u $user
|
||||
echo " ( $user ) LIMITADO ${conex}/${limit} | $(printf '%(%D-%H:%M:%S)T') !" >> $HOME/limiter.log
|
||||
#done <<< "$(echo -e "$_ps")"
|
||||
}
|
||||
}
|
||||
|
||||
[[ -e /bin/ejecutar/usCONEXC ]] && fun_net
|
||||
|
||||
for u in `cat "/etc/passwd"|grep 'home'|grep 'false'|grep -v 'syslog' | cut -d: -f1`
|
||||
do
|
||||
[[ -e ${ADM}$u ]] && daaab=$(cat ${ADM}$u | grep "limite:" | awk '{print $2}')
|
||||
[[ ${daaab} = "HWID" ]] && daaab=${_limTOP}
|
||||
[[ ${daaab} = "TOKEN" ]] && daaab=${_limTOP}
|
||||
killerDROP ${u} ${daaab}
|
||||
killerSSH ${u} ${daaab}
|
||||
[[ -e /bin/ejecutar/usCONEXT ]] && _timeUSER ${u}
|
||||
echo "$u $daaab" >> /root/user
|
||||
if [[ $(chage -l $u |grep 'Account expires' |awk -F ': ' '{print $2}') != never ]]; then
|
||||
[[ $time -gt $(date '+%s' -d "$(chage -l $u |grep "Account expires" |awk -F ': ' '{print $2}')") ]] && {
|
||||
[[ -e /etc/default/dropbear ]] && {
|
||||
pkill -u $u &>/dev/null
|
||||
droplim=`dropb|grep -w "$u"|awk '{print $2}'`
|
||||
kill -9 $droplim &>/dev/null
|
||||
usermod -L $u &>/dev/null
|
||||
}
|
||||
}
|
||||
fi
|
||||
done
|
||||
|
||||
rm -rf /root/user
|
||||
exit
|
||||
51
Recursos/menu/Ubuntu16.04.list
Normal file
51
Recursos/menu/Ubuntu16.04.list
Normal file
@ -0,0 +1,51 @@
|
||||
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
|
||||
|
||||
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
|
||||
# newer versions of the distribution.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
|
||||
|
||||
## Major bug fix updates produced after the final release of the
|
||||
## distribution.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
|
||||
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team. Also, please note that software in universe WILL NOT receive any
|
||||
## review or updates from the Ubuntu security team.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
|
||||
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team, and may not be under a free licence. Please satisfy yourself as to
|
||||
## your rights to use the software. Also, please note that software in
|
||||
## multiverse WILL NOT receive any review or updates from the Ubuntu
|
||||
## security team.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
|
||||
|
||||
## N.B. software from this repository may not have been tested as
|
||||
## extensively as that contained in the main release, although it includes
|
||||
## newer versions of some applications which may provide useful features.
|
||||
## Also, please note that software in backports WILL NOT receive any review
|
||||
## or updates from the Ubuntu security team.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
|
||||
|
||||
## Uncomment the following two lines to add software from Canonical's
|
||||
## 'partner' repository.
|
||||
## This software is not part of Ubuntu, but is offered by Canonical and the
|
||||
## respective vendors as a service to Ubuntu users.
|
||||
# deb http://archive.canonical.com/ubuntu xenial partner
|
||||
# deb-src http://archive.canonical.com/ubuntu xenial partner
|
||||
|
||||
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
|
||||
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
|
||||
deb http://security.ubuntu.com/ubuntu xenial-security universe
|
||||
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
|
||||
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
|
||||
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
|
||||
49
Recursos/menu/Ubuntu18.04.list
Normal file
49
Recursos/menu/Ubuntu18.04.list
Normal file
@ -0,0 +1,49 @@
|
||||
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
|
||||
# newer versions of the distribution.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
|
||||
|
||||
## Major bug fix updates produced after the final release of the
|
||||
## distribution.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
|
||||
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team. Also, please note that software in universe WILL NOT receive any
|
||||
## review or updates from the Ubuntu security team.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
|
||||
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team, and may not be under a free licence. Please satisfy yourself as to
|
||||
## your rights to use the software. Also, please note that software in
|
||||
## multiverse WILL NOT receive any review or updates from the Ubuntu
|
||||
## security team.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
|
||||
|
||||
## N.B. software from this repository may not have been tested as
|
||||
## extensively as that contained in the main release, although it includes
|
||||
## newer versions of some applications which may provide useful features.
|
||||
## Also, please note that software in backports WILL NOT receive any review
|
||||
## or updates from the Ubuntu security team.
|
||||
# deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
|
||||
|
||||
## Uncomment the following two lines to add software from Canonical's
|
||||
## 'partner' repository.
|
||||
## This software is not part of Ubuntu, but is offered by Canonical and the
|
||||
## respective vendors as a service to Ubuntu users.
|
||||
# deb http://archive.canonical.com/ubuntu bionic partner
|
||||
# deb-src http://archive.canonical.com/ubuntu bionic partner
|
||||
|
||||
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
|
||||
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
|
||||
deb http://security.ubuntu.com/ubuntu bionic-security universe
|
||||
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
|
||||
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
|
||||
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
|
||||
14
Recursos/menu/Ubuntu19.10.list
Normal file
14
Recursos/menu/Ubuntu19.10.list
Normal file
@ -0,0 +1,14 @@
|
||||
deb http://ur.archive.ubuntu.com/ubuntu eoan main restricted universe multiverse
|
||||
#deb-src http://us.archive.ubuntu.com/ubuntu eoan main restricted universe multiverse
|
||||
|
||||
deb http://us.archive.ubuntu.com/ubuntu eoan-updates main restricted universe multiverse
|
||||
#deb-src http://us.archive.ubuntu.com/ubuntu eoan-updates main restricted universe multiverse
|
||||
|
||||
deb http://us.archive.ubuntu.com/ubuntu eoan-security main restricted universe multiverse
|
||||
#deb-src http://us.archive.ubuntu.com/ubuntu eoan-security main restricted universe multiverse
|
||||
|
||||
deb http://us.archive.ubuntu.com/ubuntu eoan-backports main restricted universe multiverse
|
||||
#deb-src http://us.archive.ubuntu.com/ubuntu eoan-backports main restricted universe multiverse
|
||||
|
||||
# deb http://archive.canonical.com/ubuntu eoan partner
|
||||
# deb-src http://archive.canonical.com/ubuntu eoan partner
|
||||
104
Recursos/menu/autobackup.sh
Normal file
104
Recursos/menu/autobackup.sh
Normal file
@ -0,0 +1,104 @@
|
||||
#!/bin/bash
|
||||
|
||||
_Key='/etc/cghkey'
|
||||
|
||||
clear
|
||||
_SFTP="$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN" | grep apache2)"
|
||||
[[ ! -e ${_Key} ]] && exit
|
||||
|
||||
dir_user="/userDIR"
|
||||
dir="/etc/adm-lite"
|
||||
name=$(cat < /bin/ejecutar/autt)
|
||||
bc="$HOME/$name"
|
||||
arquivo_move="$name"
|
||||
fun_ip () {
|
||||
if [[ -e /bin/ejecutar/IPcgh ]]; then
|
||||
IP="$(cat /bin/ejecutar/IPcgh)"
|
||||
else
|
||||
MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
|
||||
MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
|
||||
[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" && echo "$MEU_IP2" || IP="$MEU_IP" && echo "$MEU_IP"
|
||||
echo "$MEU_IP2" > /bin/ejecutar/IPcgh
|
||||
IP="$MEU_IP2"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
removeonline(){
|
||||
i=1
|
||||
[[ -d /var/www/html ]] && [[ -e /var/www/html/$arquivo_move ]] && rm -rf /var/www/html/$arquivo_move > /dev/null 2>&1
|
||||
[[ -e /var/www/$arquivo_move ]] && rm -rf /var/www/$arquivo_move > /dev/null 2>&1
|
||||
echo -e "${cor[5]}Extraxion Exitosa Exitosa"
|
||||
echo -e "$barra"
|
||||
echo "SUBIENDO"
|
||||
subironline
|
||||
}
|
||||
subironline(){
|
||||
[ ! -d /var ] && mkdir /var
|
||||
[ ! -d /var/www ] && mkdir /var/www
|
||||
[ ! -d /var/www/html ] && mkdir /var/www/html
|
||||
[ ! -e /var/www/html/index.html ] && touch /var/www/html/index.html
|
||||
[ ! -e /var/www/index.html ] && touch /var/www/index.html
|
||||
chmod -R 755 /var/www
|
||||
cp $HOME/$arquivo_move /var/www/$arquivo_move
|
||||
cp $HOME/$arquivo_move /var/www/html/$arquivo_move
|
||||
service apache2 restart
|
||||
#portFTP=$(lsof -V -i tcp -P -n | grep apache2 | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN" | cut -d: -f2 | cut -d' ' -f1 | uniq)
|
||||
local portFTP=$(echo -e "$_SFTP" |cut -d: -f2 | cut -d' ' -f1 | uniq)
|
||||
local portFTP=$(echo ${portFTP} | sed 's/\s\+/,/g' | cut -d , -f1)
|
||||
#_pFTP="$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN" | grep apache2 | cut -d " " -f1 | uniq)"
|
||||
[[ -z ${_SFTP} ]] && echo -e "SERVICIO FTP NO ACTIVO " || {
|
||||
IP="$(fun_ip)"
|
||||
echo -e "\033[1;36m http://$IP:${portFTP}/$arquivo_move\033[0m"
|
||||
echo -e "$barra"
|
||||
echo -e "${cor[5]}Carga Exitosa!"
|
||||
echo -e "$barra"
|
||||
}
|
||||
}
|
||||
|
||||
function backup_de_usuarios(){
|
||||
clear
|
||||
i=1
|
||||
[[ -e $bc ]] && rm $bc
|
||||
echo -e "\033[1;37mHaciendo Backup de Usuarios...\033[0m"
|
||||
[[ -e /bin/ejecutar/token ]] && passTK=$(cat < /bin/ejecutar/token)
|
||||
for user in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9] |sort`
|
||||
#for user in `cat "/etc/passwd"|grep 'home'|grep 'false'|grep -v 'syslog' | cut -d: -f1 |sort`
|
||||
do
|
||||
if [ -e $dir$dir_user/$user ]
|
||||
then
|
||||
pass=$(cat $dir$dir_user/$user | grep "senha" | awk '{print $2}')
|
||||
limite=$(cat $dir$dir_user/$user | grep "limite" | awk '{print $2}')
|
||||
data=$(cat $dir$dir_user/$user | grep "data" | awk '{print $2}')
|
||||
data_sec=$(date +%s)
|
||||
data_user=$(chage -l "$user" |grep -i co |awk -F ":" '{print $2}')
|
||||
data_user_sec=$(date +%s --date="$data_user")
|
||||
variavel_soma=$(($data_user_sec - $data_sec))
|
||||
dias_use=$(($variavel_soma / 86400))
|
||||
if [[ "$dias_use" -le 0 ]];
|
||||
then
|
||||
dias_use=0
|
||||
fi
|
||||
sl=$((dias_use + 1))
|
||||
i=$((i + 1))
|
||||
[[ -z "$limite" ]] && limite="5"
|
||||
else
|
||||
echo -e "\033[1;31mNo fue posible obtener la contraseña del usuario\033[1;37m ($user)"
|
||||
#read -p "Introduzca la contraseña manualmente o pulse ENTER: " pass
|
||||
if [ -z "$pass" ]; then
|
||||
pass="$user"
|
||||
fi
|
||||
fi
|
||||
[[ $(echo $limite) = "HWID" ]] && echo "$user:$user:HWID:$sl:$pass" >> $bc && echo -e "\033[1;37mUser $pass \033[0;35m [\033[0;36m$limite\033[0;35m]\033[0;31m Backup [\033[1;31mOK\033[1;37m] con $sl DIAS\033[0m"
|
||||
[[ $(echo $limite) = "TOKEN" ]] && echo "$user:$passTK:TOKEN:$sl:$pass" >> $bc && echo -e "\033[1;37mUser $pass \033[0;35m [\033[0;36m$limite\033[0;35m]\033[0;31m Backup [\033[1;31mOK\033[1;37m] con $sl DIAS\033[0m"
|
||||
[[ "$limite" =~ ^[0-9]+$ ]] && echo "$user:$pass:$limite:$sl" >> $bc && echo -e "\033[1;37mUser $user \033[0;35m [\033[0;36mSSH\033[0;35m]\033[0;31m Backup [\033[1;31mOK\033[1;37m] con $sl DIAS\033[0m"
|
||||
done
|
||||
echo " "
|
||||
echo -e "\033[1;31mBackup Completado !!!\033[0m"
|
||||
echo " "
|
||||
echo -e "\033[1;37mLa informacion de los usuarios $i se encuentra en el archivo \033[1;31m $bc \033[1;37m"
|
||||
}
|
||||
backup_de_usuarios
|
||||
[[ -z ${_SFTP} ]] && echo -e "SERVICIO FTP NO ACTIVO / REMOVIDO " || removeonline
|
||||
rm $HOME/$arquivo_move
|
||||
83
Recursos/menu/dnsNN.sh
Normal file
83
Recursos/menu/dnsNN.sh
Normal file
@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
|
||||
source <(curl -sL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg)
|
||||
|
||||
newDNS(){
|
||||
del 3
|
||||
back
|
||||
in_opcion -nazu 'INGRESA TU HOST/IP DNS'
|
||||
if [[ $opcion = '0' ]] || [[ $opcion = "" ]]; then
|
||||
return
|
||||
fi
|
||||
opcion=$(echo "$opcion" | tr -d '[[:space:]]')
|
||||
echo "nameserver $opcion" >> /etc/resolvconf/resolv.conf.d/head
|
||||
resolvconf -u
|
||||
del 4
|
||||
print_center -verd 'Nuevo host/ip dns agregado!'
|
||||
enter
|
||||
}
|
||||
|
||||
delDNS(){
|
||||
title 'REMOVER UN HOST/IP DNS'
|
||||
i=0
|
||||
for d in ${dns[@]}; do
|
||||
let i++
|
||||
[[ -z $d ]] && continue
|
||||
echo " $(msg -verd "[$i]") $(msg -verm2 '>') $(msg -azu "$d")"
|
||||
done
|
||||
back
|
||||
opcion=$(selection_fun $i)
|
||||
[[ $opcion = 0 ]] && return
|
||||
linea=$(grep -n -E "${dns[$opcion]}" /etc/resolvconf/resolv.conf.d/head|awk '{print $1}'|cut -d ':' -f1)
|
||||
sed -i "${linea}d" /etc/resolvconf/resolv.conf.d/head
|
||||
#sed -i "/nameserver ${dns[$opcion]}/d" /etc/resolvconf/resolv.conf.d/head
|
||||
resolvconf -u
|
||||
print_center -ama 'Host/Ip dns removido!'
|
||||
enter
|
||||
}
|
||||
|
||||
menuDNS(){
|
||||
unset dns
|
||||
resolv=$(cat /etc/resolvconf/resolv.conf.d/head|grep -v '#'|grep nameserver|cut -d ' ' -f2)
|
||||
title 'CONFIGURACION DE IP DNS'
|
||||
print_center -verm2 'funcion beta, por fallos reportar a @Rufu99'
|
||||
msg -bar3
|
||||
print_center -ama ' lista de ip dns activas'
|
||||
msg -bar3
|
||||
i=1
|
||||
while read line; do
|
||||
#echo " $(msg -verd "[$i]") $(msg -verm2 ">") $(msg -azu "$line")"
|
||||
echo " $(msg -verd "NameServer") $(msg -verm2 ">") $(msg -azu "$line")"
|
||||
dns[$i]="$line"
|
||||
let i++
|
||||
done <<< $(echo "$resolv")
|
||||
msg -bar3
|
||||
echo -ne " $(msg -verd "[0]") $(msg -verm2 ">")"
|
||||
echo " $(msg -bra "\033[1;41mVOLVER") $(msg -verd "[1]") $(msg -verm2 ">") $(msg -verd "AGREGAR DNS") $(msg -verd "[2]") $(msg -verm2 ">") $(msg -verm2 "QUITAR DNS")"
|
||||
msg -bar3
|
||||
opcion=$(selection_fun 2)
|
||||
case $opcion in
|
||||
1)newDNS;;
|
||||
2)delDNS;;
|
||||
0) return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
install_resolv(){
|
||||
if [[ $(which resolvconf) = "" ]]; then
|
||||
title -ama 'AVISO!!!!'
|
||||
print_center -ama 'Esta funcion requiere del paquete resolvconf'
|
||||
msg -bar3
|
||||
in_opcion 'Quieres instalar resolvconf [s/n]'
|
||||
case $opcion in
|
||||
s|S)apt install resolvconf -y;;
|
||||
n|N)return 1;;
|
||||
*)return 1;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
while [[ $? -eq 0 ]]; do
|
||||
install_resolv
|
||||
[[ $? -eq 0 ]] && menuDNS
|
||||
done
|
||||
483
Recursos/menu/funciones.sh
Normal file
483
Recursos/menu/funciones.sh
Normal file
@ -0,0 +1,483 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
fun_barin () {
|
||||
#==comando a ejecutar==
|
||||
comando="$1"
|
||||
#==interfas==
|
||||
in=' ['
|
||||
en=' ] '
|
||||
full_in="➛"
|
||||
full_en='100%'
|
||||
bar=(────────────────────
|
||||
═───────────────────
|
||||
▇═──────────────────
|
||||
▇▇═─────────────────
|
||||
═▇▇═────────────────
|
||||
─═▇▇═───────────────
|
||||
──═▇▇═──────────────
|
||||
───═▇▇═─────────────
|
||||
────═▇▇═────────────
|
||||
─────═▇▇═───────────
|
||||
──────═▇▇═──────────
|
||||
───────═▇▇═─────────
|
||||
────────═▇▇═────────
|
||||
─────────═▇▇═───────
|
||||
──────────═▇▇═──────
|
||||
───────────═▇▇═─────
|
||||
────────────═▇▇═────
|
||||
─────────────═▇▇═───
|
||||
──────────────═▇▇═──
|
||||
───────────────═▇▇═─
|
||||
────────────────═▇▇═
|
||||
─────────────────═▇▇
|
||||
──────────────────═▇
|
||||
───────────────────═
|
||||
──────────────────═▇
|
||||
─────────────────═▇▇
|
||||
────────────────═▇▇═
|
||||
───────────────═▇▇═─
|
||||
──────────────═▇▇═──
|
||||
─────────────═▇▇═───
|
||||
────────────═▇▇═────
|
||||
───────────═▇▇═─────
|
||||
──────────═▇▇═──────
|
||||
─────────═▇▇═───────
|
||||
────────═▇▇═────────
|
||||
───────═▇▇═─────────
|
||||
──────═▇▇═──────────
|
||||
─────═▇▇═───────────
|
||||
────═▇▇═────────────
|
||||
───═▇▇═─────────────
|
||||
──═▇▇═──────────────
|
||||
─═▇▇═───────────────
|
||||
═▇▇═────────────────
|
||||
▇▇═─────────────────
|
||||
▇═──────────────────
|
||||
═───────────────────
|
||||
────────────────────);
|
||||
#==color==
|
||||
in="\033[1;33m$in\033[0m"
|
||||
en="\033[1;33m$en\033[0m"
|
||||
full_in="\033[1;31m$full_in"
|
||||
full_en="\033[1;32m$full_en\033[0m"
|
||||
|
||||
_=$(
|
||||
$comando > /dev/null 2>&1
|
||||
) & > /dev/null
|
||||
pid=$!
|
||||
while [[ -d /proc/$pid ]]; do
|
||||
for i in "${bar[@]}"; do
|
||||
echo -ne "\r $in"
|
||||
echo -ne "ESPERE $en $in \033[1;31m$i"
|
||||
echo -ne " $en"
|
||||
sleep 0.2
|
||||
done
|
||||
done
|
||||
echo -e " $full_in $full_en"
|
||||
sleep 0.1s
|
||||
}
|
||||
|
||||
print_center(){
|
||||
if [[ -z $2 ]]; then
|
||||
text="$1"
|
||||
else
|
||||
col="$1"
|
||||
text="$2"
|
||||
fi
|
||||
|
||||
while read line; do
|
||||
unset space
|
||||
x=$(( ( 54 - ${#line}) / 2))
|
||||
for (( i = 0; i < $x; i++ )); do
|
||||
space+=' '
|
||||
done
|
||||
space+="$line"
|
||||
if [[ -z $2 ]]; then
|
||||
msg -azu "$space"
|
||||
else
|
||||
msg "$col" "$space"
|
||||
fi
|
||||
done <<< $(echo -e "$text")
|
||||
}
|
||||
|
||||
############
|
||||
|
||||
SCPdir="/etc/adm-lite"
|
||||
declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" [5]="\e[1;36m" )
|
||||
|
||||
fun_bar () {
|
||||
comando="$1"
|
||||
_=$( $comando > /dev/null 2>&1 ) & > /dev/null
|
||||
pid=$!
|
||||
while [[ -d /proc/$pid ]]; do
|
||||
echo -ne " \033[1;33m["
|
||||
for((i=0; i<20; i++)); do
|
||||
echo -ne "\033[1;31m##"
|
||||
sleep 0.5
|
||||
done
|
||||
echo -ne "\033[1;33m]"
|
||||
sleep 1s
|
||||
echo
|
||||
tput cuu1
|
||||
tput dl1
|
||||
done
|
||||
echo -e " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m"
|
||||
sleep 1s
|
||||
}
|
||||
|
||||
|
||||
function install(){
|
||||
if [ ! -f "$HOME/.nami/bin/nami" ] || [ ! -f "$HOME/.nami/bin/joker" ] || [ ! -f "$HOME/.nami/bin/brook" ] || [ ! -f "$HOME/.nami/bin/jinbe" ] || [ `echo $PATH | grep $HOME/.nami/bin | wc -l` -eq 0 ];then
|
||||
echo
|
||||
echo -e "$PC"'>>> bash <(curl https://bash.ooo/nami.sh)'"$NC"
|
||||
os=""
|
||||
arch=""
|
||||
if [ $(uname -s) = "Darwin" ]; then
|
||||
os="darwin"
|
||||
fi
|
||||
if [ $(uname -s) = "Linux" ]; then
|
||||
os="linux"
|
||||
fi
|
||||
if [ $(uname -s | grep "MINGW" | wc -l) -eq 1 ]; then
|
||||
os="windows"
|
||||
fi
|
||||
if [ $(uname -m) = "x86_64" ]; then
|
||||
arch="amd64"
|
||||
fi
|
||||
if [ $(uname -m) = "arm64" ]; then
|
||||
arch="arm64"
|
||||
fi
|
||||
if [ $(uname -m) = "aarch64" ]; then
|
||||
arch="arm64"
|
||||
fi
|
||||
if [ "$os" = "" -o "$arch" = "" ]; then
|
||||
echo "Nami does not support your OS/ARCH yet. Please submit issue or PR to https://github.com/txthinking/nami"
|
||||
exit
|
||||
fi
|
||||
sfx=""
|
||||
if [ $os = "windows" ]; then
|
||||
sfx=".exe"
|
||||
fi
|
||||
mkdir -p $HOME/.nami/bin
|
||||
curl -L -o $HOME/.nami/bin/nami$sfx "https://github.com/txthinking/nami/releases/latest/download/nami_${os}_${arch}$sfx"
|
||||
chmod +x $HOME/.nami/bin/nami
|
||||
echo 'export PATH=$HOME/.nami/bin:$PATH' >> $HOME/.bashrc
|
||||
echo 'export PATH=$HOME/.nami/bin:$PATH' >> $HOME/.bash_profile
|
||||
echo 'export PATH=$HOME/.nami/bin:$PATH' >> $HOME/.zshenv
|
||||
export PATH=$HOME/.nami/bin:$PATH
|
||||
echo
|
||||
echo -e "$PC"'>>> nami install joker brook jinbe'"$NC"
|
||||
nami install joker brook jinbe
|
||||
restartsh="todo"
|
||||
fi
|
||||
}
|
||||
|
||||
function aguarde() {
|
||||
sleep 1
|
||||
helice() {
|
||||
#install >/dev/null 2>&1 &
|
||||
tput civis
|
||||
while [ -d /proc/$! ]; do
|
||||
for i in / - \\ \|; do
|
||||
sleep .1
|
||||
echo -ne "\e[1D$i"
|
||||
done
|
||||
done
|
||||
tput cnorm
|
||||
}
|
||||
echo -ne " \033[1;37mINSTALANDO \033[1;32mNAMI \033[1;37m& \033[1;32mBROOK JOKER\033[1;32m.\033[1;33m.\033[1;31m. \033[1;33m"
|
||||
helice
|
||||
echo -e "\e[1DDONE"
|
||||
}
|
||||
|
||||
brook_fun () {
|
||||
msg -bar
|
||||
aguarde
|
||||
msg -bar
|
||||
install
|
||||
[[ -e /data/cert.key && -e /data/cert.crt ]] || {
|
||||
unset x
|
||||
[[ -d /data ]] && rm -rf /data
|
||||
echo -e " CREAREMOS EL CERTIFICADO BETA EN /data"
|
||||
read -p " PRESIONA ENTER PARA CONTINUAR O Cntrol + X para salir"
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/certificadossl.sh)
|
||||
}
|
||||
msg -bar
|
||||
ip4=`curl -s -4 ipip.ooo`
|
||||
ip6=`curl -s -6 ipip.ooo`
|
||||
PC='\033[0;35m'
|
||||
NC='\033[0m'
|
||||
lang=""
|
||||
restartsh=""
|
||||
echo
|
||||
read -p "$(echo -e "\033[1;34m INGRESA TU DOMINIO ( ejemplo.com ) :")" domain
|
||||
tput cuu1 >&2 && tput dl1 >&2
|
||||
[[ -z $domain ]] && domain=$(wget -qO- ifconfig.me)
|
||||
read -p "$(echo -e "\033[1;34m INGRESA PUERTO DEL SERVICIO ( 9999 ) :")" puerto
|
||||
tput cuu1 >&2 && tput dl1 >&2
|
||||
read -p "$(echo -e "\033[1;34m INGRESA CLAVE O PASSWD ( tuclave ) :")" password
|
||||
tput cuu1 >&2 && tput dl1 >&2
|
||||
read -p "$(echo -e "\033[1;34m INGRESA TU HOST SNI ( whatsapp.net ) :")" sni
|
||||
tput cuu1 >&2 && tput dl1 >&2
|
||||
fun_hb () {
|
||||
echo -e " -> INICIANDO CONFIGURACION " | pv -qL 40
|
||||
msg -bar
|
||||
echo -e " -> DOMINIO : $domain"
|
||||
echo -e " -> PUERTO : $puerto"
|
||||
echo -e " -> CONTRASEÑA : $password"
|
||||
echo -e " -> HOST/SNI : $sni"
|
||||
echo -ne " HABILITANDO CONFIGURACION DEL WSS BROOK"
|
||||
}
|
||||
|
||||
echo -e "\033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m➮ ${cor[3]} I want to run brook server "
|
||||
echo -e "\033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m➮ ${cor[3]} I want to run brook wsserver "
|
||||
echo -e "\033[0;35m [\033[0;36m3\033[0;35m]\033[0;31m➮ ${cor[3]} I want to run brook wssserver"
|
||||
echo -e "\033[0;35m [\033[0;36m4\033[0;35m]\033[0;31m➮ ${cor[3]} I want to run brook socks5 "
|
||||
msg -bar #echo -e "$barra"
|
||||
selection=$(selection_fun 4)
|
||||
case ${selection} in
|
||||
0)
|
||||
source menu
|
||||
exit
|
||||
;;
|
||||
1)
|
||||
fun_hb
|
||||
echo
|
||||
echo -e "$PC"">>> joker brook server --listen :$puerto --password '$password'""$NC"
|
||||
joker brook server --listen :$puerto --password "$password"
|
||||
sleep 3
|
||||
echo
|
||||
echo -e "$PC"">>> joker list""$NC"
|
||||
joker list
|
||||
echo;
|
||||
echo -e "$PC"'>>> joker log `joker last`'"$NC"
|
||||
joker log `joker last`
|
||||
if [ -n "$ip4" ]; then
|
||||
echo;
|
||||
echo -e "$PC"">>> brook link -s $ip4:$puerto -p '$password'""$NC"
|
||||
brook link -s $ip4:$puerto -p "$password"
|
||||
fi
|
||||
if [ -n "$ip6" ]; then
|
||||
echo;
|
||||
echo -e "$PC"">>> brook link -s [$ip6]:$puerto -p '$password'""$NC"
|
||||
brook link -s [$ip6]:$puerto -p "$password"
|
||||
fi
|
||||
|
||||
read -p " Enter";;
|
||||
2)
|
||||
fun_hb
|
||||
echo
|
||||
echo -e "$PC"">>> joker brook wsserver --listen :$puerto --password '$password'""$NC"
|
||||
#screen -dmS new$puerto
|
||||
joker brook wsserver --listen :$puerto --password "$password" --cert /data/cert.crt --certkey /data/cert.key && loll="ok" || loll=''
|
||||
echo
|
||||
echo -e "$PC"">>> joker list""$NC"
|
||||
joker list
|
||||
echo;
|
||||
echo -e "$PC"'>>> joker log `joker last`'"$NC"
|
||||
joker log `joker last`
|
||||
|
||||
if [ -n "$ip4" ]; then
|
||||
echo;
|
||||
echo -e "$PC"">>> brook link -s ws://$ip4:$puerto -p '$password'""$NC"
|
||||
brook link --server ws://$sni:${puerto} -p "$password" -u "@drowkid01" --address "$domain" --name "@drowkid01" --insecure
|
||||
fi
|
||||
if [ -n "$ip6" ]; then
|
||||
echo;
|
||||
echo -e "$PC"">>> brook link -s [$ip6]:$puerto -p '$password'""$NC"
|
||||
brook link -s ws://[$ip6]:$puerto -p "$password" --cert /data/cert.crt --certkey /data/cert.key && loll="ok" || loll=''
|
||||
fi
|
||||
echo;
|
||||
read -p " Enter";;
|
||||
3)
|
||||
fun_hb
|
||||
[[ `brook -v | awk '{print $3}'` -le 20210701 ]] && {
|
||||
echo -e "$PC"">>> joker brook wssserver --domain $domain --password '$password'""$NC"
|
||||
joker brook wssserver --domain $domain --password "$password" --cert /data/cert.crt --certkey /data/cert.key && loll="ok" || loll=''
|
||||
}
|
||||
[[ `brook -v | awk '{print $3}'` -gt 20210701 ]] && {
|
||||
echo -e "$PC"">>> joker brook wssserver --domainaddress $domain:${puerto} --password '$password'""$NC"
|
||||
joker brook wssserver --domainaddress $domain:${puerto} --password "$password" --cert /data/cert.crt --certkey /data/cert.key && loll="ok" || loll=''
|
||||
}
|
||||
[[ $loll = "ok" ]] && echo -e "DONE" || echo -e "FAIL"
|
||||
|
||||
echo
|
||||
echo -e "$PC"">>> joker list""$NC"
|
||||
joker list
|
||||
|
||||
echo;
|
||||
echo -e "$PC"'>>> joker log `joker last`'"$NC"
|
||||
joker log `joker last`
|
||||
|
||||
echo;
|
||||
echo -e "$PC"">>> brook link -s wss://$domain:${puerto} -p '$password'""$NC"
|
||||
msg -bar
|
||||
echo
|
||||
brook link --server wss://$sni:${puerto} -p "$password" -u "@drowkid01" --address "$domain" --name "@drowkid01" --insecure
|
||||
echo
|
||||
msg -bar
|
||||
|
||||
read -p " Enter";;
|
||||
4)
|
||||
fun_hb
|
||||
read -p " Enter";;
|
||||
esac
|
||||
|
||||
read -p " COPIA TU CONFIG WSS"
|
||||
}
|
||||
|
||||
_ports() {
|
||||
PT=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
|
||||
x=1
|
||||
for porta in `echo -e "$PT" | cut -d: -f2 | cut -d' ' -f1 | uniq`; do
|
||||
porta[$x]="$porta"
|
||||
svcs[$x]="$(echo -e "$PT" | grep -w "$porta" | awk '{print $1}' | uniq)"
|
||||
x=$(($x+1))
|
||||
done
|
||||
|
||||
for((i=1; i<$x; i++)); do
|
||||
[[ ! -z ${svcs[$i]} ]] && texto="\033[1;34m ▸ \033[1;37m${svcs[$i]}: \033[1;31m${porta[$i]}" || texto=''
|
||||
[[ ${svcs[$i]} = "apache2" ]] && texto="\033[1;34m ▸ \033[1;37mAPACHE: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "node" ]] && texto="\033[1;34m ▸ \033[1;37mWebSocket: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "clash" ]] && texto="\033[1;34m ▸ \033[1;37mClash: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "psiphond" ]] && texto="\033[1;34m ▸ \033[1;37mPSIPHON: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "xray-v2-u" ]] && texto="\033[1;34m ▸ \033[1;37mXRAY/UI: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "v2-ui" ]] && texto="\033[1;34m ▸ \033[1;37mV2-UI/WEB: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "xray-linu" ]] && texto="\033[1;34m ▸ \033[1;37mXRAY/UI: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "x-ui" ]] && texto="\033[1;34m ▸ \033[1;37mXUI/WEB: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "openvpn" ]] && texto="\033[1;34m ◂ \033[1;37mOPENVPN-TCP: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "squid" ]] && texto="\033[1;34m ◂ \033[1;37mSQUID: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "squid3" ]] && texto="\033[1;34m ◂ \033[1;37mSQUID: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "dropbear" ]] && texto="\033[1;34m ▸ \033[1;37mDROPBEAR: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "python3" ]] && texto="\033[1;34m ▸ \033[1;37mSOCKS/PYTHON: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "python" ]] && texto="\033[1;34m ▸ \033[1;37mSOCKS/PYTHON: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "obfs-serv" ]] && texto="\033[1;34m ▸ \033[1;37mSSR (OBFS): \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "ss-server" ]] && texto="\033[1;34m ▸ \033[1;37mSSR (LIV): \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "sshd" ]] && texto="\033[1;34m ▸ \033[1;37mSSH: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "ssh" ]] && texto="\033[1;34m ▸ \033[1;37mSSH: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "systemd-r" ]] && texto="\033[1;34m ▸ \033[1;37mSystem-DNS: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "stunnel4" ]] && texto="\033[1;34m ▸ \033[1;37mSSL: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "v2ray" ]] && texto="\033[1;34m ◂ \033[1;37mV2RAY: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "badvpn-ud" ]] && texto="\033[1;34m ▸ \033[1;37mBadVPN: \033[1;31mON"
|
||||
[[ ${porta[$i]} = "7200" ]] && texto="\033[1;34m ▸ \033[1;37mNetflix: \033[1;31mON"
|
||||
[[ ${svcs[$i]} = "trojan" ]] && texto="\033[1;34m ◂ \033[1;37mTrojan-GO: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "sslh" ]] && texto="\033[1;34m ◂ \033[1;37mSSLH: \033[1;31m${porta[$i]}"
|
||||
[[ ${porta[$i]} = "8888" ]] && texto="\033[1;34m ◂ \033[1;37mKeyGen: \033[1;31mON"
|
||||
i=$(($i+1))
|
||||
[[ ! -z ${svcs[$i]} ]] && texto_="\033[1;34m ▸ \033[1;37m${svcs[$i]}: \033[1;31m${porta[$i]}" || texto_=''
|
||||
[[ ${svcs[$i]} = "apache2" ]] && texto_="\033[1;34m ▸ \033[1;37mAPACHE: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "node" ]] && texto_="\033[1;34m ▸ \033[1;37mWebSocket: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "clash" ]] && texto_="\033[1;34m ▸ \033[1;37mClash: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "psiphond" ]] && texto_="\033[1;34m ▸ \033[1;37mPSIPHON: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "xray-v2-u" ]] && texto_="\033[1;34m ▸ \033[1;37mXRAY/UI: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "v2-ui" ]] && texto_="\033[1;34m ▸ \033[1;37mV2-UI/WEB: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "xray-linu" ]] && texto_="\033[1;34m ▸ \033[1;37mXRAY/UI: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "x-ui" ]] && texto_="\033[1;34m ▸ \033[1;37mXUI/WEB: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "openvpn" ]] && texto_="\033[1;34m ◂ \033[1;37mOPENVPN-TCP: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "squid" ]] && texto_="\033[1;34m ◂ \033[1;37mSQUID: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "squid3" ]] && texto_="\033[1;34m ◂ \033[1;37mSQUID: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "dropbear" ]] && texto_="\033[1;34m ▸ \033[1;37mDROPBEAR: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "python3" ]] && texto_="\033[1;34m ▸ \033[1;37mSOCKS/PYTHON: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "python" ]] && texto_="\033[1;34m ▸ \033[1;37mSOCKS/PYTHON: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "obfs-serv" ]] && texto_="\033[1;34m ▸ \033[1;37mSSR (OBFS): \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "ss-server" ]] && texto_="\033[1;34m ▸ \033[1;37mSSR (LIV): \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "sshd" ]] && texto_="\033[1;34m ▸ \033[1;37mSSH: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "ssh" ]] && texto_="\033[1;34m ▸ \033[1;37mSSH: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "systemd-r" ]] && texto_="\033[1;34m ▸ \033[1;37mSystem-DNS: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "stunnel4" ]] && texto_="\033[1;34m ▸ \033[1;37mSSL: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "v2ray" ]] && texto_="\033[1;34m ◂ \033[1;37mV2RAY: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "xray" ]] && texto_="\033[1;34m ◂ \033[1;37mXRAY: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "badvpn-ud" ]] && texto_="\033[1;34m ▸ \033[1;37mBadVPN: \033[1;31mON"
|
||||
[[ ${porta[$i]} = "7200" ]] && texto_="\033[1;34m ▸ \033[1;37mNetflix: \033[1;31mON"
|
||||
[[ ${svcs[$i]} = "trojan" ]] && texto_="\033[1;34m ◂ \033[1;37mTrojan-GO: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "sslh" ]] && texto_="\033[1;34m ◂ \033[1;37mSSLH: \033[1;31m${porta[$i]}"
|
||||
[[ ${porta[$i]} = "8888" ]] && texto_="\033[1;34m ◂ \033[1;37mKeyGen: \033[1;31mON"
|
||||
i=$(($i+1))
|
||||
[[ ! -z ${svcs[$i]} ]] && texto_3="\033[1;34m ▸ \033[1;37m${svcs[$i]}: \033[1;31m${porta[$i]}" || texto_3=''
|
||||
[[ ${svcs[$i]} = "apache2" ]] && texto_3="\033[1;34m ▸ \033[1;37mAPACHE: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "node" ]] && texto_3="\033[1;34m ▸ \033[1;37mWebSocket: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "clash" ]] && texto_3="\033[1;34m ▸ \033[1;37mClash: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "psiphond" ]] && texto_3="\033[1;34m ▸ \033[1;37mPSIPHON: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "xray-v2-u" ]] && texto_3="\033[1;34m ▸ \033[1;37mXRAY/UI: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "v2-ui" ]] && texto_3="\033[1;34m ▸ \033[1;37mV2-UI/WEB: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "xray-linu" ]] && texto_3="\033[1;34m ▸ \033[1;37mXRAY/UI: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "x-ui" ]] && texto_3="\033[1;34m ▸ \033[1;37mXUI/WEB: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "openvpn" ]] && texto_3="\033[1;34m ◂ \033[1;37mOPENVPN-TCP: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "squid" ]] && texto_3="\033[1;34m ◂ \033[1;37mSQUID: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "squid3" ]] && texto_3="\033[1;34m ◂ \033[1;37mSQUID: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "dropbear" ]] && texto_3="\033[1;34m ▸ \033[1;37mDROPBEAR: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "python3" ]] && texto_3="\033[1;34m ▸ \033[1;37mSOCKS/PYTHON: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "python" ]] && texto_3="\033[1;34m ▸ \033[1;37mSOCKS/PYTHON: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "obfs-serv" ]] && texto_3="\033[1;34m ▸ \033[1;37mSSR (OBFS): \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "ss-server" ]] && texto_3="\033[1;34m ▸ \033[1;37mSSR (LIV): \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "sshd" ]] && texto_3="\033[1;34m ▸ \033[1;37mSSH: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "ssh" ]] && texto_3="\033[1;34m ▸ \033[1;37mSSH: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "systemd-r" ]] && texto_3="\033[1;34m ▸ \033[1;37mSystem-DNS: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "stunnel4" ]] && texto_3="\033[1;34m ▸ \033[1;37mSSL: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "v2ray" ]] && texto_3="\033[1;34m ◂ \033[1;37mV2RAY: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "xray" ]] && texto_3="\033[1;34m ◂ \033[1;37mXRAY: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "badvpn-ud" ]] && texto_3="\033[1;34m ▸ \033[1;37mBadVPN: \033[1;31mON"
|
||||
[[ ${porta[$i]} = "7200" ]] && texto_3="\033[1;34m ▸ \033[1;37mNetflix: \033[1;31mON"
|
||||
[[ ${svcs[$i]} = "trojan" ]] && texto_3="\033[1;34m ◂ \033[1;37mTrojan-GO: \033[1;31m${porta[$i]}"
|
||||
[[ ${svcs[$i]} = "sslh" ]] && texto_3="\033[1;34m ◂ \033[1;37mSSLH: \033[1;31m${porta[$i]}"
|
||||
[[ ${porta[$i]} = "8888" ]] && texto_3="\033[1;34m ◂ \033[1;37mKeyGen: \033[1;31mON"
|
||||
echo -e "$texto $texto_ $texto_3"
|
||||
done
|
||||
PIDGEN=$(ps x | grep "teleBotGen" | grep -v grep |awk '{print $1}')
|
||||
[[ ! -z $PIDGEN ]] && {
|
||||
botG="\033[1;34m ▸ \033[1;37m BotGen Telegram 🤖 : \033[1;31m ⚡ ACTIVO ⚡"
|
||||
msg -bar
|
||||
echo -e "$botG"
|
||||
}
|
||||
}
|
||||
|
||||
mportas () {
|
||||
unset portas
|
||||
portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
|
||||
while read port; do
|
||||
var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
|
||||
[[ "$(echo -e $portas|grep "$var1:$var2")" ]] || portas+="$var1:$var2\n"
|
||||
done <<< "$portas_var"
|
||||
i=1
|
||||
echo -e "$portas"
|
||||
}
|
||||
|
||||
fun_ports () {
|
||||
portas1=$(mportas)
|
||||
for i in ${portas1}; do
|
||||
b=$(echo $i | awk -F ":" '{print $2}')
|
||||
echo "$b"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
menu () {
|
||||
[[ -e /etc/bash.bashrc-bakup ]] && _autorun="\033[0;31m [\033[0;32mON\033[0;31m] " || _autorun="\033[0;31m [OFF]"
|
||||
_ports
|
||||
msg -bar2
|
||||
echo -e "\033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m ➮${cor[3]} ADMINISTRAR USUARIOS "
|
||||
echo -e "\033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮${cor[3]} HERRAMIENTAS (\033[0;34mBad/VPN$_badvpn${cor[3]}) (\033[0;34mTCP-SPEED$_tcpspeed${cor[3]}) "
|
||||
echo -e "\033[0;35m [\033[0;36m3\033[0;35m]\033[0;31m ➮\033[0;33m [!]${cor[3]} OPTIMIZAR VPS "
|
||||
echo -e "\033[0;35m [\033[0;36m4\033[0;35m]\033[0;31m ➮\033[0;33m [!]\033[0;31m DESINSTALAR SCRIPT "
|
||||
echo -e "\033[0;35m [\033[0;36m6\033[0;35m]\033[0;31m ➮${cor[3]} Cont/Limit DE USUARIOS $VERIFICAR_PID \033[1;31m ║"
|
||||
echo -e "\033[0;35m [\033[0;36m7\033[0;35m]\033[0;31m ➮ \e[3;32mHERRAMIENTAS BETA\e[0m \033[0;33m (#EXPERIMENTAL) "
|
||||
echo -e "\033[0;35m [\033[0;36m8\033[0;35m]\033[0;31m ➮${cor[3]} AUTOINICIAR SCRIPT $_autorun "
|
||||
echo -e "\033[0;35m [\033[0;36m9\033[0;35m]\033[0;31m ➮${cor[3]} INSTALADOR DE PROTOCOLOS "
|
||||
msg -bar2
|
||||
echo -e "\033[0;35m [\033[0;36m10\033[0;35m]\033[0;31m ➮\033[0;33m [!] \033[1;32mACTUALIZAR${cor[3]} |\033[0;35m [\033[0;36m0\033[0;35m]\033[0;31m ➮ $(msg -bra "\033[1;41m[ Salir ]\e[0m")"
|
||||
echo -ne "\033[1;31m ╰══════╣ OPCION :" && read -p "" opt
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
msg -bar
|
||||
_ports
|
||||
msg -bar
|
||||
fun_ports
|
||||
read -p "D"
|
||||
#echo "MPORTAS1 ORIGINAL"
|
||||
#mportas1
|
||||
232
Recursos/menu/hora.sh
Normal file
232
Recursos/menu/hora.sh
Normal file
@ -0,0 +1,232 @@
|
||||
#!/bin/bash
|
||||
|
||||
act_hora () {
|
||||
echo "America/Chihuahua"
|
||||
echo "America/Chihuahua" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Chihuahua /etc/localtime > /dev/null 2>&1
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
msg -bar
|
||||
return 0
|
||||
}
|
||||
act_hora1 () {
|
||||
echo "America/Mexico_City"
|
||||
echo "America/Mexico_City" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Mexico_City /etc/localtime > /dev/null 2>&1
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
msg -bar
|
||||
return 0
|
||||
}
|
||||
act_hora2 () {
|
||||
echo "Argentina"
|
||||
ln -sf /usr/share/zoneinfo/America/Argentina/Buenos_Aires /etc/localtime > /dev/null 2>&1
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
msg -bar
|
||||
return 0
|
||||
}
|
||||
act_hora3 () {
|
||||
echo "CHILE"
|
||||
timedatectl > /dev/null 2>&1
|
||||
timedatectl list-timezones | grep Chile/Continental > /dev/null 2>&1
|
||||
timedatectl set-timezone Chile/Continental > /dev/null 2>&1
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
msg -bar
|
||||
return 0
|
||||
}
|
||||
act_hora4 () {
|
||||
echo "America/Los_Angeles"
|
||||
timedatectl > /dev/null 2>&1
|
||||
timedatectl list-timezones | grep Los_Angeles > /dev/null 2>&1
|
||||
timedatectl set-timezone America/Los_Angeles > /dev/null 2>&1
|
||||
msg -bar
|
||||
return 0
|
||||
}
|
||||
act_hora5 () {
|
||||
echo "America/La_Paz"
|
||||
echo "America/La_Paz" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/La_Paz /etc/localtime > /dev/null 2>&1
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
msg -bar
|
||||
return 0
|
||||
}
|
||||
act_hora6 () {
|
||||
echo "America/Guatemala"
|
||||
echo "America/Guatemala" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Guatemala /etc/localtime > /dev/null 2>&1
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
msg -bar
|
||||
return 0
|
||||
}
|
||||
act_hora7 () {
|
||||
echo "America/Bogota"
|
||||
echo "America/Bogota" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Bogota /etc/localtime > /dev/null 2>&1
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
msg -bar
|
||||
return 0
|
||||
}
|
||||
act_hora8 () {
|
||||
echo "America/Guayaquil"
|
||||
echo "America/Guayaquil" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Guayaquil /etc/localtime > /dev/null 2>&1
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
msg -bar
|
||||
return 0
|
||||
}
|
||||
verzm () {
|
||||
timedatectl
|
||||
echo -e "\033[1;31m PRESIONE ENTER PARA CONTINUAR \033[0m"
|
||||
read -p " "
|
||||
return 0
|
||||
}
|
||||
shadowe_fun () {
|
||||
#source /etc/adm-lite/cabelcaho
|
||||
while true; do
|
||||
clear&&clear
|
||||
_tm=$(timedatectl | grep "Time zone")
|
||||
unset selection
|
||||
echo -e " \033[1;36m ZONA HORARIA"
|
||||
msg -bar
|
||||
echo -e "${_tm}"
|
||||
msg -bar
|
||||
echo -e "${cor[4]} [1] > ${cor[2]}VER ZONA HORARIA ACTUAL ${cor[4]} [12] > ${cor[2]} HORARIO PERÚ"
|
||||
echo -e "${cor[4]} [2] > ${cor[5]}HORARIO MEXICO ${cor[4]} [13] > ${cor[2]} HORARIO BRAZIL"
|
||||
echo -e "${cor[4]} [3] > ${cor[5]}HORARIO Argentina"
|
||||
echo -e "${cor[4]} [4] > ${cor[5]}HORARIO CHILE"
|
||||
echo -e "${cor[4]} [5] > ${cor[5]}HORARIO MEXICO"
|
||||
echo -e "${cor[4]} [6] > ${cor[5]}HORARIO Bolivia "
|
||||
echo -e "${cor[4]} [7] > ${cor[5]}HORARIO Guatemala"
|
||||
echo -e "${cor[4]} [8] > ${cor[5]}HORARIO COLOMBIA"
|
||||
echo -e "${cor[4]} [9] > ${cor[5]}HORARIO ECUADOR "
|
||||
echo -e "${cor[4]} [10] > ${cor[5]}HORARIO Los Angeles (USA)"
|
||||
echo -e "${cor[4]} [11] > ${cor[5]}RESTAURAR ZONA ORIGINAL"
|
||||
msg -bar
|
||||
selection=$(selection_fun 13)
|
||||
case ${selection} in
|
||||
0)
|
||||
break;;
|
||||
1)
|
||||
fun_bar
|
||||
verzm
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
2)
|
||||
fun_bar
|
||||
act_hora1
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
3)
|
||||
fun_bar
|
||||
act_hora2
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
4)
|
||||
fun_bar
|
||||
act_hora3
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
5)
|
||||
act_hora
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
6)
|
||||
fun_bar
|
||||
act_hora5
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
7)
|
||||
fun_bar
|
||||
act_hora6
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
8)
|
||||
fun_bar
|
||||
act_hora7
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
9)
|
||||
fun_bar
|
||||
act_hora8
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
10)
|
||||
fun_bar
|
||||
act_hora4
|
||||
unset selection
|
||||
sleep 2s
|
||||
;;
|
||||
11)
|
||||
fun_bar
|
||||
echo "Etc/UTC" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
sleep 2s
|
||||
;;
|
||||
12)
|
||||
fun_bar
|
||||
echo "America/Lima" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Lima /etc/localtime
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
sleep 2s
|
||||
;;
|
||||
13)
|
||||
fun_bar
|
||||
echo "America/Sao_Paulo" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
sleep 2s
|
||||
;;
|
||||
14)
|
||||
fun_bar
|
||||
echo "America/Lima" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Lima /etc/localtime
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
sleep 2s
|
||||
;;
|
||||
15)
|
||||
fun_bar
|
||||
echo "America/Lima" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Lima /etc/localtime
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
sleep 2s
|
||||
;;
|
||||
16)
|
||||
fun_bar
|
||||
echo "America/Lima" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Lima /etc/localtime
|
||||
dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
|
||||
sleep 2s
|
||||
;;
|
||||
17)
|
||||
fun_bar
|
||||
echo "America/Lima" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Lima /etc/localtime
|
||||
sleep 2s
|
||||
;;
|
||||
18)
|
||||
fun_bar
|
||||
echo "America/Lima" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Lima /etc/localtime
|
||||
;;
|
||||
19)
|
||||
fun_bar
|
||||
echo "America/Lima" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Lima /etc/localtime
|
||||
;;
|
||||
20)
|
||||
fun_bar
|
||||
echo "America/Lima" > /etc/timezone
|
||||
ln -fs /usr/share/zoneinfo/America/Lima /etc/localtime
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
shadowe_fun
|
||||
61
Recursos/menu/killram.sh
Normal file
61
Recursos/menu/killram.sh
Normal file
@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
#Autor: Henry Chumo
|
||||
#Alias : ChumoGH
|
||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games/
|
||||
kill $(ps -A -ostat,ppid | awk '/[zZ]/{print $2}')
|
||||
tiempo=$(printf '%(%D-%H:%M:%S)T')
|
||||
unLimit=$(free --mega | awk 'NR==2{printf $7}')
|
||||
#[[ $(dpkg --get-selections|grep -w "snapd"|head -1) ]] && apt purge snapd -y &>/dev/null
|
||||
killall multipathd
|
||||
killall systemd-journald
|
||||
killall udisksd
|
||||
sudo systemctl disable systemd-journald
|
||||
sudo systemctl stop systemd-journald
|
||||
if [ ${unLimit} -le 200 ]; then
|
||||
echo $(free --mega -h | awk 'NR==2{printf $4}') " EN " $tiempo >> /root/lm.log
|
||||
sudo sync
|
||||
sudo sysctl -w vm.drop_caches=3
|
||||
echo 3 > /proc/sys/vm/drop_caches 1> /dev/null 2> /dev/null
|
||||
echo "@drowkid01" > /var/log/syslog
|
||||
echo "@drowkid01" > /var/log/auth.log && rm -f /var/log/*.log.*
|
||||
killall kswapd0
|
||||
killall ksoftirqd
|
||||
killall tcpdump
|
||||
killall multipathd
|
||||
killall snapd
|
||||
killall droplet-agent
|
||||
[[ -e /etc/v2ray/config.json ]] && v2ray clean
|
||||
[[ -e /etc/xray/config.json ]] && xray clean
|
||||
swapoff -a && swapon -a
|
||||
rm -rf /tmp/*
|
||||
echo $(free --kilo -h | awk 'NR==2{printf $4}') " LUEGO " $tiempo >> /root/lm.log
|
||||
else
|
||||
echo "@drowkid01" > /var/log/syslog
|
||||
echo "@drowkid01" > /var/log/auth.log && rm -f /var/log/*.log.*
|
||||
sync
|
||||
echo 3 >/proc/sys/vm/drop_caches
|
||||
sync && sysctl -w vm.drop_caches=3
|
||||
sysctl -w vm.drop_caches=0
|
||||
swapoff -a
|
||||
swapon -a
|
||||
rm -rf /tmp/*
|
||||
killall kswapd0
|
||||
killall tcpdump
|
||||
killall ksoftirqd
|
||||
killall multipathd
|
||||
[[ -e /etc/v2ray/config.json ]] && v2ray clean && v2ray restart
|
||||
[[ -e /etc/xray/config.json ]] && xray clean && xray clean
|
||||
tiempo=$(printf '%(%D-%H:%M:%S)T')
|
||||
echo -e >> $HOME/lm.log
|
||||
echo "Limpio >" $tiempo >> /root/lm.log
|
||||
echo ${unLimit} "MB - Esta bajo el limite 100MB en " $tiempo >> /root/lm.log
|
||||
fi
|
||||
wget -q -O /bin/ejecutar/msg https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg
|
||||
[[ -e /bin/ejecutar/autt ]] && {
|
||||
name=$(cat < /bin/ejecutar/autt)
|
||||
echo "Haciendo COPIA DE USUARIOS EN $name " $tiempo >> /root/lm.log
|
||||
source <(curl -sL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu/autobackup.sh)
|
||||
} || {
|
||||
[[ -e /var/www/html/backup ]] && rm /var/www/html/backup
|
||||
echo "NO FileSystem " $tiempo >> /root/lm.log
|
||||
}
|
||||
733
Recursos/menu/mod-v2ray.sh
Normal file
733
Recursos/menu/mod-v2ray.sh
Normal file
@ -0,0 +1,733 @@
|
||||
#!/bin/sh
|
||||
#Autor: Henry Chumo
|
||||
#Alias : ChumoGH
|
||||
clear
|
||||
config="/usr/local/etc/trojan/config.json"
|
||||
temp="/etc/trojan/temp.json"
|
||||
trojdir="/etc/trojan" && [[ ! -d $trojdir ]] && mkdir $trojdir
|
||||
user_conf="/etc/trojan/user" && [[ ! -e $user_conf ]] && touch $user_conf
|
||||
backdir="/etc/trojan/back" && [[ ! -d ${backdir} ]] && mkdir ${backdir}
|
||||
tmpdir="$backdir/tmp"
|
||||
[[ ! -e $trojdir/conf ]] && echo "autBackup 0" > $trojdir/conf
|
||||
if [[ $(cat $trojdir/conf | grep "autBackup") = "" ]]; then
|
||||
echo "autBackup 0" >> $trojdir/conf
|
||||
fi
|
||||
unset barra
|
||||
barra="\033[0;34m•••••••••••••••••••••••••••••••••••••••••••••••••\033[0m"
|
||||
[[ -e /bin/ejecutar/msg source msg
|
||||
numero='^[0-9]+$'
|
||||
hora=$(printf '%(%H:%M:%S)T')
|
||||
fecha=$(printf '%(%D)T')
|
||||
|
||||
|
||||
trojan()
|
||||
{
|
||||
wget -q https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/trojango.sh; chmod +x trojango.sh; ./trojango.sh
|
||||
rm -f trojango.sh
|
||||
}
|
||||
|
||||
|
||||
install_ini () {
|
||||
add-apt-repository universe
|
||||
apt update -y; apt upgrade -y
|
||||
clear
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[92m -- INSTALANDO PAQUETES NECESARIOS -- "
|
||||
echo -e "$BARRA"
|
||||
#bc
|
||||
[[ $(dpkg --get-selections|grep -w "bc"|head -1) ]] || apt-get install bc -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "bc"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "bc"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install bc................... $ESTATUS "
|
||||
#jq
|
||||
[[ $(dpkg --get-selections|grep -w "jq"|head -1) ]] || apt-get install jq -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "jq"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "jq"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install jq................... $ESTATUS "
|
||||
#curl
|
||||
[[ $(dpkg --get-selections|grep -w "curl"|head -1) ]] || apt-get install curl -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "curl"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "curl"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install curl................. $ESTATUS "
|
||||
#npm
|
||||
[[ $(dpkg --get-selections|grep -w "npm"|head -1) ]] || apt-get install npm -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "npm"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "npm"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install npm.................. $ESTATUS "
|
||||
#nodejs
|
||||
[[ $(dpkg --get-selections|grep -w "nodejs"|head -1) ]] || apt-get install nodejs -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "nodejs"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "nodejs"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install nodejs............... $ESTATUS "
|
||||
#socat
|
||||
[[ $(dpkg --get-selections|grep -w "socat"|head -1) ]] || apt-get install socat -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "socat"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "socat"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install socat................ $ESTATUS "
|
||||
#netcat
|
||||
[[ $(dpkg --get-selections|grep -w "netcat"|head -1) ]] || apt-get install netcat -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "netcat"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "netcat"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install netcat............... $ESTATUS "
|
||||
#netcat-traditional
|
||||
[[ $(dpkg --get-selections|grep -w "netcat-traditional"|head -1) ]] || apt-get install netcat-traditional -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "netcat-traditional"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "netcat-traditional"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install netcat-traditional... $ESTATUS "
|
||||
#net-tools
|
||||
[[ $(dpkg --get-selections|grep -w "net-tools"|head -1) ]] || apt-get net-tools -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "net-tools"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "net-tools"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install net-tools............ $ESTATUS "
|
||||
#cowsay
|
||||
[[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || apt-get install cowsay -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install cowsay............... $ESTATUS "
|
||||
#figlet
|
||||
[[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || apt-get install figlet -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install figlet............... $ESTATUS "
|
||||
#lolcat
|
||||
apt-get install lolcat -y &>/dev/null
|
||||
sudo gem install lolcat &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install lolcat............... $ESTATUS "
|
||||
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[92m La instalacion de paquetes necesarios a finalizado"
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[97m Si la instalacion de paquetes tiene fallas"
|
||||
echo -ne "\033[97m Puede intentar de nuevo [s/n]: "
|
||||
read inst
|
||||
[[ $inst = @(s|S|y|Y) ]] && install_ini
|
||||
}
|
||||
|
||||
|
||||
enon(){
|
||||
echo "source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu/mod-v2ray.sh)" > /bin/troj.sh
|
||||
chmod +x /bin/troj.sh
|
||||
clear
|
||||
echo -e $barra
|
||||
blanco " Se ha agregado un autoejecutor en el Sector de Inicios Rapidos"
|
||||
echo -e $barra
|
||||
blanco " Para Acceder al menu Rapido \n Utilize * troj.sh * !!!"
|
||||
echo -e $barra
|
||||
echo -e " \033[4;31mNOTA importante\033[0m"
|
||||
echo -e " \033[0;31mSi deseas desabilitar esta opcion, apagala"
|
||||
echo -e " Y te recomiendo, no alterar nada en este menu, para"
|
||||
echo -e " Evitar Errores Futuros"
|
||||
echo -e " y causar problemas en futuras instalaciones.\033[0m"
|
||||
echo -e $barra
|
||||
continuar
|
||||
read foo
|
||||
}
|
||||
enoff(){
|
||||
rm -f /bin/v2r.sh
|
||||
echo -e $barra
|
||||
echo -e " \033[4;31mNOTA importante\033[0m"
|
||||
echo -e " \033[0;31mSe ha Desabilitado el menu Rapido de troj.sh"
|
||||
echo -e " Y te recomiendo, no alterar nada en este menu, para"
|
||||
echo -e " Evitar Errores Futuros"
|
||||
echo -e " y causar problemas en futuras instalaciones.\033[0m"
|
||||
echo -e $barra
|
||||
continuar
|
||||
read foo
|
||||
}
|
||||
|
||||
enttrada () {
|
||||
|
||||
while :
|
||||
do
|
||||
clear
|
||||
echo -e $barra
|
||||
blanco " Ajustes e Entrasda Rapida de Menu TROJAN"
|
||||
echo -e $barra
|
||||
col "1)" "Habilitar troj.sh, Como entrada Rapida"
|
||||
col "2)" "Eliminar troj.sh, Como entrada Rapida"
|
||||
echo -e $barra
|
||||
col "0)" "Volver"
|
||||
echo -e $barra
|
||||
blanco "opcion" 0
|
||||
read opcion
|
||||
|
||||
[[ -z $opcion ]] && vacio && sleep 0.3 && break
|
||||
[[ $opcion = 0 ]] && break
|
||||
|
||||
case $opcion in
|
||||
1)enon;;
|
||||
2)enoff;;
|
||||
*) blanco " solo numeros de 0 a 2" && sleep 0.3;;
|
||||
esac
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
on_off_res(){
|
||||
if [[ $(cat $trojdir/conf | grep "autBackup" | cut -d " " -f2) = "0" ]]; then
|
||||
echo -e "\033[0;31m[off]"
|
||||
else
|
||||
echo -e "\033[1;92m[on]"
|
||||
fi
|
||||
}
|
||||
|
||||
blanco(){
|
||||
[[ ! $2 = 0 ]] && {
|
||||
echo -e "\033[1;37m$1\033[0m"
|
||||
} || {
|
||||
echo -ne " \033[1;37m$1:\033[0m "
|
||||
}
|
||||
}
|
||||
|
||||
col(){
|
||||
|
||||
nom=$(printf '%-55s' "\033[0;92m${1} \033[0;31m ➣ \033[1;37m${2}")
|
||||
echo -e " $nom\033[0;31m${3} \033[0;92m${4}\033[0m"
|
||||
}
|
||||
|
||||
col2(){
|
||||
|
||||
echo -e " \033[1;91m$1\033[0m \033[1;37m$2\033[0m"
|
||||
}
|
||||
|
||||
vacio(){
|
||||
|
||||
blanco "\n no se puede ingresar campos vacios..."
|
||||
}
|
||||
|
||||
cancelar(){
|
||||
|
||||
echo -e "\n \033[3;49;31minstalacion cancelada...\033[0m"
|
||||
}
|
||||
|
||||
continuar(){
|
||||
|
||||
echo -e " \033[3;49;32mEnter para continuar...\033[0m"
|
||||
}
|
||||
|
||||
title2(){
|
||||
trojanports=`lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN" | grep trojan | awk '{print substr($9,3); }' > /tmp/trojan.txt && echo | cat /tmp/trojan.txt | tr '\n' ' ' > /etc/adm-lite/trojanports.txt && cat /etc/adm-lite/trojanports.txt` > /dev/null 2>&1
|
||||
v1=$(cat /etc/adm-lite/v-local.log)
|
||||
v2=$(cat /bin/ejecutar/v-new.log)
|
||||
echo -e "\033[7;49;35m =====>>►► 🐲 Menu TROJAN ChumoGH💥VPS 🐲 ◄◄<<===== \033[0m"
|
||||
echo -e $barra
|
||||
[[ $v1 = $v2 ]] && echo -e " \e[97m\033[1;41mProyecto Trojan by @drowkid01 [$v1] \033[0m" || echo -e " \e[97m\033[1;41mProyecto Trojan by @drowkid01 [$v1] >> \033[1;92m[$v2] \033[0m"
|
||||
[[ $trojanports > 0 ]] && echo -e " \e[97m\033[1;41mPuerta Activa en menu : \033[0m \033[3;32m $trojanports\033[3;32m" || echo -e " \e[97m\033[1;41mERROR A INICIAR TROJAN : \033[0m \033[3;32m FAIL\033[3;32m"
|
||||
}
|
||||
|
||||
title(){
|
||||
echo -e $barra
|
||||
echo -e " >>>>>>> Fecha Actual $(date '+%d-%m-%Y') <<<<<<<<<<<"
|
||||
blanco "$1"
|
||||
echo -e $barra
|
||||
}
|
||||
|
||||
userDat(){
|
||||
#echo -e " >>>>>>> Fecha Actual $(date '+%d-%m-%Y') <<<<<<<<<<<"
|
||||
blanco " N° Usuarios fech exp dias"
|
||||
echo -e $barra
|
||||
}
|
||||
|
||||
log_traff () {
|
||||
|
||||
tail -f /usr/local/etc/trojan/config.json
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
add_user(){
|
||||
autoDel
|
||||
unset seg
|
||||
seg=$(date +%s)
|
||||
while :
|
||||
do
|
||||
clear
|
||||
nick="$(cat $config | grep ',"')"
|
||||
users="$(cat < ${user_conf}adm) $(echo $nick|sed -e 's/[^a-z0-9 -]//ig')"
|
||||
title " CREAR USUARIO Trojan"
|
||||
userDat
|
||||
n=0
|
||||
for i in $users
|
||||
do
|
||||
unset DateExp
|
||||
unset seg_exp
|
||||
unset exp
|
||||
|
||||
[[ $i = "chumoghscript" ]] && {
|
||||
n=0
|
||||
i="ADM-SCRIPT"
|
||||
a='◈'
|
||||
DateExp="【 I N D E F I N I D O 】"
|
||||
col "$a)" "$i" "$DateExp"
|
||||
|
||||
} || {
|
||||
[[ $i = "$(cat < ${user_conf}adm)" ]] && {
|
||||
n=0
|
||||
i="$(cat < ${user_conf}adm)"
|
||||
a='◈'
|
||||
DateExp="【 I N D E F I N I D O 】"
|
||||
col "$a)" "$i" "$DateExp"
|
||||
} || {
|
||||
DateExp="$(cat ${user_conf}|grep -w "${i}"|cut -d'|' -f3)"
|
||||
seg_exp=$(date +%s --date="$DateExp")
|
||||
exp="[$(($(($seg_exp - $seg)) / 86400))]"
|
||||
col "$n)" "$i" "$DateExp" "$exp"
|
||||
}
|
||||
}
|
||||
let n++
|
||||
done
|
||||
echo -e $barra
|
||||
col "0)" "VOLVER"
|
||||
echo -e $barra
|
||||
blanco "Ingresa Nombre de USUARIO :" 0
|
||||
read usser
|
||||
[[ -z $usser ]] && vacio && sleep 0.3 && continue
|
||||
[[ $usser = 0 ]] && break
|
||||
[[ -z $(echo "$users" | grep $usser) ]] && {
|
||||
opcion=$usser
|
||||
echo -e $barra
|
||||
blanco "DURACION EN DIAS" 0
|
||||
read dias
|
||||
espacios=$(echo "$opcion" | tr -d '[[:space:]]')
|
||||
opcion=$espacios
|
||||
mv $config $temp
|
||||
movetm=$(echo -e "$opcion" | sed 's/^/,"/;s/$/"/')
|
||||
sed "10i\ $movetm" $temp > $config
|
||||
#echo -e "$opcion" | sed 's/^/,"/;s/$/"/'
|
||||
sed -i "/usser/d" $user_conf
|
||||
echo "$opcion | $usser | $(date '+%y-%m-%d' -d " +$dias days")" >> $user_conf
|
||||
chmod 777 $config
|
||||
rm $temp
|
||||
clear
|
||||
echo -e $barra
|
||||
blanco " Usuario $usser creado con exito"
|
||||
echo -e $barra
|
||||
autoDel
|
||||
killall trojan > /dev/null
|
||||
screen -dmS trojanserv trojan /usr/local/etc/trojan/config.json
|
||||
sleep 0.3
|
||||
} || echo " USUARIO YA EXISTE " && sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
renew(){
|
||||
while :
|
||||
do
|
||||
unset user
|
||||
clear
|
||||
title " RENOVAR USUARIOS"
|
||||
userDat
|
||||
userEpx=$(cut -d " " -f1 $user_conf)
|
||||
n=1
|
||||
for i in $userEpx
|
||||
do
|
||||
DateExp="$(cat ${user_conf}|grep -w "${i}"|cut -d'|' -f3)"
|
||||
seg_exp=$(date +%s --date="$DateExp")
|
||||
[[ "$seg" -gt "$seg_exp" ]] && {
|
||||
col "$n)" "$i" "$DateExp" "\033[0;31m[Exp]"
|
||||
uid[$n]="$(cat ${user_conf}|grep -w "${i}"|cut -d'|' -f2|tr -d '[[:space:]]')"
|
||||
user[$n]=$i
|
||||
let n++
|
||||
}
|
||||
done
|
||||
[[ -z ${user[1]} ]] && blanco " No hay expirados"
|
||||
echo -e $barra
|
||||
col "0)" "VOLVER"
|
||||
echo -e $barra
|
||||
blanco "NUMERO DE USUARIO A RENOVAR" 0
|
||||
read opcion
|
||||
|
||||
[[ -z $opcion ]] && vacio && sleep 0.3 && continue
|
||||
[[ $opcion = 0 ]] && break
|
||||
|
||||
[[ ! $opcion =~ $numero ]] && {
|
||||
blanco " solo numeros apartir de 1"
|
||||
sleep 0.3
|
||||
} || {
|
||||
[[ $opcion>=${n} ]] && {
|
||||
let n--
|
||||
blanco "solo numero entre 1 y $n"
|
||||
sleep 0.3
|
||||
} || {
|
||||
blanco "DURACION EN DIAS" 0
|
||||
read dias
|
||||
mv $config $temp
|
||||
movetm=$(echo -e "${user[$opcion]}" | sed 's/^/,"/;s/$/"/')
|
||||
sed "10i\ $movetm" $temp > $config
|
||||
sed -i "/${user[$opcion]}/d" $user_conf
|
||||
echo "${user[$opcion]} | ${user[$opcion]} | $(date '+%y-%m-%d' -d " +$dias days")" >> $user_conf
|
||||
chmod 777 $config
|
||||
rm -f $temp
|
||||
clear
|
||||
echo -e $barra
|
||||
blanco " Usuario > ${user[$opcion]} renovado hasta $(date '+%y-%m-%d' -d " +$dias days")"
|
||||
sleep 5s
|
||||
}
|
||||
}
|
||||
done
|
||||
killall trojan > /dev/null
|
||||
screen -dmS trojanserv trojan /usr/local/etc/trojan/config.json
|
||||
continuar
|
||||
read foo
|
||||
}
|
||||
|
||||
autoDel(){
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/trojango-sh/trojan-sh/autodel-trojan.sh)
|
||||
}
|
||||
|
||||
dell_user(){
|
||||
unset seg
|
||||
seg=$(date +%s)
|
||||
while :
|
||||
do
|
||||
clear
|
||||
nick="$(cat $config | grep ',"')"
|
||||
users="$(cat < ${user_conf}adm) $(echo $nick|sed -e 's/[^a-z0-9 -]//ig')"
|
||||
title " ELIMINAR USUARIO TROJAN"
|
||||
userDat
|
||||
n=0
|
||||
for i in $users
|
||||
do
|
||||
userd[$n]=$i
|
||||
unset DateExp
|
||||
unset seg_exp
|
||||
unset exp
|
||||
|
||||
[[ $i = "chumoghscript" ]] && {
|
||||
i="ADM-SCRIPT"
|
||||
a='◈'
|
||||
DateExp="【 I N D E F I N I D O 】"
|
||||
col "$a)" "$i" "$DateExp"
|
||||
} || {
|
||||
|
||||
[[ $i = "$(cat < ${user_conf}adm)" ]] && {
|
||||
i="$(cat < ${user_conf}adm)"
|
||||
a='◈'
|
||||
DateExp="【 I N D E F I N I D O 】"
|
||||
col "$a)" "$i" "$DateExp"
|
||||
} || {
|
||||
DateExp="$(cat ${user_conf}|grep -w "${i}"|cut -d'|' -f3)"
|
||||
seg_exp=$(date +%s --date="$DateExp")
|
||||
exp="[$(($(($seg_exp - $seg)) / 86400))]"
|
||||
col "$n)" "$i" "$DateExp" "$exp"
|
||||
}
|
||||
}
|
||||
p=$n
|
||||
let n++
|
||||
done
|
||||
userEpx=$(cut -d " " -f 1 $user_conf)
|
||||
for i in $userEpx
|
||||
do
|
||||
DateExp="$(cat ${user_conf}|grep -w "${i}"|cut -d'|' -f3)"
|
||||
seg_exp=$(date +%s --date="$DateExp")
|
||||
[[ "$seg" -gt "$seg_exp" ]] && {
|
||||
col "$n)" "$i" "$DateExp" "\033[0;31m[Exp]"
|
||||
expUser[$n]=$i
|
||||
}
|
||||
let n++
|
||||
done
|
||||
echo -e $barra
|
||||
col "0)" "VOLVER"
|
||||
echo -e $barra
|
||||
blanco "NUMERO DE USUARIO A ELIMINAR" 0
|
||||
read opcion
|
||||
[[ -z $opcion ]] && vacio && sleep 0.3 && continue
|
||||
[[ $opcion = 0 ]] && break
|
||||
|
||||
[[ ! $opcion =~ $numero ]] && {
|
||||
blanco " solo numeros apartir de 1"
|
||||
sleep 0.3
|
||||
} || {
|
||||
let n--
|
||||
[[ $opcion>=${n} ]] && {
|
||||
blanco "solo numero entre 1 y $n"
|
||||
sleep 0.3
|
||||
} || {
|
||||
|
||||
[[ $opcion>=${p} ]] && {
|
||||
sed -i "/${expUser[$opcion]}/d" $user_conf
|
||||
} || {
|
||||
mv $config $temp
|
||||
sed -i "/${expUser[$opcion]}/d" $user_conf
|
||||
sed "/${userd[$opcion]}/ d" $temp > $config
|
||||
chmod 777 $config
|
||||
rm $temp
|
||||
clear
|
||||
echo -e $barra
|
||||
blanco " Usuario ${userd[$opcion]}${expUser[$opcion]} eliminado"
|
||||
echo -e $barra
|
||||
sleep 0.5s
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
done
|
||||
killall trojan > /dev/null
|
||||
screen -dmS trojanserv trojan /usr/local/etc/trojan/config.json
|
||||
}
|
||||
|
||||
bakc() {
|
||||
clear
|
||||
while :
|
||||
do
|
||||
clear
|
||||
#col "5)" "\033[1;33mCONFIGURAR Trojan"
|
||||
echo -e $barra
|
||||
col "1)" "\033[1;33mRestaurar Copia"
|
||||
echo -e $barra
|
||||
col "2)" "\033[1;33mCrear Copia"
|
||||
echo -e $barra
|
||||
col "0)" "SALIR \033[0;31m|| $(blanco "Respaldos automaticos") $(on_off_res)"
|
||||
echo -e $barra
|
||||
blanco "opcion" 0
|
||||
read opcion
|
||||
case $opcion in
|
||||
1)[[ -e config.json ]] && cp config.json /usr/local/etc/trojan/config.json || echo "No existe Copia";;
|
||||
2)[[ -e /usr/local/etc/trojan/config.json ]] && cp /usr/local/etc/trojan/config.json config.json || echo "No existe Copia";;
|
||||
0) break;;
|
||||
*) blanco "\n selecione una opcion del 0 al 2" && sleep 0.3;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
}
|
||||
|
||||
reintro() {
|
||||
clear
|
||||
while :
|
||||
do
|
||||
clear
|
||||
#col "5)" "\033[1;33mCONFIGURAR Trojan"
|
||||
echo -e $barra
|
||||
col "1)" "\033[1;33mReinstalar Servicio"
|
||||
echo -e $barra
|
||||
col "2)" "\033[1;33mReiniciar Servicio"
|
||||
echo -e $barra
|
||||
col "3)" "\033[1;33mEditar Manual ( nano )"
|
||||
echo -e $barra
|
||||
col "0)" "SALIR \033[0;31m|| $(blanco "Respaldos automaticos") $(on_off_res)"
|
||||
echo -e $barra
|
||||
blanco "opcion" 0
|
||||
read opcion
|
||||
case $opcion in
|
||||
1)
|
||||
trojan
|
||||
;;
|
||||
2)
|
||||
[[ -e /usr/local/etc/trojan/config.json ]] && {
|
||||
title "Fichero Interno Configurado"
|
||||
killall trojan > /dev/null
|
||||
screen -dmS trojanserv trojan /usr/local/etc/trojan/config.json && blanco "Reinicio Completado Exitosamente " || blanco "Error al Aplicar Reinicio "
|
||||
} || echo -e "Servicio No instalado Aun"
|
||||
;;
|
||||
3)
|
||||
nano /usr/local/etc/trojan/config.json
|
||||
;;
|
||||
0) break;;
|
||||
*) blanco "\n selecione una opcion del 0 al 3" && sleep 0.3;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
continuar
|
||||
read foo
|
||||
}
|
||||
|
||||
cattro () {
|
||||
|
||||
clear
|
||||
while :
|
||||
do
|
||||
clear
|
||||
#col "5)" "\033[1;33mCONFIGURAR Trojan"
|
||||
echo -e $barra
|
||||
col "1)" "\033[1;33mMostrar fichero de CONFIG "
|
||||
echo -e $barra
|
||||
col "2)" "\033[1;33mEditar Config Manual ( Comando nano )"
|
||||
echo -e $barra
|
||||
col "0)" "SALIR \033[0;31m|| $(blanco "Respaldos automaticos") $(on_off_res)"
|
||||
echo -e $barra
|
||||
blanco "opcion" 0
|
||||
read opcion
|
||||
case $opcion in
|
||||
1)
|
||||
title "Fichero Interno Configurado"
|
||||
cat /usr/local/etc/trojan/config.json
|
||||
blanco "Fin Fichero "
|
||||
continuar
|
||||
read foo
|
||||
;;
|
||||
2)
|
||||
[[ -e /usr/local/etc/trojan/config.json ]] && {
|
||||
title "Fichero Interno Configurado"
|
||||
nano /usr/local/etc/trojan/config.json
|
||||
killall trojan > /dev/null
|
||||
screen -dmS trojanserv trojan /usr/local/etc/trojan/config.json && blanco "Reinicio Completado Exitosamente " || blanco "Error al Aplicar Reinicio "
|
||||
} || echo -e "Servicio No instalado Aun"
|
||||
;;
|
||||
0) break;;
|
||||
*) blanco "\n selecione una opcion del 0 al 2" && sleep 0.3;;
|
||||
esac
|
||||
done
|
||||
continuar
|
||||
}
|
||||
|
||||
view_user(){
|
||||
trojanport=`lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN" | grep trojan | awk '{print substr($9,3); }' > /tmp/trojan.txt && echo | cat /tmp/trojan.txt | tr '\n' ' ' > /etc/adm-lite/trojanports.txt && cat /etc/adm-lite/trojanports.txt`;
|
||||
trojanport=$(cat /etc/adm-lite/trojanports.txt | sed 's/\s\+/,/g' | cut -d , -f1)
|
||||
unset seg
|
||||
seg=$(date +%s)
|
||||
while :
|
||||
do
|
||||
|
||||
clear
|
||||
nick="$(cat $config | grep ',"')"
|
||||
users="$(echo $nick|sed -e 's/[^a-z0-9 -]//ig')"
|
||||
title " VER USUARIO TROJAN"
|
||||
userDat
|
||||
|
||||
n=1
|
||||
for i in $users
|
||||
do
|
||||
unset DateExp
|
||||
unset seg_exp
|
||||
unset exp
|
||||
[[ $i = "$(cat < ${user_conf}adm)" ]] && {
|
||||
i="$(cat < ${user_conf}adm)"
|
||||
DateExp="【 I N D E F I N I D O 】"
|
||||
} || {
|
||||
[[ $i = "chumoghscript" ]] && {
|
||||
i="ADM-SCRIPT"
|
||||
DateExp="【 I N D E F I N I D O 】"
|
||||
} || {
|
||||
DateExp="$(cat ${user_conf}|grep -w "${i}"|cut -d'|' -f3)"
|
||||
seg_exp=$(date +%s --date="$DateExp")
|
||||
exp="[$(($(($seg_exp - $seg)) / 86400))]"
|
||||
}
|
||||
}
|
||||
|
||||
col "$n)" "$i" "$DateExp" "$exp"
|
||||
let n++
|
||||
done
|
||||
echo -e $barra
|
||||
col "0)" "VOLVER"
|
||||
echo -e $barra
|
||||
blanco "VER DATOS DEL USUARIO" 0
|
||||
read opcion
|
||||
[[ -z $opcion ]] && vacio && sleep 0.3 && continue
|
||||
[[ $opcion = 0 ]] && break
|
||||
n=1
|
||||
unset i
|
||||
for i in $users
|
||||
do
|
||||
unset DateExp
|
||||
unset seg_exp
|
||||
unset exp
|
||||
DateExp="$(cat ${user_conf}|grep -w "${i}"|cut -d'|' -f3)"
|
||||
seg_exp=$(date +%s --date="$DateExp")
|
||||
exp="[$(($(($seg_exp - $seg)) / 86400))]"
|
||||
#col "$n)" "$i" "$DateExp" "$exp"
|
||||
[[ $n = $opcion ]] && trojanpass=$i && dataEX=$DateExp && dEX=$exp
|
||||
let n++
|
||||
done
|
||||
let opcion--
|
||||
addip=$(wget -qO- ifconfig.me)
|
||||
echo -e " PARA FINALIZAR AGREGA TU HOST SNI / HOST:Port"
|
||||
read -p " Host / SNI : " host
|
||||
[[ -z $host ]] && host="coloca-tu-SNI"
|
||||
clear&&clear
|
||||
blanco $barra
|
||||
blanco " TROJAN LINK CONFIG"
|
||||
blanco $barra
|
||||
col "$opcion)" "$trojanpass" "$dataEX" "$dEX"
|
||||
trojan_conf
|
||||
blanco $barra
|
||||
continuar
|
||||
read foo
|
||||
done
|
||||
}
|
||||
|
||||
trojan_conf (){
|
||||
echo -e $barra
|
||||
col2 "Remarks:" "$trojanpass"
|
||||
col2 "IP-Address:" "$addip"
|
||||
col2 "Port:" "$trojanport"
|
||||
col2 "password:" "$trojanpass"
|
||||
[[ ! -z $host ]] && col2 "Host/SNI:" "$host"
|
||||
echo -ne "$(msg -verd "") $(msg -verm2 " ") "&& msg -bra "\033[1;41mEn APPS como HTTP Inyector,CUSTOM,Trojan,etc"
|
||||
echo -e "\033[3;32m trojan://$(echo $trojanpass@$addip:$trojanport?sni=$host#$trojanpass )\033[3;32m"
|
||||
|
||||
}
|
||||
|
||||
main(){
|
||||
[[ ! -e $config ]] && {
|
||||
clear
|
||||
echo -e $barra
|
||||
blanco " No se encontro ningun archovo de configracion Trojan"
|
||||
echo -e $barra
|
||||
blanco " No instalo Trojan o esta usando\n una vercion diferente!!!"
|
||||
echo -e $barra
|
||||
echo -e " \033[4;31mNOTA importante\033[0m"
|
||||
echo -e " \033[0;31mSi esta usando una vercion Trojan diferente"
|
||||
echo -e " y opta por cuntinuar usando este script."
|
||||
echo -e " Este puede; no funcionar correctamente"
|
||||
echo -e " y causar problemas en futuras instalaciones.\033[0m"
|
||||
echo -e $barra
|
||||
continuar
|
||||
read foo
|
||||
}
|
||||
while :
|
||||
do
|
||||
_usor=$(printf '%-8s' "$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')")
|
||||
_usop=$(printf '%-1s' "$(top -bn1 | awk '/Cpu/ { cpu = "" 100 - $8 "%" }; END { print cpu }')")
|
||||
[[ -e /bin/troj.sh ]] && enrap="\033[1;92m[Encendido]" || enrap="\033[0;31m[Apagado]"
|
||||
clear
|
||||
title2
|
||||
title " Ram: \033[1;32m$_usor \033[0;31m<<< \033[1;37mMENU Trojan \033[0;31m>>> \033[1;37mCPU: \033[1;32m$_usop"
|
||||
col "1)" "CREAR USUARIO "
|
||||
col "2)" "\033[0;92mRENOVAR USUARIO "
|
||||
col "3)" "\033[0;31mREMOVER USUARIO <->"
|
||||
col "4)" "VER DATOS DE USUARIOS "
|
||||
#col "5)" "\033[1;33mCONFIGURAR Trojan"
|
||||
echo -e $barra
|
||||
col "6)" "\033[1;33mEntrada Rapida $enrap"
|
||||
echo -e $barra
|
||||
col "7)" "\033[1;33mMostrar/Editar Fichero interno"
|
||||
col "8)" "\033[1;33mMenu Avanzado Trojan"
|
||||
col "9)" "\033[1;33mCrear Copia de Config Trojan"
|
||||
echo -e $barra
|
||||
col "10)" "\033[1;33mMostrar Log del Trafico"
|
||||
echo -e $barra
|
||||
col "0)" "SALIR \033[0;31m|| $(blanco "Respaldos automaticos") $(on_off_res)"
|
||||
echo -e $barra
|
||||
blanco "opcion" 0
|
||||
read opcion
|
||||
|
||||
case $opcion in
|
||||
1)add_user;;
|
||||
2)renew;;
|
||||
3)dell_user;;
|
||||
4)view_user;;
|
||||
5)settings;;
|
||||
6)enttrada;;
|
||||
7)cattro;;
|
||||
8)reintro;;
|
||||
9)bakc;;
|
||||
10)log_traff;;
|
||||
0) break;;
|
||||
*) blanco "\n selecione una opcion del 0 al 10" && sleep 0.3;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
[[ $1 = "autoDel" ]] && {
|
||||
autoDel
|
||||
} || {
|
||||
autoDel
|
||||
main
|
||||
}
|
||||
53
Recursos/menu/nginx.conf
Normal file
53
Recursos/menu/nginx.conf
Normal file
@ -0,0 +1,53 @@
|
||||
user www-data;
|
||||
|
||||
worker_processes 1;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
multi_accept on;
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_comp_level 5;
|
||||
gzip_types text/plain application/x-javascript text/xml text/css;
|
||||
|
||||
autoindex on;
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
server_tokens off;
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
client_max_body_size 32M;
|
||||
client_header_buffer_size 8m;
|
||||
large_client_header_buffers 8 8m;
|
||||
|
||||
fastcgi_buffer_size 8m;
|
||||
fastcgi_buffers 8 8m;
|
||||
|
||||
fastcgi_read_timeout 600;
|
||||
|
||||
set_real_ip_from 204.93.240.0/24;
|
||||
set_real_ip_from 204.93.177.0/24;
|
||||
set_real_ip_from 199.27.128.0/21;
|
||||
set_real_ip_from 173.245.48.0/20;
|
||||
set_real_ip_from 103.21.244.0/22;
|
||||
set_real_ip_from 103.22.200.0/22;
|
||||
set_real_ip_from 103.31.4.0/22;
|
||||
set_real_ip_from 141.101.64.0/18;
|
||||
set_real_ip_from 108.162.192.0/18;
|
||||
set_real_ip_from 190.93.240.0/20;
|
||||
set_real_ip_from 188.114.96.0/20;
|
||||
set_real_ip_from 197.234.240.0/22;
|
||||
set_real_ip_from 198.41.128.0/17;
|
||||
real_ip_header CF-Connecting-IP;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
57
Recursos/menu/sourcesfix.sh
Normal file
57
Recursos/menu/sourcesfix.sh
Normal file
@ -0,0 +1,57 @@
|
||||
function fixsources19(){
|
||||
echo -e "Reinstalando fuentes (sources)"
|
||||
curl -o /etc/apt/sources.list https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu/Ubuntu19.10.list && apt-get update && apt-get upgrade -y
|
||||
echo -e "Reinstalacion completada"
|
||||
echo -e "\033[1;31mPRESIONE ENTER PARA CONTINUAR\033[0m"
|
||||
read -p " "
|
||||
menu
|
||||
}
|
||||
function fixsources18(){
|
||||
echo -e "Reinstalando fuentes (sources)"
|
||||
curl -o /etc/apt/sources.list https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu/Ubuntu18.04.list && apt-get update && apt-get upgrade -y
|
||||
echo -e "Reinstalacion completada"
|
||||
echo -e "\033[1;31mPRESIONE ENTER PARA CONTINUAR\033[0m"
|
||||
read -p " "
|
||||
menu
|
||||
}
|
||||
function fixsources16(){
|
||||
echo -e "Reinstalando fuentes (sources)"
|
||||
curl -o /etc/apt/sources.list https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu/Ubuntu16.04.list && apt-get update && apt-get upgrade -y
|
||||
echo -e "Reinstalacion completada"
|
||||
echo -e "\033[1;31mPRESIONE ENTER PARA CONTINUAR\033[0m"
|
||||
read -p " "
|
||||
menu
|
||||
}
|
||||
function fixsources(){
|
||||
clear
|
||||
if [[ $1 == "" ]]
|
||||
then
|
||||
figlet -p -f slant < /root/name | lolcat
|
||||
echo -e "\033[1;37m 【 ★ ChumoGH Packet 2020 ★ 】\033[0m"
|
||||
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m ───────────────── /// ─────────────────\033[1;33m"
|
||||
echo -e "\033[1;37m ChumoGH-ADM @ FIX SOURCES \033[0m"
|
||||
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m ───────────────── /// ─────────────────\033[1;33m"
|
||||
echo -e "\033[1;37mSeleccione una opcion: Para Salir Ctrl + C\033[1;33m
|
||||
[\033[1;32m1\033[1;33m] › FIX SOURCES UBUNTU 16.04 \033[1;33m
|
||||
[\033[1;32m2\033[1;33m] › FIX SOURCES UBUNTU 18.04 \033[1;33m
|
||||
[\033[1;32m3\033[1;33m] › FIX SOURCES UBUNTU 19.10 \033[1;33m
|
||||
[\033[1;32m4\033[1;33m] › FIX SOURCES UBUNTU 20.04 \033[1;33m
|
||||
[\033[1;32m0\033[1;33m] < REGRESAR \033[1;33m"
|
||||
read -p ": " opcao
|
||||
else
|
||||
opcao=$1
|
||||
fi
|
||||
case $opcao in
|
||||
1)
|
||||
fixsources16;;
|
||||
2)
|
||||
fixsources18;;
|
||||
3)
|
||||
fixsources19;;
|
||||
4)
|
||||
fixsources20;;
|
||||
0)
|
||||
exit;;
|
||||
esac
|
||||
}
|
||||
fixsources
|
||||
338
Recursos/menu/swapfile.sh
Normal file
338
Recursos/menu/swapfile.sh
Normal file
@ -0,0 +1,338 @@
|
||||
#!/bin/bash
|
||||
clear
|
||||
BARRA="\033[0;49;31m============================================================\033[0m"
|
||||
echo -e $BARRA
|
||||
echo -e "\033[7;107;31mEsto le ayudara a crear un archivo swap para su sistema\033[0m"
|
||||
echo -e $BARRA
|
||||
echo "Enter para continuar..."
|
||||
read foo
|
||||
stsl=$(ps x | grep "limiter"|grep -v grep > /dev/null && echo -e "\033[1;32m◉ " || echo -e "\033[1;31m○ ")
|
||||
swap=/swapfile
|
||||
fstab=/etc/fstab
|
||||
sysctl=/etc/sysctl.conf
|
||||
|
||||
funcion_crear () {
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "se recomienda que la memoria swap"
|
||||
echo "sea de almenos el doble de su memoria ram"
|
||||
echo -e $BARRA
|
||||
echo "Seleccione una opcion"
|
||||
echo ""
|
||||
echo "1) 2GB"
|
||||
echo "2) 4GB"
|
||||
echo "3) 8GB"
|
||||
echo ""
|
||||
echo "0) Regresar al inicio"
|
||||
echo -e $BARRA
|
||||
echo -n "Opcion:"
|
||||
read opcion
|
||||
case $opcion in
|
||||
1)
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "Creando archivo swapfile"
|
||||
echo -e $BARRA
|
||||
dd if=/dev/zero of=$swap bs=1MB count=2048
|
||||
echo -e $BARRA
|
||||
echo "Archivo creado"
|
||||
echo "comprueve detalles en la opcion 2";;
|
||||
2)
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "Creando archivo swapfile"
|
||||
echo -e $BARRA
|
||||
dd if=/dev/zero of=$swap bs=1MB count=4096
|
||||
echo -e $BARRA
|
||||
echo "Archivo creado"
|
||||
echo "comprueve detalles en la opcion 2";;
|
||||
3)
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "Creando archivo swapfile"
|
||||
echo -e $BARRA
|
||||
dd if=/dev/zero of=$swap bs=1MB count=8192
|
||||
echo -e $BARRA
|
||||
echo "Archivo creado"
|
||||
echo "comprueve detalles en la opcion 2";;
|
||||
0)
|
||||
echo "";;
|
||||
*)
|
||||
echo ""
|
||||
echo "Solo opciones del 0 al 3"
|
||||
sleep 2
|
||||
funcion_crear;;
|
||||
esac
|
||||
}
|
||||
|
||||
funcion_enter () {
|
||||
echo ""
|
||||
echo "Enter para continuar"
|
||||
read foo
|
||||
}
|
||||
|
||||
|
||||
funcion_remove () {
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "Se encontro un archivo swap pre-existente"
|
||||
echo -e $BARRA
|
||||
echo "desea remover el archivo"
|
||||
echo ""
|
||||
echo "1) si"
|
||||
echo "2) no"
|
||||
echo -e $BARRA
|
||||
echo -n "Opcion:"
|
||||
read opcion
|
||||
case $opcion in
|
||||
1)
|
||||
rm $swap
|
||||
echo ""
|
||||
echo "archivo removido"
|
||||
echo ""
|
||||
echo "Enter para continuar"
|
||||
read foo
|
||||
funcion_crear;;
|
||||
2)
|
||||
echo "";;
|
||||
*)
|
||||
echo ""
|
||||
echo "Solo opciones del 1 al 2"
|
||||
sleep 2
|
||||
funcion_remove;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
funcion_check () {
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "Comprobando detalles del archivo"
|
||||
echo -e $BARRA
|
||||
sleep 3
|
||||
ls -lh $swap
|
||||
echo -e $BARRA
|
||||
}
|
||||
|
||||
|
||||
funcion_error () {
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "No se encontro ningun archivo"
|
||||
echo "para crear usa la opcion 1"
|
||||
echo -e $BARRA
|
||||
}
|
||||
|
||||
|
||||
funcion_assign () {
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "Asignando permisos y formato"
|
||||
echo -e $BARRA
|
||||
sleep 2
|
||||
chmod 600 $swap
|
||||
mkswap $swap
|
||||
echo -e $BARRA
|
||||
echo "listo"
|
||||
}
|
||||
|
||||
|
||||
funcion_activar () {
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "Como desea activar la memoria swap"
|
||||
echo -e $BARRA
|
||||
echo "1) permanente"
|
||||
echo "2) temporal (asta el proximo reinicio)"
|
||||
echo ""
|
||||
echo "0) Regresar al inicio"
|
||||
echo -e $BARRA
|
||||
echo -n "Opcion:"
|
||||
read opcion
|
||||
case $opcion in
|
||||
1)
|
||||
sed -i '/swap/d' $fstab
|
||||
echo "/swapfile none swap sw 0 0" >> $fstab
|
||||
swapon $swap
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "memoria swap activada"
|
||||
echo "de forma permanente"
|
||||
echo -e $BARRA;;
|
||||
2)
|
||||
swapon $swap
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "memoria swap activada"
|
||||
echo "asta el proximo reinicio"
|
||||
echo -e $BARRA;;
|
||||
0)
|
||||
echo "";;
|
||||
*)
|
||||
echo ""
|
||||
echo "Solo opciones del 0 al 2"
|
||||
sleep 2
|
||||
funcion_activar
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
funcion_prio () {
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "Asigne la prioridad swap"
|
||||
echo -e $BARRA
|
||||
echo "1) 10"
|
||||
echo "2) 20 (recomendado)"
|
||||
echo "3) 30"
|
||||
echo "4) 40"
|
||||
echo "5) 50"
|
||||
echo "6) 60"
|
||||
echo "7) 70"
|
||||
echo "8) 80"
|
||||
echo "9) 90"
|
||||
echo "10) 100"
|
||||
echo ""
|
||||
echo "0) Regresar al inicio"
|
||||
echo -e $BARRA
|
||||
echo -n "Opcion:"
|
||||
read opcion
|
||||
case $opcion in
|
||||
1)
|
||||
clear
|
||||
echo "vm.swappiness=10" >> $sysctl
|
||||
echo "swappines asignado en 10"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
2)
|
||||
clear
|
||||
echo "vm.swappiness=20" >> $sysctl
|
||||
echo "swappines asignado en 20"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
3)
|
||||
clear
|
||||
echo "vm.swappiness=30" >> $sysctl
|
||||
echo "swappines asignado en 30"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
4)
|
||||
clear
|
||||
echo "vm.swappiness=40" >> $sysctl
|
||||
echo "swappines asignado en 40"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
5)
|
||||
clear
|
||||
echo "vm.swappiness=50" >> $sysctl
|
||||
echo "swappines asignado en 50"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
6)
|
||||
clear
|
||||
echo "vm.swappiness=60" >> $sysctl
|
||||
echo "swappines asignado en 60"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
7)
|
||||
clear
|
||||
echo "vm.swappiness=70" >> $sysctl
|
||||
echo "swappines asignado en 70"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
8)
|
||||
clear
|
||||
echo "vm.swappiness=80" >> $sysctl
|
||||
echo "swappines asignado en 80"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
9)
|
||||
clear
|
||||
echo "vm.swappiness=90" >> $sysctl
|
||||
echo "swappines asignado en 90"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
10)
|
||||
clear
|
||||
echo "vm.swappiness=100" >> $sysctl
|
||||
echo "swappines asignado en 100"
|
||||
echo "los cambios se aplicaran"
|
||||
echo "despues del reinicio";;
|
||||
0)
|
||||
echo "";;
|
||||
*)
|
||||
echo ""
|
||||
echo "Solo opciones del 0 al 10"
|
||||
sleep 2
|
||||
funcion_prio;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
while :
|
||||
do
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "Seleccione una opcion"
|
||||
echo -e $BARRA
|
||||
echo "1) Crear/Eliminar archivo"
|
||||
echo "2) Comprovar archivo"
|
||||
echo "3) Dar formato y permisos al archivo"
|
||||
echo "4) Activar/Desactvar swap"
|
||||
echo "5) Prioridad swap"
|
||||
echo ""
|
||||
echo "0) Salir"
|
||||
echo -e $BARRA
|
||||
echo -n "Opcion:"
|
||||
read opcion
|
||||
case $opcion in
|
||||
1)
|
||||
if [ -f $swap ]; then
|
||||
funcion_remove
|
||||
else
|
||||
funcion_crear
|
||||
fi
|
||||
funcion_enter;;
|
||||
2)
|
||||
if [ -f $swap ]; then
|
||||
funcion_check
|
||||
else
|
||||
funcion_error
|
||||
fi
|
||||
funcion_enter;;
|
||||
3)
|
||||
if [ -f $swap ]; then
|
||||
funcion_assign
|
||||
else
|
||||
funcion_error
|
||||
fi
|
||||
funcion_enter;;
|
||||
4)
|
||||
if [ -f $swap ]; then
|
||||
funcion_activar
|
||||
else
|
||||
funcion_error
|
||||
fi
|
||||
funcion_enter;;
|
||||
5)
|
||||
if [ -f $swap ]; then
|
||||
funcion_prio
|
||||
else
|
||||
funcion_error
|
||||
fi
|
||||
funcion_enter;;
|
||||
0)
|
||||
clear
|
||||
echo -e $BARRA
|
||||
echo "script finalizado"
|
||||
echo -e $BARRA
|
||||
echo "Enter para continuar"
|
||||
read foo
|
||||
clear
|
||||
exit;;
|
||||
*)
|
||||
echo ""
|
||||
echo "solo opciones del 0 al 5"
|
||||
sleep 1;;
|
||||
esac
|
||||
done
|
||||
689
Recursos/menu/tcp.sh
Normal file
689
Recursos/menu/tcp.sh
Normal file
@ -0,0 +1,689 @@
|
||||
#!/bin/bash
|
||||
#19/12/2019
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg2)
|
||||
clear
|
||||
msg -bar
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
|
||||
BARRA1="\e[0;31m--------------------------------------------------------------------\e[0m"
|
||||
SCPinst="/etc/ger-inst" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
|
||||
#=================================================
|
||||
# System Required: CentOS 6/7,Debian 8/9,Ubuntu 16+
|
||||
# Description: BBR+BBRVersión mágica+BBRplus+Lotserver
|
||||
# Version: 1.3.1
|
||||
# Author: Mil sombras,cx9208
|
||||
# Blog: https://www.94ish.me/
|
||||
#=================================================
|
||||
|
||||
sh_ver="1.3.1"
|
||||
github="raw.githubusercontent.com/cx9208/Linux-NetSpeed/master"
|
||||
|
||||
Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
|
||||
Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
|
||||
Error="${Red_font_prefix}[Error]${Font_color_suffix}"
|
||||
Tip="${Green_font_prefix}[Atencion]${Font_color_suffix}"
|
||||
|
||||
#Instalar el núcleo BBR
|
||||
installbbr(){
|
||||
kernel_version="4.11.8"
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
rpm --import http://${github}/bbr/${release}/RPM-GPG-KEY-elrepo.org
|
||||
yum install -y http://${github}/bbr/${release}/${version}/${bit}/kernel-ml-${kernel_version}.rpm
|
||||
yum remove -y kernel-headers
|
||||
yum install -y http://${github}/bbr/${release}/${version}/${bit}/kernel-ml-headers-${kernel_version}.rpm
|
||||
yum install -y http://${github}/bbr/${release}/${version}/${bit}/kernel-ml-devel-${kernel_version}.rpm
|
||||
elif [[ "${release}" == "debian" || "${release}" == "ubuntu" ]]; then
|
||||
mkdir bbr && cd bbr
|
||||
wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u10_amd64.deb
|
||||
wget -N --no-check-certificate http://${github}/bbr/debian-ubuntu/linux-headers-${kernel_version}-all.deb
|
||||
wget -N --no-check-certificate http://${github}/bbr/debian-ubuntu/${bit}/linux-headers-${kernel_version}.deb
|
||||
wget -N --no-check-certificate http://${github}/bbr/debian-ubuntu/${bit}/linux-image-${kernel_version}.deb
|
||||
|
||||
dpkg -i libssl1.0.0_1.0.1t-1+deb8u10_amd64.deb
|
||||
dpkg -i linux-headers-${kernel_version}-all.deb
|
||||
dpkg -i linux-headers-${kernel_version}.deb
|
||||
dpkg -i linux-image-${kernel_version}.deb
|
||||
cd .. && rm -rf bbr
|
||||
fi
|
||||
detele_kernel
|
||||
BBR_grub
|
||||
msg -bar
|
||||
echo -e "${Tip} Después de reiniciar el VPS, vuelva a ejecutar el script para abrir\n${Red_font_prefix} BBR/BBR Versión mágica${Font_color_suffix}"
|
||||
msg -bar
|
||||
stty erase '^H' && read -p "Debe reiniciar el VPS antes de poder habilitar BBR, reiniciar ahora. ? [Y/n] :" yn
|
||||
[ -z "${yn}" ] && yn="y"
|
||||
if [[ $yn == [Yy] ]]; then
|
||||
echo -e "${Info} VPS se reinicia ..."
|
||||
reboot
|
||||
fi
|
||||
}
|
||||
|
||||
#Instale el núcleo BBRplus
|
||||
installbbrplus(){
|
||||
kernel_version="4.14.129-bbrplus"
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
wget -N --no-check-certificate https://${github}/bbrplus/${release}/${version}/kernel-${kernel_version}.rpm
|
||||
yum install -y kernel-${kernel_version}.rpm
|
||||
rm -f kernel-${kernel_version}.rpm
|
||||
kernel_version="4.14.129_bbrplus" #fix a bug
|
||||
elif [[ "${release}" == "debian" || "${release}" == "ubuntu" ]]; then
|
||||
mkdir bbrplus && cd bbrplus
|
||||
wget -N --no-check-certificate http://${github}/bbrplus/debian-ubuntu/${bit}/linux-headers-${kernel_version}.deb
|
||||
wget -N --no-check-certificate http://${github}/bbrplus/debian-ubuntu/${bit}/linux-image-${kernel_version}.deb
|
||||
dpkg -i linux-headers-${kernel_version}.deb
|
||||
dpkg -i linux-image-${kernel_version}.deb
|
||||
cd .. && rm -rf bbrplus
|
||||
fi
|
||||
detele_kernel
|
||||
BBR_grub
|
||||
msg -bar
|
||||
echo -e "${Tip} Después de reiniciar el VPS, vuelva a ejecutar el script para abrir\n${Red_font_prefix} BBRplus${Font_color_suffix}"
|
||||
msg -bar
|
||||
stty erase '^H' && read -p "Debe reiniciar el VPS antes de poder habilitar BBRplus, reiniciar ahora ? [Y/n] :" yn
|
||||
[ -z "${yn}" ] && yn="y"
|
||||
if [[ $yn == [Yy] ]]; then
|
||||
echo -e "${Info} VPS se reinicia ..."
|
||||
reboot
|
||||
fi
|
||||
}
|
||||
|
||||
#Instale el kernel de Lotserver
|
||||
installlot(){
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
rpm --import http://${github}/lotserver/${release}/RPM-GPG-KEY-elrepo.org
|
||||
yum remove -y kernel-firmware
|
||||
yum install -y http://${github}/lotserver/${release}/${version}/${bit}/kernel-firmware-${kernel_version}.rpm
|
||||
yum install -y http://${github}/lotserver/${release}/${version}/${bit}/kernel-${kernel_version}.rpm
|
||||
yum remove -y kernel-headers
|
||||
yum install -y http://${github}/lotserver/${release}/${version}/${bit}/kernel-headers-${kernel_version}.rpm
|
||||
yum install -y http://${github}/lotserver/${release}/${version}/${bit}/kernel-devel-${kernel_version}.rpm
|
||||
elif [[ "${release}" == "ubuntu" ]]; then
|
||||
bash <(wget --no-check-certificate -qO- "http://${github}/Debian_Kernel.sh")
|
||||
elif [[ "${release}" == "debian" ]]; then
|
||||
bash <(wget --no-check-certificate -qO- "http://${github}/Debian_Kernel.sh")
|
||||
fi
|
||||
detele_kernel
|
||||
BBR_grub
|
||||
msg -bar
|
||||
echo -e "${Tip} Después de reiniciar el VPS, vuelva a ejecutar el script para abrir\n${Red_font_prefix}Lotserver${Font_color_suffix}"
|
||||
msg -bar
|
||||
stty erase '^H' && read -p "Necesita reiniciar el VPS antes de poder abrir Lotserver, reiniciar ahora ? [Y/n] :" yn
|
||||
[ -z "${yn}" ] && yn="y"
|
||||
if [[ $yn == [Yy] ]]; then
|
||||
echo -e "${Info} VPS se reinicia ..."
|
||||
reboot
|
||||
fi
|
||||
}
|
||||
|
||||
# Habilitar BBR
|
||||
startbbr(){
|
||||
remove_all
|
||||
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
|
||||
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
|
||||
sysctl -p
|
||||
echo -e "${Info}¡BBR comenzó con éxito!"
|
||||
msg -bar
|
||||
}
|
||||
|
||||
#Habilitar BBRplus
|
||||
startbbrplus(){
|
||||
remove_all
|
||||
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
|
||||
echo "net.ipv4.tcp_congestion_control=bbrplus" >> /etc/sysctl.conf
|
||||
sysctl -p
|
||||
echo -e "${Info}BBRplus comenzó con éxito!!"
|
||||
msg -bar
|
||||
}
|
||||
|
||||
# Compilar y habilitar el cambio mágico BBR
|
||||
startbbrmod(){
|
||||
remove_all
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
yum install -y make gcc
|
||||
mkdir bbrmod && cd bbrmod
|
||||
wget -N --no-check-certificate http://${github}/bbr/tcp_tsunami.c
|
||||
echo "obj-m:=tcp_tsunami.o" > Makefile
|
||||
make -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=/usr/bin/gcc
|
||||
chmod +x ./tcp_tsunami.ko
|
||||
cp -rf ./tcp_tsunami.ko /lib/modules/$(uname -r)/kernel/net/ipv4
|
||||
insmod tcp_tsunami.ko
|
||||
depmod -a
|
||||
else
|
||||
apt-get update
|
||||
if [[ "${release}" == "ubuntu" && "${version}" = "14" ]]; then
|
||||
apt-get -y install build-essential
|
||||
apt-get -y install software-properties-common
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
apt-get update
|
||||
fi
|
||||
apt-get -y install make gcc
|
||||
mkdir bbrmod && cd bbrmod
|
||||
wget -N --no-check-certificate http://${github}/bbr/tcp_tsunami.c
|
||||
echo "obj-m:=tcp_tsunami.o" > Makefile
|
||||
ln -s /usr/bin/gcc /usr/bin/gcc-4.9
|
||||
make -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=/usr/bin/gcc-4.9
|
||||
install tcp_tsunami.ko /lib/modules/$(uname -r)/kernel
|
||||
cp -rf ./tcp_tsunami.ko /lib/modules/$(uname -r)/kernel/net/ipv4
|
||||
depmod -a
|
||||
fi
|
||||
|
||||
|
||||
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
|
||||
echo "net.ipv4.tcp_congestion_control=tsunami" >> /etc/sysctl.conf
|
||||
sysctl -p
|
||||
cd .. && rm -rf bbrmod
|
||||
echo -e "${Info}¡La versión mágica de BBR comenzó con éxito!"
|
||||
msg -bar
|
||||
}
|
||||
|
||||
# Compilar y habilitar el cambio mágico BBR
|
||||
startbbrmod_nanqinlang(){
|
||||
remove_all
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
yum install -y make gcc
|
||||
mkdir bbrmod && cd bbrmod
|
||||
wget -N --no-check-certificate https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/bbr/centos/tcp_nanqinlang.c
|
||||
echo "obj-m := tcp_nanqinlang.o" > Makefile
|
||||
make -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=/usr/bin/gcc
|
||||
chmod +x ./tcp_nanqinlang.ko
|
||||
cp -rf ./tcp_nanqinlang.ko /lib/modules/$(uname -r)/kernel/net/ipv4
|
||||
insmod tcp_nanqinlang.ko
|
||||
depmod -a
|
||||
else
|
||||
apt-get update
|
||||
if [[ "${release}" == "ubuntu" && "${version}" = "14" ]]; then
|
||||
apt-get -y install build-essential
|
||||
apt-get -y install software-properties-common
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
apt-get update
|
||||
fi
|
||||
apt-get -y install make gcc-4.9
|
||||
mkdir bbrmod && cd bbrmod
|
||||
wget -N --no-check-certificate https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/bbr/tcp_nanqinlang.c
|
||||
echo "obj-m := tcp_nanqinlang.o" > Makefile
|
||||
make -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=/usr/bin/gcc-4.9
|
||||
install tcp_nanqinlang.ko /lib/modules/$(uname -r)/kernel
|
||||
cp -rf ./tcp_nanqinlang.ko /lib/modules/$(uname -r)/kernel/net/ipv4
|
||||
depmod -a
|
||||
fi
|
||||
|
||||
|
||||
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
|
||||
echo "net.ipv4.tcp_congestion_control=nanqinlang" >> /etc/sysctl.conf
|
||||
sysctl -p
|
||||
echo -e "${Info}¡La versión mágica de BBR comenzó con éxito!"
|
||||
msg -bar
|
||||
}
|
||||
|
||||
# Habilitar Lotserver
|
||||
startlotserver(){
|
||||
remove_all
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
yum install ethtool
|
||||
else
|
||||
apt-get update
|
||||
apt-get install ethtool
|
||||
fi
|
||||
bash <(wget --no-check-certificate -qO- https://github.com/MoeClub/lotServer/raw/master/Install.sh) install
|
||||
start_menu
|
||||
}
|
||||
|
||||
# Desinstalar toda la aceleración
|
||||
remove_all(){
|
||||
rm -rf bbrmod
|
||||
sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
|
||||
sed -i '/fs.file-max/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.rmem_max/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.wmem_max/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.rmem_default/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.wmem_default/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.somaxconn/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_syncookies/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_tw_reuse/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_tw_recycle/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_fin_timeout/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_keepalive_time/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.ip_local_port_range/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_max_tw_buckets/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_rmem/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_wmem/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_mtu_probing/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.ip_forward/d' /etc/sysctl.conf
|
||||
sed -i '/fs.inotify.max_user_instances/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_syncookies/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_fin_timeout/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_tw_reuse/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.ip_local_port_range/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_max_tw_buckets/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.route.gc_timeout/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_synack_retries/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_syn_retries/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.somaxconn/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_timestamps/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_max_orphans/d' /etc/sysctl.conf
|
||||
if [[ -e /appex/bin/lotServer.sh ]]; then
|
||||
bash <(wget --no-check-certificate -qO- https://github.com/MoeClub/lotServer/raw/master/Install.sh) uninstall
|
||||
fi
|
||||
clear
|
||||
echo -e "${Info}:La aceleración está Desinstalada."
|
||||
sleep 1s
|
||||
}
|
||||
|
||||
#Optimizar la configuración del sistema
|
||||
optimizing_system(){
|
||||
sed -i '/fs.file-max/d' /etc/sysctl.conf
|
||||
sed -i '/fs.inotify.max_user_instances/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_syncookies/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_fin_timeout/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_tw_reuse/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.ip_local_port_range/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_max_tw_buckets/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.route.gc_timeout/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_synack_retries/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_syn_retries/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.somaxconn/d' /etc/sysctl.conf
|
||||
sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_timestamps/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.tcp_max_orphans/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv4.ip_forward/d' /etc/sysctl.conf
|
||||
echo "fs.file-max = 1000000
|
||||
fs.inotify.max_user_instances = 8192
|
||||
net.ipv4.tcp_syncookies = 1
|
||||
net.ipv4.tcp_fin_timeout = 30
|
||||
net.ipv4.tcp_tw_reuse = 1
|
||||
net.ipv4.ip_local_port_range = 1024 65000
|
||||
net.ipv4.tcp_max_syn_backlog = 16384
|
||||
net.ipv4.tcp_max_tw_buckets = 6000
|
||||
net.ipv4.route.gc_timeout = 100
|
||||
net.ipv4.tcp_syn_retries = 1
|
||||
net.ipv4.tcp_synack_retries = 1
|
||||
net.core.somaxconn = 32768
|
||||
net.core.netdev_max_backlog = 32768
|
||||
net.ipv4.tcp_timestamps = 0
|
||||
net.ipv4.tcp_max_orphans = 32768
|
||||
# forward ipv4
|
||||
net.ipv4.ip_forward = 1">>/etc/sysctl.conf
|
||||
sysctl -p
|
||||
echo "* soft nofile 1000000
|
||||
* hard nofile 1000000">/etc/security/limits.conf
|
||||
echo "ulimit -SHn 1000000">>/etc/profile
|
||||
read -p "Después de aplicar la configuracion al VPS necesita reiniciar, reiniciar ahora ? [Y/n] :" yn
|
||||
msg -bar
|
||||
[ -z "${yn}" ] && yn="y"
|
||||
if [[ $yn == [Yy] ]]; then
|
||||
echo -e "${Info} Reinicio de VPS..."
|
||||
reboot
|
||||
fi
|
||||
}
|
||||
# Script de actualización
|
||||
Update_Shell(){
|
||||
echo -e "La versión actual es [ ${sh_ver} ],Empieza a detectar la última versión..."
|
||||
sh_new_ver=$(wget --no-check-certificate -qO- "http://${github}/tcp.sh"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1)
|
||||
[[ -z ${sh_new_ver} ]] && echo -e "${Error} Error al detectar la última versión !" && start_menu
|
||||
if [[ ${sh_new_ver} != ${sh_ver} ]]; then
|
||||
echo -e "Descubre nueva versión[ ${sh_new_ver} ],Ya sea para actualizar?[Y/n]"
|
||||
read -p "(Por defecto: y):" yn
|
||||
[[ -z "${yn}" ]] && yn="y"
|
||||
if [[ ${yn} == [Yy] ]]; then
|
||||
wget -N --no-check-certificate http://${github}/tcp.sh && chmod +x tcp.sh
|
||||
echo -e "El script ha sido actualizado a la última versión.[ ${sh_new_ver} ] !"
|
||||
else
|
||||
echo && echo " Cancelado ..." && echo
|
||||
fi
|
||||
else
|
||||
echo -e "Actualmente la última versión[ ${sh_new_ver} ] !"
|
||||
sleep 5s
|
||||
fi
|
||||
}
|
||||
|
||||
# Menú de inicio
|
||||
start_menu(){
|
||||
clear
|
||||
msg -bar
|
||||
echo -e " TCP Aceleración (BBR/Plus) ADM-ChumoGH By @drowkid01 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}
|
||||
$(msg -bar)
|
||||
${Green_font_prefix}0.${Font_color_suffix} Script de actualización
|
||||
————————————Gestión del Núcleo————————————
|
||||
${Green_font_prefix}1.${Font_color_suffix} Instalación BBR/BBR Kernel Mágico
|
||||
${Green_font_prefix}2.${Font_color_suffix} Instalación BBRplus Kernel
|
||||
${Green_font_prefix}3.${Font_color_suffix} Instalación Lotserver Kernel (Velocidad Aguda)
|
||||
————————————Gestión Acelerada————————————
|
||||
${Green_font_prefix}4.${Font_color_suffix} Usar BBR Aceleración
|
||||
${Green_font_prefix}5.${Font_color_suffix} Usar BBR Velocidad de revisión mágica
|
||||
${Green_font_prefix}6.${Font_color_suffix} Usar BBR Aceleración Violenta de revisión mágica
|
||||
${Green_font_prefix}7.${Font_color_suffix} Usar BBRplus Aceleración
|
||||
${Green_font_prefix}8.${Font_color_suffix} Usar Lotserver (Velocidad Brusca) Aceleración
|
||||
————————————Manejo misceláneo————————————
|
||||
${Green_font_prefix}9.${Font_color_suffix} Desintalar Todas las Aceleraciones
|
||||
${Green_font_prefix}10.${Font_color_suffix} Optimización de la configuración del sistema.
|
||||
${Green_font_prefix}11.${Font_color_suffix} Salir del script
|
||||
————————————————————————————————" && msg -bar
|
||||
|
||||
check_status
|
||||
if [[ ${kernel_status} == "noinstall" ]]; then
|
||||
echo -e " Estado actual: ${Green_font_prefix}No instalado\n${Font_color_suffix} Kernel Acelerado ${Red_font_prefix}Por favor, instale el Núcleo primero.${Font_color_suffix}"
|
||||
else
|
||||
echo -e " Estado actual: ${Green_font_prefix}Instalado\n${Font_color_suffix} ${_font_prefix}${kernel_status}${Font_color_suffix} Kernel Acelerado, ${Green_font_prefix}${run_status}${Font_color_suffix}"
|
||||
|
||||
fi
|
||||
msg -bar
|
||||
read -p " Por favor ingrese un número [0-11]:" num
|
||||
case "$num" in
|
||||
0)
|
||||
Update_Shell
|
||||
;;
|
||||
1)
|
||||
check_sys_bbr
|
||||
;;
|
||||
2)
|
||||
check_sys_bbrplus
|
||||
;;
|
||||
3)
|
||||
check_sys_Lotsever
|
||||
;;
|
||||
4)
|
||||
startbbr
|
||||
;;
|
||||
5)
|
||||
startbbrmod
|
||||
;;
|
||||
6)
|
||||
startbbrmod_nanqinlang
|
||||
;;
|
||||
7)
|
||||
startbbrplus
|
||||
;;
|
||||
8)
|
||||
startlotserver
|
||||
;;
|
||||
9)
|
||||
remove_all
|
||||
;;
|
||||
10)
|
||||
optimizing_system
|
||||
;;
|
||||
11)
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
clear
|
||||
echo -e "${Error}:Por favor ingrese el número correcto [0-11]"
|
||||
sleep 5s
|
||||
start_menu
|
||||
;;
|
||||
esac
|
||||
}
|
||||
############# Componentes de gestión del núcleo #############
|
||||
|
||||
# Eliminar kernel redundante
|
||||
detele_kernel(){
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
rpm_total=`rpm -qa | grep kernel | grep -v "${kernel_version}" | grep -v "noarch" | wc -l`
|
||||
if [ "${rpm_total}" > "1" ]; then
|
||||
echo -e "Detectado ${rpm_total} El resto del núcleo, comienza a desinstalar ..."
|
||||
for((integer = 1; integer <= ${rpm_total}; integer++)); do
|
||||
rpm_del=`rpm -qa | grep kernel | grep -v "${kernel_version}" | grep -v "noarch" | head -${integer}`
|
||||
echo -e "Comience a desinstalar${rpm_del} Kernel ..."
|
||||
rpm --nodeps -e ${rpm_del}
|
||||
echo -e "Desinstalar ${rpm_del} La desinstalación del núcleo se ha completado, continúa ..."
|
||||
done
|
||||
echo --nodeps -e "El núcleo se desinstala y continúa ..."
|
||||
else
|
||||
echo -e " El número de núcleos detectados es incorrecto, ¡por favor verifique!" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "debian" || "${release}" == "ubuntu" ]]; then
|
||||
deb_total=`dpkg -l | grep linux-image | awk '{print $2}' | grep -v "${kernel_version}" | wc -l`
|
||||
if [ "${deb_total}" > "1" ]; then
|
||||
echo -e "Detectado ${deb_total} El resto del núcleo, comienza a desinstalar ..."
|
||||
for((integer = 1; integer <= ${deb_total}; integer++)); do
|
||||
deb_del=`dpkg -l|grep linux-image | awk '{print $2}' | grep -v "${kernel_version}" | head -${integer}`
|
||||
echo -e "Comience a desinstalar ${deb_del} Kernel ..."
|
||||
apt-get purge -y ${deb_del}
|
||||
echo -e "Desinstalar ${deb_del} La desinstalación del núcleo se ha completado, continúa ..."
|
||||
done
|
||||
echo -e "El núcleo se desinstala y continúa ..."
|
||||
else
|
||||
echo -e " El número de núcleos detectados es incorrecto, ¡por favor verifique!" && exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#Actualizar arranque
|
||||
BBR_grub(){
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
if [[ ${version} = "6" ]]; then
|
||||
if [ ! -f "/boot/grub/grub.conf" ]; then
|
||||
echo -e "${Error} /boot/grub/grub.conf No encontrado, verifique."
|
||||
exit 1
|
||||
fi
|
||||
sed -i 's/^default=.*/default=0/g' /boot/grub/grub.conf
|
||||
elif [[ ${version} = "7" ]]; then
|
||||
if [ ! -f "/boot/grub2/grub.cfg" ]; then
|
||||
echo -e "${Error} /boot/grub2/grub.cfg No encontrado, verifique."
|
||||
exit 1
|
||||
fi
|
||||
grub2-set-default 0
|
||||
fi
|
||||
elif [[ "${release}" == "debian" || "${release}" == "ubuntu" ]]; then
|
||||
/usr/sbin/update-grub
|
||||
fi
|
||||
}
|
||||
|
||||
#############Componente de gestión del kernel#############
|
||||
|
||||
|
||||
|
||||
#############Componentes de detección del sistema#############
|
||||
|
||||
#Sistema de inspección
|
||||
check_sys(){
|
||||
if [[ -f /etc/redhat-release ]]; then
|
||||
release="centos"
|
||||
elif cat /etc/issue | grep -q -E -i "debian"; then
|
||||
release="debian"
|
||||
elif cat /etc/issue | grep -q -E -i "ubuntu"; then
|
||||
release="ubuntu"
|
||||
elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
|
||||
release="centos"
|
||||
elif cat /proc/version | grep -q -E -i "debian"; then
|
||||
release="debian"
|
||||
elif cat /proc/version | grep -q -E -i "ubuntu"; then
|
||||
release="ubuntu"
|
||||
elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
|
||||
release="centos"
|
||||
fi
|
||||
}
|
||||
|
||||
#Verifique la versión de Linux
|
||||
check_version(){
|
||||
if [[ -s /etc/redhat-release ]]; then
|
||||
version=`grep -oE "[0-9.]+" /etc/redhat-release | cut -d . -f 1`
|
||||
else
|
||||
version=`grep -oE "[0-9.]+" /etc/issue | cut -d . -f 1`
|
||||
fi
|
||||
bit=`uname -m`
|
||||
if [[ ${bit} = "x86_64" ]]; then
|
||||
bit="x64"
|
||||
else
|
||||
bit="x32"
|
||||
fi
|
||||
}
|
||||
|
||||
#Verifique los requisitos del sistema para instalar bbr
|
||||
check_sys_bbr(){
|
||||
check_version
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
if [[ ${version} -ge "6" ]]; then
|
||||
installbbr
|
||||
else
|
||||
echo -e "${Error} BBR El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "debian" ]]; then
|
||||
if [[ ${version} -ge "8" ]]; then
|
||||
installbbr
|
||||
else
|
||||
echo -e "${Error} BBR El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "ubuntu" ]]; then
|
||||
if [[ ${version} -ge "14" ]]; then
|
||||
installbbr
|
||||
else
|
||||
echo -e "${Error} BBR El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
else
|
||||
echo -e "${Error} BBR El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_sys_bbrplus(){
|
||||
check_version
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
if [[ ${version} -ge "6" ]]; then
|
||||
installbbrplus
|
||||
else
|
||||
echo -e "${Error} BBRplus El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "debian" ]]; then
|
||||
if [[ ${version} -ge "8" ]]; then
|
||||
installbbrplus
|
||||
else
|
||||
echo -e "${Error} BBRplus El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "ubuntu" ]]; then
|
||||
if [[ ${version} -ge "14" ]]; then
|
||||
installbbrplus
|
||||
else
|
||||
echo -e "${Error} BBRplus El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
else
|
||||
echo -e "${Error} BBRplus El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#Verifique los requisitos del sistema para instalar Lotsever
|
||||
check_sys_Lotsever(){
|
||||
check_version
|
||||
if [[ "${release}" == "centos" ]]; then
|
||||
if [[ ${version} == "6" ]]; then
|
||||
kernel_version="2.6.32-504"
|
||||
installlot
|
||||
elif [[ ${version} == "7" ]]; then
|
||||
yum -y install net-tools
|
||||
kernel_version="3.10.0-327"
|
||||
installlot
|
||||
else
|
||||
echo -e "${Error} Lotsever No es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "debian" ]]; then
|
||||
if [[ ${version} = "7" || ${version} = "8" ]]; then
|
||||
if [[ ${bit} == "x64" ]]; then
|
||||
kernel_version="3.16.0-4"
|
||||
installlot
|
||||
elif [[ ${bit} == "x32" ]]; then
|
||||
kernel_version="3.2.0-4"
|
||||
installlot
|
||||
fi
|
||||
elif [[ ${version} = "9" ]]; then
|
||||
if [[ ${bit} == "x64" ]]; then
|
||||
kernel_version="4.9.0-4"
|
||||
installlot
|
||||
fi
|
||||
else
|
||||
echo -e "${Error} Lotsever No es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "ubuntu" ]]; then
|
||||
if [[ ${version} -ge "12" ]]; then
|
||||
if [[ ${bit} == "x64" ]]; then
|
||||
kernel_version="4.4.0-47"
|
||||
installlot
|
||||
elif [[ ${bit} == "x32" ]]; then
|
||||
kernel_version="3.13.0-29"
|
||||
installlot
|
||||
fi
|
||||
else
|
||||
echo -e "${Error} Lotsever No es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
else
|
||||
echo -e "${Error} Lotsever No es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_status(){
|
||||
kernel_version=`uname -r | awk -F "-" '{print $1}'`
|
||||
kernel_version_full=`uname -r`
|
||||
if [[ ${kernel_version_full} = "4.14.129-bbrplus" ]]; then
|
||||
kernel_status="BBRplus"
|
||||
elif [[ ${kernel_version} = "3.10.0" || ${kernel_version} = "3.16.0" || ${kernel_version} = "3.2.0" || ${kernel_version} = "4.4.0" || ${kernel_version} = "3.13.0" || ${kernel_version} = "2.6.32" || ${kernel_version} = "4.9.0" ]]; then
|
||||
kernel_status="Lotserver"
|
||||
elif [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` == "4" ]] && [[ `echo ${kernel_version} | awk -F'.' '{print $2}'` -ge 9 ]] || [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` == "5" ]]; then
|
||||
kernel_status="BBR"
|
||||
else
|
||||
kernel_status="noinstall"
|
||||
fi
|
||||
|
||||
if [[ ${kernel_status} == "Lotserver" ]]; then
|
||||
if [[ -e /appex/bin/lotServer.sh ]]; then
|
||||
run_status=`bash /appex/bin/lotServer.sh status | grep "LotServer" | awk '{print $3}'`
|
||||
if [[ ${run_status} = "running!" ]]; then
|
||||
run_status="Comenzó exitosamente"
|
||||
else
|
||||
run_status="No se pudo iniciar"
|
||||
fi
|
||||
else
|
||||
run_status="No hay un módulo de aceleración instalado"
|
||||
fi
|
||||
elif [[ ${kernel_status} == "BBR" ]]; then
|
||||
run_status=`grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{print $2}'`
|
||||
if [[ ${run_status} == "bbr" ]]; then
|
||||
run_status=`lsmod | grep "bbr" | awk '{print $1}'`
|
||||
if [[ ${run_status} == "tcp_bbr" ]]; then
|
||||
run_status="BBR Comenzó exitosamente"
|
||||
else
|
||||
run_status="BBR Comenzó exitosamente"
|
||||
fi
|
||||
elif [[ ${run_status} == "tsunami" ]]; then
|
||||
run_status=`lsmod | grep "tsunami" | awk '{print $1}'`
|
||||
if [[ ${run_status} == "tcp_tsunami" ]]; then
|
||||
run_status="BBR La revisión mágica se lanzó con éxito"
|
||||
else
|
||||
run_status="BBR Inicio de modificación mágica fallido"
|
||||
fi
|
||||
elif [[ ${run_status} == "nanqinlang" ]]; then
|
||||
run_status=`lsmod | grep "nanqinlang" | awk '{print $1}'`
|
||||
if [[ ${run_status} == "tcp_nanqinlang" ]]; then
|
||||
run_status="El violento manifestante de BBR se lanzó con éxito"
|
||||
else
|
||||
run_status="Violenta revisión mágica de BBR no pudo comenzar"
|
||||
fi
|
||||
else
|
||||
run_status="No hay un módulo de aceleración instalado"
|
||||
fi
|
||||
elif [[ ${kernel_status} == "BBRplus" ]]; then
|
||||
run_status=`grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{print $2}'`
|
||||
if [[ ${run_status} == "bbrplus" ]]; then
|
||||
run_status=`lsmod | grep "bbrplus" | awk '{print $1}'`
|
||||
if [[ ${run_status} == "tcp_bbrplus" ]]; then
|
||||
run_status="BBRplus comenzó con éxito"
|
||||
else
|
||||
run_status="BBRplus comenzó con éxito"
|
||||
fi
|
||||
else
|
||||
run_status="No hay un módulo de aceleración instalado"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#############Componentes de detección del sistema#############
|
||||
check_sys
|
||||
check_version
|
||||
[[ ${release} != "debian" ]] && [[ ${release} != "ubuntu" ]] && [[ ${release} != "centos" ]] && echo -e "${Error} Este script no es compatible con el sistema actual. ${release} !" && exit 1
|
||||
start_menu
|
||||
|
||||
BIN
Recursos/menu/trojan-nao-sh/trojan-1.16.0-linux-amd64.tar.xz
Normal file
BIN
Recursos/menu/trojan-nao-sh/trojan-1.16.0-linux-amd64.tar.xz
Normal file
Binary file not shown.
BIN
Recursos/menu/trojan-nao-sh/web.zip
Normal file
BIN
Recursos/menu/trojan-nao-sh/web.zip
Normal file
Binary file not shown.
494
Recursos/menu/trojan-nao.sh
Normal file
494
Recursos/menu/trojan-nao.sh
Normal file
@ -0,0 +1,494 @@
|
||||
#!/bin/bash
|
||||
|
||||
function blue(){
|
||||
echo -e "\033[34m\033[01m$1\033[0m"
|
||||
}
|
||||
function green(){
|
||||
echo -e "\033[32m\033[01m$1\033[0m"
|
||||
}
|
||||
function red(){
|
||||
echo -e "\033[31m\033[01m$1\033[0m"
|
||||
}
|
||||
function version_lt(){
|
||||
test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1";
|
||||
}
|
||||
#copy from 秋水逸冰 ss scripts
|
||||
if [[ -f /etc/redhat-release ]]; then
|
||||
release="centos"
|
||||
systemPackage="yum"
|
||||
elif cat /etc/issue | grep -Eqi "debian"; then
|
||||
release="debian"
|
||||
systemPackage="apt-get"
|
||||
elif cat /etc/issue | grep -Eqi "ubuntu"; then
|
||||
release="ubuntu"
|
||||
systemPackage="apt-get"
|
||||
elif cat /etc/issue | grep -Eqi "centos|red hat|redhat"; then
|
||||
release="centos"
|
||||
systemPackage="yum"
|
||||
elif cat /proc/version | grep -Eqi "debian"; then
|
||||
release="debian"
|
||||
systemPackage="apt-get"
|
||||
elif cat /proc/version | grep -Eqi "ubuntu"; then
|
||||
release="ubuntu"
|
||||
systemPackage="apt-get"
|
||||
elif cat /proc/version | grep -Eqi "centos|red hat|redhat"; then
|
||||
release="centos"
|
||||
systemPackage="yum"
|
||||
fi
|
||||
systempwd="/etc/systemd/system/"
|
||||
|
||||
#install & config trojan
|
||||
function install_trojan(){
|
||||
$systemPackage install -y nginx
|
||||
systemctl stop nginx
|
||||
sleep 5
|
||||
cat > /etc/nginx/nginx.conf <<-EOF
|
||||
user root;
|
||||
worker_processes 1;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
log_format main '\$remote_addr - \$remote_user [\$time_local] "\$request" '
|
||||
'\$status \$body_bytes_sent "\$http_referer" '
|
||||
'"\$http_user_agent" "\$http_x_forwarded_for"';
|
||||
access_log /var/log/nginx/access.log main;
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
keepalive_timeout 120;
|
||||
client_max_body_size 20m;
|
||||
#gzip on;
|
||||
server {
|
||||
listen 80;
|
||||
server_name $your_domain;
|
||||
root /usr/share/nginx/html;
|
||||
index index.php index.html index.htm;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
#设置伪装站
|
||||
rm -rf /usr/share/nginx/html/*
|
||||
cd /usr/share/nginx/html/
|
||||
wget https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu/trojan-nao-sh/web.zip >/dev/null 2>&1
|
||||
unzip web.zip >/dev/null 2>&1
|
||||
sleep 5
|
||||
#申请https证书
|
||||
if [ ! -d "/usr/src" ]; then
|
||||
mkdir /usr/src
|
||||
fi
|
||||
mkdir /usr/src/trojan-cert /usr/src/trojan-temp
|
||||
curl https://get.acme.sh | sh
|
||||
~/.acme.sh/acme.sh --issue -d $your_domain --standalone
|
||||
if test -s /root/.acme.sh/$your_domain/fullchain.cer; then
|
||||
systemctl start nginx
|
||||
cd /usr/src
|
||||
#wget https://github.com/trojan-gfw/trojan/releases/download/v1.13.0/trojan-1.13.0-linux-amd64.tar.xz
|
||||
wget https://api.github.com/repos/trojan-gfw/trojan/releases/latest >/dev/null 2>&1
|
||||
latest_version=`grep tag_name latest| awk -F '[:,"v]' '{print $6}'`
|
||||
rm -f latest
|
||||
wget https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu/trojan-nao-sh/trojan-1.16.0-linux-amd64.tar.xz >/dev/null 2>&1
|
||||
tar xf trojan-1.16.0-linux-amd64.tar.xz >/dev/null 2>&1
|
||||
#下载trojan客户端
|
||||
wget https://www.dropbox.com/s/yegoxa4hfo5sf2z/trojan-cli.zip >/dev/null 2>&1
|
||||
wget -P /usr/src/trojan-temp https://github.com/trojan-gfw/trojan/releases/download/v${latest_version}/trojan-${latest_version}-win.zip >/dev/null 2>&1
|
||||
unzip trojan-cli.zip >/dev/null 2>&1
|
||||
unzip /usr/src/trojan-temp/trojan-${latest_version}-win.zip -d /usr/src/trojan-temp/ >/dev/null 2>&1
|
||||
mv -f /usr/src/trojan-temp/trojan/trojan.exe /usr/src/trojan-cli/
|
||||
trojan_passwd=$(cat /dev/urandom | head -1 | md5sum | head -c 8)
|
||||
unset porta
|
||||
echo "================================================================="
|
||||
read -p " INGRESE PUERTO TROJAN A USAR : " porta
|
||||
echo "================================================================="
|
||||
[[ -z $porta ]] && porta="443"
|
||||
cat > /usr/src/trojan-cli/config.yml <<-EOF
|
||||
port: 7890
|
||||
socks-port: 7891
|
||||
redir-port: 7892
|
||||
allow-lan: true
|
||||
mode: Global
|
||||
log-level: info
|
||||
external-controller: '0.0.0.0:9090'
|
||||
secret: ''
|
||||
|
||||
dns:
|
||||
enable: true
|
||||
nameserver:
|
||||
- 1.1.1.1
|
||||
- 1.0.0.1
|
||||
|
||||
proxies:
|
||||
- name: Trojan
|
||||
type: "trojan"
|
||||
server: $your_domain
|
||||
port: 443
|
||||
password: $trojan_passwd
|
||||
udp: true
|
||||
sni: www.tuhost.com
|
||||
alpn:
|
||||
- h2
|
||||
- http/1.1
|
||||
skip-cert-verify: true
|
||||
|
||||
# Eliminar "#" si configura v2ray
|
||||
#- name: V2ray
|
||||
# type: vmess
|
||||
# server: 123.0.0.0
|
||||
# port:
|
||||
# uuid:
|
||||
# alterId:
|
||||
# cipher: auto
|
||||
# udp: true
|
||||
# tls: true
|
||||
# skip-cert-verify: true
|
||||
# network: ws
|
||||
# ws-path: /
|
||||
# ws-headers: {host: www.tuhost.com}
|
||||
|
||||
###################################
|
||||
EOF
|
||||
rm -rf /usr/local/etc/trojan/config.json
|
||||
cat > /usr/local/etc/trojan/config.json <<-EOF
|
||||
{
|
||||
"run_type": "server",
|
||||
"local_addr": "0.0.0.0",
|
||||
"local_port": 443,
|
||||
"remote_addr": "127.0.0.1",
|
||||
"remote_port": 80,
|
||||
"password": [
|
||||
"$trojan_passwd"
|
||||
,"chumoghscript"
|
||||
],
|
||||
"log_level": 1,
|
||||
"ssl": {
|
||||
"cert": "/usr/src/trojan-cert/fullchain.cer",
|
||||
"key": "/usr/src/trojan-cert/private.key",
|
||||
"key_password": "",
|
||||
"cipher_tls13":"TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
|
||||
"prefer_server_cipher": true,
|
||||
"alpn": [
|
||||
"http/1.1"
|
||||
],
|
||||
"reuse_session": true,
|
||||
"session_ticket": false,
|
||||
"session_timeout": 600,
|
||||
"plain_http_response": "",
|
||||
"curves": "",
|
||||
"dhparam": ""
|
||||
},
|
||||
"tcp": {
|
||||
"no_delay": true,
|
||||
"keep_alive": true,
|
||||
"fast_open": false,
|
||||
"fast_open_qlen": 20
|
||||
},
|
||||
"mysql": {
|
||||
"enabled": false,
|
||||
"server_addr": "127.0.0.1",
|
||||
"server_port": 3306,
|
||||
"database": "trojan",
|
||||
"username": "trojan",
|
||||
"password": ""
|
||||
}
|
||||
}
|
||||
EOF
|
||||
cd /usr/src/trojan-cli/
|
||||
config.yml /usr/src/trojan-cli/
|
||||
trojan_path=$(cat /dev/urandom | head -1 | md5sum | head -c 16)
|
||||
mkdir /usr/share/nginx/html/${trojan_path}
|
||||
mv /usr/src/trojan-cli/config.yml /usr/share/nginx/html/${trojan_path}/
|
||||
#增加启动脚本
|
||||
|
||||
cat > ${systempwd}trojan.service <<-EOF
|
||||
[Unit]
|
||||
Description=trojan
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
PIDFile=/usr/src/trojan/trojan/trojan.pid
|
||||
ExecStart=/usr/src/trojan/trojan -c "/usr/local/etc/trojan/config.json"
|
||||
ExecReload=/bin/kill -HUP \$MAINPID
|
||||
Restart=on-failure
|
||||
RestartSec=1s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
chmod +x ${systempwd}trojan.service
|
||||
systemctl enable trojan.service
|
||||
cd /root
|
||||
~/.acme.sh/acme.sh --installcert -d $your_domain \
|
||||
--key-file /usr/src/trojan-cert/private.key \
|
||||
--fullchain-file /usr/src/trojan-cert/fullchain.cer \
|
||||
--reloadcmd "systemctl restart trojan"
|
||||
green "=============================================================="
|
||||
green "Se ha instalado trojan, utilice el siguiente enlace para\ndescargar el archivo .yml para configurar en Clash."
|
||||
blue "http://${your_domain}/$trojan_path/config.yml"
|
||||
red "Link único y generado de manera aleatoria."
|
||||
green "=============================================================="
|
||||
green "Puede modificar el archivo .yml abriéndolo como Texto. "
|
||||
green "Recuerde modificar el dominio por la ip en el archivo yml. "
|
||||
green "Todo viene configurado, pero para que funcione correctamente\ntiene que modificar el host."
|
||||
green "=============================================================="
|
||||
red "Si gusta configurar manualmente, esta es la información:"
|
||||
blue "Dominio: $your_domain"
|
||||
blue "Puerto: 443"
|
||||
blue "Contraseña: $trojan_passwd"
|
||||
green "=============================================================="
|
||||
else
|
||||
red "==================================="
|
||||
red "Si el certificado https no obtuvo resultados\nde solicitud y la instalación automática falló"
|
||||
green "No se preocupe, puede reparar manualmente la solicitud del certificado."
|
||||
green "1. Reinicie la VPS."
|
||||
green "2. Vuelva a ejecutar el script y use la función de reparación de certificado."
|
||||
red "==================================="
|
||||
fi
|
||||
}
|
||||
function preinstall_check(){
|
||||
|
||||
nginx_status=`ps -aux | grep "nginx: worker" |grep -v "grep"`
|
||||
if [ -n "$nginx_status" ]; then
|
||||
systemctl stop nginx
|
||||
fi
|
||||
$systemPackage -y install net-tools socat
|
||||
Port80=`netstat -tlpn | awk -F '[: ]+' '$1=="tcp"{print $5}' | grep -w 80`
|
||||
Port443=`netstat -tlpn | awk -F '[: ]+' '$1=="tcp"{print $5}' | grep -w 443`
|
||||
if [ -n "$Port80" ]; then
|
||||
process80=`netstat -tlpn | awk -F '[: ]+' '$5=="80"{print $9}'`
|
||||
red "==========================================================="
|
||||
red "Se detectó que el puerto 80 está ocupado, el proceso que lo\nocupa es:${process80},La instalación ha finalizado."
|
||||
red "==========================================================="
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "$Port443" ]; then
|
||||
process443=`netstat -tlpn | awk -F '[: ]+' '$5=="443"{print $9}'`
|
||||
red "============================================================="
|
||||
red "Se detectó que el puerto 443 está ocupado, el proceso que lo\nocupa es::${process443},La instalación ha finalizado."
|
||||
red "============================================================="
|
||||
exit 1
|
||||
fi
|
||||
if [ -f "/etc/selinux/config" ]; then
|
||||
CHECK=$(grep SELINUX= /etc/selinux/config | grep -v "#")
|
||||
if [ "$CHECK" != "SELINUX=disabled" ]; then
|
||||
green "Se detectó que SELinux está activado, se agregaran las reglas del puerto 80/443"
|
||||
yum install -y policycoreutils-python >/dev/null 2>&1
|
||||
semanage port -m -t http_port_t -p tcp 80
|
||||
semanage port -m -t http_port_t -p tcp 443
|
||||
fi
|
||||
fi
|
||||
if [ "$release" == "centos" ]; then
|
||||
if [ -n "$(grep ' 6\.' /etc/redhat-release)" ] ;then
|
||||
red "==============="
|
||||
red "El sistema actual no es compatible."
|
||||
red "==============="
|
||||
exit
|
||||
fi
|
||||
if [ -n "$(grep ' 5\.' /etc/redhat-release)" ] ;then
|
||||
red "==============="
|
||||
red "El sistema actual no es compatible."
|
||||
red "==============="
|
||||
exit
|
||||
fi
|
||||
firewall_status=`systemctl status firewalld | grep "Active: active"`
|
||||
if [ -n "$firewall_status" ]; then
|
||||
green "Se detectó que el firewall está activado, se agregaran las reglas del puerto 80/443"
|
||||
firewall-cmd --zone=public --add-port=80/tcp --permanent
|
||||
firewall-cmd --zone=public --add-port=443/tcp --permanent
|
||||
firewall-cmd --reload
|
||||
fi
|
||||
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
|
||||
elif [ "$release" == "ubuntu" ]; then
|
||||
if [ -n "$(grep ' 14\.' /etc/os-release)" ] ;then
|
||||
red "==============="
|
||||
red "El sistema actual no es compatible."
|
||||
red "==============="
|
||||
exit
|
||||
fi
|
||||
if [ -n "$(grep ' 12\.' /etc/os-release)" ] ;then
|
||||
red "==============="
|
||||
red "El sistema actual no es compatible."
|
||||
red "==============="
|
||||
exit
|
||||
fi
|
||||
ufw_status=`systemctl status ufw | grep "Active: active"`
|
||||
if [ -n "$ufw_status" ]; then
|
||||
ufw allow 80/tcp
|
||||
ufw allow 443/tcp
|
||||
fi
|
||||
apt-get update
|
||||
elif [ "$release" == "debian" ]; then
|
||||
ufw_status=`systemctl status ufw | grep "Active: active"`
|
||||
if [ -n "$ufw_status" ]; then
|
||||
ufw allow 80/tcp
|
||||
ufw allow 443/tcp
|
||||
fi
|
||||
apt-get update
|
||||
fi
|
||||
$systemPackage -y install wget unzip zip curl tar >/dev/null 2>&1
|
||||
green "======================="
|
||||
blue "Ingrese el dominio vinculado a esta VPS " && read -p ": " your_domain
|
||||
green "======================="
|
||||
|
||||
real_addr=`ping ${your_domain} -c 1 | sed '1{s/[^(]*(//;s/).*//;q}'`
|
||||
local_addr=`curl ipv4.icanhazip.com`
|
||||
if [ $real_addr == $local_addr ] ; then
|
||||
green "=========================================="
|
||||
green "La resolución del dominio es normal, se intalará trojan"
|
||||
green "=========================================="
|
||||
sleep 1s
|
||||
install_trojan
|
||||
|
||||
else
|
||||
red "===================================="
|
||||
red "La resolución de dominio es inconsistente con la dirección IP de la VPS"
|
||||
red "Si cree que el análisis es correcto, puede forzar a que el script continúe"
|
||||
red "===================================="
|
||||
read -p "¿Forzar el script? Seleccione [Y/n] :" yn
|
||||
[ -z "${yn}" ] && yn="y"
|
||||
if [[ $yn == [Yy] ]]; then
|
||||
green "Forzar el script"
|
||||
sleep 1s
|
||||
install_trojan
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function repair_cert(){
|
||||
systemctl stop nginx
|
||||
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
|
||||
Port80=`netstat -tlpn | awk -F '[: ]+' '$1=="tcp"{print $5}' | grep -w 80`
|
||||
if [ -n "$Port80" ]; then
|
||||
process80=`netstat -tlpn | awk -F '[: ]+' '$5=="80"{print $9}'`
|
||||
red "==========================================================="
|
||||
red "Se detectó que el puerto 80 está ocupado, el proceso que lo\nocupa es:${process80},La instalación ha finalizado."
|
||||
red "==========================================================="
|
||||
exit 1
|
||||
fi
|
||||
green "======================="
|
||||
blue "Ingrese el dominio vinculado a esta VPS."
|
||||
blue "Debe ser el mismo dominio que no pudo usar antes."
|
||||
green "======================="
|
||||
read your_domain
|
||||
real_addr=`ping ${your_domain} -c 1 | sed '1{s/[^(]*(//;s/).*//;q}'`
|
||||
local_addr=`curl ipv4.icanhazip.com`
|
||||
if [ $real_addr == $local_addr ] ; then
|
||||
~/.acme.sh/acme.sh --issue -d $your_domain --standalone
|
||||
~/.acme.sh/acme.sh --installcert -d $your_domain \
|
||||
--key-file /usr/src/trojan-cert/private.key \
|
||||
--fullchain-file /usr/src/trojan-cert/fullchain.cer \
|
||||
--reloadcmd "systemctl restart trojan"
|
||||
if test -s /usr/src/trojan-cert/fullchain.cer; then
|
||||
green "Solicitud de certificado exitosa."
|
||||
green "Descargue fullchain.cer en /usr/src/trojan-cert/ en la carpeta del cliente trojan-cli"
|
||||
systemctl restart trojan
|
||||
systemctl start nginx
|
||||
else
|
||||
red "No se pudo solicitar el certificado."
|
||||
fi
|
||||
else
|
||||
red "================================"
|
||||
red "La resolución de dominio es inconsistente con la dirección IP de la VPS"
|
||||
red "La instalación falló, asegúrese de que la resolución del dominio sea normal"
|
||||
red "================================"
|
||||
fi
|
||||
}
|
||||
|
||||
function remove_trojan(){
|
||||
red "================================"
|
||||
red "Trojan se desintalará"
|
||||
red "Nginx también se desintalará"
|
||||
red "================================"
|
||||
systemctl stop trojan
|
||||
systemctl disable trojan
|
||||
rm -f ${systempwd}trojan.service
|
||||
if [ "$release" == "centos" ]; then
|
||||
yum remove -y nginx
|
||||
else
|
||||
apt autoremove -y nginx
|
||||
fi
|
||||
rm -rf /usr/src/trojan*
|
||||
rm -rf /usr/share/nginx/html/*
|
||||
rm -rf /root/.acme.sh/
|
||||
green "=============="
|
||||
green "Trojan desinstalado."
|
||||
green "=============="
|
||||
}
|
||||
|
||||
function update_trojan(){
|
||||
/usr/src/trojan/trojan -v 2>trojan.tmp
|
||||
curr_version=`cat trojan.tmp | grep "trojan" | awk '{print $4}'`
|
||||
wget https://api.github.com/repos/trojan-gfw/trojan/releases/latest >/dev/null 2>&1
|
||||
latest_version=`grep tag_name latest| awk -F '[:,"v]' '{print $6}'`
|
||||
rm -f latest
|
||||
rm -f trojan.tmp
|
||||
if version_lt "$curr_version" "$latest_version"; then
|
||||
green "Versión actual: $curr_version, Última versión: $latest_version, actualizando……"
|
||||
mkdir trojan_update_temp && cd trojan_update_temp
|
||||
wget https://github.com/trojan-gfw/trojan/releases/download/v${latest_version}/trojan-${latest_version}-linux-amd64.tar.xz >/dev/null 2>&1
|
||||
tar xf trojan-${latest_version}-linux-amd64.tar.xz >/dev/null 2>&1
|
||||
mv ./trojan/trojan /usr/src/trojan/
|
||||
cd .. && rm -rf trojan_update_temp
|
||||
systemctl restart trojan
|
||||
/usr/src/trojan/trojan -v 2>trojan.tmp
|
||||
green "Se completó la actualización de trojan, la versión actual es:`cat trojan.tmp | grep "trojan" | awk '{print $4}'`"
|
||||
rm -f trojan.tmp
|
||||
else
|
||||
green "Versión actual: $curr_version, Última versión: $latest_version, no es necesario actualizar."
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
start_menu(){
|
||||
clear
|
||||
green " ======================================="
|
||||
green " Script de Instalación de Trojan "
|
||||
green " Sistemas:centos7+/debian9+/ubuntu16.04+"
|
||||
green " Edicion ChumoGH - ADM "
|
||||
blue " Declaración:"
|
||||
red " *No use este script en ningún entorno de producción."
|
||||
red " *No debe tener ocupados los puertos 80/443."
|
||||
red " *Siga las instrucciones."
|
||||
green " ======================================="
|
||||
echo
|
||||
green " 1. Instalar trojan"
|
||||
red " 2. Desinstalar trojan"
|
||||
green " 3. Actualizar trojan"
|
||||
green " 4. Reparar certificado"
|
||||
blue " 0. Salir del script"
|
||||
echo
|
||||
read -p "Ingrese una opción:" num
|
||||
case "$num" in
|
||||
1)
|
||||
preinstall_check
|
||||
;;
|
||||
2)
|
||||
remove_trojan
|
||||
;;
|
||||
3)
|
||||
update_trojan
|
||||
;;
|
||||
4)
|
||||
repair_cert
|
||||
;;
|
||||
0)
|
||||
adm 1
|
||||
;;
|
||||
*)
|
||||
clear
|
||||
red "Ingrese una opción correcta."
|
||||
sleep 1s
|
||||
start_menu
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
start_menu
|
||||
134
Recursos/menu/tumbs.sh
Normal file
134
Recursos/menu/tumbs.sh
Normal file
@ -0,0 +1,134 @@
|
||||
#!/bin/bash
|
||||
#Autor: Henry Chumo
|
||||
#Alias : ChumoGH
|
||||
# -*- ENCODING: UTF-8 -*-
|
||||
|
||||
# verificacion primarias
|
||||
|
||||
echo " ====================================== "
|
||||
echo " ======== ENTRANDO EN $1 ========= "
|
||||
echo " ====================================== "
|
||||
#[[ -z $(cat /etc/crontab | grep ejecutar) ]] && {
|
||||
|
||||
|
||||
fun_limpram() {
|
||||
sync
|
||||
echo 3 >/proc/sys/vm/drop_caches
|
||||
sync && sysctl -w vm.drop_caches=3
|
||||
sysctl -w vm.drop_caches=0
|
||||
swapoff -a
|
||||
swapon -a
|
||||
[[ -e /etc/v2ray/config.json ]] && v2ray clean >/dev/null 2>&1 &
|
||||
[[ -e /etc/xray/config.json ]] && v2ray clean >/dev/null 2>&1 &
|
||||
killall kswapd0 >/dev/null 2>&1 &
|
||||
killall tcpdump >/dev/null 2>&1 &
|
||||
killall ksoftirqd >/dev/null 2>&1 &
|
||||
#apt purge rsyslog -y > /dev/null 2>&1
|
||||
rm -f /var/log/*.log.*
|
||||
[[ -e /var/log/auth.log ]] && echo "@drowkid01 "> /var/log/auth.log
|
||||
rm -f /var/log/*.1
|
||||
systemctl restart rsyslog.service
|
||||
systemctl restart systemd-journald.service
|
||||
service dropbear stop > /dev/null 2>&1
|
||||
service sshd restart > /dev/null 2>&1
|
||||
service dropbear restart > /dev/null 2>&1
|
||||
#killall systemd-journald
|
||||
[[ -e /etc/fipv6 ]] || {
|
||||
sed -i "/net.ipv6.conf/d" /etc/sysctl.conf
|
||||
touch /etc/fipv6
|
||||
}
|
||||
[[ -z $(grep -w "net.ipv6.conf" /etc/sysctl.conf) ]] && {
|
||||
echo -e 'net.ipv6.conf.all.disable_ipv6=1
|
||||
net.ipv6.conf.default.disable_ipv6=1' >> /etc/sysctl.conf
|
||||
sysctl -w net.ipv6.conf.all.disable_ipv6=1
|
||||
sysctl -w net.ipv6.conf.default.disable_ipv6=1
|
||||
sysctl -w net.ipv6.conf.lo.disable_ipv6=1
|
||||
} || {
|
||||
sysctl -w net.ipv6.conf.all.disable_ipv6=1
|
||||
sysctl -w net.ipv6.conf.default.disable_ipv6=1
|
||||
sysctl -w net.ipv6.conf.lo.disable_ipv6=1
|
||||
}
|
||||
sysctl -p /etc/sysctl.conf &>/dev/null
|
||||
echo "DONE" > /etc/fixrsyslog
|
||||
}
|
||||
function aguarde() {
|
||||
sleep 1
|
||||
helice() {
|
||||
fun_limpram >/dev/null 2>&1 &
|
||||
tput civis
|
||||
while [ -d /proc/$! ]; do
|
||||
for i in / - \\ \|; do
|
||||
sleep .1
|
||||
echo -ne "\e[1D$i"
|
||||
done
|
||||
done
|
||||
tput cnorm
|
||||
}
|
||||
echo -ne "\033[1;37m Reconstruyendo \033[1;32mLOGS de \033[1;37me \033[1;32m USERS\033[1;32m.\033[1;33m.\033[1;31m. \033[1;33m"
|
||||
helice
|
||||
echo -e "\e[1DOk"
|
||||
}
|
||||
|
||||
|
||||
function checkON () {
|
||||
#[[ ! -e /etc/fixrsyslog ]] && aguarde
|
||||
#find . -type f -size +10M -exec rm {} \;
|
||||
echo -ne " COMPILANDO BINARIO DE AUTOPTIMIZACIONES "
|
||||
if wget https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu/killram.sh &>/dev/null -O /bin/automatizar.sh &>/dev/null ; then
|
||||
echo -e "\033[1;32m DONE \n" && msg -bar3
|
||||
chmod +x /bin/automatizar.sh &>/dev/null
|
||||
else
|
||||
echo -e "\033[1;31m FAIL \n" && msg -bar3
|
||||
rm -f /bin/automatizar.sh
|
||||
sleep 2s
|
||||
return
|
||||
fi
|
||||
echo -ne " COMPILANDO BINARIO DE AUTOPLIMPIEZAS "
|
||||
if wget https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu/killram.sh &>/dev/null -O /bin/gnula.sh &>/dev/null ; then
|
||||
echo -e " \033[1;32m DONE \n" && msg -bar3
|
||||
chmod +x /bin/gnula.sh &>/dev/null
|
||||
else
|
||||
echo -e " \033[1;31m FAIL \n" && msg -bar3
|
||||
rm -f /bin/gnula.sh
|
||||
sleep 2s
|
||||
return
|
||||
fi
|
||||
sed -i "/automatizar.sh/d" /etc/crontab && sed -i "/gnula.sh/d" /etc/crontab
|
||||
echo "00 03 * * * root bash /bin/automatizar.sh" >> /etc/crontab
|
||||
echo "00 * * * * root bash /bin/gnula.sh" >> /etc/crontab
|
||||
#echo 'echo "$(printf '%(%H:%M:%S)T')" >> /root/clearlog.txt' >> /bin/autoboot
|
||||
service cron restart >/dev/null 2>&1
|
||||
systemctl enable cron &>/dev/null
|
||||
systemctl start cron &>/dev/null
|
||||
cat /etc/crontab | tail -n5
|
||||
rm -f /root/cron
|
||||
msg -azu " Tarea programada cada $(msg -verd "[ $(crontab -l|grep 'ejecutar'|awk '{print $2}'|sed $'s/[^[:alnum:]\t]//g')HS ]")"
|
||||
#[[ -e /etc/systemd/system/autoStart.service ]] && echo -e " TAREA DE LOOP DE AUTOREACTIVACION CREADA "
|
||||
[[ -e /bin/autoboot ]] && chmod +x /bin/autoboot
|
||||
}
|
||||
|
||||
function checkOFF () {
|
||||
rm -f /bin/ejecutar/automatizar.sh
|
||||
rm -f /bin/ejecutar/gnula.sh
|
||||
#rm -f /bin/autoboot
|
||||
sed -i "/automatizar.sh/d" /etc/crontab && sed -i "/gnula.sh/d" /etc/crontab
|
||||
sed -i "/autoboot/d" /etc/crontab
|
||||
#crontab -l > /root/cron
|
||||
#sed -i "/ejecutar/d" /root/cron
|
||||
#sed -i "/autoboot/d" /root/cron
|
||||
service cron restart
|
||||
unset _opti
|
||||
echo -e " DESACTIVADA DEL SISTEMA CORRECTAMENTE"
|
||||
#rm -f /etc/fixrsyslog
|
||||
}
|
||||
|
||||
[[ "$1" = '--start' ]] && {
|
||||
checkON
|
||||
exit 0
|
||||
}
|
||||
|
||||
[[ "$1" = '--stop' ]] && {
|
||||
checkOFF
|
||||
exit 0
|
||||
}
|
||||
rm -rf /usr/.work
|
||||
19
Recursos/menu/vps.conf
Normal file
19
Recursos/menu/vps.conf
Normal file
@ -0,0 +1,19 @@
|
||||
server {
|
||||
listen 81;
|
||||
server_name 127.0.0.1 localhost;
|
||||
access_log /var/log/nginx/vps-access.log;
|
||||
error_log /var/log/nginx/vps-error.log error;
|
||||
root /var/www/html;
|
||||
|
||||
location / {
|
||||
index index.html index.htm index.php;
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include /etc/nginx/fastcgi_params;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
}
|
||||
2076
Recursos/menu_inst/C-SSR.sh
Normal file
2076
Recursos/menu_inst/C-SSR.sh
Normal file
File diff suppressed because it is too large
Load Diff
362
Recursos/menu_inst/SlowDNS.sh
Normal file
362
Recursos/menu_inst/SlowDNS.sh
Normal file
@ -0,0 +1,362 @@
|
||||
#!/bin/bash
|
||||
clear
|
||||
#${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ##
|
||||
#ADM_inst="/ADMcgh/slow/dnsi" && [[ ! -d ${ADM_inst} ]] && mkdir ${ADM_inst}
|
||||
#ADM_inst="/ADMcgh/slow/dnsi" && [[ ! -d ${ADM_inst} ]] && mkdir ${ADM_inst}
|
||||
[[ ! -d /etc/adm-lite/slow/ ]] && mkdir /etc/adm-lite/slow
|
||||
ADM_slow="/etc/adm-lite/slow/dnsi" && [[ ! -d ${ADM_slow} ]] && mkdir ${ADM_slow}
|
||||
Key="$(cat /etc/cghkey)" && _Key='/etc/cghkey'
|
||||
#[[ -e /bin/ejecutar/msg ]] && source /bin/ejecutar/msg > /dev/null || source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg) > /dev/null
|
||||
source msg
|
||||
#${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ##
|
||||
#${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ##
|
||||
|
||||
#FELICIDADES, NUNCA DEJES DE APRENDER
|
||||
|
||||
_Key='/etc/cghkey'
|
||||
|
||||
clear
|
||||
|
||||
[[ ! -e ${_Key} ]] && exit
|
||||
|
||||
clear
|
||||
function chekKEY {
|
||||
[[ -z ${IP} ]] && IP=$(mip)
|
||||
[[ -z ${IP} ]] && IP=$(wget -qO- ifconfig.me)
|
||||
Key="$(cat /etc/cghkey)"
|
||||
IiP="$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
|
||||
[[ -e /file ]] && _double=$(cat < /file) || {
|
||||
wget -q -O /file https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/Control-BOT
|
||||
_double=$(cat < /file)
|
||||
}
|
||||
_check2="$(echo -e "$_double" | grep ${IiP})"
|
||||
[[ ! -e /etc/folteto ]] && {
|
||||
wget --no-check-certificate -O /etc/folteto $IiP:81/ChumoGH/checkIP.log
|
||||
cheklist="$(cat /etc/folteto)"
|
||||
echo -e "$(echo -e "$cheklist" | grep ${IP})" > /etc/folteto
|
||||
}
|
||||
[[ -z ${_check2} ]] && {
|
||||
[[ ! -d /bin/ejecutar/Ubam ]] && mkdir /bin/ejecutar/Ubam
|
||||
mss_='\n BotGEN NO AUTORIZADO POR @drowkid01 '
|
||||
|
||||
cat <<EOF >/bin/menu
|
||||
clear && clear
|
||||
echo -e "\n\n\033[1;31m==================================================\n ¡¡ 🚫 KEY BANEADA 🚫 ! CONTACTE Su ADMINISTRADOR! \n==================================================\n ¡¡ FECHA DE BANEO :$(date +%d/%m/%Y) HORA :$(date +%H:%M:%S) \n==================================================\n\n¡¡ ${mss_} \n\n==================================================\n"
|
||||
echo -e " \e[1;32m --- SI CONSIDERA QUE FUE UN ERROR --- " | pv -qL 60
|
||||
echo -e " \e[1;32m -- ${mss_} -- " | pv -qL 60
|
||||
echo -e "\n \e[1;93m --- TECLEA \e[1;93m --- \e[1;97mcgh -fix\e[1;93m --- " | pv -qL 50
|
||||
echo -e "\n\033[1;31m==================================================\n\n"
|
||||
#echo "/etc/adm-lite/menu" > /bin/menu && chmod +x /bin/menu
|
||||
EOF
|
||||
rm -f /etc/folteto
|
||||
mv etc/adm-lite/* /bin/ejecutar/Ubam
|
||||
MENSAJE="${TTini}${m3ssg}MSG RECIVIDO${m3ssg}${TTfin}\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" IP Clon: ${IP} Rechazada\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" ${lLaM} DETECCUION EN SlowDNS ${lLaM}\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" KEY : ${Key}\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" ${rUlq} Bot generador de key ${rUlq}\n"
|
||||
MENSAJE+=" ${pUn5A} By @drowkid01 ${pUn5A} \n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
curl -s --max-time 10 -d "chat_id=$ID&disable_web_page_preview=1&text=$(echo -e "$MENSAJE")" $urlBOT &>/dev/null
|
||||
exit && exit
|
||||
}
|
||||
}
|
||||
|
||||
selection_fun () {
|
||||
local selection="null"
|
||||
local range
|
||||
for((i=0; i<=$1; i++)); do range[$i]="$i "; done
|
||||
while [[ ! $(echo ${range[*]}|grep -w "$selection") ]]; do
|
||||
echo -ne "\033[1;37m ${flech} Selecione una Opcion: " >&2
|
||||
read selection
|
||||
tput cuu1 >&2 && tput dl1 >&2
|
||||
done
|
||||
echo $selection
|
||||
}
|
||||
|
||||
|
||||
info(){
|
||||
clear
|
||||
nodata(){
|
||||
msg -bar
|
||||
msg -ama " !SIN INFORMACION SLOWDNS!"
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
exit 0
|
||||
}
|
||||
if [[ -e ${ADM_slow}/domain_ns ]]; then
|
||||
ns=$(cat ${ADM_slow}/domain_ns)
|
||||
if [[ -z "$ns" ]]; then
|
||||
nodata
|
||||
fi
|
||||
else
|
||||
nodata
|
||||
fi
|
||||
|
||||
if [[ -e ${ADM_slow}/server.pub ]]; then
|
||||
key=$(cat ${ADM_slow}/server.pub)
|
||||
if [[ -z "$key" ]]; then
|
||||
nodata
|
||||
fi
|
||||
else
|
||||
nodata
|
||||
fi
|
||||
|
||||
msg -bar
|
||||
msg -ama " DATOS DE SU CONECCION SLOWDNS"
|
||||
msg -bar
|
||||
msg -ama "Su NameServer: $(cat ${ADM_slow}/domain_ns)"
|
||||
msg -bar
|
||||
msg -ama "Su Llave: $(cat ${ADM_slow}/server.pub)" msg -bar
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
}
|
||||
|
||||
drop_port(){
|
||||
local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
|
||||
local NOREPEAT
|
||||
local reQ
|
||||
local Port
|
||||
unset DPB
|
||||
while read port; do
|
||||
reQ=$(echo ${port}|awk '{print $1}')
|
||||
Port=$(echo {$port} | awk '{print $9}' | awk -F ":" '{print $2}')
|
||||
[[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
|
||||
NOREPEAT+="$Port\n"
|
||||
case ${reQ} in
|
||||
sshd|dropbear|stunnel4|stunnel|trojan|v2ray|xray|python|python3|openvpn|node|squid|squid3|sslh|snell-ser|ss-server|obfs-serv|trojan-go)DPB+=" $reQ:$Port";;
|
||||
*) continue;;
|
||||
esac
|
||||
done <<< "${portasVAR}"
|
||||
}
|
||||
|
||||
ini_slow(){
|
||||
msg -bra "INSTALADOR SLOWDNS"
|
||||
drop_port
|
||||
n=1
|
||||
for i in $DPB; do
|
||||
proto=$(echo $i|awk -F ":" '{print $1}')
|
||||
proto2=$(printf '%-12s' "$proto")
|
||||
port=$(echo $i|awk -F ":" '{print $2}')
|
||||
echo -e " $(msg -verd "[$n]") $(msg -verm2 ">") $(msg -ama " $(echo -e " ${flech} $proto2 "| tr [:lower:] [:upper:])")$(msg -azu "$port")"
|
||||
drop[$n]=$port
|
||||
dPROT[$n]=$proto2
|
||||
num_opc="$n"
|
||||
let n++
|
||||
done
|
||||
msg -bar
|
||||
opc=$(selection_fun $num_opc)
|
||||
echo "${drop[$opc]}" > ${ADM_slow}/puerto
|
||||
echo "${dPROT[$opc]}" > ${ADM_slow}/protc
|
||||
PORT=$(cat ${ADM_slow}/puerto)
|
||||
PRT=$(cat ${ADM_slow}/protc)
|
||||
msg -bra " INSTALADOR SLOWDNS "
|
||||
msg -bar
|
||||
echo -e " $(msg -ama "Redireccion SlowDns:") $(msg -verd "$(echo -e "${PRT}" | tr [:lower:] [:upper:])") : $(msg -verd "$PORT") $(msg -ama " -> ") $(msg -verd "5300")"
|
||||
msg -bar
|
||||
[[ -e /dominio_NS.txt && ! -e ${ADM_slow}/domain_ns ]] && cp /dominio_NS.txt ${ADM_slow}/domain_ns
|
||||
[[ -e ${ADM_slow}/domain_ns ]] && NS1=$(cat < ${ADM_slow}/domain_ns) || unset NS1 NS
|
||||
unset NS
|
||||
[[ -z $NS1 ]] && {
|
||||
while [[ -z $NS ]]; do
|
||||
msg -bar
|
||||
echo -ne "\e[1;31m TU DOMINIO NS \e[1;37m: "
|
||||
read NS
|
||||
tput cuu1 && tput dl1
|
||||
done
|
||||
} || {
|
||||
msg -bar
|
||||
echo -e "\e[1;31m TIENES UN DOMINIO NS YA REGISTRADO \e[1;37m "
|
||||
echo -e "\e[1;32m TU NS ES : ${NS1} \e[1;37m "
|
||||
echo -e " SI QUIERES UTILIZARLO, SOLO PRESIONA ENTER "
|
||||
echo -e " CASO CONTRARIO DIJITA TU NUEVO NS "
|
||||
msg -bar
|
||||
echo -ne "\e[1;31m TU DOMINIO NS \e[1;37m: "
|
||||
read NS
|
||||
[[ -z $NS ]] && NS="${NS1}"
|
||||
tput cuu1 && tput dl1
|
||||
echo "$NS" > ${ADM_slow}/domain_ns
|
||||
}
|
||||
echo "$NS" > ${ADM_slow}/domain_ns
|
||||
echo -e " $(msg -ama "NAME SERVER:") $(msg -verd "$NS")"
|
||||
msg -bar
|
||||
chekKEY &> /dev/null 2>&1
|
||||
if [[ ! -e ${ADM_inst}/dns-server ]]; then
|
||||
msg -ama " Descargando binario...."
|
||||
[[ $(uname -m 2> /dev/null) != x86_64 ]] && {
|
||||
if wget -O ${ADM_inst}/dns-server https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/binarios/SlowDNS/autoStart-ARM &>/dev/null ; then
|
||||
chmod +x ${ADM_inst}/dns-server
|
||||
msg -verd "[OK]"
|
||||
else
|
||||
msg -verm "[fail]"
|
||||
msg -bar
|
||||
msg -ama "No se pudo descargar el binario"
|
||||
msg -verm "Instalacion cancelada"
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
exit 0
|
||||
fi
|
||||
} || {
|
||||
if wget -O ${ADM_inst}/dns-server https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/binarios/SlowDNS/autoStart-x86-64 &>/dev/null ; then
|
||||
chmod +x ${ADM_inst}/dns-server
|
||||
msg -verd "[OK]"
|
||||
else
|
||||
msg -verm "[fail]"
|
||||
msg -bar
|
||||
msg -ama "No se pudo descargar el binario"
|
||||
msg -verm "Instalacion canselada"
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
msg -bar
|
||||
fi
|
||||
[[ -e "${ADM_slow}/server.pub" ]] && pub=$(cat ${ADM_slow}/server.pub)
|
||||
if [[ ! -z "$pub" ]]; then
|
||||
echo -ne "$(msg -ama " Usar clave existente [S/N]: ")"
|
||||
read ex_key
|
||||
case $ex_key in
|
||||
s|S|y|Y) tput cuu1 && tput dl1
|
||||
echo -e " $(msg -ama "KEY.PUB:") $(msg -verd "$(cat ${ADM_slow}/server.pub)")";;
|
||||
n|N) tput cuu1 && tput dl1
|
||||
rm -rf ${ADM_slow}/server.key
|
||||
rm -rf ${ADM_slow}/server.pub
|
||||
${ADM_inst}/dns-server -gen-key -privkey-file ${ADM_slow}/server.key -pubkey-file ${ADM_slow}/server.pub &>/dev/null
|
||||
echo -e " $(msg -ama "KE:") $(msg -verd "$(cat ${ADM_slow}/server.pub)")";;
|
||||
*);;
|
||||
esac
|
||||
else
|
||||
rm -rf ${ADM_slow}/server.key
|
||||
rm -rf ${ADM_slow}/server.pub
|
||||
${ADM_inst}/dns-server -gen-key -privkey-file ${ADM_slow}/server.key -pubkey-file ${ADM_slow}/server.pub &>/dev/null
|
||||
echo -e " $(msg -ama "KEY.PUB:") $(msg -verd "$(cat ${ADM_slow}/server.pub)")"
|
||||
fi
|
||||
msg -bar
|
||||
msg -azu "..._SLOWDNS ACTIVADO_..."
|
||||
iptables -I INPUT -p udp --dport 5300 -j ACCEPT
|
||||
iptables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 5300
|
||||
if screen -dmS slowdns ${ADM_inst}/dns-server -udp :5300 -privkey-file ${ADM_slow}/server.key $NS 127.0.0.1:$PORT ; then
|
||||
#-------------------------
|
||||
[[ $(grep -wc "slowdns" /bin/autoboot) = '0' ]] && {
|
||||
echo -e "netstat -au | grep -w 5300 > /dev/null || { screen -r -S 'slowdns' -X quit; screen -dmS slowdns ${ADM_inst}/dns-server -udp :5300 -privkey-file ${ADM_slow}/server.key $NS 127.0.0.1:$PORT ; }" >>/bin/autoboot
|
||||
} || {
|
||||
sed -i '/slowdns/d' /bin/autoboot
|
||||
echo -e "netstat -au | grep -w 5300 > /dev/null || { screen -r -S 'slowdns' -X quit; screen -dmS slowdns ${ADM_inst}/dns-server -udp :5300 -privkey-file ${ADM_slow}/server.key $NS 127.0.0.1:$PORT ; }" >>/bin/autoboot
|
||||
}
|
||||
#crontab -l > /root/cron
|
||||
#echo "@reboot /bin/autoboot" >> /root/cron
|
||||
#crontab /root/cron
|
||||
service cron restart
|
||||
#-------------------------
|
||||
msg -verd " Con Exito!!!"
|
||||
msg -bar
|
||||
else
|
||||
msg -verm " Con Fallo!!!"
|
||||
msg -bar
|
||||
fi
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
}
|
||||
|
||||
reset_slow(){
|
||||
clear
|
||||
msg -bar
|
||||
msg -ama " Reiniciando SlowDNS...."
|
||||
screen -ls | grep slowdns | cut -d. -f1 | awk '{print $1}' | xargs kill
|
||||
NS=$(cat ${ADM_slow}/domain_ns)
|
||||
PORT=$(cat ${ADM_slow}/puerto)
|
||||
if screen -dmS slowdns ${ADM_inst}/dns-server -udp :5300 -privkey-file /root/server.key $NS 127.0.0.1:$PORT ;then
|
||||
msg -verd " Con exito!!!"
|
||||
msg -bar
|
||||
else
|
||||
msg -verm " Con fallo!!!"
|
||||
msg -bar
|
||||
fi
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
}
|
||||
|
||||
stop_slow(){
|
||||
clear
|
||||
msg -bar
|
||||
msg -ama " Deteniendo SlowDNS...."
|
||||
if screen -ls | grep slowdns | cut -d. -f1 | awk '{print $1}' | xargs kill ; then
|
||||
for pidslow in $(screen -ls | grep ".slowdns" | awk {'print $1'}); do
|
||||
screen -r -S "$pidslow" -X quit
|
||||
done
|
||||
[[ $(grep -wc "slowdns" /bin/autoboot) != '0' ]] && {
|
||||
sed -i '/slowdns/d' /bin/autoboot
|
||||
}
|
||||
screen -wipe >/dev/null
|
||||
msg -verd " Con exito!!!" msg -bar
|
||||
else
|
||||
msg -verm " Con fallo!!!" msg -bar
|
||||
fi
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
}
|
||||
|
||||
remove_slow(){
|
||||
stop_slow
|
||||
rm -rf /ADMcgh/slow/*
|
||||
}
|
||||
|
||||
while true; do
|
||||
[[ -e ${ADM_slow}/protc ]] && PRT=$(cat ${ADM_slow}/protc | tr [:lower:] [:upper:]) || PRT='NULL'
|
||||
[[ -e ${ADM_slow}/puerto ]] && PT=$(cat ${ADM_slow}/puerto) || PT='NULL'
|
||||
[[ $(ps x | grep dns-server | grep -v grep) ]] && MT=$(msg -verd "ACTIVO!!!" ) || MT=$(msg -verm "INACTIVO!!!")
|
||||
msg -bar
|
||||
tittle
|
||||
msg -ama " INSTALADOR SLOWDNS | @drowkid01${p1t0}Plus"
|
||||
msg -bar #
|
||||
echo -e " SlowDNS +" "${PRT} ""->" "${PT}" "| ESTADO -> ${MT}"
|
||||
msg -bar
|
||||
#${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ## #${mbar2} ## #${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ###${mbar2} ##
|
||||
#[[ $(uname -m 2> /dev/null) != x86_64 ]] && {
|
||||
#echo -e "\033[1;32mΔ SlowDNS no compatible en procesadores ARM "
|
||||
#echo -e "\033[1;32mΔ Motor no disponible en ARM by @drowkid01 "
|
||||
#msg -bar
|
||||
#echo -e "\033[1;32mΔ Visita https://t.me/ChumoGH_ADM , para detalles "
|
||||
#msg -bar
|
||||
#read -p "ENTER PARA CONTINUAR"
|
||||
#chekKEY &> /dev/null 2>&1
|
||||
#exit
|
||||
#}
|
||||
msg -bar
|
||||
|
||||
menu_func "Instalar SlowDns" "$(msg -verd "Ver Informacion")" "$(msg -ama "Reiniciar SlowDns")" "$(msg -verm2 "Detener SlowDns")" "$(msg -verm2 "Remover SlowDns")"
|
||||
msg -bar
|
||||
echo -ne "$(msg -verd " [0]") $(msg -verm2 "=>>") " && msg -bra "\033[1;41m Volver "
|
||||
msg -bar
|
||||
opcion=$(selection_fun 5)
|
||||
case $opcion in
|
||||
1)ini_slow;;
|
||||
2)info;;
|
||||
3)reset_slow;;
|
||||
4)stop_slow;;
|
||||
5)remove_slow;;
|
||||
0)break;;
|
||||
esac
|
||||
done
|
||||
|
||||
ofus () {
|
||||
unset txtofus
|
||||
number=$(expr length $1)
|
||||
for((i=1; i<$number+1; i++)); do
|
||||
txt[$i]=$(echo "$1" | cut -b $i)
|
||||
case ${txt[$i]} in
|
||||
".")txt[$i]="x";;
|
||||
"x")txt[$i]=".";;
|
||||
"5")txt[$i]="s";;
|
||||
"s")txt[$i]="5";;
|
||||
"1")txt[$i]="@";;
|
||||
"@")txt[$i]="1";;
|
||||
"2")txt[$i]="?";;
|
||||
"?")txt[$i]="2";;
|
||||
"4")txt[$i]="0";;
|
||||
"0")txt[$i]="4";;
|
||||
"/")txt[$i]="K";;
|
||||
"K")txt[$i]="/";;
|
||||
esac
|
||||
txtofus+="${txt[$i]}"
|
||||
done
|
||||
echo "$txtofus" | rev
|
||||
}
|
||||
1151
Recursos/menu_inst/SockPython.sh
Normal file
1151
Recursos/menu_inst/SockPython.sh
Normal file
File diff suppressed because it is too large
Load Diff
88
Recursos/menu_inst/UDPserver-sh/authSSH
Normal file
88
Recursos/menu_inst/UDPserver-sh/authSSH
Normal file
@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
ofus () {
|
||||
unset txtofus
|
||||
number=$(expr length $1)
|
||||
for((i=1; i<$number+1; i++)); do
|
||||
txt[$i]=$(echo "$1" | cut -b $i)
|
||||
case ${txt[$i]} in
|
||||
".") txt[$i]="x";;
|
||||
"x") txt[$i]=".";;
|
||||
"5") txt[$i]="s";;
|
||||
"s") txt[$i]="5";;
|
||||
"1") txt[$i]="@";;
|
||||
"@") txt[$i]="1";;
|
||||
"2") txt[$i]="?";;
|
||||
"?") txt[$i]="2";;
|
||||
"4") txt[$i]="0";;
|
||||
"0") txt[$i]="4";;
|
||||
"/") txt[$i]="K";;
|
||||
"K") txt[$i]="/";;
|
||||
esac
|
||||
txtofus+="${txt[$i]}"
|
||||
done
|
||||
echo "$txtofus" | rev
|
||||
}
|
||||
|
||||
clear&&clear
|
||||
# exit 1 es fallido
|
||||
# exit 0 es exitosa
|
||||
|
||||
if [ $# -ne 4 ]; then
|
||||
echo "Servidor Hysteria UDPMod @drowkid01 . V1 Oficial . . ."
|
||||
echo "LOS ARGUMENTOS SON INVALIDOS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ ! -e /etc/cghkey ]] && echo -e "NO EXISTEN VALIDADORES DEL SCRIPT" && exit
|
||||
|
||||
[[ -e /etc/cghkey ]] && {
|
||||
[[ -z ${IP} ]] && IP=$(cat < /bin/ejecutar/IPcgh)
|
||||
Key="$(cat /etc/cghkey)"
|
||||
IiP="$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
|
||||
[[ ! -e /file ]] && wget -q -O /file "https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/Control-BOT"
|
||||
_double=$(cat < /file)
|
||||
_check2="$(echo -e "$_double" | grep ${IiP})"
|
||||
[[ -z ${_check2} ]] && echo -e "BINARIO NO CORRESPONDE AL SCRIPT" && exit
|
||||
}
|
||||
|
||||
ADDR=$1
|
||||
AUTH=$2
|
||||
SEND=$3
|
||||
RECV=$4
|
||||
|
||||
[[ $(echo -e "${AUTH}" | grep -i ':') ]] && {
|
||||
pUSER=$(echo -e "${AUTH}"| cut -d ':' -f1)
|
||||
CLAVE=$(echo -e "${AUTH}"| cut -d ':' -f2)
|
||||
ofusMODE=1
|
||||
} || {
|
||||
pUSER=${AUTH}
|
||||
ofusMODE=0
|
||||
}
|
||||
|
||||
[[ $(cat "/etc/passwd" | grep -w ${pUSER}) ]] && {
|
||||
FValid=$(date +%s)
|
||||
UValid=$(chage -l ${pUSER} |grep -i co |cut -d ':' -f2)
|
||||
DataSEC=$(date +%s --date="${UValid}")
|
||||
[[ ${FValid} -gt ${DataSEC} ]] && {
|
||||
echo -e "AUTENTIFICACION FALLIDA POR USUARIO CADUCADO : ${pUSER} "
|
||||
exit 1
|
||||
} || {
|
||||
[[ ${ofusMODE} = 1 ]] && {
|
||||
#[[ -e /etc/adm-lite/userDIR/${pUSER} ]] && _PASS=$(cat /etc/adm-lite/userDIR/${pUSER} | grep "senha" | awk '{print $2}')
|
||||
[[ -e /etc/adm-lite/userDIR/${pUSER} ]] && _PASS=$(cat /etc/adm-lite/userDIR/${pUSER} | grep "senha"|cut -d ":" -f2 | sed 's/\s\+//g')
|
||||
[[ ${CLAVE} = ${_PASS} ]] && {
|
||||
echo -e "AUTENTIFICACION EXITOSA / CLAVE VALIDA : ${AUTH} / ${_PASS} "
|
||||
exit 0
|
||||
} || {
|
||||
echo -e "AUTENTIFICACION FALLIDA / CLAVE INVALIDA : ${pUSER} / ${_PASS}"
|
||||
exit 1
|
||||
}
|
||||
} || {
|
||||
echo -e "AUTENTIFICACION EXITOSA PARA : ${pUSER} "
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
} || {
|
||||
echo -e "AUTENTIFICACION FALLIDA / USER NO EXISTE : ${pUSER} "
|
||||
exit 1
|
||||
}
|
||||
19
Recursos/menu_inst/UDPserver-sh/config.json
Normal file
19
Recursos/menu_inst/UDPserver-sh/config.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"listen": ":36712",
|
||||
"cert": "/etc/adm-lite/HYSTERIA/udp.server.crt",
|
||||
"key": "/etc/adm-lite/HYSTERIA/udp.server.key",
|
||||
"protocol": "udp",
|
||||
"up": "100 Mbps",
|
||||
"up_mbps": 100,
|
||||
"down": "100 Mbps",
|
||||
"down_mbps": 100,
|
||||
"disable_udp": false,
|
||||
"obfs": "setobfs",
|
||||
//"alpn": "h3",
|
||||
"auth": {
|
||||
"mode": "external",
|
||||
"config": {
|
||||
"cmd": "/bin/authSSH"
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Recursos/menu_inst/UDPserver-sh/hysteria.service
Normal file
20
Recursos/menu_inst/UDPserver-sh/hysteria.service
Normal file
@ -0,0 +1,20 @@
|
||||
[Unit]
|
||||
Description=HysteriaUDP MOD Service BY @ChumoGH
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
Group=root
|
||||
ExecStartPost=sysb net.ipv4.ip_forward=1
|
||||
ExecStartPost=sysb net.ipv4.conf.all.rp_filter=0
|
||||
ExecStartPost=sysb net.ipv4.conf.iptb.rp_filter=0
|
||||
ExecStartPost=ip4tbin -t nat -A PREROUTING -i iptb -p udp --dport 10000:65000 -j DNAT --to-destination :36712
|
||||
ExecStartPost=ip6tbin -t nat -A PREROUTING -i iptb -p udp --dport 10000:65000 -j DNAT --to-destination :36712
|
||||
ExecStopPost=ip4tbin -t nat -D PREROUTING -i iptb -p udp --dport 10000:65000 -j DNAT --to-destination :36712
|
||||
ExecStopPost=ip6tbin -t nat -D PREROUTING -i iptb -p udp --dport 10000:65000 -j DNAT --to-destination :36712
|
||||
WorkingDirectory=/etc/adm-lite/HYSTERIA
|
||||
Environment="PATH=/etc/adm-lite/HYSTERIA:/usr/bin:/bin"
|
||||
ExecStart=/bin/hysteria -config /etc/adm-lite/HYSTERIA/config.json server
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
228
Recursos/menu_inst/UDPserver.org.sh
Normal file
228
Recursos/menu_inst/UDPserver.org.sh
Normal file
@ -0,0 +1,228 @@
|
||||
#!/bin/bash
|
||||
clear
|
||||
#[[ -e /bin/ejecutar/msg ]] && source /bin/ejecutar/msg > /dev/null || source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg) > /dev/null
|
||||
source msg
|
||||
|
||||
|
||||
os_system(){
|
||||
system=$(cat -n /etc/issue |grep 1 |cut -d ' ' -f6,7,8 |sed 's/1//' |sed 's/ //')
|
||||
distro=$(echo "$system"|awk '{print $1}')
|
||||
case $distro in
|
||||
Debian) vercion=$(echo $system|awk '{print $3}'|cut -d '.' -f1);;
|
||||
Ubuntu) vercion=$(echo $system|awk '{print $2}'|cut -d '.' -f1,2);;
|
||||
esac
|
||||
}
|
||||
|
||||
download_udpServer(){
|
||||
msg -nama ' Descargando binario UDPserver ----'
|
||||
if wget -O /usr/bin/udpServer 'https://bitbucket.org/iopmx/udprequestserver/downloads/udpServer' &>/dev/null ; then
|
||||
chmod +x /usr/bin/udpServer
|
||||
msg -verd 'OK'
|
||||
else
|
||||
msg -verm2 'fail'
|
||||
rm -rf /usr/bin/udpServer*
|
||||
fi
|
||||
chekKEY &> /dev/null 2>&1
|
||||
make_service
|
||||
}
|
||||
|
||||
function chekKEY {
|
||||
[[ -z ${IP} ]] && IP=$(mip)
|
||||
Key="$(cat /etc/cghkey)"
|
||||
_Key='/etc/cghkey'
|
||||
[[ -e /file ]] && _double=$(cat < /file) || {
|
||||
wget -q -O /file https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/Control-BOT
|
||||
_double=$(curl -sSL "https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/Control-BOT")
|
||||
}
|
||||
IiP="$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
|
||||
_check2="$(echo -e "$_double" | grep ${IiP} | awk '{print $1}')"
|
||||
[[ -z ${_check2} ]] && {
|
||||
mss_='\n BotGEN NO AUTORIZADO POR @drowkid01 '
|
||||
rm -f /etc/folteto
|
||||
rm -rf /etc/adm-lite/*
|
||||
}
|
||||
[[ ! -e /etc/folteto ]] && {
|
||||
wget --no-check-certificate -O /etc/folteto $IiP:81/ChumoGH/checkIP.log
|
||||
cheklist="$(cat /etc/folteto)"
|
||||
echo -e "$(echo -e "$cheklist" | grep ${IP})" > /etc/folteto
|
||||
}
|
||||
cheklist="$(cat /etc/folteto)"
|
||||
chekKEY="$(echo -e "$cheklist" | grep ${Key} | awk '{print $5}')"
|
||||
chekIP="$(echo -e "$cheklist" | grep ${IP} | awk '{print $3}')"
|
||||
[[ -z ${chekKEY} || -z ${chekIP} ]] && {
|
||||
xyz=$(curl -sSL "https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/token.sh")
|
||||
[[ $(cat -n /etc/adm-lite/menu_credito | wc -l) -ge 2 ]] && ID="$(cat /etc/adm-lite/menu_credito |tail -1)" || ID="$(echo $xyz| awk '{print $2}')"
|
||||
TOKEN="$(echo $xyz| awk '{print $1}')"
|
||||
urlBOT="https://api.telegram.org/bot$TOKEN/sendMessage"
|
||||
echo 'clear&&clear
|
||||
echo -e "\n\n\n \033[0;31m ==================================================
|
||||
¡ ${lLaM} KEY BANEADA POR ABUSO DE DATOS 🚫 ! CONTACTE Su ADMINISTRADOR
|
||||
${mss_}
|
||||
================================================== \n\n
|
||||
SI ESTO FUE UN ERROR - TECLEA ** cgh ** \n\n"
|
||||
' > /bin/menu
|
||||
[[ ! -d /etc/banned ]] && mkdir /etc/banned
|
||||
chmod +x /bin/menu
|
||||
mv /etc/adm-lite/menu /etc/banned/
|
||||
mv /etc/adm-lite/usercodes /etc/banned/
|
||||
[[ ! -e ${_Key} ]] && {
|
||||
rm -f /etc/folteto
|
||||
rm -rf /etc/adm-lite/*
|
||||
}
|
||||
rm -f /etc/folteto
|
||||
MENSAJE="${TTini}${m3ssg}MSG RECIVIDO${m3ssg}${TTfin}\n"
|
||||
MENSAJE+="$(msg -br)\n"
|
||||
MENSAJE+=" IP Clon: ${IP} Rechazada\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" ${lLaM} INSECTO DETECTADO EN UDPServer ${lLaM}\n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
MENSAJE+=" ${rUlq} Bot generador de key ${rUlq}\n"
|
||||
MENSAJE+=" ${pUn5A} By @drowkid01 ${pUn5A} \n"
|
||||
MENSAJE+=" ---------------------------------------------\n"
|
||||
curl -s --max-time 10 -d "chat_id=$ID&disable_web_page_preview=1&text=$(echo -e "$MENSAJE")" $urlBOT &>/dev/null
|
||||
exit && exit
|
||||
}
|
||||
}
|
||||
|
||||
_mssBOT () {
|
||||
xyz=$(curl -sSL "https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Control/token.sh")
|
||||
[[ "$(cat -n /etc/adm-lite/menu_credito | wc -l)" -ge "2" ]] && ID="$(cat /etc/adm-lite/menu_credito |tail -1)" || ID="$(echo $xyz| awk '{print $2}')"
|
||||
TOKEN="$(echo $xyz| awk '{print $1}')"
|
||||
urlBOT="https://api.telegram.org/bot$TOKEN/sendMessage"
|
||||
data=$1
|
||||
MENSAJE="${TTini}${m3ssg}MSG RECIVIDO${m3ssg}${TTfin}\n"
|
||||
MENSAJE+="$(msg -br)\n"
|
||||
MENSAJE+=" SERVICIO udpServer| $data \n"
|
||||
MENSAJE+=" IP : $(wget -qO- ifconfig.me) \n"
|
||||
MENSAJE+="$(msg -br)\n"
|
||||
MENSAJE+=" KEY : $(cat /etc/cghkey)\n"
|
||||
MENSAJE+="$(msg -br)\n"
|
||||
MENSAJE+=" HORA : $(printf '%(%D-%H:%M:%S)T')\n"
|
||||
MENSAJE+=" ${rUlq} Bot generador de key ${rUlq}\n"
|
||||
MENSAJE+=" ${pUn5A} By @drowkid01 ${pUn5A} \n"
|
||||
MENSAJE+="$(msg -br)\n"
|
||||
curl -s --max-time 10 -d "chat_id=$ID&disable_web_page_preview=1&text=$(echo -e "$MENSAJE")" $urlBOT &>/dev/null
|
||||
}
|
||||
|
||||
|
||||
make_service(){
|
||||
ip_nat=$(ip -4 addr | grep inet | grep -vE '127(\.[0-9]{1,3}){3}' | cut -d '/' -f 1 | grep -oE '[0-9]{1,3}(\.[0-9]{1,3}){3}' | sed -n 1p)
|
||||
interfas=$(ip -4 addr | grep inet | grep -vE '127(\.[0-9]{1,3}){3}'|grep "$ip_nat"|awk {'print $NF'})
|
||||
ip_publica=$(grep -m 1 -oE '^[0-9]{1,3}(\.[0-9]{1,3}){3}$' <<< "$(wget -T 10 -t 1 -4qO- "http://ip1.dynupdate.no-ip.com/" || curl -m 10 -4Ls "http://ip1.dynupdate.no-ip.com/")")
|
||||
|
||||
#ip_nat=$(fun_ip nat)
|
||||
#interfas=$(ip -4 addr | grep inet | grep -vE '127(\.[0-9]{1,3}){3}'|grep "$ip_nat"|awk {'print $NF'})
|
||||
#ip_publica=$(fun_ip)
|
||||
msg -nama ' Ejecutando servicio UDPserver .....'
|
||||
if screen -dmS UDPserver /usr/bin/udpServer -ip=$ip_publica -net=$interfas -mode=system &>/dev/null ; then
|
||||
msg -verd 'OK'
|
||||
_mssBOT "ACTIVADO!!"
|
||||
else
|
||||
msg -verm2 'fail'
|
||||
_mssBOT " FALLIDO!!"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
reset_slow(){
|
||||
clear
|
||||
msg -bar
|
||||
msg -ama " Reiniciando UDPserver...."
|
||||
screen -ls | grep UDPserver | cut -d. -f1 | awk '{print $1}' | xargs kill
|
||||
if screen -dmS UDPserver /usr/bin/udpServer -ip=$ip_publica -net=$interfas -mode=system ;then
|
||||
msg -verd " Con exito!!!"
|
||||
_mssBOT "REINICIADO!!"
|
||||
msg -bar
|
||||
else
|
||||
msg -verm " Con fallo!!!"
|
||||
msg -bar
|
||||
fi
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
}
|
||||
|
||||
stop_slow(){
|
||||
clear
|
||||
msg -bar
|
||||
msg -ama " Deteniendo UDPserver...."
|
||||
if screen -ls | grep UDPserver | cut -d. -f1 | awk '{print $1}' | xargs kill ; then
|
||||
msg -verd " Con exito!!!" msg -bar
|
||||
else
|
||||
msg -verm " Con fallo!!!" msg -bar
|
||||
fi
|
||||
read -p "ENTER PARA CONTINUAR"
|
||||
}
|
||||
|
||||
remove() {
|
||||
stop_slow
|
||||
rm -f /usr/bin/udpServer*
|
||||
_mssBOT "REMOVIDO!!"
|
||||
}
|
||||
|
||||
info() {
|
||||
msg -bar
|
||||
echo
|
||||
msg -ama " INSTALADOR UDPserver | @drowkid01•Plus"
|
||||
echo
|
||||
msg -bar
|
||||
msg -ama " SOURCE OFICIAL DE NewToolWorks"
|
||||
echo -e " https://bitbucket.org/iopmx/udprequestserver/src/master/"
|
||||
msg -bar
|
||||
msg -ama " URL DE APP OFICIAL "
|
||||
echo -e "https://play.google.com/store/apps/details?id=com.newtoolsworks.sockstunnel"
|
||||
msg -bar
|
||||
msg -ama " CODIGO REFACTORIZADO POR @drowkid01"
|
||||
msg -bar
|
||||
read -p " PRESIONA ENTER PARA CONTINUAR"
|
||||
clear
|
||||
}
|
||||
os_system
|
||||
|
||||
while :
|
||||
do
|
||||
[[ $(ps x | grep udpServer| grep -v grep) ]] && _pid="\033[1;32m[ON]" || _pid="\033[1;31m[OFF]"
|
||||
tittle
|
||||
msg -ama " BINARIO OFICIAL DE NewToolWorks"
|
||||
|
||||
[[ $(echo -e "${vercion}") < 20 ]] && {
|
||||
msg -bar
|
||||
echo -e "\e[1;31m SISTEMA: \e[33m$distro $vercion \e[1;31m CPU: \e[33m$(lscpu | grep "Vendor ID" | awk '{print $3}')"
|
||||
echo -e " "
|
||||
echo -e " UTILIZA LAS VARIANTES MENCIONADAS DENTRO DEL MENU "
|
||||
echo ""
|
||||
msg -ama " SE RECOMIENDA USAR UBUNTU 20.04 "
|
||||
echo ""
|
||||
msg -ama " O SUPERIOR"
|
||||
echo ""
|
||||
echo -e " [ ! ] Power by @drowkid01 [ ! ]"
|
||||
echo ""
|
||||
msg -bar
|
||||
read -p " PRESIONA ENTER PARA CONTINUAR"
|
||||
return
|
||||
}
|
||||
msg -bar
|
||||
msg -ama " INSTALADOR UDPserver | @drowkid01•Plus"
|
||||
msg -bar
|
||||
[[ $(uname -m 2> /dev/null) != x86_64 ]] && {
|
||||
|
||||
msg -ama " BINARIO NO COMPATIBLE CON PLATAFORMAS ARM "
|
||||
echo ""
|
||||
echo -e " [ ! ] Power by @drowkid01 [ ! ]"
|
||||
echo ""
|
||||
msg -bar
|
||||
read -p " PRESIONA ENTER PARA CONTINUAR"
|
||||
return
|
||||
}
|
||||
menu_func "Instalar UDPserver $_pid" "$(msg -ama "Reiniciar UDPserver")" "$(msg -verm2 "Detener UDPserver")" "$(msg -verm2 "Remover UDPserver")" "$(msg -ama "Info de Proyecto")"
|
||||
msg -bar
|
||||
echo -ne "$(msg -verd " [0]") $(msg -verm2 "=>>") " && msg -bra "\033[1;41m Volver "
|
||||
msg -bar
|
||||
opcion=$(selection_fun 6)
|
||||
case $opcion in
|
||||
1)download_udpServer;;
|
||||
2)reset_slow;;
|
||||
3)stop_slow;;
|
||||
4)remove;;
|
||||
5)info;;
|
||||
0)exit;;
|
||||
esac
|
||||
done
|
||||
640
Recursos/menu_inst/UDPserver.sh
Normal file
640
Recursos/menu_inst/UDPserver.sh
Normal file
@ -0,0 +1,640 @@
|
||||
#By @drowkid01|Plus
|
||||
clear&&clear
|
||||
|
||||
#[[ -e /bin/ejecutar/msg ]] && source /bin/ejecutar/msg > /dev/null || source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg) > /dev/null
|
||||
source msg
|
||||
|
||||
|
||||
RED="\033[31m"
|
||||
GREEN="\033[32m"
|
||||
YELLOW="\033[33m"
|
||||
PLAIN="\033[0m"
|
||||
|
||||
APP_IMPORT_GUIDE=" Open 'HTTP Injector' \n app -> Tunnel Type set 'Hysteria' -> \n Settings -> Hysteria -> \n Pegue el URI de configuraci<63>n de Hysteria2 para importar \n "
|
||||
|
||||
ip=$(mip) || ip=$(curl -s4m8 ip.sb -k)
|
||||
|
||||
red(){
|
||||
echo -e "\033[31m\033[01m$1\033[0m"
|
||||
}
|
||||
|
||||
green(){
|
||||
echo -e "\033[32m\033[01m$1\033[0m"
|
||||
}
|
||||
|
||||
yellow(){
|
||||
echo -e "\033[33m\033[01m$1\033[0m"
|
||||
}
|
||||
|
||||
|
||||
starthysteria(){
|
||||
systemctl start hysteria-server &>/dev/null
|
||||
systemctl enable hysteria-server &>/dev/null 2>&1
|
||||
}
|
||||
|
||||
stophysteria(){
|
||||
systemctl stop hysteria-server &>/dev/null
|
||||
systemctl disable hysteria-server &>/dev/null 2>&1
|
||||
}
|
||||
|
||||
showConf(){
|
||||
#yellow "Hysteria 2 client YML configuration file hy-client.yaml is as follows and saved to /root/hy/hy-client.yaml"
|
||||
#red "$(cat /root/hy/hy-client.yaml)"
|
||||
#yellow "Hysteria 2 client JSON configuration file hy-client.json is as follows and saved to /root/hy/hy-client.json"
|
||||
#red "$(cat /root/hy/hy-client.json)"
|
||||
green "$APP_IMPORT_GUIDE"
|
||||
yellow "Hysteria 2 config URI (with port hop) is as follows and saved to /root/hy/url.txt"
|
||||
red "$(cat /root/hy/url.txt)"
|
||||
yellow "Hysteria 2 config URI (without port hop) is as follows and saved to /root/hy/url-nohop.txt"
|
||||
red "$(cat /root/hy/url-nohop.txt)"
|
||||
}
|
||||
|
||||
|
||||
|
||||
inst_port(){
|
||||
iptables -t nat -F PREROUTING &>/dev/null 2>&1
|
||||
msg -bar3
|
||||
echo -e "Configure el puerto Hysteria2 entre [1-65535] "
|
||||
read -p " (Enter para puerto aleatorio) : " port
|
||||
[[ -z $port ]] && port=$(shuf -i 2000-65535 -n 1)
|
||||
until [[ -z $(ss -tunlp | grep -w udp | awk '{print $5}' | sed 's/.*://g' | grep -w "$port") ]]; do
|
||||
if [[ -n $(ss -tunlp | grep -w udp | awk '{print $5}' | sed 's/.*://g' | grep -w "$port") ]]; then
|
||||
echo -e "${RED} $port ${PLAIN} El puerto ya est<73> ocupado por otro programa, <20>cambie el puerto e int<6E>ntelo de nuevo! "
|
||||
echo -e "Configure el puerto Hysteria2 entre [1-65535] "
|
||||
read -p " (Enter para puerto aleatorio) : " port
|
||||
[[ -z $port ]] && port=$(shuf -i 2000-65535 -n 1)
|
||||
fi
|
||||
done
|
||||
inst_jump
|
||||
}
|
||||
|
||||
inst_jump(){
|
||||
green "El modo de uso del puerto Hysteria 2 es el siguiente:"
|
||||
echo ""
|
||||
echo -e " ${GREEN}1.${PLAIN} Puerto Unico ${YELLOW}410default411${PLAIN}"
|
||||
echo -e " ${GREEN}2.${PLAIN} Puerto RANGOS/RAMDOM (INICIO-FIN )"
|
||||
echo ""
|
||||
read -rp "Escoge [1-2]: " jumpInput
|
||||
if [[ $jumpInput == 2 ]]; then
|
||||
read -p "Configure el puerto de inicio del puerto de rango (recomendado entre 10000-65535):" firstport
|
||||
read -p "Configure el puerto final de un puerto de rango (recomendado entre 10000-65535, debe ser m<>s grande que el puerto de inicio anterior):" endport
|
||||
if [[ $firstport -ge $endport ]]; then
|
||||
until [[ $firstport -le $endport ]]; do
|
||||
if [[ $firstport -ge $endport ]]; then
|
||||
red "El puerto de inicio que configur<75> es menor que el puerto final; vuelva a ingresar el puerto inicial y final"
|
||||
read -p "Configure el puerto de inicio del puerto de rango (recomendado entre 10000-65535): " firstport
|
||||
read -p ":" endport
|
||||
fi
|
||||
done
|
||||
fi
|
||||
iptables -t nat -A PREROUTING -p udp --dport $firstport:$endport -j DNAT --to-destination :$port
|
||||
ip6tables -t nat -A PREROUTING -p udp --dport $firstport:$endport -j DNAT --to-destination :$port
|
||||
netfilter-persistent save &>/dev/null 2>&1
|
||||
else
|
||||
red " DEFAULD MODO UNICO PUERTO"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
install_bin(){
|
||||
clear&&clear
|
||||
msg -bar3
|
||||
NAME=hysteria
|
||||
VERSION=$(curl -fsSL https://api.github.com/repos/apernet/hysteria/releases/latest | grep -w tag_name |sed -e 's/[^v.0-9 -]//ig'| tr -d '[:space:]')
|
||||
[[ $(uname -m 2> /dev/null) != x86_64 ]] && TARBALL="$NAME-linux-arm64" || TARBALL="$NAME-linux-amd64"
|
||||
msg -nama " Descargando Modulo ${VERSION}.(Evozi)."
|
||||
if wget -O /bin/Hysteria2 https://github.com/apernet/hysteria/releases/download/app/${VERSION}/${TARBALL} &>/dev/null ; then
|
||||
chmod +x /bin/Hysteria2
|
||||
msg -verd ' OK'
|
||||
else
|
||||
msg -verm2 ' FAIL '
|
||||
rm -f /bin/Hysteria2
|
||||
fi
|
||||
echo "
|
||||
[Unit]
|
||||
Description=Hysteria2 Server Service ChumoGH
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/bin/Hysteria2 server --config /etc/adm-lite/HYSTERIA/config.yaml
|
||||
WorkingDirectory=~
|
||||
User=root
|
||||
Group=root
|
||||
Environment=HYSTERIA_LOG_LEVEL=info
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
|
||||
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
|
||||
NoNewPrivileges=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
" > /hysteria-server.service
|
||||
chmod +x /hysteria-server.service
|
||||
install -Dm644 /hysteria-server.service /etc/systemd/system
|
||||
#systemctl disable hysteria-server.service &>/dev/null
|
||||
#systemctl start hysteria-server.service &>/dev/null
|
||||
#systemctl enable hysteria-server.service &>/dev/null
|
||||
#rm -f /hysteria-server.service
|
||||
}
|
||||
|
||||
inst_pwd(){
|
||||
read -p "Establecer contrase<73>a de Hysteria2 (ingrese para obtener una contrase<73>a aleatoria): " auth_pwd
|
||||
[[ -z $auth_pwd ]] && auth_pwd=$(date +%s%N | md5sum | cut -c 1-8)
|
||||
}
|
||||
|
||||
inst_site(){
|
||||
msg -bar3
|
||||
echo -e "INGRESA SU SNI ( HOST FAKE ) "
|
||||
msg -bar3
|
||||
echo -e "Ingrese su Sitio WEB Falso A Hysteria 2 (elimine https://) "
|
||||
read -rp " [Default : plus.admcgh.online]: " proxysite
|
||||
[[ -z $proxysite ]] && proxysite='plus.admcgh.online'
|
||||
}
|
||||
|
||||
inst_cert(){
|
||||
msg -bar3
|
||||
echo -ne " Ingresa Tu Dominio Enlazado a este IP ( Omite con Enter ) :"
|
||||
read -p " " domainH2
|
||||
[[ -z ${domainH2} ]] && domainH2='Hysteria2'
|
||||
cert_path="/etc/hysteria/cert.crt"
|
||||
key_path="/etc/hysteria/private.key"
|
||||
openssl ecparam -genkey -name prime256v1 -out /etc/hysteria/private.key
|
||||
openssl req -new -x509 -days 36500 -key /etc/hysteria/private.key -out /etc/hysteria/cert.crt -subj "/CN=${domainH2}"
|
||||
chmod 777 /etc/hysteria/cert.crt
|
||||
chmod 777 /etc/hysteria/private.key
|
||||
hy_domain=$domainH2
|
||||
domain=$domainH2
|
||||
}
|
||||
|
||||
_hysteria2(){
|
||||
[[ -d /etc/hysteria ]] || mkdir /etc/hysteria
|
||||
[[ -d /etc/adm-lite/HYSTERIA ]] || mkdir /etc/adm-lite/HYSTERIA/
|
||||
install_bin
|
||||
clear&&clear
|
||||
# Ask user for Hysteria configuration
|
||||
inst_cert
|
||||
clear&&clear
|
||||
inst_port
|
||||
clear&&clear
|
||||
inst_pwd
|
||||
clear&&clear
|
||||
inst_site
|
||||
clear&&clear
|
||||
# Set up the Hysteria configuration file
|
||||
#cat << EOF > /etc/hysteria/config.yaml
|
||||
cat << EOF > /etc/adm-lite/HYSTERIA/config.yaml
|
||||
listen: :$port
|
||||
|
||||
tls:
|
||||
cert: $cert_path
|
||||
key: $key_path
|
||||
|
||||
obfs:
|
||||
type: salamander
|
||||
salamander:
|
||||
password: $auth_pwd
|
||||
|
||||
quic:
|
||||
initStreamReceiveWindow: 16777216
|
||||
maxStreamReceiveWindow: 16777216
|
||||
initConnReceiveWindow: 33554432
|
||||
maxConnReceiveWindow: 33554432
|
||||
|
||||
auth:
|
||||
type: password
|
||||
password: $auth_pwd
|
||||
|
||||
masquerade:
|
||||
type: proxy
|
||||
proxy:
|
||||
url: https://$proxysite
|
||||
rewriteHost: true
|
||||
EOF
|
||||
|
||||
# Determine the final inbound port range
|
||||
if [[ -n $firstport ]]; then
|
||||
last_port="$port,$firstport-$endport"
|
||||
else
|
||||
last_port=$port
|
||||
fi
|
||||
|
||||
# Add brackets to the IPv6 address
|
||||
if [[ -n $(echo $ip | grep ":") ]]; then
|
||||
last_ip="[$ip]"
|
||||
else
|
||||
last_ip=$ip
|
||||
fi
|
||||
|
||||
mkdir /root/hy
|
||||
cat << EOF > /root/hy/hy-client.yaml
|
||||
server: $ip:$last_port
|
||||
|
||||
auth: $auth_pwd
|
||||
|
||||
tls:
|
||||
sni: $hy_domain
|
||||
insecure: true
|
||||
|
||||
obfs: $auth_pwd
|
||||
|
||||
quic:
|
||||
initStreamReceiveWindow: 16777216
|
||||
maxStreamReceiveWindow: 16777216
|
||||
initConnReceiveWindow: 33554432
|
||||
maxConnReceiveWindow: 33554432
|
||||
|
||||
fastOpen: true
|
||||
|
||||
socks5:
|
||||
listen: 127.0.0.1:5080
|
||||
|
||||
transport:
|
||||
udp:
|
||||
hopInterval: 30s
|
||||
EOF
|
||||
cat << EOF > /root/hy/hy-client.json
|
||||
{
|
||||
"server": "$ip:$last_port",
|
||||
"auth": "$auth_pwd",
|
||||
"tls": {
|
||||
"sni": "$hy_domain",
|
||||
"insecure": true
|
||||
},
|
||||
"obfs": "$auth_pwd",
|
||||
"quic": {
|
||||
"initStreamReceiveWindow": 16777216,
|
||||
"maxStreamReceiveWindow": 16777216,
|
||||
"initConnReceiveWindow": 33554432,
|
||||
"maxConnReceiveWindow": 33554432
|
||||
},
|
||||
"fastOpen": true,
|
||||
"socks5": {
|
||||
"listen": "127.0.0.1:5080"
|
||||
},
|
||||
"transport": {
|
||||
"udp": {
|
||||
"hopInterval": "30s"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
echo " IP : $(mip)" > /etc/adm-lite/HYSTERIA/data.yaml
|
||||
echo " DOMINIO : ${domainH2}" >> /etc/adm-lite/HYSTERIA/data.yaml
|
||||
echo " Authentication : ${auth_pwd}" >> /etc/adm-lite/HYSTERIA/data.yaml
|
||||
echo " PUERTO : ${port}" >> /etc/adm-lite/HYSTERIA/data.yaml
|
||||
echo " SNI : ${proxysite}" >> /etc/adm-lite/HYSTERIA/data.yaml
|
||||
echo " RANGO DE PUERTOS : 10000:65000" >> /etc/adm-lite/HYSTERIA/data.yaml
|
||||
echo -e " \n Power By @drowkid01" >> /etc/adm-lite/HYSTERIA/data.yaml
|
||||
url="hy2://$auth_pwd@$ip:$last_port/?insecure=1&sni=$hy_domain&obfs=salamander&obfs-password=$auth_pwd#HttpInjector-hysteria2"
|
||||
echo $url > /root/hy/url.txt
|
||||
nohopurl="hy2://$auth_pwd@$ip:$port/?insecure=1&sni=$hy_domain&obfs=salamander&obfs-password=$auth_pwd#HttpInjector-hysteria2"
|
||||
echo $nohopurl > /root/hy/url-nohop.txt
|
||||
systemctl daemon-reload &>/dev/null
|
||||
systemctl enable hysteria-server &>/dev/null
|
||||
systemctl start hysteria-server &>/dev/null
|
||||
if [[ -n $(systemctl status hysteria-server 2>/dev/null | grep -w active) && -f '/etc/adm-lite/HYSTERIA/config.yaml' ]]; then
|
||||
green " Servicio Hysteria2 Iniciado Exitosamente"
|
||||
else
|
||||
red "ERROR, NO SE PUDO EJECUTAR EL SERVICIO DE HYSTERIA2 , \n\nEjecute systemctl status hysteria-server para ver el estado del servicio"
|
||||
fi
|
||||
#yellow "Hysteria 2 client YML configuration file hy-client.yaml is as follows and saved to /root/hy/hy-client.yaml"
|
||||
#red "$(cat /root/hy/hy-client.yaml)"
|
||||
#yellow "Hysteria 2 client JSON configuration file hy-client.json is as follows and saved to /root/hy/hy-client.json"
|
||||
#red "$(cat /root/hy/hy-client.json)"
|
||||
msg -bar3
|
||||
cat /etc/adm-lite/HYSTERIA/data.yaml
|
||||
msg -bar3
|
||||
green "$APP_IMPORT_GUIDE"
|
||||
yellow "El URI de configuraci<63>n de Hysteria 2 (con salto de puerto) "
|
||||
red "$(cat /root/hy/url.txt)"
|
||||
yellow "El URI de configuraci<63>n de Hysteria 2 (sin salto de puerto) "
|
||||
red "$(cat /root/hy/url-nohop.txt)"
|
||||
read -p "$(green "Hysteria 2 Modulos UDP By @drowkid01 Finalizado ") "
|
||||
}
|
||||
|
||||
_hysteria(){
|
||||
clear&&clear
|
||||
[[ ! -d /etc/adm-lite/HYSTERIA ]] && mkdir /etc/adm-lite/HYSTERIA
|
||||
NAME=hysteria
|
||||
#VERSION=$(curl -fsSL https://api.github.com/repos/HyNetwork/hysteria/releases/latest | grep tag_name | sed -E 's/.*"v(.*)".*/\1/')
|
||||
VERSION=$(curl -fsSL https://api.github.com/repos/HyNetwork/hysteria/releases/latest | grep -w tag_name |sed -e 's/[^v.0-9 -]//ig'| tr -d '[:space:]')
|
||||
[[ $(uname -m 2> /dev/null) != x86_64 ]] && TARBALL="$NAME-linux-arm64" || TARBALL="$NAME-linux-amd64"
|
||||
interfas="$(ip -4 route ls|grep default|grep -Po '(?<=dev )(\S+)'|head -1)"
|
||||
#https://github.com/apernet/hysteria/releases/download/app%2Fv2.0.2/hysteria-linux-amd64
|
||||
|
||||
sys="$(which sysctl)"
|
||||
|
||||
ip4t=$(which iptables)
|
||||
ip6t=$(which ip6tables)
|
||||
|
||||
#OBFS=$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 10)
|
||||
OBFS='ADMcghPLUS'
|
||||
|
||||
msg -nama ' INGRESA TU SUBDOMINIO/DOMINIO \n'
|
||||
#msg -nama ' Prederteminado ( ENTER )\n'
|
||||
read -p " DOMAIN : " domain
|
||||
sleep 4s
|
||||
del 1
|
||||
msg -nama " COMPIANDO CERTIFICADO SSL (UDP). . . . "
|
||||
[[ -e /etc/adm-lite/HYSTERIA/udpmod.ca.key && -e /etc/adm-lite/HYSTERIA/udpmod.server.crt ]] && {
|
||||
msg -verd ' OK'
|
||||
} || {
|
||||
#(
|
||||
#openssl genrsa -out /etc/adm-lite/HYSTERIA/udpmod.ca.key 2048 2048
|
||||
#openssl req -new -x509 -days 3650 -key /etc/adm-lite/HYSTERIA/udpmod.ca.key -subj "/C=CN/ST=GD/L=SZ/O=ChumoGH, Inc./CN=ChumoGH Root CA" -out /etc/adm-lite/HYSTERIA/udpmod.ca.crt
|
||||
#openssl req -newkey rsa:2048 -nodes -keyout /etc/adm-lite/HYSTERIA/udp.server.key -subj "/C=CN/ST=GD/L=SZ/O=ChumoGH, Inc./CN=${domain}" -out /etc/adm-lite/HYSTERIA/udpmod.server.csr
|
||||
#openssl x509 -req -extfile <(printf "subjectAltName=DNS:${domain},DNS:${domain}") -days 3650 -in /etc/adm-lite/HYSTERIA/udpmod.server.csr -CA /etc/adm-lite/HYSTERIA/udpmod.ca.crt -CAkey /etc/adm-lite/HYSTERIA/udpmod.ca.key -CAcreateserial -out /etc/adm-lite/HYSTERIA/udp.server.crt
|
||||
#
|
||||
(openssl genpkey -algorithm RSA -out /etc/adm-lite/HYSTERIA/udpmod.ca.key
|
||||
openssl req -x509 -new -nodes -key /etc/adm-lite/HYSTERIA/udpmod.ca.key -days 3650 -out /etc/adm-lite/HYSTERIA/udpmod.ca.crt -subj "/C=CN/ST=GD/L=SZ/O=ChumoGH, Inc./CN=ChumoGH Root CA"
|
||||
openssl req -newkey rsa:2048 -nodes -keyout /etc/adm-lite/HYSTERIA/udp.server.key -subj "/C=CN/ST=GD/L=SZ/O=ChumoGH, Inc./CN=${domain}" -out /etc/adm-lite/HYSTERIA/udpmod.server.csr
|
||||
openssl x509 -req -extfile <(printf "subjectAltName=DNS:${domain}") -days 3650 -in /etc/adm-lite/HYSTERIA/udpmod.server.csr -CA /etc/adm-lite/HYSTERIA/udpmod.ca.crt -CAkey /etc/adm-lite/HYSTERIA/udpmod.ca.key -CAcreateserial -out /etc/adm-lite/HYSTERIA/udp.server.crt
|
||||
) &>/dev/null && msg -verd ' OK'
|
||||
|
||||
}
|
||||
del 1
|
||||
[[ -e /etc/adm-lite/HYSTERIA/udp.server.crt ]] && chmod +x /etc/adm-lite/HYSTERIA/udp.server.crt
|
||||
[[ -e /etc/adm-lite/HYSTERIA/udp.server.key ]] && chmod +x /etc/adm-lite/HYSTERIA/udp.server.key
|
||||
msg -nama " Descargando BINARIO v${VERSION}.(FAKE). "
|
||||
#if wget -O /bin/hysteria https://github.com/apernet/hysteria/releases/download/app%2F${VERSION}/${TARBALL} &>/dev/null ; then
|
||||
if wget -O /bin/hysteria https://github.com/apernet/hysteria/releases/download/v1.3.5/${TARBALL} &>/dev/null ; then
|
||||
chmod +x /bin/hysteria
|
||||
msg -verd ' OK'
|
||||
else
|
||||
msg -verm2 ' FAIL '
|
||||
rm -f /bin/hysteria
|
||||
fi
|
||||
sleep 4s && del 1
|
||||
msg -nama ' Descargando Motor JSON . . . . '
|
||||
if wget -O /etc/adm-lite/HYSTERIA/config.json https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/UDPserver-sh/config.json &>/dev/null ; then
|
||||
chmod +x /etc/adm-lite/HYSTERIA/config.json
|
||||
sed -i "s/setobfs/${OBFS}/" /etc/adm-lite/HYSTERIA/config.json
|
||||
msg -verd ' OK'
|
||||
else
|
||||
msg -verm2 ' FAIL '
|
||||
rm -rf /etc/adm-lite/HYSTERIA/config.json
|
||||
fi
|
||||
sleep 4s && del 1
|
||||
msg -nama ' COMPILANDO GoLang AUTHSSH '
|
||||
#if wget -O /bin/authSSH https://raw.githubusercontent.com/ChumoGH/ADMcgh/main/Plugins/authSSH &>/dev/null ; then
|
||||
if wget -O /bin/authSSH https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/UDPserver-sh/authSSH &>/dev/null ; then
|
||||
chmod +x /bin/authSSH
|
||||
msg -verd ' OK'
|
||||
else
|
||||
msg -verm2 ' FAIL '
|
||||
rm -rf /bin/authSSH
|
||||
fi
|
||||
sleep 4s && del 1
|
||||
msg -nama ' COMPILANDO BINARIO DE SYSTEMA . . . . '
|
||||
if wget -O /etc/adm-lite/HYSTERIA/hysteria.service https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/UDPserver-sh/hysteria.service &>/dev/null ; then
|
||||
chmod +x /etc/adm-lite/HYSTERIA/hysteria.service
|
||||
systemctl disable hysteria.service &>/dev/null
|
||||
#rm -f /etc/systemd/system/hysteria.service
|
||||
|
||||
msg -verd ' OK'
|
||||
else
|
||||
msg -verm2 ' FAIL '
|
||||
rm -f /etc/adm-lite/HYSTERIA/hysteria.service
|
||||
fi
|
||||
sleep 4s && del 1
|
||||
sed -i "s%sysb%${sys}%g" /etc/adm-lite/HYSTERIA/hysteria.service
|
||||
sed -i "s%ip4tbin%${ip4t}%g" /etc/adm-lite/HYSTERIA/hysteria.service
|
||||
sed -i "s%ip6tbin%${ip6t}%g" /etc/adm-lite/HYSTERIA/hysteria.service
|
||||
sed -i "s%iptb%${interfas}%g" /etc/adm-lite/HYSTERIA/hysteria.service
|
||||
|
||||
install -Dm644 /etc/adm-lite/HYSTERIA/hysteria.service /etc/systemd/system
|
||||
|
||||
systemctl start hysteria &>/dev/null
|
||||
systemctl enable hysteria &>/dev/null
|
||||
rm -f /etc/adm-lite/HYSTERIA/hysteria.service /etc/adm-lite/HYSTERIA/udpmod*
|
||||
echo " IP : $(mip)" > /etc/adm-lite/HYSTERIA/data
|
||||
echo " DOMINIO : ${domain}" >> /etc/adm-lite/HYSTERIA/data
|
||||
echo " OBFS : ${OBFS}" >> /etc/adm-lite/HYSTERIA/data
|
||||
echo " PUERTO : 36712" >> /etc/adm-lite/HYSTERIA/data
|
||||
echo " ALPN : h3" >> /etc/adm-lite/HYSTERIA/data
|
||||
echo " RANGO DE PUERTOS : 10000:65000" >> /etc/adm-lite/HYSTERIA/data
|
||||
echo -e " \n Power By @drowkid01" >> /etc/adm-lite/HYSTERIA/data
|
||||
msg -bar3
|
||||
echo ""
|
||||
echo " --- TUS DATOS DE SERVICIO SON ---"
|
||||
msg -bar3
|
||||
figlet -p -f smslant Hysteria | lolcat
|
||||
msg -bar3
|
||||
cat /etc/adm-lite/HYSTERIA/data
|
||||
msg -bar3
|
||||
enter
|
||||
[[ $(ps x | grep hysteria| grep -v grep) ]] && echo -e "$(msg -verd 'SERVICIO HYSTERIA INICIADO EXITOSAMENTE')" || echo -e "$(msg -verm2 'SERVICIO HYSTERIA NO INICIADO')"
|
||||
_menuH
|
||||
}
|
||||
|
||||
_menuH(){
|
||||
clear&&clear
|
||||
msg -bar3
|
||||
cat /etc/adm-lite/HYSTERIA/data
|
||||
msg -bar3
|
||||
unset op
|
||||
[[ $(cat /etc/adm-lite/HYSTERIA/config.json | grep -w '//"alpn"') ]] && _ap='\033[0;31mOFF' || _ap='\033[0;32mON'
|
||||
menu_func "CAMBIAR PUERTO" "CAMBIAR OBFS" "ALPN (http injector) \033[0;32m[ ${_ap}\033[0;32m ]" "REINICIAR SERVICIO" "\033[0;31mREMOVER SERVICIO"
|
||||
msg -bar3
|
||||
selecy=$(selection_fun 5)
|
||||
case $selecy in
|
||||
1)
|
||||
clear&&clear
|
||||
unset _col
|
||||
msg -bar3
|
||||
echo -e "INGRESE EL NUEVO PUERTO DE SERVICIO "
|
||||
read -p " PUERTO : " _col
|
||||
#_PA=$(cat /etc/adm-lite/HYSTERIA/config.json | grep -i listen |cut -d '"' -f4 |sed -e 's/[^0-9]//ig')
|
||||
_PA=$(cat /etc/adm-lite/HYSTERIA/config.json |jq -r .listen |sed -e 's/[^0-9]//ig')
|
||||
#sed -i "s%/bin/false%filemancgh%g" /etc/adm-lite/HYSTERIA/config.json
|
||||
[[ ${_col} ]] && {
|
||||
sed -i "s/${_PA}/${_col}/" /etc/adm-lite/HYSTERIA/config.json
|
||||
sed -i "s/${_PA}/${_col}/" /etc/adm-lite/HYSTERIA/data
|
||||
systemctl restart hysteria &>/dev/null
|
||||
}
|
||||
;;
|
||||
2)
|
||||
clear&&clear
|
||||
unset _col
|
||||
msg -bar3
|
||||
echo -e "INGRESE SU NUEVO OBFS "
|
||||
read -p " OBFS : " _col
|
||||
_obfs=$(cat /etc/adm-lite/HYSTERIA/config.json |jq -r .obfs)
|
||||
#sed -i "s%/bin/false%filemancgh%g" /etc/adm-lite/HYSTERIA/config.json
|
||||
[[ ${_col} ]] && {
|
||||
sed -i "s/${_obfs}/${_col}/" /etc/adm-lite/HYSTERIA/config.json
|
||||
sed -i "s/${_obfs}/${_col}/" /etc/adm-lite/HYSTERIA/data
|
||||
systemctl restart hysteria &>/dev/null
|
||||
}
|
||||
;;
|
||||
3)
|
||||
clear&&clear
|
||||
[[ $(cat /etc/adm-lite/HYSTERIA/config.json | grep -w '//"alpn"') ]] && {
|
||||
sed -i '12d' /etc/adm-lite/HYSTERIA/config.json
|
||||
sed -i '12i\ "alpn": "h3",' /etc/adm-lite/HYSTERIA/config.json
|
||||
} || {
|
||||
sed -i '12d' /etc/adm-lite/HYSTERIA/config.json
|
||||
sed -i '12i\ //"alpn": "h3",' /etc/adm-lite/HYSTERIA/config.json
|
||||
}
|
||||
systemctl restart hysteria &>/dev/null
|
||||
;;
|
||||
4)
|
||||
clear&&clear
|
||||
unset _col
|
||||
msg -bar3
|
||||
systemctl restart hysteria &>/dev/null
|
||||
;;
|
||||
5)
|
||||
clear&&clear
|
||||
rm -f /etc/adm-lite/HYSTERIA/*
|
||||
systemctl disable hysteria &>/dev/null
|
||||
systemctl remove hysteria &>/dev/null
|
||||
rm -f /etc/systemd/system/hysteria.service
|
||||
systemctl stop hysteria &>/dev/null
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_menuH2(){
|
||||
clear&&clear
|
||||
msg -bar3
|
||||
cat /etc/adm-lite/HYSTERIA/data.yaml
|
||||
msg -bar3
|
||||
green "$APP_IMPORT_GUIDE"
|
||||
yellow "El URI de configuraci<63>n de Hysteria 2 (con salto de puerto) "
|
||||
red "$(cat /root/hy/url.txt)"
|
||||
yellow "El URI de configuraci<63>n de Hysteria 2 (sin salto de puerto) "
|
||||
red "$(cat /root/hy/url-nohop.txt)"
|
||||
msg -bar3
|
||||
unset op
|
||||
[[ $(cat /etc/adm-lite/HYSTERIA/config.yaml | grep -w '//"alpn"') ]] && _ap='\033[0;31mOFF' || _ap='\033[0;32mON'
|
||||
menu_func "CAMBIAR PUERTO" "CAMBIAR CONTRASE<53>A" "REINICIAR SERVICIO" "\033[0;31mREMOVER SERVICIO"
|
||||
msg -bar3
|
||||
selecy=$(selection_fun 5)
|
||||
case $selecy in
|
||||
1)
|
||||
clear&&clear
|
||||
unset _col
|
||||
msg -bar3
|
||||
oldport=$(cat /etc/adm-lite/HYSTERIA/config.yaml 2>/dev/null | sed -n 1p | awk '{print $2}' | awk -F ":" '{print $2}')
|
||||
echo -e "INGRESE EL NUEVO PUERTO DE SERVICIO "
|
||||
read -p "Puerto [1-65535] (Puerto Ramdom Enter): " port
|
||||
[[ -z $port ]] && port=$(shuf -i 2000-65535 -n 1)
|
||||
until [[ -z $(ss -tunlp | grep -w udp | awk '{print $5}' | sed 's/.*://g' | grep -w "$port") ]]; do
|
||||
if [[ -n $(ss -tunlp | grep -w udp | awk '{print $5}' | sed 's/.*://g' | grep -w "$port") ]]; then
|
||||
echo -e "${RED} $port ${PLAIN} Puerto Ocupado , Reintente Nuevamente! "
|
||||
read -p "Puerto [1-65535] (Puerto Ramdom Enter): " port
|
||||
[[ -z $port ]] && port=$(shuf -i 2000-65535 -n 1)
|
||||
fi
|
||||
done
|
||||
sed -i "1s#$oldport#$port#g" /etc/adm-lite/HYSTERIA/config.yaml
|
||||
sed -i "1s#$oldport#$port#g" /root/hy/hy-client.yaml
|
||||
sed -i "2s#$oldport#$port#g" /root/hy/hy-client.json
|
||||
sed -i "s#$oldport#$port#g" /root/hy/url.txt
|
||||
stophysteria && starthysteria
|
||||
green "Su puerto fue modificado Exitosamente : $port"
|
||||
cat /root/hy/url.txt
|
||||
;;
|
||||
2)
|
||||
clear&&clear
|
||||
unset _col
|
||||
msg -bar3
|
||||
oldpasswd=$(cat /etc/adm-lite/HYSTERIA/config.yaml 2>/dev/null | sed -n 20p | awk '{print $2}')
|
||||
oldobfs=$(cat /etc/adm-lite/HYSTERIA/config.yaml 2>/dev/null | sed -n 10p | awk '{print $2}')
|
||||
echo -e "INGRESE SU NUEVA CLAVE/CONTRASE<53>A "
|
||||
read -p " (Enter Clave RAMDON): " passwd
|
||||
[[ -z $passwd ]] && passwd=$(date +%s%N | md5sum | cut -c 1-8)
|
||||
|
||||
sed -i "20s#$oldpasswd#$passwd#g" /etc/adm-lite/HYSTERIA/config.yaml
|
||||
sed -i "10s#$oldobfs#$passwd#g" /etc/adm-lite/HYSTERIA/config.yaml
|
||||
sed -i "3s#$oldpasswd#$passwd#g" /root/hy/hy-client.yaml
|
||||
sed -i "9s#$oldobfs#$passwd#g" /root/hy/hy-client.yaml
|
||||
sed -i "3s#$oldpasswd#$passwd#g" /root/hy/hy-client.json
|
||||
sed -i "8s#$oldobfs#$passwd#g" /root/hy/hy-client.json
|
||||
sed -i "s#$oldpasswd#$passwd#g" /root/hy/url.txt
|
||||
sed -i "s#$oldobfs#$passwd#g" /root/hy/url.txt
|
||||
stophysteria && starthysteria
|
||||
green "Su nueva contrase<73>a $passwd se aplico Exitosamente"
|
||||
cat /root/hy/url.txt
|
||||
;;
|
||||
3)
|
||||
stophysteria && starthysteria
|
||||
;;
|
||||
4)
|
||||
clear&&clear
|
||||
rm -f /etc/adm-lite/HYSTERIA/*
|
||||
systemctl stop hysteria-server.service >/dev/null 2>&1
|
||||
systemctl disable hysteria-server.service >/dev/null 2>&1
|
||||
rm -f /lib/systemd/system/hysteria-server.service /lib/systemd/system/hysteria-server@.service
|
||||
rm -rf /bin/Hysteria2 /etc/hysteria /root/hy /root/hysteria.sh
|
||||
rm -f /bin/Hysteria2
|
||||
iptables -t nat -F PREROUTING >/dev/null 2>&1
|
||||
netfilter-persistent save >/dev/null 2>&1
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset _So _Cu _HIS _HIS2
|
||||
while :
|
||||
[[ $(ps x | grep -w 'udpServer'| grep -v grep) ]] && _So="$(msg -verd 'ON')" || _So="$(msg -verm2 'OFF')"
|
||||
[[ $(ps x | grep -w 'UDP-Custom'| grep -v grep) ]] && _Cu="$(msg -verd 'ON')" || _Cu="$(msg -verm2 'OFF')"
|
||||
[[ $(ps x | grep -w '/bin/hysteria' | grep -v grep) ]] && _HIS="$(msg -verd 'ON')" || _HIS="$(msg -verm2 'OFF')"
|
||||
[[ $(ps x | grep -w '/bin/Hysteria2'| grep -v grep) ]] && _HIS2="$(msg -verd 'ON')" || _HIS2="$(msg -verm2 'OFF')"
|
||||
_MSYS=" \n$(print_center "\033[0;35mUsuarios SSH del Sistema")"
|
||||
_MSYS2="\n$(print_center "\033[0;35mNO SOPORTA USERS DE SISTEMA")"
|
||||
|
||||
do
|
||||
unset port
|
||||
tittle
|
||||
a=( [0]="\e[1;30m[\e[38;5;219m#" [1]="\e[1;30m]" )
|
||||
menu_func "UDP-REQUEST ${a[0]}socks-ip${a[1]} ${_So}" \
|
||||
"UDP-CUSTOM ${a[0]}http-custom${a[1]} ${_Cu}" \
|
||||
"UDP-HYSTERIA ${a[0]}app'smod${a[1]} ${_HIS}" \
|
||||
"UDP-HYSTERIA2 ${a[0]}http-injector${a[1]} ${_HIS2}"
|
||||
back
|
||||
#menu_func " UDP-REQUEST SocksIP \033[0;31m[${_So}\033[0;31m]${_MSYS}" "UDP-CUSTOM HTTPCustom \033[0;31m[${_Cu}\033[0;31m]${_MSYS}" "UDP-Hysteria APPMod's \033[0;31m[${_HIS}\033[0;31m] ${_MSYS}"
|
||||
#echo -e "\033[0;35m [${cor[2]}01\033[0;35m]\033[0;33m ${flech}${cor[3]}UDP-REQUEST SocksIP \033[0;31m[${_So}\033[0;31m] ${_MSYS}"
|
||||
#echo -e "\033[0;35m [${cor[2]}02\033[0;35m]\033[0;33m ${flech}${cor[3]}UDP-CUSTOM HTTPCustom \033[0;31m[${_Cu}\033[0;31m] ${_MSYS}"
|
||||
#echo -e "\033[0;35m [${cor[2]}03\033[0;35m]\033[0;33m ${flech}${cor[3]}UDP-Hysteria APPMod's \033[0;31m[${_HIS}\033[0;31m] ${_MSYS}"
|
||||
#echo -e "\033[0;35m [${cor[2]}04\033[0;35m]\033[0;33m ${flech}${cor[3]}UDP-Hysteria2 HTTP-Injector \033[0;31m[${_HIS2}\033[0;31m] ${_MSYS2}"
|
||||
#msg -bar3
|
||||
#echo -ne "$(msg -verd " [0]") $(msg -verm2 "=>>") " && msg -bra "\033[1;41m Volver "
|
||||
#msg -bar3
|
||||
opcion=$(selection_fun 4)
|
||||
case $opcion in
|
||||
1) source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/UDPserver.org.sh) && exit;;
|
||||
2) source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/udp-custom.sh) && exit;;
|
||||
3) [[ $(ps x | grep -w "/bin/hysteria"| grep -v grep) ]] && _menuH || _hysteria ;;
|
||||
4) [[ $(ps x | grep -w "/bin/Hysteria2"| grep -v grep) ]] && _menuH2 || _hysteria2 ;;
|
||||
0) exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
pruebas(){
|
||||
|
||||
echo '[Unit]
|
||||
Description=HysteriaUDP MOD Service BY @drowkid01
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
Group=root' > /etc/adm-lite/HYSTERIA/hysteria.service
|
||||
echo "ExecStartPost=${sys} net.ipv4.ip_forward=1
|
||||
ExecStartPost=${sys} net.ipv4.conf.all.rp_filter=0
|
||||
ExecStartPost=${sys} net.ipv4.conf.${interfas}.rp_filter=0
|
||||
ExecStartPost=${ip4t} -t nat -A PREROUTING -i ${interfas} -p udp --dport 10000:65000 -j DNAT --to-destination :36712
|
||||
ExecStartPost=${ip6t} -t nat -A PREROUTING -i ${interfas} -p udp --dport 10000:65000 -j DNAT --to-destination :36712
|
||||
ExecStopPost=${ip4t} -t nat -D PREROUTING -i ${interfas} -p udp --dport 10000:65000 -j DNAT --to-destination :36712
|
||||
ExecStopPost=${ip6t} -t nat -D PREROUTING -i ${interfas} -p udp --dport 10000:65000 -j DNAT --to-destination :36712" >> /etc/adm-lite/HYSTERIA/hysteria.service
|
||||
|
||||
echo 'WorkingDirectory=/etc/adm-lite/HYSTERIA
|
||||
Environment="PATH=/etc/adm-lite/HYSTERIA"
|
||||
ExecStart=/bin/hysteria -config /etc/adm-lite/HYSTERIA/config.json server
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
' >> /etc/adm-lite/HYSTERIA/hysteria.service
|
||||
|
||||
}
|
||||
283
Recursos/menu_inst/autoconfig-sh/PDirect.py
Normal file
283
Recursos/menu_inst/autoconfig-sh/PDirect.py
Normal file
@ -0,0 +1,283 @@
|
||||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
import socket, threading, thread, select, signal, sys, time, getopt
|
||||
|
||||
# Listen
|
||||
LISTENING_ADDR = '0.0.0.0'
|
||||
if sys.argv[1:]:
|
||||
LISTENING_PORT = sys.argv[1]
|
||||
else:
|
||||
LISTENING_PORT = 80
|
||||
#Pass
|
||||
PASS = ''
|
||||
# CONST
|
||||
BUFLEN = 4096 * 4
|
||||
TIMEOUT = 60
|
||||
DEFAULT_HOST = '127.0.0.1:22'
|
||||
#MSG = '<span style=color: #ff0000;><strong><span style=color: #ff9900;>By</span>-<span style=color: #008000;>@drowkid01</span>-ADM</strong></span>'
|
||||
MSG = '<span style=color: #ff0000;><strong><span style="color: #ff0000;">✧</span><span style="color: #ff9900;"> | </span><span style="color: #008000;">ᴅ</span><span style="color: #0000ff;">ʀ</span><span style="color: #ff0000;">ᴏ</span><span style="color: #ff9900;">ᴡ</span><span style="color: #008000;">ᴋ</span><span style="color: #0000ff;">ɪ</span><span style="color: #ff0000;">ᴅ</span><span style="color: #ff9900;"> | </span><span style="color: #008000;">✧</span><span style="color: #0000ff;"></span></strong></span>'
|
||||
|
||||
STATUS_RESP = '101'
|
||||
FTAG = '\r\nContent-length: 0\r\n\r\nHTTP/1.1 Connection established\r\n\r\n'
|
||||
|
||||
if STATUS_RESP == '101':
|
||||
STATUS_TXT = '<font color="green">Protocolo Websocket</font>'
|
||||
else:
|
||||
STATUS_TXT = '<font color="red">Connection established</font>'
|
||||
|
||||
RESPONSE = "HTTP/1.1 " + str(STATUS_RESP) + ' ' + str(STATUS_TXT) + ' ' + str(MSG) + ' ' + str(FTAG)
|
||||
#RESPONSE = "HTTP/1.1 " + str(STATUS_RESP) + ' ' + str(MSG) + ' ' + str(FTAG)
|
||||
|
||||
|
||||
class Server(threading.Thread):
|
||||
def __init__(self, host, port):
|
||||
threading.Thread.__init__(self)
|
||||
self.running = False
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.threads = []
|
||||
self.threadsLock = threading.Lock()
|
||||
self.logLock = threading.Lock()
|
||||
|
||||
def run(self):
|
||||
self.soc = socket.socket(socket.AF_INET)
|
||||
self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self.soc.settimeout(2)
|
||||
intport = int(self.port)
|
||||
self.soc.bind((self.host, intport))
|
||||
self.soc.listen(0)
|
||||
self.running = True
|
||||
|
||||
try:
|
||||
while self.running:
|
||||
try:
|
||||
c, addr = self.soc.accept()
|
||||
c.setblocking(1)
|
||||
except socket.timeout:
|
||||
continue
|
||||
|
||||
conn = ConnectionHandler(c, self, addr)
|
||||
conn.start()
|
||||
self.addConn(conn)
|
||||
finally:
|
||||
self.running = False
|
||||
self.soc.close()
|
||||
|
||||
def printLog(self, log):
|
||||
self.logLock.acquire()
|
||||
print log
|
||||
self.logLock.release()
|
||||
|
||||
def addConn(self, conn):
|
||||
try:
|
||||
self.threadsLock.acquire()
|
||||
if self.running:
|
||||
self.threads.append(conn)
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
def removeConn(self, conn):
|
||||
try:
|
||||
self.threadsLock.acquire()
|
||||
self.threads.remove(conn)
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
self.running = False
|
||||
self.threadsLock.acquire()
|
||||
|
||||
threads = list(self.threads)
|
||||
for c in threads:
|
||||
c.close()
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
|
||||
class ConnectionHandler(threading.Thread):
|
||||
def __init__(self, socClient, server, addr):
|
||||
threading.Thread.__init__(self)
|
||||
self.clientClosed = False
|
||||
self.targetClosed = True
|
||||
self.client = socClient
|
||||
self.client_buffer = ''
|
||||
self.server = server
|
||||
self.log = 'Connection: ' + str(addr)
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
if not self.clientClosed:
|
||||
self.client.shutdown(socket.SHUT_RDWR)
|
||||
self.client.close()
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
self.clientClosed = True
|
||||
|
||||
try:
|
||||
if not self.targetClosed:
|
||||
self.target.shutdown(socket.SHUT_RDWR)
|
||||
self.target.close()
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
self.targetClosed = True
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.client_buffer = self.client.recv(BUFLEN)
|
||||
|
||||
hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
|
||||
|
||||
if hostPort == '':
|
||||
hostPort = DEFAULT_HOST
|
||||
|
||||
split = self.findHeader(self.client_buffer, 'X-Split')
|
||||
|
||||
if split != '':
|
||||
self.client.recv(BUFLEN)
|
||||
|
||||
if hostPort != '':
|
||||
passwd = self.findHeader(self.client_buffer, 'X-Pass')
|
||||
|
||||
if len(PASS) != 0 and passwd == PASS:
|
||||
self.method_CONNECT(hostPort)
|
||||
elif len(PASS) != 0 and passwd != PASS:
|
||||
self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
|
||||
elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
|
||||
self.method_CONNECT(hostPort)
|
||||
else:
|
||||
self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
|
||||
else:
|
||||
print '- No X-Real-Host!'
|
||||
self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
|
||||
|
||||
except Exception as e:
|
||||
self.log += ' - error: ' + e.strerror
|
||||
self.server.printLog(self.log)
|
||||
pass
|
||||
finally:
|
||||
self.close()
|
||||
self.server.removeConn(self)
|
||||
|
||||
def findHeader(self, head, header):
|
||||
aux = head.find(header + ': ')
|
||||
|
||||
if aux == -1:
|
||||
return ''
|
||||
|
||||
aux = head.find(':', aux)
|
||||
head = head[aux+2:]
|
||||
aux = head.find('\r\n')
|
||||
|
||||
if aux == -1:
|
||||
return ''
|
||||
|
||||
return head[:aux];
|
||||
|
||||
def connect_target(self, host):
|
||||
i = host.find(':')
|
||||
if i != -1:
|
||||
port = int(host[i+1:])
|
||||
host = host[:i]
|
||||
else:
|
||||
if self.method=='CONNECT':
|
||||
port = 22
|
||||
else:
|
||||
port = sys.argv[1]
|
||||
|
||||
(soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
|
||||
|
||||
self.target = socket.socket(soc_family, soc_type, proto)
|
||||
self.targetClosed = False
|
||||
self.target.connect(address)
|
||||
|
||||
def method_CONNECT(self, path):
|
||||
self.log += ' - CONNECT ' + path
|
||||
|
||||
self.connect_target(path)
|
||||
self.client.sendall(RESPONSE)
|
||||
self.client_buffer = ''
|
||||
|
||||
self.server.printLog(self.log)
|
||||
self.doCONNECT()
|
||||
|
||||
def doCONNECT(self):
|
||||
socs = [self.client, self.target]
|
||||
count = 0
|
||||
error = False
|
||||
while True:
|
||||
count += 1
|
||||
(recv, _, err) = select.select(socs, [], socs, 3)
|
||||
if err:
|
||||
error = True
|
||||
if recv:
|
||||
for in_ in recv:
|
||||
try:
|
||||
data = in_.recv(BUFLEN)
|
||||
if data:
|
||||
if in_ is self.target:
|
||||
self.client.send(data)
|
||||
else:
|
||||
while data:
|
||||
byte = self.target.send(data)
|
||||
data = data[byte:]
|
||||
|
||||
count = 0
|
||||
else:
|
||||
break
|
||||
except:
|
||||
error = True
|
||||
break
|
||||
if count == TIMEOUT:
|
||||
error = True
|
||||
if error:
|
||||
break
|
||||
|
||||
|
||||
def print_usage():
|
||||
print 'Usage: proxy.py -p <port>'
|
||||
print ' proxy.py -b <bindAddr> -p <port>'
|
||||
print ' proxy.py -b 0.0.0.0 -p 80'
|
||||
|
||||
def parse_args(argv):
|
||||
global LISTENING_ADDR
|
||||
global LISTENING_PORT
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(argv,"hb:p:",["bind=","port="])
|
||||
except getopt.GetoptError:
|
||||
print_usage()
|
||||
sys.exit(2)
|
||||
for opt, arg in opts:
|
||||
if opt == '-h':
|
||||
print_usage()
|
||||
sys.exit()
|
||||
elif opt in ("-b", "--bind"):
|
||||
LISTENING_ADDR = arg
|
||||
elif opt in ("-p", "--port"):
|
||||
LISTENING_PORT = int(arg)
|
||||
|
||||
|
||||
def main(host=LISTENING_ADDR, port=LISTENING_PORT):
|
||||
|
||||
print "\033[0;34m━"*8,"\033[1;32m PROXY PYTHON WEBSOCKET","\033[0;34m━"*8,"\n"
|
||||
print "\033[1;33mIP:\033[1;32m " + LISTENING_ADDR
|
||||
print "\033[1;33mPORTA:\033[1;32m " + str(LISTENING_PORT) + "\n"
|
||||
print "\033[0;34m━"*10,"\033[1;32m ChumoGH ADM - LITE","\033[0;34m━\033[1;37m"*11,"\n"
|
||||
|
||||
server = Server(LISTENING_ADDR, LISTENING_PORT)
|
||||
server.start()
|
||||
|
||||
while True:
|
||||
try:
|
||||
time.sleep(2)
|
||||
except KeyboardInterrupt:
|
||||
print 'Parando...'
|
||||
server.close()
|
||||
break
|
||||
|
||||
if __name__ == '__main__':
|
||||
parse_args(sys.argv[1:])
|
||||
main()
|
||||
480
Recursos/menu_inst/autoconfig-sh/Proxy.sh
Normal file
480
Recursos/menu_inst/autoconfig-sh/Proxy.sh
Normal file
@ -0,0 +1,480 @@
|
||||
#!/bin/bash
|
||||
# -*- ENCODING: UTF-8 -*-
|
||||
BARRA="\e[0;31m➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖\e[0m"
|
||||
echo -e "$BARRA"
|
||||
echo -e " FUNCION DESCONTINUADA . . . . ."
|
||||
echo -e " VE AL MENU 9, OPCION 7, OPCION 3"
|
||||
|
||||
#if [[ ! -e /bin/ejecutar/PDirect.py ]]; then
|
||||
clear
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[92m El programa requiere de unas instalaciones adiccionales\n al finalizar la instalacion devera ejecutar nuevamente\n este script!"
|
||||
echo -e "$BARRA"
|
||||
echo -ne "\033[97m Desea continuar [s/n]: "
|
||||
read instal
|
||||
[[ $instal = @(s|S|y|Y) ]] && {
|
||||
clear
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[92m -- INSTALANDO PAQUETES NECESARIOS -- "
|
||||
echo -e "$BARRA"
|
||||
#python
|
||||
[[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || apt-get install python -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "python"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install python.......... $ESTATUS "
|
||||
#python-pip
|
||||
[[ $(dpkg --get-selections|grep -w "python-pip"|head -1) ]] || apt-get install python-pip -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "python-pip"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "python-pip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install python-pip...... $ESTATUS "
|
||||
#cowsay
|
||||
[[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || apt-get install cowsay -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install cowsay.......... $ESTATUS "
|
||||
#figlet
|
||||
[[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || apt-get install figlet -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install figlet.......... $ESTATUS "
|
||||
#lolcat
|
||||
[[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] || apt-get install lolcat -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install lolcat.......... $ESTATUS "
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[97m Ejecute de nuevo el script"
|
||||
echo -e "$BARRA"
|
||||
}
|
||||
#exit
|
||||
#fi
|
||||
|
||||
while :
|
||||
do
|
||||
case $1 in
|
||||
-p|--port)
|
||||
port=$2
|
||||
shift 2
|
||||
;;
|
||||
-pl|--portlocal)
|
||||
portlocal=$2
|
||||
shift 2
|
||||
;;
|
||||
-i|--ipdns)
|
||||
ipdns=$2
|
||||
shift 2
|
||||
;;
|
||||
-r|--response)
|
||||
response=$2
|
||||
shift 2
|
||||
;;
|
||||
-tc|--textcolor)
|
||||
RETORNO=$2
|
||||
shift 2
|
||||
;;
|
||||
-h|--help)
|
||||
clear
|
||||
echo '=========================================================================='
|
||||
echo -e " -p --port\n ingresa un puert para PYTHON\n ej: Proxy.sh -p 8080\n"
|
||||
echo -e " -pl --portlocal\n selecciona un puerto local [OpenSSH o Dropbear]\n para la redireccion\n ej: Proxy.sh -pl 443\n"
|
||||
echo -e " -i|--ipdns\n asigna una contraseña para mayor seguridad en la\n sintaxis del payload\n ej: Proxy.sh -i rufu99\n"
|
||||
echo -e " -tc --textcolor\n ingresa un mini bnner [HTML] para el status\n de conexion"
|
||||
echo -e ' ej: Proxy.sh -tc "<font color="red">VPS</font>"\n'
|
||||
echo -e " -s|--start\n finaliza el ingresos de datos y continua con\n la ejecucion del script\n ej: Proxy.sh -i rufu99 --start\n"
|
||||
echo ' ejemplo practico'
|
||||
echo '=========================================================================='
|
||||
echo '/bin/ejecutar/PDirect.py -p 8080 -pl 443 -i ChumoGH -tc "<font color="red">VPS</font>" --start'
|
||||
echo '=========================================================================='
|
||||
shift
|
||||
exit
|
||||
;;
|
||||
-s|--start)
|
||||
if [[ -z $response ]]; then
|
||||
response="200"
|
||||
fi
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
|
||||
clear
|
||||
cowsay -f tux "Con esta herramienta podra cambia el texto y el color al status de conexion tambien podra agregar una contraseña a tu payload para mayor seguridad...." | lolcat
|
||||
figlet __ADMcgh__ | lolcat
|
||||
|
||||
[[ -z $port ]] && {
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[1;31mPUERTO PROXY PYTHON\033[0m"
|
||||
echo -e "$BARRA"
|
||||
echo -ne "\033[1;49;37mIntroduzca puerto proxy: "
|
||||
read port
|
||||
}
|
||||
|
||||
[[ -z $portlocal ]] && {
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[1;31mPUERTO LOCAL\033[0m"
|
||||
echo -e "$BARRA"
|
||||
echo -ne "\033[1;49;37mIntroduzca puerto local OpenSSH o Dropbear: "
|
||||
read portlocal
|
||||
}
|
||||
|
||||
[[ -z $ipdns ]] && {
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[1;31mAÑADIR CONTRASEÑA AL PAYLOAD\033[0m"
|
||||
echo -e "$BARRA"
|
||||
echo -ne "\033[1;49;37mContraseña o Enter para omitor: "
|
||||
read ipdns
|
||||
if [[ ! -z $ipdns ]]; then
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[1;31mATENCION:\n\033[1;34mPara Utilizar Este Proxy Es Necesario Agregar Una Linea A Su Payload\033[0m"
|
||||
echo -e "\033[1;34mAGREGUE ESTA LINEA A SU PAYLOAD:\n\033[1;36m[crlf]X-Pass: $ipdns[crlf]\n\033[0m"
|
||||
echo -e "\033[1;31mEJEMPLO 1:\n\033[1;33m\033[1;36m[crlf]X-Pass: $ipdns[crlf]GET http://tuhost.com/ HTTP/1.0 [cr|f]\033[0m"
|
||||
echo -e "\033[1;31mEJEMPLO 2:\n\033[1;33m\033[1;36mGET http://tuhost.com/ HTTP/1.0 [crlf][crlf]X-Pass: $ipdns[crlf]\033[0m"
|
||||
fi
|
||||
}
|
||||
|
||||
[[ -z $response ]] && {
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[1;31mRESPONSE PERSONALIZADO\033[0m"
|
||||
echo -e "$BARRA"
|
||||
echo -ne "\033[1;49;37mEnter por defecto (200): "
|
||||
read response
|
||||
if [[ -z $response ]]; then
|
||||
response="200"
|
||||
fi
|
||||
}
|
||||
|
||||
[[ -z $RETORNO ]] && {
|
||||
while [[ -z $FMSG || $FMSG = @(s|S|y|Y) ]]; do
|
||||
echo -e "$BARRA"
|
||||
echo -ne "\033[1;49;37mIntroduzca Un Mensaje De Status: "
|
||||
read mensage
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[1;49;37mSeleccione El Color De Mensaje: "
|
||||
echo -e "$BARRA"
|
||||
echo -e "\033[1;49;92m[1] > \033[0;49;31mRed"
|
||||
echo -e "\033[1;49;92m[2] > \033[0;49;32mGreen"
|
||||
echo -e "\033[1;49;92m[3] > \033[0;49;94mPurple"
|
||||
echo -e "\033[1;49;92m[4] > \033[0;49;36mTeal"
|
||||
echo -e "\033[1;49;92m[5] > \033[0;49;96mCyan"
|
||||
echo -e "\033[1;49;92m[6] > \033[0;49;93myellow"
|
||||
echo -e "\033[1;49;92m[7] > \033[0;49;34mblue"
|
||||
echo -e "\033[1;49;92m[8] > \033[0;107;30mblack\e[0m"
|
||||
echo -e "\033[1;49;92m[9] > \033[0;49;95mFuchsia"
|
||||
echo -e "\033[1;49;92m[10] > \033[0;49;33mBrown"
|
||||
echo -e "$BARRA"
|
||||
echo -ne "\033[1;49;37mOpcion: "
|
||||
read cor
|
||||
case $cor in
|
||||
"1") corx="<font color="red">${mensage}</font>";;
|
||||
"2") corx="<font color="green">${mensage}</font>";;
|
||||
"3") corx="<font color="purple">${mensage}</font";;
|
||||
"4") corx="<font color="Teal">${mensage}</font>";;
|
||||
"5") corx="<font color="aqua">${mensage}</font>";;
|
||||
"6") corx="<font color="yellow">${mensage}</font>";;
|
||||
"7") corx="<font color="blue">${mensage}</font>";;
|
||||
"8") corx="<font color="black">${mensage}</font>";;
|
||||
"9") corx="<font color="Fuchsia">${mensage}</font>";;
|
||||
"10") corx="<font color="maroon">${mensage}</font>";;
|
||||
*) corx="<font color="red">${mensage}</font>";;
|
||||
esac
|
||||
if [[ ! -z ${RETORNO} ]]; then
|
||||
RETORNO="${RETORNO} ${corx}"
|
||||
else
|
||||
RETORNO="${corx}"
|
||||
fi
|
||||
echo -e "$BARRA"
|
||||
echo -ne "\033[1;49;37mAgregar Mas Mensajes? [S/N]: "
|
||||
read FMSG
|
||||
done
|
||||
}
|
||||
|
||||
echo -e "$BARRA"
|
||||
echo -ne "\033[1;49;37mEnter para ejecutar"
|
||||
read foo
|
||||
shift
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Inicializando o Proxy
|
||||
(
|
||||
#/usr/bin/python -x << PYTHON
|
||||
less << PYTHON > /bin/ejecutar/PDirect${port}.py
|
||||
# -*- coding: utf-8 -*-
|
||||
import socket, threading, thread, select, signal, sys, time, getopt
|
||||
|
||||
LISTENING_ADDR = '0.0.0.0'
|
||||
LISTENING_PORT = int("$port")
|
||||
PASS = str("$ipdns")
|
||||
BUFLEN = 4096 * 4
|
||||
TIMEOUT = 60
|
||||
DEFAULT_HOST = '127.0.0.1:$portlocal'
|
||||
msg = "HTTP/1.1 $response <strong>$RETORNO</strong>\r\nContent-length: 0\r\n\r\nHTTP/1.1 200 Connection established\r\n\r\n"
|
||||
RESPONSE = str(msg)
|
||||
|
||||
class Server(threading.Thread):
|
||||
def __init__(self, host, port):
|
||||
threading.Thread.__init__(self)
|
||||
self.running = False
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.threads = []
|
||||
self.threadsLock = threading.Lock()
|
||||
self.logLock = threading.Lock()
|
||||
|
||||
def run(self):
|
||||
self.soc = socket.socket(socket.AF_INET)
|
||||
self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self.soc.settimeout(2)
|
||||
self.soc.bind((self.host, self.port))
|
||||
self.soc.listen(0)
|
||||
self.running = True
|
||||
|
||||
try:
|
||||
while self.running:
|
||||
try:
|
||||
c, addr = self.soc.accept()
|
||||
c.setblocking(1)
|
||||
except socket.timeout:
|
||||
continue
|
||||
|
||||
conn = ConnectionHandler(c, self, addr)
|
||||
conn.start()
|
||||
self.addConn(conn)
|
||||
finally:
|
||||
self.running = False
|
||||
self.soc.close()
|
||||
|
||||
def printLog(self, log):
|
||||
self.logLock.acquire()
|
||||
print log
|
||||
self.logLock.release()
|
||||
|
||||
def addConn(self, conn):
|
||||
try:
|
||||
self.threadsLock.acquire()
|
||||
if self.running:
|
||||
self.threads.append(conn)
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
def removeConn(self, conn):
|
||||
try:
|
||||
self.threadsLock.acquire()
|
||||
self.threads.remove(conn)
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
self.running = False
|
||||
self.threadsLock.acquire()
|
||||
|
||||
threads = list(self.threads)
|
||||
for c in threads:
|
||||
c.close()
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
|
||||
class ConnectionHandler(threading.Thread):
|
||||
def __init__(self, socClient, server, addr):
|
||||
threading.Thread.__init__(self)
|
||||
self.clientClosed = False
|
||||
self.targetClosed = True
|
||||
self.client = socClient
|
||||
self.client_buffer = ''
|
||||
self.server = server
|
||||
self.log = 'Connection: ' + str(addr)
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
if not self.clientClosed:
|
||||
self.client.shutdown(socket.SHUT_RDWR)
|
||||
self.client.close()
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
self.clientClosed = True
|
||||
|
||||
try:
|
||||
if not self.targetClosed:
|
||||
self.target.shutdown(socket.SHUT_RDWR)
|
||||
self.target.close()
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
self.targetClosed = True
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.client_buffer = self.client.recv(BUFLEN)
|
||||
|
||||
hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
|
||||
|
||||
if hostPort == '':
|
||||
hostPort = DEFAULT_HOST
|
||||
|
||||
split = self.findHeader(self.client_buffer, 'X-Split')
|
||||
|
||||
if split != '':
|
||||
self.client.recv(BUFLEN)
|
||||
|
||||
if hostPort != '':
|
||||
passwd = self.findHeader(self.client_buffer, 'X-Pass')
|
||||
|
||||
if len(PASS) != 0 and passwd == PASS:
|
||||
self.method_CONNECT(hostPort)
|
||||
elif len(PASS) != 0 and passwd != PASS:
|
||||
self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
|
||||
elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
|
||||
self.method_CONNECT(hostPort)
|
||||
else:
|
||||
self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
|
||||
else:
|
||||
print '- No X-Real-Host!'
|
||||
self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
|
||||
|
||||
except Exception as e:
|
||||
self.log += ' - error: ' + e.strerror
|
||||
self.server.printLog(self.log)
|
||||
pass
|
||||
finally:
|
||||
self.close()
|
||||
self.server.removeConn(self)
|
||||
|
||||
def findHeader(self, head, header):
|
||||
aux = head.find(header + ': ')
|
||||
|
||||
if aux == -1:
|
||||
return ''
|
||||
|
||||
aux = head.find(':', aux)
|
||||
head = head[aux+2:]
|
||||
aux = head.find('\r\n')
|
||||
|
||||
if aux == -1:
|
||||
return ''
|
||||
|
||||
return head[:aux];
|
||||
|
||||
def connect_target(self, host):
|
||||
i = host.find(':')
|
||||
if i != -1:
|
||||
port = int(host[i+1:])
|
||||
host = host[:i]
|
||||
else:
|
||||
if self.method=='CONNECT':
|
||||
port = 443
|
||||
else:
|
||||
port = 80
|
||||
port = 8080
|
||||
port = 8799
|
||||
port = 3128
|
||||
|
||||
(soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
|
||||
|
||||
self.target = socket.socket(soc_family, soc_type, proto)
|
||||
self.targetClosed = False
|
||||
self.target.connect(address)
|
||||
|
||||
def method_CONNECT(self, path):
|
||||
self.log += ' - CONNECT ' + path
|
||||
|
||||
self.connect_target(path)
|
||||
self.client.sendall(RESPONSE)
|
||||
self.client_buffer = ''
|
||||
|
||||
self.server.printLog(self.log)
|
||||
self.doCONNECT()
|
||||
|
||||
def doCONNECT(self):
|
||||
socs = [self.client, self.target]
|
||||
count = 0
|
||||
error = False
|
||||
while True:
|
||||
count += 1
|
||||
(recv, _, err) = select.select(socs, [], socs, 3)
|
||||
if err:
|
||||
error = True
|
||||
if recv:
|
||||
for in_ in recv:
|
||||
try:
|
||||
data = in_.recv(BUFLEN)
|
||||
if data:
|
||||
if in_ is self.target:
|
||||
self.client.send(data)
|
||||
else:
|
||||
while data:
|
||||
byte = self.target.send(data)
|
||||
data = data[byte:]
|
||||
|
||||
count = 0
|
||||
else:
|
||||
break
|
||||
except:
|
||||
error = True
|
||||
break
|
||||
if count == TIMEOUT:
|
||||
error = True
|
||||
|
||||
if error:
|
||||
break
|
||||
|
||||
def main(host=LISTENING_ADDR, port=LISTENING_PORT):
|
||||
|
||||
print "\n:-------PythonProxy-------:\n"
|
||||
print "Listening addr: " + LISTENING_ADDR
|
||||
print "Listening port: " + str(LISTENING_PORT) + "\n"
|
||||
print ":-------------------------:\n"
|
||||
|
||||
server = Server(LISTENING_ADDR, LISTENING_PORT)
|
||||
server.start()
|
||||
|
||||
while True:
|
||||
try:
|
||||
time.sleep(2)
|
||||
except KeyboardInterrupt:
|
||||
print 'Stopping...'
|
||||
server.close()
|
||||
break
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
PYTHON
|
||||
) > $HOME/proxy.log
|
||||
screen -dmS ws${port} python /bin/ejecutar/PDirect${port}.py ${port} &
|
||||
print_center -verd " ${aLerT} VERIFICANDO ACTIVIDAD DE SOCK PYTHON ${aLerT} \n ${aLerT} PORVAFOR ESPERE !! ${aLerT} "
|
||||
autoboot &> /dev/null
|
||||
sleep 2s && tput cuu1 && tput dl1
|
||||
sleep 1s && tput cuu1 && tput dl1
|
||||
[[ $(ps x | grep "ws${port} python" |grep -v grep ) ]] && {
|
||||
msg -bar3
|
||||
print_center -verd " REACTIVADOR DE SOCK Python ${port} ENCENDIDO "
|
||||
[[ $(grep -wc "ws${port}" /bin/autoboot) = '0' ]] && {
|
||||
echo -e "netstat -tlpn | grep -w ${port} > /dev/null || { screen -r -S 'ws${port}' -X quit; screen -dmS ws${port} python /bin/ejecutar/PDirect${port}.py & >> /root/proxy.log ; }" >>/bin/autoboot
|
||||
} || {
|
||||
sed -i '/ws${port}/d' /bin/autoboot
|
||||
echo -e "netstat -tlpn | grep -w ${port} > /dev/null || { screen -r -S 'ws${port}' -X quit; screen -dmS ws${port} python /bin/ejecutar/PDirect${port}.py & >> /root/proxy.log ; }" >>/bin/autoboot
|
||||
}
|
||||
crontab -l > /root/cron
|
||||
[[ -z $(cat < /root/cron | grep 'autoboot') ]] && echo "@reboot /bin/autoboot" >> /root/cron || {
|
||||
[[ $(grep -wc "autoboot" /root/cron) > "1" ]] && {
|
||||
sed -i '/autoboot/d' /root/cron
|
||||
echo "@reboot /bin/autoboot" >> /root/cron
|
||||
}
|
||||
}
|
||||
crontab /root/cron
|
||||
service cron restart
|
||||
sleep 2s && tput cuu1 && tput dl1
|
||||
} || {
|
||||
print_center -azu " FALTA ALGUN PARAMETRO PARA INICIAR REACTIVADOR "
|
||||
sleep 2s && tput cuu1 && tput dl1
|
||||
return
|
||||
}
|
||||
tput cuu1 && tput dl1
|
||||
msg -bar3
|
||||
[[ $(ps x | grep -w "ws${port}" | grep -v "grep" | awk -F "pts" '{print $1}') ]] && print_center -verd "PYTHON INICIADO CON EXITO!!!" || print_center -ama " ERROR AL INICIAR PYTHON!!!"
|
||||
msg -bar3
|
||||
exit
|
||||
480
Recursos/menu_inst/autoconfig-sh/proxy.sh
Normal file
480
Recursos/menu_inst/autoconfig-sh/proxy.sh
Normal file
@ -0,0 +1,480 @@
|
||||
#!/bin/bash
|
||||
# -*- ENCODING: UTF-8 -*-
|
||||
|
||||
msg -bar
|
||||
echo -e " FUNCION DESCONTINUADA . . . . ."
|
||||
echo -e " VE AL MENU 9, OPCION 7, OPCION 3"
|
||||
|
||||
#if [[ ! -e /bin/ejecutar/PDirect.py ]]; then
|
||||
clear
|
||||
msg -bar
|
||||
echo -e "\033[92m El programa requiere de unas instalaciones adiccionales\n al finalizar la instalacion devera ejecutar nuevamente\n este script!"
|
||||
msg -bar
|
||||
echo -ne "\033[97m Desea continuar [s/n]: "
|
||||
read instal
|
||||
[[ $instal = @(s|S|y|Y) ]] && {
|
||||
clear
|
||||
msg -bar
|
||||
echo -e "\033[92m -- INSTALANDO PAQUETES NECESARIOS -- "
|
||||
msg -bar
|
||||
#python
|
||||
[[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || apt-get install python -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "python"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install python.......... $ESTATUS "
|
||||
#python-pip
|
||||
[[ $(dpkg --get-selections|grep -w "python-pip"|head -1) ]] || apt-get install python-pip -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "python-pip"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "python-pip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install python-pip...... $ESTATUS "
|
||||
#cowsay
|
||||
[[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || apt-get install cowsay -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install cowsay.......... $ESTATUS "
|
||||
#figlet
|
||||
[[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || apt-get install figlet -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install figlet.......... $ESTATUS "
|
||||
#lolcat
|
||||
[[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] || apt-get install lolcat -y &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
|
||||
[[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
|
||||
echo -e "\033[97m # apt-get install lolcat.......... $ESTATUS "
|
||||
msg -bar
|
||||
echo -e "\033[97m Ejecute de nuevo el script"
|
||||
msg -bar
|
||||
}
|
||||
#exit
|
||||
#fi
|
||||
|
||||
while :
|
||||
do
|
||||
case $1 in
|
||||
-p|--port)
|
||||
port=$2
|
||||
shift 2
|
||||
;;
|
||||
-pl|--portlocal)
|
||||
portlocal=$2
|
||||
shift 2
|
||||
;;
|
||||
-i|--ipdns)
|
||||
ipdns=$2
|
||||
shift 2
|
||||
;;
|
||||
-r|--response)
|
||||
response=$2
|
||||
shift 2
|
||||
;;
|
||||
-tc|--textcolor)
|
||||
RETORNO=$2
|
||||
shift 2
|
||||
;;
|
||||
-h|--help)
|
||||
clear
|
||||
echo '=========================================================================='
|
||||
echo -e " -p --port\n ingresa un puert para PYTHON\n ej: Proxy.sh -p 8080\n"
|
||||
echo -e " -pl --portlocal\n selecciona un puerto local [OpenSSH o Dropbear]\n para la redireccion\n ej: Proxy.sh -pl 443\n"
|
||||
echo -e " -i|--ipdns\n asigna una contraseña para mayor seguridad en la\n sintaxis del payload\n ej: Proxy.sh -i rufu99\n"
|
||||
echo -e " -tc --textcolor\n ingresa un mini bnner [HTML] para el status\n de conexion"
|
||||
echo -e ' ej: Proxy.sh -tc "<font color="red">VPS</font>"\n'
|
||||
echo -e " -s|--start\n finaliza el ingresos de datos y continua con\n la ejecucion del script\n ej: Proxy.sh -i rufu99 --start\n"
|
||||
echo ' ejemplo practico'
|
||||
echo '=========================================================================='
|
||||
echo '/bin/ejecutar/PDirect.py -p 8080 -pl 443 -i ChumoGH -tc "<font color="red">VPS</font>" --start'
|
||||
echo '=========================================================================='
|
||||
shift
|
||||
exit
|
||||
;;
|
||||
-s|--start)
|
||||
if [[ -z $response ]]; then
|
||||
response="200"
|
||||
fi
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
|
||||
clear
|
||||
cowsay -f tux "Con esta herramienta podra cambia el texto y el color al status de conexion tambien podra agregar una contraseña a tu payload para mayor seguridad...." | lolcat
|
||||
figlet __ADMcgh__ | lolcat
|
||||
|
||||
[[ -z $port ]] && {
|
||||
msg -bar
|
||||
echo -e "\033[1;31mPUERTO PROXY PYTHON\033[0m"
|
||||
msg -bar
|
||||
echo -ne "\033[1;49;37mIntroduzca puerto proxy: "
|
||||
read port
|
||||
}
|
||||
|
||||
[[ -z $portlocal ]] && {
|
||||
msg -bar
|
||||
echo -e "\033[1;31mPUERTO LOCAL\033[0m"
|
||||
msg -bar
|
||||
echo -ne "\033[1;49;37mIntroduzca puerto local OpenSSH o Dropbear: "
|
||||
read portlocal
|
||||
}
|
||||
|
||||
[[ -z $ipdns ]] && {
|
||||
msg -bar
|
||||
echo -e "\033[1;31mAÑADIR CONTRASEÑA AL PAYLOAD\033[0m"
|
||||
msg -bar
|
||||
echo -ne "\033[1;49;37mContraseña o Enter para omitor: "
|
||||
read ipdns
|
||||
if [[ ! -z $ipdns ]]; then
|
||||
msg -bar
|
||||
echo -e "\033[1;31mATENCION:\n\033[1;34mPara Utilizar Este Proxy Es Necesario Agregar Una Linea A Su Payload\033[0m"
|
||||
echo -e "\033[1;34mAGREGUE ESTA LINEA A SU PAYLOAD:\n\033[1;36m[crlf]X-Pass: $ipdns[crlf]\n\033[0m"
|
||||
echo -e "\033[1;31mEJEMPLO 1:\n\033[1;33m\033[1;36m[crlf]X-Pass: $ipdns[crlf]GET http://tuhost.com/ HTTP/1.0 [cr|f]\033[0m"
|
||||
echo -e "\033[1;31mEJEMPLO 2:\n\033[1;33m\033[1;36mGET http://tuhost.com/ HTTP/1.0 [crlf][crlf]X-Pass: $ipdns[crlf]\033[0m"
|
||||
fi
|
||||
}
|
||||
|
||||
[[ -z $response ]] && {
|
||||
msg -bar
|
||||
echo -e "\033[1;31mRESPONSE PERSONALIZADO\033[0m"
|
||||
msg -bar
|
||||
echo -ne "\033[1;49;37mEnter por defecto (200): "
|
||||
read response
|
||||
if [[ -z $response ]]; then
|
||||
response="200"
|
||||
fi
|
||||
}
|
||||
|
||||
[[ -z $RETORNO ]] && {
|
||||
while [[ -z $FMSG || $FMSG = @(s|S|y|Y) ]]; do
|
||||
msg -bar
|
||||
echo -ne "\033[1;49;37mIntroduzca Un Mensaje De Status: "
|
||||
read mensage
|
||||
msg -bar
|
||||
echo -e "\033[1;49;37mSeleccione El Color De Mensaje: "
|
||||
msg -bar
|
||||
echo -e "\033[1;49;92m[1] > \033[0;49;31mRed"
|
||||
echo -e "\033[1;49;92m[2] > \033[0;49;32mGreen"
|
||||
echo -e "\033[1;49;92m[3] > \033[0;49;94mPurple"
|
||||
echo -e "\033[1;49;92m[4] > \033[0;49;36mTeal"
|
||||
echo -e "\033[1;49;92m[5] > \033[0;49;96mCyan"
|
||||
echo -e "\033[1;49;92m[6] > \033[0;49;93myellow"
|
||||
echo -e "\033[1;49;92m[7] > \033[0;49;34mblue"
|
||||
echo -e "\033[1;49;92m[8] > \033[0;107;30mblack\e[0m"
|
||||
echo -e "\033[1;49;92m[9] > \033[0;49;95mFuchsia"
|
||||
echo -e "\033[1;49;92m[10] > \033[0;49;33mBrown"
|
||||
msg -bar
|
||||
echo -ne "\033[1;49;37mOpcion: "
|
||||
read cor
|
||||
case $cor in
|
||||
"1") corx="<font color="red">${mensage}</font>";;
|
||||
"2") corx="<font color="green">${mensage}</font>";;
|
||||
"3") corx="<font color="purple">${mensage}</font";;
|
||||
"4") corx="<font color="Teal">${mensage}</font>";;
|
||||
"5") corx="<font color="aqua">${mensage}</font>";;
|
||||
"6") corx="<font color="yellow">${mensage}</font>";;
|
||||
"7") corx="<font color="blue">${mensage}</font>";;
|
||||
"8") corx="<font color="black">${mensage}</font>";;
|
||||
"9") corx="<font color="Fuchsia">${mensage}</font>";;
|
||||
"10") corx="<font color="maroon">${mensage}</font>";;
|
||||
*) corx="<font color="red">${mensage}</font>";;
|
||||
esac
|
||||
if [[ ! -z ${RETORNO} ]]; then
|
||||
RETORNO="${RETORNO} ${corx}"
|
||||
else
|
||||
RETORNO="${corx}"
|
||||
fi
|
||||
msg -bar
|
||||
echo -ne "\033[1;49;37mAgregar Mas Mensajes? [S/N]: "
|
||||
read FMSG
|
||||
done
|
||||
}
|
||||
|
||||
msg -bar
|
||||
echo -ne "\033[1;49;37mEnter para ejecutar"
|
||||
read foo
|
||||
shift
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Inicializando o Proxy
|
||||
(
|
||||
#/usr/bin/python -x << PYTHON
|
||||
less << PYTHON > /bin/ejecutar/PDirect${port}.py
|
||||
# -*- coding: utf-8 -*-
|
||||
import socket, threading, thread, select, signal, sys, time, getopt
|
||||
|
||||
LISTENING_ADDR = '0.0.0.0'
|
||||
LISTENING_PORT = int("$port")
|
||||
PASS = str("$ipdns")
|
||||
BUFLEN = 4096 * 4
|
||||
TIMEOUT = 60
|
||||
DEFAULT_HOST = '127.0.0.1:$portlocal'
|
||||
msg = "HTTP/1.1 $response <strong>$RETORNO</strong>\r\nContent-length: 0\r\n\r\nHTTP/1.1 200 Connection established\r\n\r\n"
|
||||
RESPONSE = str(msg)
|
||||
|
||||
class Server(threading.Thread):
|
||||
def __init__(self, host, port):
|
||||
threading.Thread.__init__(self)
|
||||
self.running = False
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.threads = []
|
||||
self.threadsLock = threading.Lock()
|
||||
self.logLock = threading.Lock()
|
||||
|
||||
def run(self):
|
||||
self.soc = socket.socket(socket.AF_INET)
|
||||
self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self.soc.settimeout(2)
|
||||
self.soc.bind((self.host, self.port))
|
||||
self.soc.listen(0)
|
||||
self.running = True
|
||||
|
||||
try:
|
||||
while self.running:
|
||||
try:
|
||||
c, addr = self.soc.accept()
|
||||
c.setblocking(1)
|
||||
except socket.timeout:
|
||||
continue
|
||||
|
||||
conn = ConnectionHandler(c, self, addr)
|
||||
conn.start()
|
||||
self.addConn(conn)
|
||||
finally:
|
||||
self.running = False
|
||||
self.soc.close()
|
||||
|
||||
def printLog(self, log):
|
||||
self.logLock.acquire()
|
||||
print log
|
||||
self.logLock.release()
|
||||
|
||||
def addConn(self, conn):
|
||||
try:
|
||||
self.threadsLock.acquire()
|
||||
if self.running:
|
||||
self.threads.append(conn)
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
def removeConn(self, conn):
|
||||
try:
|
||||
self.threadsLock.acquire()
|
||||
self.threads.remove(conn)
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
self.running = False
|
||||
self.threadsLock.acquire()
|
||||
|
||||
threads = list(self.threads)
|
||||
for c in threads:
|
||||
c.close()
|
||||
finally:
|
||||
self.threadsLock.release()
|
||||
|
||||
|
||||
class ConnectionHandler(threading.Thread):
|
||||
def __init__(self, socClient, server, addr):
|
||||
threading.Thread.__init__(self)
|
||||
self.clientClosed = False
|
||||
self.targetClosed = True
|
||||
self.client = socClient
|
||||
self.client_buffer = ''
|
||||
self.server = server
|
||||
self.log = 'Connection: ' + str(addr)
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
if not self.clientClosed:
|
||||
self.client.shutdown(socket.SHUT_RDWR)
|
||||
self.client.close()
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
self.clientClosed = True
|
||||
|
||||
try:
|
||||
if not self.targetClosed:
|
||||
self.target.shutdown(socket.SHUT_RDWR)
|
||||
self.target.close()
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
self.targetClosed = True
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.client_buffer = self.client.recv(BUFLEN)
|
||||
|
||||
hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
|
||||
|
||||
if hostPort == '':
|
||||
hostPort = DEFAULT_HOST
|
||||
|
||||
split = self.findHeader(self.client_buffer, 'X-Split')
|
||||
|
||||
if split != '':
|
||||
self.client.recv(BUFLEN)
|
||||
|
||||
if hostPort != '':
|
||||
passwd = self.findHeader(self.client_buffer, 'X-Pass')
|
||||
|
||||
if len(PASS) != 0 and passwd == PASS:
|
||||
self.method_CONNECT(hostPort)
|
||||
elif len(PASS) != 0 and passwd != PASS:
|
||||
self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
|
||||
elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
|
||||
self.method_CONNECT(hostPort)
|
||||
else:
|
||||
self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
|
||||
else:
|
||||
print '- No X-Real-Host!'
|
||||
self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
|
||||
|
||||
except Exception as e:
|
||||
self.log += ' - error: ' + e.strerror
|
||||
self.server.printLog(self.log)
|
||||
pass
|
||||
finally:
|
||||
self.close()
|
||||
self.server.removeConn(self)
|
||||
|
||||
def findHeader(self, head, header):
|
||||
aux = head.find(header + ': ')
|
||||
|
||||
if aux == -1:
|
||||
return ''
|
||||
|
||||
aux = head.find(':', aux)
|
||||
head = head[aux+2:]
|
||||
aux = head.find('\r\n')
|
||||
|
||||
if aux == -1:
|
||||
return ''
|
||||
|
||||
return head[:aux];
|
||||
|
||||
def connect_target(self, host):
|
||||
i = host.find(':')
|
||||
if i != -1:
|
||||
port = int(host[i+1:])
|
||||
host = host[:i]
|
||||
else:
|
||||
if self.method=='CONNECT':
|
||||
port = 443
|
||||
else:
|
||||
port = 80
|
||||
port = 8080
|
||||
port = 8799
|
||||
port = 3128
|
||||
|
||||
(soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
|
||||
|
||||
self.target = socket.socket(soc_family, soc_type, proto)
|
||||
self.targetClosed = False
|
||||
self.target.connect(address)
|
||||
|
||||
def method_CONNECT(self, path):
|
||||
self.log += ' - CONNECT ' + path
|
||||
|
||||
self.connect_target(path)
|
||||
self.client.sendall(RESPONSE)
|
||||
self.client_buffer = ''
|
||||
|
||||
self.server.printLog(self.log)
|
||||
self.doCONNECT()
|
||||
|
||||
def doCONNECT(self):
|
||||
socs = [self.client, self.target]
|
||||
count = 0
|
||||
error = False
|
||||
while True:
|
||||
count += 1
|
||||
(recv, _, err) = select.select(socs, [], socs, 3)
|
||||
if err:
|
||||
error = True
|
||||
if recv:
|
||||
for in_ in recv:
|
||||
try:
|
||||
data = in_.recv(BUFLEN)
|
||||
if data:
|
||||
if in_ is self.target:
|
||||
self.client.send(data)
|
||||
else:
|
||||
while data:
|
||||
byte = self.target.send(data)
|
||||
data = data[byte:]
|
||||
|
||||
count = 0
|
||||
else:
|
||||
break
|
||||
except:
|
||||
error = True
|
||||
break
|
||||
if count == TIMEOUT:
|
||||
error = True
|
||||
|
||||
if error:
|
||||
break
|
||||
|
||||
def main(host=LISTENING_ADDR, port=LISTENING_PORT):
|
||||
|
||||
print "\n:-------PythonProxy-------:\n"
|
||||
print "Listening addr: " + LISTENING_ADDR
|
||||
print "Listening port: " + str(LISTENING_PORT) + "\n"
|
||||
print ":-------------------------:\n"
|
||||
|
||||
server = Server(LISTENING_ADDR, LISTENING_PORT)
|
||||
server.start()
|
||||
|
||||
while True:
|
||||
try:
|
||||
time.sleep(2)
|
||||
except KeyboardInterrupt:
|
||||
print 'Stopping...'
|
||||
server.close()
|
||||
break
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
PYTHON
|
||||
) > $HOME/proxy.log
|
||||
screen -dmS ws${port} python /bin/ejecutar/PDirect${port}.py ${port} &
|
||||
print_center -verd " ${aLerT} VERIFICANDO ACTIVIDAD DE SOCK PYTHON ${aLerT} \n ${aLerT} PORVAFOR ESPERE !! ${aLerT} "
|
||||
autoboot &> /dev/null
|
||||
sleep 2s && tput cuu1 && tput dl1
|
||||
sleep 1s && tput cuu1 && tput dl1
|
||||
[[ $(ps x | grep "ws${port} python" |grep -v grep ) ]] && {
|
||||
msg -bar3
|
||||
print_center -verd " REACTIVADOR DE SOCK Python ${port} ENCENDIDO "
|
||||
[[ $(grep -wc "ws${port}" /bin/autoboot) = '0' ]] && {
|
||||
echo -e "netstat -tlpn | grep -w ${port} > /dev/null || { screen -r -S 'ws${port}' -X quit; screen -dmS ws${port} python /bin/ejecutar/PDirect${port}.py & >> /root/proxy.log ; }" >>/bin/autoboot
|
||||
} || {
|
||||
sed -i '/ws${port}/d' /bin/autoboot
|
||||
echo -e "netstat -tlpn | grep -w ${port} > /dev/null || { screen -r -S 'ws${port}' -X quit; screen -dmS ws${port} python /bin/ejecutar/PDirect${port}.py & >> /root/proxy.log ; }" >>/bin/autoboot
|
||||
}
|
||||
crontab -l > /root/cron
|
||||
[[ -z $(cat < /root/cron | grep 'autoboot') ]] && echo "@reboot /bin/autoboot" >> /root/cron || {
|
||||
[[ $(grep -wc "autoboot" /root/cron) > "1" ]] && {
|
||||
sed -i '/autoboot/d' /root/cron
|
||||
echo "@reboot /bin/autoboot" >> /root/cron
|
||||
}
|
||||
}
|
||||
crontab /root/cron
|
||||
service cron restart
|
||||
sleep 2s && tput cuu1 && tput dl1
|
||||
} || {
|
||||
print_center -azu " FALTA ALGUN PARAMETRO PARA INICIAR REACTIVADOR "
|
||||
sleep 2s && tput cuu1 && tput dl1
|
||||
return
|
||||
}
|
||||
tput cuu1 && tput dl1
|
||||
msg -bar3
|
||||
[[ $(ps x | grep -w "ws${port}" | grep -v "grep" | awk -F "pts" '{print $1}') ]] && print_center -verd "PYTHON INICIADO CON EXITO!!!" || print_center -ama " ERROR AL INICIAR PYTHON!!!"
|
||||
msg -bar3
|
||||
exit
|
||||
276
Recursos/menu_inst/autoconfig.sh
Normal file
276
Recursos/menu_inst/autoconfig.sh
Normal file
@ -0,0 +1,276 @@
|
||||
#!/bin/bash
|
||||
#-----------------------------------------------------------------------
|
||||
source msg
|
||||
msg -bar
|
||||
ADM_inst="/etc/adm-lite" && [[ ! -d ${ADM_inst} ]] && exit
|
||||
system=$(cat -n /etc/issue |grep 1 |cut -d ' ' -f6,7,8 |sed 's/1//' |sed 's/ //')
|
||||
vercion=$(echo $system|awk '{print $2}'|cut -d '.' -f1,2)
|
||||
echo -e "ESPERE UN MOMENTO MIENTRAS FIXEAMOS SU SISTEMA "
|
||||
|
||||
fun_upgrade() {
|
||||
sync
|
||||
echo 3 >/proc/sys/vm/drop_caches
|
||||
sync && sysctl -w vm.drop_caches=3
|
||||
sysctl -w vm.drop_caches=0
|
||||
swapoff -a
|
||||
swapon -a
|
||||
sudo apt install software-properties-common -y &> /dev/null
|
||||
apt install python2 -y &> /dev/null
|
||||
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 &> /dev/null
|
||||
rm -rf /tmp/* > /dev/null 2>&1
|
||||
killall kswapd0 > /dev/null 2>&1
|
||||
killall tcpdump > /dev/null 2>&1
|
||||
killall ksoftirqd > /dev/null 2>&1
|
||||
echo > /etc/fixpython
|
||||
}
|
||||
|
||||
function aguarde() {
|
||||
sleep .1
|
||||
echo -e "SU VERSION DE UBUNTU ${vercion} ES SUPERIOR A 18.04 "
|
||||
helice() {
|
||||
fun_upgrade >/dev/null 2>&1 &
|
||||
tput civis
|
||||
while [ -d /proc/$! ]; do
|
||||
for i in / - \\ \|; do
|
||||
sleep .1
|
||||
echo -ne "\e[1D$i"
|
||||
done
|
||||
done
|
||||
tput cnorm
|
||||
}
|
||||
echo -ne "\033[1;37m OPTIMIZANDO Y \033[1;32mFIXEANDO \033[1;37mPYTHON \033[1;32m.\033[1;32m.\033[1;33m.\033[1;31m. \033[1;33m"
|
||||
helice
|
||||
echo -e "\e[1DOk"
|
||||
}
|
||||
|
||||
[[ "${vercion}" > "20" ]] && {
|
||||
echo -e ""
|
||||
msg -bar
|
||||
[[ -e /etc/fixpython ]] || aguarde
|
||||
} || {
|
||||
echo
|
||||
[[ -e /etc/fixpython ]] || {
|
||||
echo -e " SU VERSION DE UBUNTU ${vercion} ES INFERIOR O 18.04 "
|
||||
apt-get install python -y &>/dev/null
|
||||
apt-get install python3 -y &>/dev/null
|
||||
touch /etc/fixpython
|
||||
}
|
||||
}
|
||||
clear
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
blanco(){
|
||||
[[ ! $2 = 0 ]] && {
|
||||
echo -e "\033[1;37m$1\033[0m"
|
||||
} || {
|
||||
echo -ne " \033[1;37m$1:\033[0m "
|
||||
}
|
||||
}
|
||||
|
||||
col(){
|
||||
|
||||
nom=$(printf '%-55s' "\033[0;92m${1} \033[0;31m>> \033[1;37m${2}")
|
||||
echo -e " $nom\033[0;31m${3} \033[0;92m${4}\033[0m"
|
||||
}
|
||||
|
||||
|
||||
vacio(){
|
||||
|
||||
blanco "\n no se puede ingresar campos vacios..."
|
||||
}
|
||||
|
||||
cancelar(){
|
||||
|
||||
echo -e "\n \033[3;49;31minstalacion cancelada...\033[0m"
|
||||
}
|
||||
|
||||
continuar(){
|
||||
|
||||
echo -e " \033[3;49;32mEnter para continuar...\033[0m"
|
||||
}
|
||||
|
||||
un_bar () {
|
||||
comando[0]="$1"
|
||||
comando[1]="$2"
|
||||
(
|
||||
[[ -e $HOME/fim ]] && rm $HOME/fim
|
||||
${comando[0]} > /dev/null 2>&1
|
||||
${comando[1]} > /dev/null 2>&1
|
||||
touch $HOME/fim
|
||||
) > /dev/null 2>&1 &
|
||||
tput civis
|
||||
echo -e "${col1}---------------------------------------------------${col0}"
|
||||
echo -ne "${col7} ESPERE..${col5}["
|
||||
while true; do
|
||||
for((i=0; i<18; i++)); do
|
||||
echo -ne "${col4}#"
|
||||
sleep 0.2s
|
||||
done
|
||||
[[ -e $HOME/fim ]] && rm $HOME/fim && break
|
||||
echo -e "${col5}"
|
||||
sleep 1s
|
||||
tput cuu1
|
||||
tput dl1
|
||||
echo -ne "${col7} ESPERE..${col5}["
|
||||
done
|
||||
echo -e "${col5}]${col7} -${col2} INSTALADO !${col7}"
|
||||
tput cnorm
|
||||
echo -e "${col1}---------------------------------------------------${col0}"
|
||||
}
|
||||
|
||||
|
||||
|
||||
function fix_ssl() {
|
||||
helice() {
|
||||
inst_ssl >/dev/null 2>&1 &
|
||||
tput civis
|
||||
while [ -d /proc/$! ]; do
|
||||
for i in / - \\ \|; do
|
||||
sleep .1
|
||||
echo -ne "\e[1D$i"
|
||||
done
|
||||
done
|
||||
tput cnorm
|
||||
}
|
||||
echo -ne "\033[1;37m INSTALANDO \033[1;32mSTUNNEL (\033[1;37mS\033[1;32mS\033[1;32mL\033[1;33m)\033[1;31m. \033[1;33m"
|
||||
helice
|
||||
echo -e "\e[1DOk"
|
||||
}
|
||||
|
||||
function fix_py() {
|
||||
helice() {
|
||||
inst_py >/dev/null 2>&1 &
|
||||
tput civis
|
||||
while [ -d /proc/$! ]; do
|
||||
for i in / - \\ \|; do
|
||||
sleep .1
|
||||
echo -ne "\e[1D$i"
|
||||
done
|
||||
done
|
||||
tput cnorm
|
||||
}
|
||||
echo -ne "\033[1;37m INSTALANDO \033[1;32m PYTHON (\033[1;37mS\033[1;32mO\033[1;32mC\033[1;33mK\033[1;31mS\033[1;33m)\033[1;32m . \033[1;33m"
|
||||
helice
|
||||
echo -e "\e[1DOk"
|
||||
}
|
||||
|
||||
|
||||
inst_ssl () {
|
||||
pkill -f stunnel4
|
||||
apt purge stunnel4 -y > /dev/null 2>&1
|
||||
apt install stunnel4 -y > /dev/null 2>&1
|
||||
echo -e "cert = /etc/stunnel/stunnel.pem\nclient = no\nsocket = a:SO_REUSEADDR=1\nsocket = l:TCP_NODELAY=1\nsocket = r:TCP_NODELAY=1\n\n[stunnel]\naccept = 443\nconnect = 127.0.0.1:80\n" > /etc/stunnel/stunnel.conf
|
||||
openssl genrsa -out key.pem 2048 > /dev/null 2>&1
|
||||
(echo "$(curl -sSL ipinfo.io > info && cat info | grep country | awk '{print $2}' | sed -e 's/[^a-z0-9 -]//ig')" ; echo "" ; echo "$(cat < /bin/ejecutar/IPcgh):81" ; echo "" ; echo "" ; echo "" ; echo "@cloudflare" )|openssl req -new -x509 -key key.pem -out cert.pem -days 1095 > /dev/null 2>&1
|
||||
cat key.pem cert.pem >> /etc/stunnel/stunnel.pem
|
||||
sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
|
||||
service stunnel4 restart > /dev/null 2>&1
|
||||
rm -f info key.pem cert.pem
|
||||
}
|
||||
|
||||
|
||||
inst_py () {
|
||||
sed -i '/PDirect80.py/d' /bin/autoboot
|
||||
#msg -bar
|
||||
#msg -nama ' Descargando binario Compilado !! '
|
||||
wget -O $HOME/PDirect80.py 'https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/autoconfig-sh/PDirect.py'
|
||||
screen -dmS "ws80" python $HOME/PDirect80.py & > /root/proxy.log
|
||||
}
|
||||
|
||||
menuintro() {
|
||||
clear&&clear
|
||||
msg -bar #echo -e "\033[1;31m———————————————————————————————————————————————————\033[1;37m"
|
||||
echo -e "\033[1;32m SSL + ( Payload / Directo ) | by: @drowkid01 "
|
||||
msg -bar #echo -e "\033[1;31m———————————————————————————————————————————————————\033[1;37m"
|
||||
echo -e "\033[1;36m SCRIPT REESTRUCTURA y AUTOCONFIGURACION "
|
||||
msg -bar #echo -e "\033[1;31m———————————————————————————————————————————————————\033[1;37m"
|
||||
echo -e "\033[1;37m Requiere tener el puerto libre 443 y el 80"
|
||||
msg -bar
|
||||
echo -e "\033[1;32m Visita https://t.me/drowkid01, para detalles "
|
||||
msg -bar
|
||||
while :
|
||||
do
|
||||
#col "5)" "\033[1;33mCONFIGURAR Trojan"
|
||||
col "1)" "\033[1;33mSSL + (Payload/Directo) - AUTO INSTALL"
|
||||
#msg -bar
|
||||
col "2)" "\033[1;33mCONFIGURAR PYTHON (RESPONSE STATUS 200)"
|
||||
|
||||
col "3)" "\033[1;33mRemover AUTOCONFIG (Payload+SSL)"
|
||||
msg -bar
|
||||
col "0)" "SALIR \033[0;31m"
|
||||
msg -bar
|
||||
blanco "opcion" 0
|
||||
read opcion
|
||||
case $opcion in
|
||||
1)
|
||||
clear&&clear
|
||||
source /etc/adm-lite/cabecalho
|
||||
msg -nama ' RECONFIGURANDO STUNNEL (SSL) !! '
|
||||
echo ''
|
||||
fix_ssl
|
||||
msg -nama ' RECONFIGURANDO PYTHON SOCKS 80 !! '
|
||||
echo ''
|
||||
fix_py
|
||||
#-------------------------------------------------------------------
|
||||
print_center -verd " ${aLerT} VERIFICANDO ACTIVIDAD DE SOCK PYTHON ${aLerT} \n ${aLerT} PORVAFOR ESPERE !! ${aLerT} "
|
||||
autoboot &> /dev/null
|
||||
sleep 2s && tput cuu1 && tput dl1
|
||||
sleep 1s && tput cuu1 && tput dl1
|
||||
|
||||
[[ $(ps x | grep "ws80 python" |grep -v grep ) ]] && {
|
||||
msg -bar
|
||||
print_center -verd " REACTIVADOR DE SOCK Python 80 ENCENDIDO "
|
||||
[[ $(grep -wc "ws80" /bin/autoboot) = '0' ]] && {
|
||||
echo -e "netstat -tlpn | grep -w 80 > /dev/null || { screen -r -S 'ws80' -X quit; screen -dmS ws80 python $HOME/PDirect80.py & >> /root/proxy.log ; }" >>/bin/autoboot
|
||||
} || {
|
||||
sed -i '/ws80/d' /bin/autoboot
|
||||
echo -e "netstat -tlpn | grep -w 80 > /dev/null || { screen -r -S 'ws80' -X quit; screen -dmS ws80 python $HOME/PDirect80.py & >> /root/proxy.log ; }" >>/bin/autoboot
|
||||
}
|
||||
crontab -l > /root/cron
|
||||
[[ -z $(cat < /root/cron | grep 'autoboot') ]] && echo "@reboot /bin/autoboot" >> /root/cron || {
|
||||
[[ $(grep -wc "autoboot" /root/cron) > "1" ]] && {
|
||||
sed -i '/autoboot/d' /root/cron
|
||||
echo "@reboot /bin/autoboot" >> /root/cron
|
||||
}
|
||||
}
|
||||
|
||||
crontab /root/cron
|
||||
service cron restart
|
||||
sleep 2s && tput cuu1 && tput dl1
|
||||
} || {
|
||||
print_center -azu " FALTA ALGUN PARAMETRO PARA INICIAR REACTIVADOR "
|
||||
sleep 2s && tput cuu1 && tput dl1
|
||||
return
|
||||
}
|
||||
tput cuu1 && tput dl1
|
||||
msg -bar
|
||||
[[ $(ps x | grep -w "PDirect80.py" | grep -v "grep" | awk -F "pts" '{print $1}') ]] && print_center -verd "PYTHON INICIADO CON EXITO!!!" || print_center -ama " ERROR AL INICIAR PYTHON!!!"
|
||||
msg -bar
|
||||
sleep 1
|
||||
echo -e " INSTALACIÓN TERMINADA"
|
||||
msg -bar
|
||||
echo -e "Solucionado el error de conectividad mediante el puerto $porta con SNI"
|
||||
break
|
||||
;;
|
||||
2)
|
||||
source <(curl -sSL https://raw.githubusercontent.com/emirjorge/Script-Z/master/CHUMO/Recursos/menu_inst/autoconfig-sh/Proxy.sh)
|
||||
;;
|
||||
3)
|
||||
kill $(ps x | grep -w "PDirect80" | grep -v grep | cut -d ' ' -f1) &>/dev/null
|
||||
sed -i '/PDirect80/d' /bin/autoboot
|
||||
screen -wipe &>/dev/null
|
||||
autoboot &>/dev/null
|
||||
;;
|
||||
0) break;;
|
||||
*) blanco "\n selecione una opcion del 0 al 2" && sleep 1;;
|
||||
esac
|
||||
done
|
||||
continuar
|
||||
}
|
||||
#chekKEY &> /dev/null 2>&1
|
||||
menuintro
|
||||
|
||||
223
Recursos/menu_inst/front.sh
Normal file
223
Recursos/menu_inst/front.sh
Normal file
@ -0,0 +1,223 @@
|
||||
#!/bin/bash
|
||||
#PUTO EL QUE LO DESENCRIPTA
|
||||
#colores
|
||||
lor1='\033[1;31m';lor2='\033[1;32m';lor3='\033[1;33m';lor4='\033[1;34m';lor5='\033[1;35m';lor6='\033[1;36m';lor7='\033[1;37m'
|
||||
|
||||
fun_bar () {
|
||||
comando[0]="$1"
|
||||
comando[1]="$2"
|
||||
(
|
||||
[[ -e $HOME/fim ]] && rm $HOME/fim
|
||||
${comando[0]} > /dev/null 2>&1
|
||||
${comando[1]} > /dev/null 2>&1
|
||||
touch $HOME/fim
|
||||
) > /dev/null 2>&1 &
|
||||
tput civis
|
||||
echo -e "${lor7}---------------------------------------------------${lor7}"
|
||||
echo -ne "${lor7} ESPERE.${lor1}["
|
||||
while true; do
|
||||
for((i=0; i<18; i++)); do
|
||||
echo -ne "${lor5}#"
|
||||
sleep 0.1s
|
||||
done
|
||||
[[ -e $HOME/fim ]] && rm $HOME/fim && break
|
||||
echo -e "${col5}"
|
||||
sleep 0.3s
|
||||
tput cuu1
|
||||
tput dl1
|
||||
echo -ne "${lor7} WAIT..${lor1}["
|
||||
done
|
||||
echo -e "${lor1}]${lor7} -${lor7} FINISHED ${lor7}"
|
||||
tput cnorm
|
||||
echo -e "${lor7}---------------------------------------------------${lor7}"
|
||||
}
|
||||
|
||||
banner=" ___ _ _ _ _
|
||||
/ _ \_ __ ___ | |_ ___ /\ /(_) | |
|
||||
/ /_)/ '__/ _ \| __/ _ \ / //_/ | | |
|
||||
/ ___/| | | (_) | || (_) / __ \| | | |
|
||||
\/ |_| \___/ \__\___/\/ \/|_|_|_| "
|
||||
|
||||
espe () {
|
||||
echo -e "${lor7}"
|
||||
read -p " Enter to Continue.. 0 to return"
|
||||
}
|
||||
|
||||
clear&&clear
|
||||
echo -e "${lor4}***************************************************${lor7}"
|
||||
echo -e "${lor2} SSL STUNNEL MANAGER "
|
||||
echo -e "${lor1}===================================================${lor7} "
|
||||
echo -e "${lor4}$banner ${lor7}"
|
||||
echo -e "${lor7} Mini Script Panel created by @KillShito "
|
||||
echo -e "${lor1}[-]——————————————————————————————————————————————[-]${lor7}"
|
||||
[[ $(netstat -nplt |grep 'stunnel4') ]] && sessl="STOP SERVICE ${lor2}ON" || sessl="START SERVICE ${lor1}OFF"
|
||||
echo -e "${lor7}[${lor2}1${lor7}] ${lor3}==>${lor7} INSTALL SSL STUNNEL"
|
||||
echo -e "${lor7}[${lor2}2${lor7}] ${lor3}==>${lor7} UNINSTALL SSL STUNNEL "
|
||||
echo -e "${lor7}[${lor2}3${lor7}] ${lor3}==>${lor7} ADD NEW PORT "
|
||||
echo -e "${lor7}[${lor2}4${lor7}] ${lor3}==>${lor7} $sessl "
|
||||
echo -e "${lor7}[${lor2}5${lor7}] ${lor3}==>${lor7} CERTIFICATE "
|
||||
echo -e "${lor1}[-]——————————————————————————————————————————————[-]${lor7}"
|
||||
echo -e "${lor7}[${lor2}0${lor7}] ${lor3}==>${lor7} SALIR "
|
||||
echo -e "${lor1}[-]——————————————————————————————————————————————[-]${lor7}"
|
||||
read -p "SELECT OPTION :" opci
|
||||
if [ "$opci" = "1" ];then
|
||||
if [ -f /etc/stunnel/stunnel.conf ]; then
|
||||
echo;echo -e "${lor1} ALREADY INSTALLED"
|
||||
else
|
||||
echo;echo -e "${lor7} Local port ${lor6}"
|
||||
pt=$(netstat -nplt |grep 'sshd' | awk -F ":" NR==1{'print $2'} | cut -d " " -f 1)
|
||||
read -p " PORTA :" -e -i $pt PT
|
||||
echo;echo -e "${lor7} Listen-SSL ${lor6}"
|
||||
read -p " PORTA :" sslpt
|
||||
if [ -z $sslpt ]; then
|
||||
echo;echo -e "${lor1} INVALID PORT"
|
||||
else
|
||||
if (echo $sslpt | egrep '[^0-9]' &> /dev/null);then
|
||||
echo;echo -e "${lor1} YOU MUST ENTER A NUMBER"
|
||||
else
|
||||
if lsof -Pi :$sslpt -sTCP:LISTEN -t >/dev/null ; then
|
||||
echo;echo -e "${lor1} THE PORT IS ALREADY IN USE"
|
||||
else
|
||||
inst_ssl () {
|
||||
apt-get purge stunnel4 -y
|
||||
apt-get purge stunnel -y
|
||||
apt-get install stunnel -y
|
||||
apt-get install stunnel4 -y
|
||||
pt=$(netstat -nplt |grep 'sshd' | awk -F ":" NR==1{'print $2'} | cut -d " " -f 1)
|
||||
echo -e "cert = /etc/stunnel/stunnel.pem\nclient = no\nsocket = a:SO_REUSEADDR=1\nsocket = l:TCP_NODELAY=1\nsocket = r:TCP_NODELAY=1\n\n[stunnel]\nconnect = 127.0.0.1:${PT}\naccept = ${sslpt}" > /etc/stunnel/stunnel.conf
|
||||
openssl genrsa -out key.pem 2048 > /dev/null 2>&1
|
||||
(echo "$(curl -sSL ipinfo.io > info && cat info | grep country | awk '{print $2}' | sed -e 's/[^a-z0-9 -]//ig')" ; echo "" ; echo "$(wget -qO- ifconfig.me):81" ; echo "" ; echo "" ; echo "" ; echo "@drowkid01")|openssl req -new -x509 -key key.pem -out cert.pem -days 1095 > /dev/null 2>&1
|
||||
cat key.pem cert.pem >> /etc/stunnel/stunnel.pem
|
||||
rm -rf key.pem;rm -rf cert.pem
|
||||
sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
|
||||
service stunnel4 restart
|
||||
service stunnel restart
|
||||
service stunnel4 start
|
||||
}
|
||||
fun_bar 'inst_ssl'
|
||||
echo;echo -e "${lor2} SSL STUNNEL INSTALLED "
|
||||
fi;fi;fi;fi
|
||||
fi
|
||||
if [ "$opci" = "2" ];then
|
||||
del_ssl () {
|
||||
service stunnel4 stop
|
||||
apt-get remove stunnel4 -y
|
||||
apt-get purge stunnel4 -y
|
||||
apt-get purge stunnel -y
|
||||
rm -rf /etc/stunnel
|
||||
rm -rf /etc/stunnel/stunnel.conf
|
||||
rm -rf /etc/default/stunnel4
|
||||
rm -rf /etc/stunnel/stunnel.pem
|
||||
}
|
||||
fun_bar 'del_ssl'
|
||||
echo;echo -e "${lor2} SSL STUNNEL WAS REMOVED "
|
||||
fi
|
||||
if [ "$opci" = "3" ];then
|
||||
if [ -f /etc/stunnel/stunnel.conf ]; then
|
||||
echo;echo -e "${lor7}Enter a name for the SSL Redirector${lor6}"
|
||||
read -p " :" -e -i stunnel namessl
|
||||
echo;echo -e "${lor7}Enter the port of the Service to bind${lor6}"
|
||||
pt=$(netstat -nplt |grep 'sshd' | awk -F ":" NR==1{'print $2'} | cut -d " " -f 1)
|
||||
read -p " :" -e -i $pt PT
|
||||
echo;echo -e "${lor7}Enter the New SSL Port${lor6}"
|
||||
read -p " :" sslpt
|
||||
if [ -z $sslpt ]; then
|
||||
echo;echo -e "${lor1} INVALID PORT"
|
||||
else
|
||||
if (echo $sslpt | egrep '[^0-9]' &> /dev/null);then
|
||||
echo;echo -e "${lor1} YOU MUST ENTER A NUMBER"
|
||||
else
|
||||
if lsof -Pi :$sslpt -sTCP:LISTEN -t >/dev/null ; then
|
||||
echo;echo -e "${lor1} THE PORT IS ALREADY IN USE"
|
||||
else
|
||||
addgf () {
|
||||
echo -e "\n[$namessl] " >> /etc/stunnel/stunnel.conf
|
||||
echo "connect = 127.0.0.1:$PT" >> /etc/stunnel/stunnel.conf
|
||||
echo "accept = $sslpt " >> /etc/stunnel/stunnel.conf
|
||||
service stunnel4 restart 1> /dev/null 2> /dev/null
|
||||
service stunnel restart 1> /dev/null 2> /dev/null
|
||||
sleep 2
|
||||
}
|
||||
fun_bar 'addgf'
|
||||
echo;echo -e "${lor2} NEW PORT ADDED $sslpt !${lor7}"
|
||||
fi;fi;fi
|
||||
else
|
||||
echo;echo -e "${lor1} SSL STUNEEL NOT INSTALLED !${lor7}"
|
||||
fi
|
||||
fi
|
||||
if [ "$opci" = "4" ];then
|
||||
if [ -f /etc/stunnel/stunnel.conf ];then
|
||||
if netstat -nltp|grep 'stunnel4' > /dev/null; then
|
||||
service stunnel stop 1> /dev/null 2> /dev/null
|
||||
service stunnel4 stop 1> /dev/null 2> /dev/null
|
||||
echo;echo -e "${lor1} SERVICE STOPPED "
|
||||
else
|
||||
service stunnel start 1> /dev/null 2> /dev/null
|
||||
service stunnel4 start 1> /dev/null 2> /dev/null
|
||||
echo;echo -e "${lor2} SERVICE STARTED "
|
||||
fi
|
||||
else
|
||||
echo;echo -e "${lor1} SSL STUNNEL IS NOT INSTALLED "
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$opci" = "5" ];then
|
||||
if [ -f /etc/stunnel/stunnel.conf ]; then
|
||||
insapa2(){
|
||||
for pid in $(pgrep python);do
|
||||
kill $pid
|
||||
done
|
||||
for pid in $(pgrep apache2);do
|
||||
kill $pid
|
||||
done
|
||||
service dropbear stop
|
||||
apt install apache2 -y
|
||||
echo "Listen 80
|
||||
|
||||
<IfModule ssl_module>
|
||||
Listen 443
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_gnutls.c>
|
||||
Listen 443
|
||||
</IfModule> " > /etc/apache2/ports.conf
|
||||
service apache2 restart
|
||||
}
|
||||
fun_bar 'insapa2'
|
||||
echo;echo -e "${lor7} Verify Domain ${lor6}"
|
||||
read -p " KEY:" keyy
|
||||
echo
|
||||
read -p " DATA:" dat2w
|
||||
mkdir -p /var/www/html/.well-known/pki-validation/
|
||||
datfr1=$(echo "$dat2w"|awk '{print $1}')
|
||||
datfr2=$(echo "$dat2w"|awk '{print $2}')
|
||||
datfr3=$(echo "$dat2w"|awk '{print $3}')
|
||||
echo -ne "${datfr1}\n${datfr2}\n${datfr3}" >/var/www/html/.well-known/pki-validation/$keyy.txt
|
||||
echo;echo -e "${lor3} CHECK ON THE ZEROSSL PAGE ${lor7}"
|
||||
read -p " ENTER TO CONTINUE"
|
||||
echo;echo -e "${lor7} CERTIFICATE LINK ${lor6}"
|
||||
echo -e "${lor6} LINK ${lor1}> ${lor7}\c"
|
||||
read linksd
|
||||
inscerts(){
|
||||
wget $linksd -O /etc/stunnel/certificado.zip
|
||||
cd /etc/stunnel/
|
||||
unzip certificado.zip
|
||||
cat private.key certificate.crt ca_bundle.crt > stunnel.pem
|
||||
service stunnel restart
|
||||
service stunnel4 restart
|
||||
}
|
||||
fun_bar 'inscerts'
|
||||
sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf
|
||||
service apache2 restart > /dev/null
|
||||
echo;echo -e "${lor2} CERTIFICATE INSTALLED ${lor7}"
|
||||
else
|
||||
echo;echo -e "${lor1} SSL STUNNEL IS NOT INSTALLED "
|
||||
fi
|
||||
fi
|
||||
[[ $opci = "0" ]] && {
|
||||
sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf
|
||||
service apache2 restart
|
||||
exit && menu
|
||||
}
|
||||
espe
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/front.sh)
|
||||
1308
Recursos/menu_inst/h_beta-sh/trojan-go
Normal file
1308
Recursos/menu_inst/h_beta-sh/trojan-go
Normal file
File diff suppressed because it is too large
Load Diff
505
Recursos/menu_inst/h_beta-sh/wireguard-install.sh
Normal file
505
Recursos/menu_inst/h_beta-sh/wireguard-install.sh
Normal file
@ -0,0 +1,505 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Instalador de servidor Secure WireGuard
|
||||
# https://github.com/leitura/wireguard-install
|
||||
clear&&clear
|
||||
RED='\033[0;31m'
|
||||
ORANGE='\033[0;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
function isRoot() {
|
||||
if [ "${EUID}" -ne 0 ]; then
|
||||
echo "Você precisa executar este script como root"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function checkVirt() {
|
||||
if [ "$(systemd-detect-virt)" == "openvz" ]; then
|
||||
echo "OpenVZ no es compatible"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(systemd-detect-virt)" == "lxc" ]; then
|
||||
echo "LXC no es compatible (todavía)."
|
||||
echo "WireGuard técnicamente puede ejecutarse en un contenedor LXC,"
|
||||
echo "pero el módulo del kernel debe estar instalado en el host,"
|
||||
echo "el contenedor debe ejecutarse con algunos parámetros específicos"
|
||||
echo "y solo las herramientas deben instalarse en el contenedor."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function checkOS() {
|
||||
# Check OS version
|
||||
if [[ -e /etc/debian_version ]]; then
|
||||
source /etc/os-release
|
||||
OS="${ID}" # debian or ubuntu
|
||||
if [[ ${ID} == "debian" || ${ID} == "raspbian" ]]; then
|
||||
if [[ ${VERSION_ID} -lt 10 ]]; then
|
||||
echo "Su versión de Debian (${VERSION_ID}) no es compatible. Utilice Debian 10 Buster o posterior"
|
||||
exit 1
|
||||
fi
|
||||
OS=debian # overwrite if raspbian
|
||||
fi
|
||||
elif [[ -e /etc/fedora-release ]]; then
|
||||
source /etc/os-release
|
||||
OS="${ID}"
|
||||
elif [[ -e /etc/centos-release ]]; then
|
||||
source /etc/os-release
|
||||
OS=centos
|
||||
elif [[ -e /etc/oracle-release ]]; then
|
||||
source /etc/os-release
|
||||
OS=oracle
|
||||
elif [[ -e /etc/arch-release ]]; then
|
||||
OS=arch
|
||||
else
|
||||
echo "Parece que no está ejecutando este instalador en un sistema Debian, Ubuntu, Fedora, CentOS, Oracle o Arch Linux"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function initialCheck() {
|
||||
isRoot
|
||||
checkVirt
|
||||
checkOS
|
||||
}
|
||||
|
||||
function installQuestions() {
|
||||
echo "¡Bienvenido al instalador de WireGuard!"
|
||||
#echo "O repositório git está disponível em: https://github.com/leitura/wireguard-install"
|
||||
echo ""
|
||||
echo "Necesito hacer algunas preguntas antes de comenzar la configuración."
|
||||
echo "Puede dejar las opciones predeterminadas y simplemente presionar Entrar si está de acuerdo con ellas."
|
||||
echo ""
|
||||
|
||||
# Detect public IPv4 or IPv6 address and pre-fill for the user
|
||||
#SERVER_PUB_IP=$(ip -4 addr | sed -ne 's|^.* inet \([^/]*\)/.* scope global.*$|\1|p' | awk '{print $1}' | head -1)
|
||||
SERVER_PUB_IP=$(wget -qO- ifconfig.me)
|
||||
if [[ -z ${SERVER_PUB_IP} ]]; then
|
||||
# Detect public IPv6 address
|
||||
SERVER_PUB_IP=$(ip -6 addr | sed -ne 's|^.* inet6 \([^/]*\)/.* scope global.*$|\1|p' | head -1)
|
||||
fi
|
||||
read -rp "Dirección pública IPv4 o IPv6: " -e -i "${SERVER_PUB_IP}" SERVER_PUB_IP
|
||||
|
||||
# Detect public interface and pre-fill for the user
|
||||
SERVER_NIC="$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)"
|
||||
until [[ ${SERVER_PUB_NIC} =~ ^[a-zA-Z0-9_]+$ ]]; do
|
||||
read -rp "Interface pública: " -e -i "${SERVER_NIC}" SERVER_PUB_NIC
|
||||
done
|
||||
|
||||
until [[ ${SERVER_WG_NIC} =~ ^[a-zA-Z0-9_]+$ && ${#SERVER_WG_NIC} -lt 16 ]]; do
|
||||
read -rp "Nombre de la interfaz WireGuard: " -e -i wg0 SERVER_WG_NIC
|
||||
done
|
||||
|
||||
until [[ ${SERVER_WG_IPV4} =~ ^([0-9]{1,3}\.){3} ]]; do
|
||||
read -rp "WireGuard IPv4 do servidor: " -e -i 10.66.66.1 SERVER_WG_IPV4
|
||||
done
|
||||
|
||||
until [[ ${SERVER_WG_IPV6} =~ ^([a-f0-9]{1,4}:){3,4}: ]]; do
|
||||
read -rp "WireGuard IPv6 en el servidor: " -e -i fd42:42:42::1 SERVER_WG_IPV6
|
||||
done
|
||||
|
||||
# Generate random number within private ports range
|
||||
RANDOM_PORT=$(shuf -i49152-65535 -n1)
|
||||
until [[ ${SERVER_PORT} =~ ^[0-9]+$ ]] && [ "${SERVER_PORT}" -ge 1 ] && [ "${SERVER_PORT}" -le 65535 ]; do
|
||||
read -rp "Puerto WireGuard del servidor [1-65535]: " -e -i "${RANDOM_PORT}" SERVER_PORT
|
||||
done
|
||||
|
||||
# Adguard DNS by default
|
||||
until [[ ${CLIENT_DNS_1} =~ ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ ]]; do
|
||||
read -rp "1Mer resolvedor de DNS a ser usado para los clientes: " -e -i 8.8.8.8 CLIENT_DNS_1
|
||||
done
|
||||
until [[ ${CLIENT_DNS_2} =~ ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ ]]; do
|
||||
read -rp "Segundo resolvedor de DNS a ser usado para los clientes (opcional): " -e -i 8.8.4.4 CLIENT_DNS_2
|
||||
if [[ ${CLIENT_DNS_2} == "" ]]; then
|
||||
CLIENT_DNS_2="${CLIENT_DNS_1}"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Está bien, eso era todo lo que necesitaba. Estamos listos para configurar su servidor WireGuard ahora."
|
||||
echo "Podrá generar un cliente al final de la instalación."
|
||||
read -n1 -r -p "Presione cualquier tecla para continuar."
|
||||
}
|
||||
|
||||
fun_limpram() {
|
||||
|
||||
if [[ ${OS} == 'ubuntu' ]] || [[ ${OS} == 'debian' && ${VERSION_ID} -gt 10 ]]; then
|
||||
apt-get update -y &> /dev/null
|
||||
apt-get install -y wireguard iptables resolvconf qrencode &> /dev/null
|
||||
elif [[ ${OS} == 'debian' ]]; then
|
||||
if ! grep -rqs "^deb .* buster-backports" /etc/apt/; then
|
||||
echo "deb http://deb.debian.org/debian buster-backports main" >/etc/apt/sources.list.d/backports.list
|
||||
apt-get update &> /dev/null
|
||||
fi
|
||||
apt update
|
||||
apt-get install -y iptables resolvconf qrencode &> /dev/null
|
||||
apt-get install -y -t buster-backports wireguard &> /dev/null
|
||||
elif [[ ${OS} == 'fedora' ]]; then
|
||||
if [[ ${VERSION_ID} -lt 32 ]]; then
|
||||
dnf install -y dnf-plugins-core &> /dev/null
|
||||
dnf copr enable -y jdoss/wireguard &> /dev/null
|
||||
dnf install -y wireguard-dkms &> /dev/null
|
||||
fi
|
||||
dnf install -y wireguard-tools iptables qrencode &> /dev/null
|
||||
elif [[ ${OS} == 'centos' ]]; then
|
||||
yum -y install epel-release elrepo-release &> /dev/null
|
||||
if [[ ${VERSION_ID} -eq 7 ]]; then
|
||||
yum -y install yum-plugin-elrepo &> /dev/null
|
||||
fi
|
||||
yum -y install kmod-wireguard wireguard-tools iptables qrencode &> /dev/null
|
||||
elif [[ ${OS} == 'oracle' ]]; then
|
||||
dnf install -y oraclelinux-developer-release-el8 &> /dev/null
|
||||
dnf config-manager --disable -y ol8_developer &> /dev/null
|
||||
dnf config-manager --enable -y ol8_developer_UEKR6 &> /dev/null
|
||||
dnf config-manager --save -y --setopt=ol8_developer_UEKR6.includepkgs='wireguard-tools*'
|
||||
dnf install -y wireguard-tools qrencode iptables
|
||||
elif [[ ${OS} == 'arch' ]]; then
|
||||
pacman -S --needed --noconfirm wireguard-tools qrencode
|
||||
fi
|
||||
|
||||
# Make sure the directory exists (this does not seem the be the case on fedora)
|
||||
[[ -d /etc/wireguard ]] || mkdir /etc/wireguard >/dev/null 2>&1
|
||||
|
||||
chmod 600 -R /etc/wireguard/
|
||||
|
||||
SERVER_PRIV_KEY=$(wg genkey)
|
||||
SERVER_PUB_KEY=$(echo "${SERVER_PRIV_KEY}" | wg pubkey)
|
||||
|
||||
# Save WireGuard settings
|
||||
echo "SERVER_PUB_IP=${SERVER_PUB_IP}
|
||||
SERVER_PUB_NIC=${SERVER_PUB_NIC}
|
||||
SERVER_WG_NIC=${SERVER_WG_NIC}
|
||||
SERVER_WG_IPV4=${SERVER_WG_IPV4}
|
||||
SERVER_WG_IPV6=${SERVER_WG_IPV6}
|
||||
SERVER_PORT=${SERVER_PORT}
|
||||
SERVER_PRIV_KEY=${SERVER_PRIV_KEY}
|
||||
SERVER_PUB_KEY=${SERVER_PUB_KEY}
|
||||
CLIENT_DNS_1=${CLIENT_DNS_1}
|
||||
CLIENT_DNS_2=${CLIENT_DNS_2}" >/etc/wireguard/params
|
||||
|
||||
# Add server interface
|
||||
echo "[Interface]
|
||||
Address = ${SERVER_WG_IPV4}/24,${SERVER_WG_IPV6}/64
|
||||
ListenPort = ${SERVER_PORT}
|
||||
PrivateKey = ${SERVER_PRIV_KEY}" >"/etc/wireguard/${SERVER_WG_NIC}.conf"
|
||||
|
||||
if pgrep firewalld; then
|
||||
FIREWALLD_IPV4_ADDRESS=$(echo "${SERVER_WG_IPV4}" | cut -d"." -f1-3)".0"
|
||||
FIREWALLD_IPV6_ADDRESS=$(echo "${SERVER_WG_IPV6}" | sed 's/:[^:]*$/:0/')
|
||||
echo "PostUp = firewall-cmd --add-port ${SERVER_PORT}/udp && firewall-cmd --add-rich-rule='rule family=ipv4 source address=${FIREWALLD_IPV4_ADDRESS}/24 masquerade' && firewall-cmd --add-rich-rule='rule family=ipv6 source address=${FIREWALLD_IPV6_ADDRESS}/24 masquerade'
|
||||
PostDown = firewall-cmd --remove-port ${SERVER_PORT}/udp && firewall-cmd --remove-rich-rule='rule family=ipv4 source address=${FIREWALLD_IPV4_ADDRESS}/24 masquerade' && firewall-cmd --remove-rich-rule='rule family=ipv6 source address=${FIREWALLD_IPV6_ADDRESS}/24 masquerade'" >>"/etc/wireguard/${SERVER_WG_NIC}.conf"
|
||||
else
|
||||
echo "PostUp = iptables -A FORWARD -i ${SERVER_PUB_NIC} -o ${SERVER_WG_NIC} -j ACCEPT; iptables -A FORWARD -i ${SERVER_WG_NIC} -j ACCEPT; iptables -t nat -A POSTROUTING -o ${SERVER_PUB_NIC} -j MASQUERADE; ip6tables -A FORWARD -i ${SERVER_WG_NIC} -j ACCEPT; ip6tables -t nat -A POSTROUTING -o ${SERVER_PUB_NIC} -j MASQUERADE
|
||||
PostDown = iptables -D FORWARD -i ${SERVER_PUB_NIC} -o ${SERVER_WG_NIC} -j ACCEPT; iptables -D FORWARD -i ${SERVER_WG_NIC} -j ACCEPT; iptables -t nat -D POSTROUTING -o ${SERVER_PUB_NIC} -j MASQUERADE; ip6tables -D FORWARD -i ${SERVER_WG_NIC} -j ACCEPT; ip6tables -t nat -D POSTROUTING -o ${SERVER_PUB_NIC} -j MASQUERADE" >>"/etc/wireguard/${SERVER_WG_NIC}.conf"
|
||||
fi
|
||||
|
||||
# Enable routing on the server
|
||||
echo "net.ipv4.ip_forward = 1
|
||||
net.ipv6.conf.all.forwarding = 1" >/etc/sysctl.d/wg.conf
|
||||
|
||||
sysctl --system
|
||||
|
||||
systemctl start "wg-quick@${SERVER_WG_NIC}" &> /dev/null
|
||||
systemctl enable "wg-quick@${SERVER_WG_NIC}" &> /dev/null
|
||||
|
||||
sync
|
||||
echo 3 >/proc/sys/vm/drop_caches
|
||||
sync && sysctl -w vm.drop_caches=3
|
||||
sysctl -w vm.drop_caches=0
|
||||
swapoff -a
|
||||
swapon -a
|
||||
v2ray clean 1> /dev/null 2> /dev/null
|
||||
rm -rf /tmp/* > /dev/null 2>&1
|
||||
killall kswapd0 > /dev/null 2>&1
|
||||
killall tcpdump > /dev/null 2>&1
|
||||
killall ksoftirqd > /dev/null 2>&1
|
||||
rm -f /var/log/syslog*
|
||||
sleep 4
|
||||
}
|
||||
function aguarde() {
|
||||
sleep 1
|
||||
helice() {
|
||||
fun_limpram >/dev/null 2>&1 &
|
||||
tput civis
|
||||
while [ -d /proc/$! ]; do
|
||||
for i in / - \\ \|; do
|
||||
sleep .1
|
||||
echo -ne "\e[1D$i"
|
||||
done
|
||||
done
|
||||
tput cnorm
|
||||
}
|
||||
echo -ne "\033[1;37m INSTALANDO Y CONFIGURANDO \033[1;32mWire\033[1;37m|\033[1;32mGuard\033[1;32m.\033[1;33m.\033[1;31m. \033[1;33m"
|
||||
helice
|
||||
echo -e "\e[1DOk"
|
||||
}
|
||||
|
||||
|
||||
function installWireGuard() {
|
||||
msg -bar2
|
||||
# Run setup questions first
|
||||
installQuestions
|
||||
msg -bar2
|
||||
echo ""
|
||||
echo -e " ESPERA MIENTRAS DE COMPLETA EL PROCESO . . . "
|
||||
echo -e " "
|
||||
# Install WireGuard tools and module
|
||||
aguarde
|
||||
echo ""
|
||||
msg -bar2
|
||||
newClient
|
||||
echo "Si desea agregar más clientes, simplemente necesita ejecutar este script nuevamente."
|
||||
|
||||
# Check if WireGuard is running
|
||||
systemctl is-active --quiet "wg-quick@${SERVER_WG_NIC}"
|
||||
WG_RUNNING=$?
|
||||
|
||||
# WireGuard might not work if we updated the kernel. Tell the user to reboot
|
||||
if [[ ${WG_RUNNING} -ne 0 ]]; then
|
||||
echo -e "\n${RED}AVISO: WireGuard no parece estar ejecutándose.${NC}"
|
||||
echo -e "${ORANGE}Puede verificar que WireGuard se está ejecutando con: systemctl status wg-quick@${SERVER_WG_NIC}${NC}"
|
||||
echo -e "${ORANGE}Si obtiene algo como \"No se puede encontrar el dispositivo ${SERVER_WG_NIC}\", por favor reinicie!${NC}"
|
||||
fi
|
||||
}
|
||||
|
||||
function newClient() {
|
||||
ENDPOINT="${SERVER_PUB_IP}:${SERVER_PORT}"
|
||||
|
||||
echo ""
|
||||
echo " DIJITE UN NOMBRE PARA SU 1 CLIENTE "
|
||||
echo -e "El nombre debe constar de caracteres alfanuméricos. \n También puede incluir un guión bajo o un guión y no puede exceder los 15 caracteres."
|
||||
|
||||
until [[ ${CLIENT_NAME} =~ ^[a-zA-Z0-9_-]+$ && ${CLIENT_EXISTS} == '0' && ${#CLIENT_NAME} -lt 16 ]]; do
|
||||
read -rp "NOMBRE DEL CLIENTE: " -e CLIENT_NAME
|
||||
CLIENT_EXISTS=$(grep -c -E "^### Client ${CLIENT_NAME}\$" "/etc/wireguard/${SERVER_WG_NIC}.conf")
|
||||
|
||||
if [[ ${CLIENT_EXISTS} == '1' ]]; then
|
||||
echo ""
|
||||
echo "Ya se ha creado un cliente con el nombre especificado, elija otro nombre."
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
|
||||
for DOT_IP in {2..254}; do
|
||||
DOT_EXISTS=$(grep -c "${SERVER_WG_IPV4::-1}${DOT_IP}" "/etc/wireguard/${SERVER_WG_NIC}.conf")
|
||||
if [[ ${DOT_EXISTS} == '0' ]]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${DOT_EXISTS} == '1' ]]; then
|
||||
echo ""
|
||||
echo "A sub-rede configurada suporta apenas 253 clientes."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BASE_IP=$(echo "$SERVER_WG_IPV4" | awk -F '.' '{ print $1"."$2"."$3 }')
|
||||
until [[ ${IPV4_EXISTS} == '0' ]]; do
|
||||
read -rp "Cliente WireGuard IPv4: ${BASE_IP}." -e -i "${DOT_IP}" DOT_IP
|
||||
CLIENT_WG_IPV4="${BASE_IP}.${DOT_IP}"
|
||||
IPV4_EXISTS=$(grep -c "$CLIENT_WG_IPV4/24" "/etc/wireguard/${SERVER_WG_NIC}.conf")
|
||||
|
||||
if [[ ${IPV4_EXISTS} == '1' ]]; then
|
||||
echo ""
|
||||
echo "Ya se ha creado un cliente con el IPv4 especificado, elija otro IPv4."
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
|
||||
BASE_IP=$(echo "$SERVER_WG_IPV6" | awk -F '::' '{ print $1 }')
|
||||
until [[ ${IPV6_EXISTS} == '0' ]]; do
|
||||
read -rp "WireGuard IPv6 do cliente: ${BASE_IP}::" -e -i "${DOT_IP}" DOT_IP
|
||||
CLIENT_WG_IPV6="${BASE_IP}::${DOT_IP}"
|
||||
IPV6_EXISTS=$(grep -c "${CLIENT_WG_IPV6}/64" "/etc/wireguard/${SERVER_WG_NIC}.conf")
|
||||
|
||||
if [[ ${IPV6_EXISTS} == '1' ]]; then
|
||||
echo ""
|
||||
echo "Ya se ha creado un cliente con el IPv6 especificado, elija otro IPv6."
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
|
||||
# Generate key pair for the client
|
||||
CLIENT_PRIV_KEY=$(wg genkey)
|
||||
CLIENT_PUB_KEY=$(echo "${CLIENT_PRIV_KEY}" | wg pubkey)
|
||||
CLIENT_PRE_SHARED_KEY=$(wg genpsk)
|
||||
|
||||
# Home directory of the user, where the client configuration will be written
|
||||
if [ -e "/home/${CLIENT_NAME}" ]; then
|
||||
# if $1 is a user name
|
||||
HOME_DIR="/home/${CLIENT_NAME}"
|
||||
elif [ "${SUDO_USER}" ]; then
|
||||
# if not, use SUDO_USER
|
||||
if [ "${SUDO_USER}" == "root" ]; then
|
||||
# If running sudo as root
|
||||
HOME_DIR="/root"
|
||||
else
|
||||
HOME_DIR="/home/${SUDO_USER}"
|
||||
fi
|
||||
else
|
||||
# if not SUDO_USER, use /root
|
||||
HOME_DIR="/root"
|
||||
fi
|
||||
|
||||
# Create client file and add the server as a peer
|
||||
echo "[Interface]
|
||||
PrivateKey = ${CLIENT_PRIV_KEY}
|
||||
Address = ${CLIENT_WG_IPV4}/32,${CLIENT_WG_IPV6}/128
|
||||
DNS = ${CLIENT_DNS_1},${CLIENT_DNS_2}
|
||||
|
||||
[Peer]
|
||||
PublicKey = ${SERVER_PUB_KEY}
|
||||
PresharedKey = ${CLIENT_PRE_SHARED_KEY}
|
||||
Endpoint = ${ENDPOINT}
|
||||
AllowedIPs = 0.0.0.0/0,::/0" >>"${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf"
|
||||
|
||||
# Add the client as a peer to the server
|
||||
echo -e "\n### Client ${CLIENT_NAME}
|
||||
[Peer]
|
||||
PublicKey = ${CLIENT_PUB_KEY}
|
||||
PresharedKey = ${CLIENT_PRE_SHARED_KEY}
|
||||
AllowedIPs = ${CLIENT_WG_IPV4}/32,${CLIENT_WG_IPV6}/128" >>"/etc/wireguard/${SERVER_WG_NIC}.conf"
|
||||
|
||||
wg syncconf "${SERVER_WG_NIC}" <(wg-quick strip "${SERVER_WG_NIC}")
|
||||
|
||||
echo -e "\nAqui está o arquivo de configuração do seu cliente como um código QR:"
|
||||
|
||||
qrencode -t ansiutf8 -l L <"${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf"
|
||||
|
||||
echo "Também está disponível em ${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf"
|
||||
cp ${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf /var/www/html/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf
|
||||
echo -e " ==================================================="
|
||||
echo ""
|
||||
echo -e " URL WEB : http://$(wget -qO- ifconfig.me):81/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf"
|
||||
echo -e ""
|
||||
echo -e " ==================================================="
|
||||
|
||||
}
|
||||
|
||||
function revokeClient() {
|
||||
NUMBER_OF_CLIENTS=$(grep -c -E "^### Client" "/etc/wireguard/${SERVER_WG_NIC}.conf")
|
||||
if [[ ${NUMBER_OF_CLIENTS} == '0' ]]; then
|
||||
echo ""
|
||||
echo "¡No tienes clientes existentes!"
|
||||
#exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Seleccione el cliente existente que desea revocar"
|
||||
grep -E "^### Client" "/etc/wireguard/${SERVER_WG_NIC}.conf" | cut -d ' ' -f 3 | nl -s ') '
|
||||
until [[ ${CLIENT_NUMBER} -ge 1 && ${CLIENT_NUMBER} -le ${NUMBER_OF_CLIENTS} ]]; do
|
||||
if [[ ${CLIENT_NUMBER} == '1' ]]; then
|
||||
read -rp "Selecione un cliente [1]: " CLIENT_NUMBER
|
||||
else
|
||||
read -rp "Selecione un cliente [1-${NUMBER_OF_CLIENTS}]: " CLIENT_NUMBER
|
||||
fi
|
||||
done
|
||||
|
||||
# match the selected number to a client name
|
||||
CLIENT_NAME=$(grep -E "^### Client" "/etc/wireguard/${SERVER_WG_NIC}.conf" | cut -d ' ' -f 3 | sed -n "${CLIENT_NUMBER}"p)
|
||||
|
||||
# remove [Peer] block matching $CLIENT_NAME
|
||||
sed -i "/^### Client ${CLIENT_NAME}\$/,/^$/d" "/etc/wireguard/${SERVER_WG_NIC}.conf"
|
||||
|
||||
# remove generated client file
|
||||
rm -f "${HOME}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf"
|
||||
|
||||
# restart wireguard to apply changes
|
||||
wg syncconf "${SERVER_WG_NIC}" <(wg-quick strip "${SERVER_WG_NIC}")
|
||||
}
|
||||
|
||||
function uninstallWg() {
|
||||
echo ""
|
||||
read -rp "¿Realmente desea eliminar WireGuard? [y/n]: " -e -i n REMOVE
|
||||
if [[ $REMOVE == 'y' ]]; then
|
||||
checkOS
|
||||
|
||||
systemctl stop "wg-quick@${SERVER_WG_NIC}"
|
||||
systemctl disable "wg-quick@${SERVER_WG_NIC}"
|
||||
|
||||
if [[ ${OS} == 'ubuntu' ]]; then
|
||||
apt-get autoremove --purge -y wireguard qrencode
|
||||
elif [[ ${OS} == 'debian' ]]; then
|
||||
apt-get autoremove --purge -y wireguard qrencode
|
||||
elif [[ ${OS} == 'fedora' ]]; then
|
||||
dnf remove -y wireguard-tools qrencode
|
||||
if [[ ${VERSION_ID} -lt 32 ]]; then
|
||||
dnf remove -y wireguard-dkms
|
||||
dnf copr disable -y jdoss/wireguard
|
||||
fi
|
||||
dnf autoremove -y
|
||||
elif [[ ${OS} == 'centos' ]]; then
|
||||
yum -y remove kmod-wireguard wireguard-tools qrencode
|
||||
yum -y autoremove
|
||||
elif [[ ${OS} == 'oracle' ]]; then
|
||||
yum -y remove wireguard-tools qrencode
|
||||
yum -y autoremove
|
||||
elif [[ ${OS} == 'arch' ]]; then
|
||||
pacman -Rs --noconfirm wireguard-tools qrencode
|
||||
fi
|
||||
|
||||
rm -rf /etc/wireguard
|
||||
rm -f /etc/sysctl.d/wg.conf
|
||||
|
||||
# Reload sysctl
|
||||
sysctl --system
|
||||
|
||||
# Check if WireGuard is running
|
||||
systemctl is-active --quiet "wg-quick@${SERVER_WG_NIC}"
|
||||
WG_RUNNING=$?
|
||||
|
||||
if [[ ${WG_RUNNING} -eq 0 ]]; then
|
||||
echo "WireGuard no se pudo desinstalar correctamente."
|
||||
exit 1
|
||||
else
|
||||
echo "WireGuard desinstalado con exito."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
echo "Eliminación abortada!"
|
||||
fi
|
||||
}
|
||||
|
||||
function manageMenu() {
|
||||
echo "¡Bienvenido a la instalación de WireGuard!"
|
||||
#echo "El repositorio git está disponible en: https://github.com/leitura/wireguard-install"
|
||||
echo ""
|
||||
echo "Parece que WireGuard ya está instalado."
|
||||
echo ""
|
||||
echo " ¿Qué quieres hacer?"
|
||||
echo " 1) Agregar un nuevo usuario"
|
||||
echo " 2) Revocar usuario existente"
|
||||
echo " 3) Desinstalar WireGuard"
|
||||
echo " 4) Salir"
|
||||
until [[ ${MENU_OPTION} =~ ^[1-4]$ ]]; do
|
||||
read -rp "Selecione uma opcion [1-4]: " MENU_OPTION
|
||||
done
|
||||
case "${MENU_OPTION}" in
|
||||
1)
|
||||
newClient
|
||||
;;
|
||||
2)
|
||||
revokeClient
|
||||
;;
|
||||
3)
|
||||
uninstallWg
|
||||
;;
|
||||
4)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Check for root, virt, OS...
|
||||
initialCheck
|
||||
|
||||
# Check if WireGuard is already installed and load params
|
||||
if [[ -e /etc/wireguard/params ]]; then
|
||||
source /etc/wireguard/params
|
||||
manageMenu
|
||||
else
|
||||
installWireGuard
|
||||
fi
|
||||
270
Recursos/menu_inst/h_beta.sh
Normal file
270
Recursos/menu_inst/h_beta.sh
Normal file
@ -0,0 +1,270 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
|
||||
verif_ptrs() {
|
||||
porta=$1
|
||||
PT=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
|
||||
for pton in $(echo -e "$PT" | cut -d: -f2 | cut -d' ' -f1 | uniq); do
|
||||
svcs=$(echo -e "$PT" | grep -w "$pton" | awk '{print $1}' | uniq)
|
||||
[[ "$porta" = "$pton" ]] && {
|
||||
echo -e "\n\033[1;31mPUERTO \033[1;33m$porta \033[1;31mOCUPADO POR \033[1;37m$svcs\033[0m"
|
||||
sleep 0.5
|
||||
return 0
|
||||
}
|
||||
done
|
||||
}
|
||||
|
||||
source msg
|
||||
fun_openssh() {
|
||||
clear
|
||||
echo -e "\E[44;1;37m OPENSSH \E[0m\n"
|
||||
echo -e "\033[1;31m[\033[1;36m1\033[1;31m] \033[1;37m• \033[1;33mADICIONAR PORTA\033[1;31m
|
||||
[\033[1;36m2\033[1;31m] \033[1;37m• \033[1;33mREMOVER PORTA\033[1;31m
|
||||
[\033[1;36m3\033[1;31m] \033[1;37m• \033[1;33mVOLTAR\033[0m"
|
||||
echo ""
|
||||
echo -ne "\033[1;32mOQUE DESEJA FAZER \033[1;33m?\033[1;37m "
|
||||
read resp
|
||||
if [[ "$resp" = '1' ]]; then
|
||||
clear
|
||||
echo -e "\E[44;1;37m ADICIONAR PORTA AO SSH \E[0m\n"
|
||||
echo -ne "\033[1;32mQUAL PORTA DESEJA ADICIONAR \033[1;33m?\033[1;37m "
|
||||
read pt
|
||||
[[ -z "$pt" ]] && {
|
||||
echo -e "\n\033[1;31mPorta invalida!"
|
||||
sleep 3
|
||||
return 0
|
||||
}
|
||||
verif_ptrs $pt
|
||||
echo -e "\n\033[1;32mADICIONANDO PORTA AO SSH\033[0m"
|
||||
echo ""
|
||||
fun_addpssh() {
|
||||
echo "Port $pt" >>/etc/ssh/sshd_config
|
||||
service ssh restart
|
||||
}
|
||||
fun_bar 'fun_addpssh'
|
||||
echo -e "\n\033[1;32mPORTA ADICIONADA COM SUCESSO\033[0m"
|
||||
sleep 3
|
||||
return 0
|
||||
elif [[ "$resp" = '2' ]]; then
|
||||
clear
|
||||
echo -e "\E[41;1;37m REMOVER PORTA DO SSH \E[0m"
|
||||
echo -e "\n\033[1;33m[\033[1;31m!\033[1;33m] \033[1;32mPORTA PADRAO \033[1;37m22 \033[1;33mCUIDADO !\033[0m"
|
||||
echo -e "\n\033[1;33mPUERTAS SSH EN USO: \033[1;37m$(grep 'Port' /etc/ssh/sshd_config | cut -d' ' -f2 | grep -v 'no' | xargs)\n"
|
||||
echo -ne "\033[1;32mQUE PUERTO DESEAS REMOVER \033[1;33m?\033[1;37m "
|
||||
read pt
|
||||
[[ -z "$pt" ]] && {
|
||||
echo -e "\n\033[1;31mPUERTO INVALIDO!"
|
||||
sleep 2
|
||||
return 0
|
||||
}
|
||||
[[ $(grep -wc "$pt" '/etc/ssh/sshd_config') != '0' ]] && {
|
||||
echo -e "\n\033[1;32mREMOVENDO PUERTO DE SSH\033[0m"
|
||||
echo ""
|
||||
fun_delpssh() {
|
||||
sed -i "/Port $pt/d" /etc/ssh/sshd_config
|
||||
service ssh restart
|
||||
}
|
||||
fun_bar 'fun_delpssh'
|
||||
echo -e "\n\033[1;32mPORTA REMOVIDA COM SUCESSO\033[0m"
|
||||
sleep 2
|
||||
return 0
|
||||
} || {
|
||||
echo -e "\n\033[1;31mPorta invalida!"
|
||||
sleep 2
|
||||
return 0
|
||||
}
|
||||
elif [[ "$resp" = '3' ]]; then
|
||||
echo -e "\n\033[1;31mRetornando.."
|
||||
sleep 2
|
||||
return 0
|
||||
else
|
||||
echo -e "\n\033[1;31mOpcao invalida!"
|
||||
sleep 2
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
menu_udp () {
|
||||
_udp=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND"|grep "badvpn-ud"|awk '{print $1}')
|
||||
[[ -z $_udp ]] && v_udp="\e[31m[ OFF ]" || v_udp="\e[32m[ ON ] "
|
||||
msg -bar
|
||||
echo -e " \033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m ➮ ${cor[3]} PARAR TODOS LOS BADVPN $v_udp"
|
||||
echo -e " \033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮ ${cor[3]} ADD + BADVPN ( CUSTOM PORT )"
|
||||
#echo -e " \033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮ ${cor[3]} AGREGAR / REMOVER HOST-SQUID"
|
||||
#echo -e " \033[0;35m [\033[0;36m3\033[0;35m]\033[0;31m ➮ ${cor[3]} DESINSTALAR SQUID"
|
||||
msg -bar
|
||||
echo -e " \033[0;35m [\033[0;36m0\033[0;35m]\033[0;31m ➮ $(msg -bra "\033[1;41m[ REGRESAR ]\e[0m")"
|
||||
msg -bar
|
||||
selection=$(selection_fun 2)
|
||||
case ${selection} in
|
||||
0)
|
||||
return 0
|
||||
;;
|
||||
1)
|
||||
for pid in $(pgrep badvpn-udpgw);do
|
||||
kill $pid
|
||||
done
|
||||
return 0
|
||||
;;
|
||||
2)
|
||||
badcustom
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
badcustom () {
|
||||
msg -bar
|
||||
echo -e "BIENVENIDO AL MENU DE CUSTOM PORT "
|
||||
msg -bar
|
||||
read -p " DIJITA TU PUERTO CUSTOM PARA BADVPN :" -e -i "7100" port
|
||||
echo -e " VERIFICANDO BADVPN "
|
||||
msg -bar
|
||||
screen -dmS badvpn$port /bin/badvpn-udpgw --listen-addr 127.0.0.1:${port} --max-clients 10000 --max-connections-for-client 10000 --client-socket-sndbuf 10000 && msg -ama " BadVPN ACTIVADA CON EXITO" || msg -ama " Error al Activar BadVPN"
|
||||
echo -e "netstat -tlpn | grep -w ${port} > /dev/null || { screen -r -S 'badvpn'$port -X quit; screen -dmS badvpn $(which badvpn-udpgw) --listen-addr 127.0.0.1:${port} --max-clients 10000 --max-connections-for-client 10000 --client-socket-sndbuf 10000; }" >>/bin/autoboot
|
||||
msg -bar
|
||||
#echo -e ""
|
||||
|
||||
}
|
||||
|
||||
_badfix () {
|
||||
https://github.com/rudi9999/ADMRufu/raw/main/Utils/badvpn/badvpn-master.zip
|
||||
|
||||
}
|
||||
|
||||
packobs () {
|
||||
msg -ama "Buscando Paquetes Obsoletos"
|
||||
dpkg -l | grep -i ^rc
|
||||
msg -ama "Limpiando Paquetes Obsoloteos"
|
||||
dpkg -l |grep -i ^rc | cut -d " " -f 3 | xargs dpkg --purge
|
||||
sudo sync
|
||||
sudo sysctl -w vm.drop_caches=3 > /dev/null 2>&1
|
||||
msg -ama "Limpieza Completa"
|
||||
}
|
||||
|
||||
############
|
||||
|
||||
SCPdir="/etc/adm-lite"
|
||||
#SCPfrm="${SCPdir}" && [[ ! -d ${SCPfrm} ]] && exit
|
||||
#SCPinst="${SCPdir}"&& [[ ! -d ${SCPinst} ]] && exit
|
||||
#declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" [5]="\e[1;36m" )
|
||||
|
||||
#LISTA PORTAS
|
||||
mportas () {
|
||||
unset portas
|
||||
portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
|
||||
while read port; do
|
||||
var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
|
||||
[[ "$(echo -e $portas|grep "$var1:$var2")" ]] || portas+="$var1:$var2\n"
|
||||
done <<< "$portas_var"
|
||||
i=1
|
||||
echo -e "$portas"
|
||||
}
|
||||
|
||||
|
||||
fun_apache () {
|
||||
echo -e "FUNCION DE MENU APACHE MODO BETA"
|
||||
msg -bar
|
||||
read -p " INGRESA PUERTO APACHE NUEVO :" nwPP
|
||||
[[ -z $nwPP ]] && nwPP="81"
|
||||
msg -bar
|
||||
echo "ESPERE MIENTRAS COMPLETAMOS EL PROCESO"
|
||||
fun_bar "apt purge apache2 -y "
|
||||
echo "REINSTALANDO Y RECONFIGURANDO"
|
||||
fun_bar "apt install apache2 -y "
|
||||
sed -i "s;Listen 80;Listen ${nwPP};g" /etc/apache2/ports.conf
|
||||
echo "REINICIANDO Y APLICANDO CAMBIOS"
|
||||
service apache2 restart &>/dev/null
|
||||
}
|
||||
|
||||
filemanager () {
|
||||
[[ $(ps x | grep filebrowser | grep -v grep) ]] && {
|
||||
killall filebrowser &> /dev/null
|
||||
} || {
|
||||
[[ -z $(which filebrowser) ]] && curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash &> /dev/null
|
||||
read -p " INGRESA PUERTO : " webrowser
|
||||
nohup filebrowser -a $(ip -4 addr | sed -ne 's|^.* inet \([^/]*\)/.* scope global.*$|\1|p' | awk '{print $1}' | head -1) -b / -p ${webrowser} -r /root/& > /dev/null
|
||||
msg -bar2
|
||||
echo ""
|
||||
echo -e " SERVICIO ACTIVO EN URL : http://$(wget -qO- ifconfig.me):${webrowser}/"
|
||||
echo ""
|
||||
echo -e " ACCEDE CON LAS CREDENCIALES : admin "
|
||||
echo ""
|
||||
msg -bar2
|
||||
}
|
||||
read -p " PRESIONA ENTER PARA CONTINUAR"
|
||||
}
|
||||
|
||||
|
||||
if netstat -tnlp |grep 'apache2' &>/dev/null; then
|
||||
_apa="\e[32m[ ON ] "
|
||||
else
|
||||
_apa="\e[31m[ OFF ]"
|
||||
fi
|
||||
clear&&clear
|
||||
[[ -e /etc/wireguard/params ]] && _wir="\e[32m[ ON ] " || _wir="\e[31m[ OFF ]"
|
||||
[[ $(ps x | grep filebrowser | grep -v grep) ]] && file="\e[32m[ ON ] " || file="\e[31m[ OFF ]"
|
||||
#msg -bar2
|
||||
#echo -e " \033[7;49;35m =>►► 🐲 FUNCIONES ALTERNS ChumoGH💥VPS 🐲 ◄◄<= \033[0m\033[1;31m"
|
||||
#msg -bar2
|
||||
tittle
|
||||
echo -e " \033[0;35m[\033[0;36m1\033[0;35m] \033[0;34m➮\033[0;33m PUERTO APACHE CUSTOM ${_apa} "
|
||||
echo -e " \033[0;35m[\033[0;36m2\033[0;35m] \033[0;34m➮\033[0;33m LIMPIAR RAM && PAQUETES ANTIGUOS "
|
||||
echo -e " \033[0;35m[\033[0;36m3\033[0;35m] \033[0;34m➮\033[0;31m ADD / REMOVE PORTS CUSTOM BADVPN "
|
||||
echo -e " \033[0;35m[\033[0;36m4\033[0;35m] \033[0;34m➮\033[0;31m ADD / REMOVE PORTS CUSTOM OPENSSH "
|
||||
echo -e " \033[0;35m[\033[0;36m5\033[0;35m] \033[0;34m➮\033[0;31m TROJAN GO - BETA "
|
||||
echo -e " \033[0;35m[\033[0;36m6\033[0;35m] \033[0;34m➮\033[0;31m CREAR CERTIFICADO CON DOMINIO "
|
||||
echo -e " \033[0;35m[\033[0;36m7\033[0;35m] \033[0;34m➮\033[0;31m Modulo WireGuard VPN Client ${_wir} "
|
||||
echo -e " \033[0;35m[\033[0;36m8\033[0;35m] \033[0;34m➮\033[0;31m FIILEMANAGER WEB ${file} "
|
||||
back
|
||||
selection=$(selection_fun 8)
|
||||
case ${selection} in
|
||||
0)
|
||||
return 0
|
||||
;;
|
||||
1)
|
||||
fun_apache
|
||||
return 0
|
||||
;;
|
||||
2)
|
||||
packobs
|
||||
return 0
|
||||
;;
|
||||
3)
|
||||
menu_udp
|
||||
return 0
|
||||
;;
|
||||
4)
|
||||
fun_openssh
|
||||
return 0
|
||||
;;
|
||||
5)
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/h_beta-sh/trojan-go)
|
||||
;;
|
||||
6)
|
||||
clear&&clear
|
||||
echo -e "================================================"
|
||||
echo -e "A CONTINUACION CREAREMOS UN CETIFICADO SSL"
|
||||
echo -e " LA VERIFICACION ES MEDIANTE DOMINIO"
|
||||
echo -e " NECECITAS TENER EL PUERTO 80 Y 443 LIBRES"
|
||||
echo -e "================================================"
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/certificadossl.sh)
|
||||
echo -e "================================================"
|
||||
echo -e ""
|
||||
echo -e "================================================"
|
||||
echo -e " SI LA EMICION FUE CORRECTA, TU CERTIFICADO"
|
||||
echo -e " SE ENCUENTR ALOJADO EN /data "
|
||||
echo -e "================================================"
|
||||
echo -e " /data/cert.crt && /data/cert.key "
|
||||
echo -e "================================================"
|
||||
echo -e ""
|
||||
;;
|
||||
7)
|
||||
rm -f /tmp/wireguard-install.sh* && wget -q -O /tmp/wireguard-install.sh https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/h_beta-sh/wireguard-install.sh && chmod +x /tmp/wireguard-install.sh && /tmp/wireguard-install.sh
|
||||
;;
|
||||
8)
|
||||
filemanager
|
||||
;;
|
||||
esac
|
||||
|
||||
47
Recursos/menu_inst/openvpn.sh
Normal file
47
Recursos/menu_inst/openvpn.sh
Normal file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
#19/12/2019
|
||||
clear
|
||||
SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && mkdir /etc/ger-frm
|
||||
SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && mkdir /etc/ger-inst
|
||||
#source <(curl -sL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg)
|
||||
source msg
|
||||
menu_org () {
|
||||
sudo bash -c "$(curl -fsSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/openvpnmenu.sh)"
|
||||
}
|
||||
|
||||
menu_kali () {
|
||||
SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && mkdir /etc/ger-frm
|
||||
SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && mkdir /etc/ger-inst
|
||||
SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && mkdir ${SCPdir}
|
||||
SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPdir}/herramientas
|
||||
SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPinst} ]] && mkdir ${SCPdir}/protocolos
|
||||
SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
|
||||
source <(curl -sL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/msg-bar/msg)
|
||||
wget -O /tmp/openvpn.sh -q https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/openvpnmenu.sh && chmod +x /tmp/openvpn.sh && cd /tmp && ./openvpn.sh && cd
|
||||
|
||||
#source <(curl -sL https://www.dropbox.com/s/omykq6x27ua54fb/openvpn-install.sh)
|
||||
|
||||
}
|
||||
source /etc/adm-lite/cabecalho
|
||||
echo -e $barra
|
||||
#echo -e " \033[1;42mBIENVENIDO NUEVAMENTE!\033[0m"
|
||||
#echo -e $barra
|
||||
#echo -e " \033[1;44mEstas Funciones Aun no estan Completas\033[0m, \n \033[1;44mpor lo que pueden presentar errores criticos\033[0m,\n \033[1;44mUselas bajo su Propio Riesgo\033[0m"
|
||||
echo -e $barra
|
||||
#echo -ne $(msg -verm2 " Instalador OpenVPN") && msg -azu " ( Estado Critico ) "
|
||||
echo " "
|
||||
echo -e $barra
|
||||
echo -e "\033[0;35m[\033[0;36m1\033[0;35m] \033[0;34m<\033[0;33m INICIAR Menu OPENVPN Original "
|
||||
#echo -e "\033[0;35m[\033[0;36m2\033[0;35m] \033[0;34m<\033[0;33m INICIAR Menu OPENVPN By @Kalix1"
|
||||
echo -e $barra
|
||||
#echo -e "\033[0;35m[\033[0;36m0\033[0;35m] \033[0;34m<\033[0;33m SALIR"
|
||||
#unset inst
|
||||
#echo -e $barra
|
||||
#echo -ne "\033[97m ESCOJE [ 1 / 2 ]: "
|
||||
#read inst
|
||||
sleep 5s
|
||||
#[[ $inst = "1" ]] &&
|
||||
menu_org
|
||||
#[[ $inst = "2" ]] && menu_kali
|
||||
#[[ $inst = "3" ]] && stop_ser
|
||||
#[[ $inst = "0" ]] && menu
|
||||
595
Recursos/menu_inst/openvpnmenu.sh
Normal file
595
Recursos/menu_inst/openvpnmenu.sh
Normal file
@ -0,0 +1,595 @@
|
||||
#!/bin/bash
|
||||
#19/12/2019
|
||||
clear&&clear
|
||||
enter () {
|
||||
read -p "Enter para Continuar"
|
||||
}
|
||||
# Funcoes Globais
|
||||
msg () {
|
||||
local colors="/etc/new-adm-color"
|
||||
if [[ ! -e $colors ]]; then
|
||||
COLOR[0]='\033[1;37m' #BRAN='\033[1;37m'
|
||||
COLOR[1]='\e[31m' #VERMELHO='\e[31m'
|
||||
COLOR[2]='\e[32m' #VERDE='\e[32m'
|
||||
COLOR[3]='\e[33m' #AMARELO='\e[33m'
|
||||
COLOR[4]='\e[34m' #AZUL='\e[34m'
|
||||
COLOR[5]='\e[91m' #MAGENTA='\e[35m'
|
||||
COLOR[6]='\033[1;97m' #MAG='\033[1;36m'
|
||||
else
|
||||
local COL=0
|
||||
for number in $(cat $colors); do
|
||||
case $number in
|
||||
1) COLOR[$COL]='\033[1;37m';;
|
||||
2) COLOR[$COL]='\e[31m';;
|
||||
3) COLOR[$COL]='\e[32m';;
|
||||
4) COLOR[$COL]='\e[33m';;
|
||||
5) COLOR[$COL]='\e[34m';;
|
||||
6) COLOR[$COL]='\033[0;35m';;
|
||||
7) COLOR[$COL]='\033[1;36m';;
|
||||
esac
|
||||
let COL++
|
||||
done
|
||||
fi
|
||||
NEGRITO='\e[1m'
|
||||
SEMCOR='\e[0m'
|
||||
case $1 in
|
||||
-ne) cor="${COLOR[1]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";;
|
||||
-ama) cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
|
||||
-verm) cor="${COLOR[3]}${NEGRITO}[!] ${COLOR[1]}" && echo -e "${cor}${2}${SEMCOR}";;
|
||||
-verm2) cor="${COLOR[1]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
|
||||
-azu) cor="${COLOR[6]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
|
||||
-verd) cor="${COLOR[2]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
|
||||
-bra) cor="${COLOR[0]}${SEMCOR}" && echo -e "${cor}${2}${SEMCOR}";;
|
||||
"-bar2"|"-bar") cor="${COLOR[6]}•••••••••••••••••••••••••••••••••••••••••••••••••" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
|
||||
esac
|
||||
}
|
||||
|
||||
mportas () {
|
||||
unset portas
|
||||
portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
|
||||
while read port; do
|
||||
var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
|
||||
[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
|
||||
done <<< "$portas_var"
|
||||
i=1
|
||||
echo -e "$portas"
|
||||
}
|
||||
|
||||
print_center(){
|
||||
local x
|
||||
local y
|
||||
text="$*"
|
||||
x=$(( ($(tput cols) - ${#text}) / 2))
|
||||
echo -ne "\E[6n";read -sdR y; y=$(echo -ne "${y#*[}" | cut -d';' -f1)
|
||||
echo -ne "\033[${y};${x}f$*"
|
||||
echo ""
|
||||
}
|
||||
|
||||
msg -bar
|
||||
|
||||
# MENU FLUTUANTE
|
||||
menu_func () {
|
||||
local options=${#@}
|
||||
local array
|
||||
for((num=1; num<=$options; num++)); do
|
||||
echo -ne " $(msg -verd "[$num]") $(msg -verm2 "➮") "
|
||||
array=(${!num})
|
||||
case ${array[0]} in
|
||||
"-vd") msg -verd "\033[1;33m[!]\033[1;32m ${array[@]:1}" | sed ':a;N;$!ba;s/\n/ /g';;
|
||||
"-vm") msg -verm2 "\033[1;33m[!]\033[1;31m ${array[@]:1}" | sed ':a;N;$!ba;s/\n/ /g';;
|
||||
"-fi") msg -azu "${array[@]:2} ${array[1]}" | sed ':a;N;$!ba;s/\n/ /g';;
|
||||
*) msg -azu "${array[@]}" | sed ':a;N;$!ba;s/\n/ /g';;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
meu_ip () {
|
||||
[[ -e /etc/catIPlocal && -e /etc/catIP ]] && {
|
||||
MEU_IP=$(cat < /etc/catIPlocal)
|
||||
MEU_IP2=$(cat < /etc/catIP)
|
||||
[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
|
||||
} || {
|
||||
MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1) && echo $MEU_IP > /etc/catIPlocal
|
||||
MEU_IP2=$(wget -qO- ipv4.icanhazip.com) && echo $MEU_IP2 > /etc/catIP
|
||||
[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
|
||||
}
|
||||
}
|
||||
|
||||
# Detect Debian users running the script with "sh" instead of bash
|
||||
if readlink /proc/$$/exe | grep -q "dash"; then
|
||||
print_center "Este script se utiliza con bash"
|
||||
enter
|
||||
fi
|
||||
|
||||
if [[ "$EUID" -ne 0 ]]; then
|
||||
print_center "Sorry, solo funciona como root"
|
||||
enter
|
||||
fi
|
||||
|
||||
if [[ ! -e /dev/net/tun ]]; then
|
||||
print_center "El TUN device no esta disponible"
|
||||
print_center "Necesitas habilitar TUN antes de usar este script"
|
||||
enter
|
||||
fi
|
||||
|
||||
if [[ -e /etc/debian_version ]]; then
|
||||
OS=debian
|
||||
GROUPNAME=nogroup
|
||||
RCLOCAL='/etc/rc.local'
|
||||
elif [[ -e /etc/centos-release || -e /etc/redhat-release ]]; then
|
||||
OS=centos
|
||||
GROUPNAME=nobody
|
||||
RCLOCAL='/etc/rc.d/rc.local'
|
||||
else
|
||||
print_center "Sistema no compatible para este script"
|
||||
enter
|
||||
fi
|
||||
del(){
|
||||
for (( i = 0; i < $1; i++ )); do
|
||||
tput cuu1 && tput dl1
|
||||
done
|
||||
}
|
||||
|
||||
agrega_dns(){
|
||||
msg -ama " Escriba el HOST DNS que desea Agregar"
|
||||
read -p " [NewDNS]: " SDNS
|
||||
cat /etc/hosts|grep -v "$SDNS" > /etc/hosts.bak && mv -f /etc/hosts.bak /etc/hosts
|
||||
if [[ -e /etc/opendns ]]; then
|
||||
cat /etc/opendns > /tmp/opnbak
|
||||
mv -f /tmp/opnbak /etc/opendns
|
||||
echo "$SDNS" >> /etc/opendns
|
||||
else
|
||||
echo "$SDNS" > /etc/opendns
|
||||
fi
|
||||
[[ -z $NEWDNS ]] && NEWDNS="$SDNS" || NEWDNS="$NEWDNS $SDNS"
|
||||
unset SDNS
|
||||
}
|
||||
|
||||
dns_fun(){
|
||||
case $1 in
|
||||
1)
|
||||
if grep -q "127.0.0.53" "/etc/resolv.conf"; then
|
||||
RESOLVCONF='/run/systemd/resolve/resolv.conf'
|
||||
else
|
||||
RESOLVCONF='/etc/resolv.conf'
|
||||
fi
|
||||
grep -v '#' $RESOLVCONF | grep 'nameserver' | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | while read line; do
|
||||
echo "push \"dhcp-option DNS $line\"" >> /etc/openvpn/server.conf
|
||||
done;;
|
||||
2) #cloudflare
|
||||
echo 'push "dhcp-option DNS 1.1.1.1"' >> /etc/openvpn/server.conf
|
||||
echo 'push "dhcp-option DNS 1.0.0.1"' >> /etc/openvpn/server.conf;;
|
||||
3) #google
|
||||
echo 'push "dhcp-option DNS 8.8.8.8"' >> /etc/openvpn/server.conf
|
||||
echo 'push "dhcp-option DNS 8.8.4.4"' >> /etc/openvpn/server.conf;;
|
||||
4) #OpenDNS
|
||||
echo 'push "dhcp-option DNS 208.67.222.222"' >> /etc/openvpn/server.conf
|
||||
echo 'push "dhcp-option DNS 208.67.220.220"' >> /etc/openvpn/server.conf;;
|
||||
5) #Verisign
|
||||
echo 'push "dhcp-option DNS 64.6.64.6"' >> /etc/openvpn/server.conf
|
||||
echo 'push "dhcp-option DNS 64.6.65.6"' >> /etc/openvpn/server.conf;;
|
||||
6) #Quad9
|
||||
echo 'push "dhcp-option DNS 9.9.9.9"' >> /etc/openvpn/server.conf
|
||||
echo 'push "dhcp-option DNS 149.112.112.112"' >> /etc/openvpn/server.conf;;
|
||||
7) #UncensoredDNS
|
||||
echo 'push "dhcp-option DNS 91.239.100.100"' >> /etc/openvpn/server.conf
|
||||
echo 'push "dhcp-option DNS 89.233.43.71"' >> /etc/openvpn/server.conf;;
|
||||
esac
|
||||
}
|
||||
|
||||
meu_ip
|
||||
|
||||
|
||||
|
||||
|
||||
instala_ovpn(){
|
||||
clear
|
||||
msg -bar
|
||||
print_center "INSTALADOR DE OPENVPN"
|
||||
msg -bar
|
||||
# OpenVPN setup and first user creation
|
||||
msg -ama " Algunos ajustes son necesario para conf OpenVPN"
|
||||
msg -bar
|
||||
# Autodetect IP address and pre-fill for the user
|
||||
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
|
||||
if echo "$IP" | grep -qE '^(10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|192\.168)'; then
|
||||
PUBLICIP=$(wget -qO- ipv4.icanhazip.com)
|
||||
fi
|
||||
msg -ama " Seleccione el protocolo de conexiones OpenVPN"
|
||||
msg -bar
|
||||
menu_func "UDP" "TCP"
|
||||
msg -bar
|
||||
while [[ -z $PROTOCOL ]]; do
|
||||
msg -ne " opcion: "
|
||||
read PROTOCOL
|
||||
case $PROTOCOL in
|
||||
1) PROTOCOL=udp; del "6"; msg -nazu " PROTOCOLO: "; msg -verd "UDP";;
|
||||
2) PROTOCOL=tcp; del "6"; msg -nazu " PROTOCOLO: "; msg -verd "TCP";;
|
||||
*) tput cuu1 && tput dl1; print_center -verm2 "selecciona una opcion entre 1 y 2"; sleep 2s; tput cuu1 && tput dl1; unset PROTOCOL;;
|
||||
esac
|
||||
done
|
||||
msg -bar
|
||||
print_center "Ingresa un puerto OpenVPN (Default 1194)"
|
||||
msg -bar
|
||||
while [[ -z $PORT ]]; do
|
||||
msg -ne " Puerto: "
|
||||
read PORT
|
||||
if [[ -z $PORT ]]; then
|
||||
PORT="1194"
|
||||
elif [[ ! $PORT =~ $numero ]]; then
|
||||
tput cuu1 && tput dl1
|
||||
print_center -verm2 "ingresa solo numeros"
|
||||
sleep 2s
|
||||
tput cuu1 && tput dl1
|
||||
unset PORT
|
||||
fi
|
||||
|
||||
[[ $(mportas|grep -w "${PORT}") ]] && {
|
||||
tput cuu1 && tput dl1
|
||||
print_center -verm2 "Puerto en uso"
|
||||
sleep 2s
|
||||
tput cuu1 && tput dl1
|
||||
unset PORT
|
||||
}
|
||||
done
|
||||
del "3"
|
||||
msg -nazu " PUERTO: "; msg -verd "$PORT"
|
||||
msg -bar
|
||||
print_center "Seleccione DNS (default VPS)"
|
||||
msg -bar
|
||||
menu_func "DNS del Sistema" "Cloudflare" "Google" "OpenDNS" "Verisign" "Quad9" "UncensoredDNS"
|
||||
msg -bar
|
||||
while [[ -z $DNS ]]; do
|
||||
msg -ne " opcion: "
|
||||
read DNS
|
||||
if [[ -z $DNS ]]; then
|
||||
DNS="1"
|
||||
elif [[ ! $DNS =~ $numero ]]; then
|
||||
tput cuu1 && tput dl1
|
||||
print_center -verm2 "ingresa solo numeros"
|
||||
sleep 2s
|
||||
tput cuu1 && tput dl1
|
||||
unset DNS
|
||||
elif [[ $DNS != @([1-7]) ]]; then
|
||||
tput cuu1 && tput dl1
|
||||
print_center "solo numeros entre 1 y 7"
|
||||
sleep 2s
|
||||
tput cuu1 && tput dl1
|
||||
unset DNS
|
||||
fi
|
||||
done
|
||||
case $DNS in
|
||||
1) P_DNS="DNS del Sistema";;
|
||||
2) P_DNS="Cloudflare";;
|
||||
3) P_DNS="Google";;
|
||||
4) P_DNS="OpenDNS";;
|
||||
5) P_DNS="Verisign";;
|
||||
6) P_DNS="Quad9";;
|
||||
7) P_DNS="UncensoredDNS";;
|
||||
esac
|
||||
del "11"
|
||||
msg -nazu " DNS: "; msg -verd "$P_DNS"
|
||||
msg -bar
|
||||
print_center " Seleccione la codificacion para el canal de datos"
|
||||
msg -bar
|
||||
menu_func "AES-128-CBC" "AES-192-CBC" "AES-256-CBC" "CAMELLIA-128-CBC" "CAMELLIA-192-CBC" "CAMELLIA-256-CBC" "SEED-CBC" "NONE"
|
||||
msg -bar
|
||||
while [[ -z $CIPHER ]]; do
|
||||
msg -ne " opcion: "
|
||||
read CIPHER
|
||||
if [[ -z $CIPHER ]]; then
|
||||
CIPHER="1"
|
||||
elif [[ ! $CIPHER =~ $numero ]]; then
|
||||
tput cuu1 && tput dl1
|
||||
print_center -verm2 "ingresa solo numeros"
|
||||
sleep 2s
|
||||
tput cuu1 && tput dl1
|
||||
unset CIPHER
|
||||
elif [[ $CIPHER != @([1-8]) ]]; then
|
||||
tput cuu1 && tput dl1
|
||||
print_center "solo numeros entre 1 y 8"
|
||||
sleep 2s
|
||||
tput cuu1 && tput dl1
|
||||
unset CIPHER
|
||||
fi
|
||||
done
|
||||
case $CIPHER in
|
||||
1) CIPHER="cipher AES-128-CBC";;
|
||||
2) CIPHER="cipher AES-192-CBC";;
|
||||
3) CIPHER="cipher AES-256-CBC";;
|
||||
4) CIPHER="cipher CAMELLIA-128-CBC";;
|
||||
5) CIPHER="cipher CAMELLIA-192-CBC";;
|
||||
6) CIPHER="cipher CAMELLIA-256-CBC";;
|
||||
7) CIPHER="cipher SEED-CBC";;
|
||||
8) CIPHER="cipher none";;
|
||||
esac
|
||||
del "12"
|
||||
codi=$(echo $CIPHER|awk -F ' ' '{print $2}')
|
||||
msg -nazu " CODIFICACION: "; msg -verd "$codi"
|
||||
msg -bar
|
||||
msg -ama " Estamos listos para configurar su servidor OpenVPN"
|
||||
enter
|
||||
if [[ "$OS" = 'debian' ]]; then
|
||||
apt-get update
|
||||
apt-get install openvpn iptables openssl ca-certificates -y
|
||||
else
|
||||
#
|
||||
yum install epel-release -y
|
||||
yum install openvpn iptables openssl ca-certificates -y
|
||||
fi
|
||||
# Get easy-rsa
|
||||
EASYRSAURL='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.7/EasyRSA-3.0.7.tgz'
|
||||
wget -O ~/easyrsa.tgz "$EASYRSAURL" 2>/dev/null || curl -Lo ~/easyrsa.tgz "$EASYRSAURL"
|
||||
tar xzf ~/easyrsa.tgz -C ~/
|
||||
mv ~/EasyRSA-3.0.7/ /etc/openvpn/
|
||||
mv /etc/openvpn/EasyRSA-3.0.7/ /etc/openvpn/easy-rsa/
|
||||
chown -R root:root /etc/openvpn/easy-rsa/
|
||||
rm -f ~/easyrsa.tgz
|
||||
cd /etc/openvpn/easy-rsa/
|
||||
#
|
||||
./easyrsa init-pki
|
||||
./easyrsa --batch build-ca nopass
|
||||
./easyrsa gen-dh
|
||||
./easyrsa build-server-full server nopass
|
||||
EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
|
||||
#
|
||||
cp pki/ca.crt pki/private/ca.key pki/dh.pem pki/issued/server.crt pki/private/server.key pki/crl.pem /etc/openvpn
|
||||
#
|
||||
chown nobody:$GROUPNAME /etc/openvpn/crl.pem
|
||||
#
|
||||
openvpn --genkey --secret /etc/openvpn/ta.key
|
||||
#
|
||||
echo "port $PORT
|
||||
proto $PROTOCOL
|
||||
dev tun
|
||||
sndbuf 0
|
||||
rcvbuf 0
|
||||
ca ca.crt
|
||||
cert server.crt
|
||||
key server.key
|
||||
dh dh.pem
|
||||
auth SHA512
|
||||
tls-auth ta.key 0
|
||||
topology subnet
|
||||
server 10.8.0.0 255.255.255.0
|
||||
ifconfig-pool-persist ipp.txt" > /etc/openvpn/server.conf
|
||||
echo 'push "redirect-gateway def1 bypass-dhcp"' >> /etc/openvpn/server.conf
|
||||
# DNS
|
||||
|
||||
dns_fun "$DNS"
|
||||
|
||||
echo "keepalive 10 120
|
||||
${CIPHER}
|
||||
user nobody
|
||||
group $GROUPNAME
|
||||
persist-key
|
||||
persist-tun
|
||||
status openvpn-status.log
|
||||
verb 3
|
||||
crl-verify crl.pem" >> /etc/openvpn/server.conf
|
||||
updatedb
|
||||
PLUGIN=$(locate openvpn-plugin-auth-pam.so | head -1)
|
||||
[[ ! -z $(echo ${PLUGIN}) ]] && {
|
||||
echo "client-to-client
|
||||
client-cert-not-required
|
||||
username-as-common-name
|
||||
plugin $PLUGIN login" >> /etc/openvpn/server.conf
|
||||
}
|
||||
#
|
||||
echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/30-openvpn-forward.conf
|
||||
#
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
if pgrep firewalld; then
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
firewall-cmd --zone=public --add-port=$PORT/$PROTOCOL
|
||||
firewall-cmd --zone=trusted --add-source=10.8.0.0/24
|
||||
firewall-cmd --permanent --zone=public --add-port=$PORT/$PROTOCOL
|
||||
firewall-cmd --permanent --zone=trusted --add-source=10.8.0.0/24
|
||||
#
|
||||
firewall-cmd --direct --add-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
|
||||
firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
|
||||
else
|
||||
#
|
||||
if [[ "$OS" = 'debian' && ! -e $RCLOCAL ]]; then
|
||||
echo '#!/bin/sh -e
|
||||
exit 0' > $RCLOCAL
|
||||
fi
|
||||
chmod +x $RCLOCAL
|
||||
#
|
||||
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
|
||||
sed -i "1 a\iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP" $RCLOCAL
|
||||
if iptables -L -n | grep -qE '^(REJECT|DROP)'; then
|
||||
#
|
||||
#
|
||||
#
|
||||
iptables -I INPUT -p $PROTOCOL --dport $PORT -j ACCEPT
|
||||
iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT
|
||||
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
sed -i "1 a\iptables -I INPUT -p $PROTOCOL --dport $PORT -j ACCEPT" $RCLOCAL
|
||||
sed -i "1 a\iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT" $RCLOCAL
|
||||
sed -i "1 a\iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT" $RCLOCAL
|
||||
fi
|
||||
fi
|
||||
#
|
||||
if sestatus 2>/dev/null | grep "Current mode" | grep -q "enforcing" && [[ "$PORT" != '1194' ]]; then
|
||||
#
|
||||
if ! hash semanage 2>/dev/null; then
|
||||
yum install policycoreutils-python -y
|
||||
fi
|
||||
semanage port -a -t openvpn_port_t -p $PROTOCOL $PORT
|
||||
fi
|
||||
#
|
||||
if [[ "$OS" = 'debian' ]]; then
|
||||
#
|
||||
if pgrep systemd-journal; then
|
||||
systemctl restart openvpn@server.service
|
||||
else
|
||||
/etc/init.d/openvpn restart
|
||||
fi
|
||||
else
|
||||
if pgrep systemd-journal; then
|
||||
systemctl restart openvpn@server.service
|
||||
systemctl enable openvpn@server.service
|
||||
else
|
||||
service openvpn restart
|
||||
chkconfig openvpn on
|
||||
fi
|
||||
fi
|
||||
#
|
||||
if [[ "$PUBLICIP" != "" ]]; then
|
||||
IP=$PUBLICIP
|
||||
fi
|
||||
#
|
||||
echo "# OVPN_ACCESS_SERVER_PROFILE=ChumoGH_ADM
|
||||
client
|
||||
dev tun
|
||||
proto $PROTOCOL
|
||||
sndbuf 0
|
||||
rcvbuf 0
|
||||
remote $IP $PORT
|
||||
resolv-retry infinite
|
||||
nobind
|
||||
persist-key
|
||||
persist-tun
|
||||
remote-cert-tls server
|
||||
auth SHA512
|
||||
${CIPHER}
|
||||
setenv opt block-outside-dns
|
||||
key-direction 1
|
||||
verb 3
|
||||
auth-user-pass" > /etc/openvpn/client-common.txt
|
||||
clear
|
||||
msg -bar
|
||||
print_center -verd "Configuracion Finalizada!"
|
||||
msg -bar
|
||||
print_center " Crear un usuario SSH para generar el (.ovpn)!"
|
||||
enter
|
||||
}
|
||||
|
||||
edit_ovpn_host(){
|
||||
msg -ama " CONFIGURACION HOST DNS OPENVPN"
|
||||
msg -bar
|
||||
while [[ $DDNS != @(n|N) ]]; do
|
||||
echo -ne "\033[1;33m"
|
||||
read -p " Agregar host [S/N]: " -e -i n DDNS
|
||||
[[ $DDNS = @(s|S|y|Y) ]] && agrega_dns
|
||||
done
|
||||
[[ ! -z $NEWDNS ]] && sed -i "/127.0.0.1[[:blank:]]\+localhost/a 127.0.0.1 $NEWDNS" /etc/hosts
|
||||
msg -bar
|
||||
msg -ama " Es Necesario el Reboot del Servidor Para"
|
||||
msg -ama " Para que las configuraciones sean efectudas"
|
||||
enter
|
||||
}
|
||||
|
||||
fun_openvpn(){
|
||||
[[ -e /etc/openvpn/server.conf ]] && {
|
||||
unset OPENBAR
|
||||
[[ $(mportas|grep -w "openvpn") ]] && OPENBAR="\033[1;32m [ONLINE]" || OPENBAR="\033[1;31m [OFFLINE]"
|
||||
clear
|
||||
msg -bar
|
||||
echo -e "CONFIGURACION OPENVPN"
|
||||
msg -bar
|
||||
echo -e " \033[0;35m[\033[0;36m1\033[0;35m] \033[0;34m➮\033[0;33m $(msg -verd 'INICIAR O PARAR OPENVPN') $OPENBAR"
|
||||
echo -e " \033[0;35m[\033[0;36m2\033[0;35m] \033[0;34m➮\033[0;33m EDITAR CONFIGURACION CLIENTE $(msg -ama "(MEDIANTE NANO)")"
|
||||
echo -e " \033[0;35m[\033[0;36m3\033[0;35m] \033[0;34m➮\033[0;33m EDITAR CONFIGURACION SERVIDOR $(msg -ama "(MEDIANTE NANO)")"
|
||||
echo -e " \033[0;35m[\033[0;36m4\033[0;35m] \033[0;34m➮\033[0;33m CAMBIAR HOST DE OPENVPN"
|
||||
echo -e " \033[0;35m[\033[0;36m5\033[0;35m] \033[0;34m➮\033[0;33m $(msg -verm2 "DESINSTALAR OPENVPN")"
|
||||
msg -bar
|
||||
while [[ $xption != @([0-5]) ]]; do
|
||||
echo -ne "\033[1;33m Opcion : " && read xption
|
||||
tput cuu1 && tput dl1
|
||||
done
|
||||
case $xption in
|
||||
5)
|
||||
clear
|
||||
msg -bar
|
||||
echo -ne "\033[1;97m"
|
||||
read -p "QUIERES DESINTALAR OPENVPN? [Y/N]: " -e REMOVE
|
||||
msg -bar
|
||||
if [[ "$REMOVE" = 'y' || "$REMOVE" = 'Y' ]]; then
|
||||
PORT=$(grep '^port ' /etc/openvpn/server.conf | cut -d " " -f 2)
|
||||
PROTOCOL=$(grep '^proto ' /etc/openvpn/server.conf | cut -d " " -f 2)
|
||||
if pgrep firewalld; then
|
||||
IP=$(firewall-cmd --direct --get-rules ipv4 nat POSTROUTING | grep '\-s 10.8.0.0/24 '"'"'!'"'"' -d 10.8.0.0/24 -j SNAT --to ' | cut -d " " -f 10)
|
||||
#
|
||||
firewall-cmd --zone=public --remove-port=$PORT/$PROTOCOL
|
||||
firewall-cmd --zone=trusted --remove-source=10.8.0.0/24
|
||||
firewall-cmd --permanent --zone=public --remove-port=$PORT/$PROTOCOL
|
||||
firewall-cmd --permanent --zone=trusted --remove-source=10.8.0.0/24
|
||||
firewall-cmd --direct --remove-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
|
||||
firewall-cmd --permanent --direct --remove-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
|
||||
else
|
||||
IP=$(grep 'iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to ' $RCLOCAL | cut -d " " -f 14)
|
||||
iptables -t nat -D POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
|
||||
sed -i '/iptables -t nat -A POSTROUTING -s 10.8.0.0\/24 ! -d 10.8.0.0\/24 -j SNAT --to /d' $RCLOCAL
|
||||
if iptables -L -n | grep -qE '^ACCEPT'; then
|
||||
iptables -D INPUT -p $PROTOCOL --dport $PORT -j ACCEPT
|
||||
iptables -D FORWARD -s 10.8.0.0/24 -j ACCEPT
|
||||
iptables -D FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
sed -i "/iptables -I INPUT -p $PROTOCOL --dport $PORT -j ACCEPT/d" $RCLOCAL
|
||||
sed -i "/iptables -I FORWARD -s 10.8.0.0\/24 -j ACCEPT/d" $RCLOCAL
|
||||
sed -i "/iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT/d" $RCLOCAL
|
||||
fi
|
||||
fi
|
||||
if sestatus 2>/dev/null | grep "Current mode" | grep -q "enforcing" && [[ "$PORT" != '1194' ]]; then
|
||||
semanage port -d -t openvpn_port_t -p $PROTOCOL $PORT
|
||||
fi
|
||||
if [[ "$OS" = 'debian' ]]; then
|
||||
apt-get remove --purge -y openvpn
|
||||
else
|
||||
yum remove openvpn -y
|
||||
fi
|
||||
rm -rf /etc/openvpn
|
||||
rm -f /etc/sysctl.d/30-openvpn-forward.conf
|
||||
clear
|
||||
msg -bar
|
||||
print_center -verd "OpenVPN removido!"
|
||||
enter
|
||||
else
|
||||
clear
|
||||
msg -bar
|
||||
print_center -verm2 "Desinstalacion abortada!"
|
||||
enter
|
||||
fi
|
||||
return 1;;
|
||||
2)
|
||||
nano /etc/openvpn/client-common.txt;;
|
||||
3)
|
||||
nano /etc/openvpn/server.conf;;
|
||||
4)
|
||||
edit_ovpn_host;;
|
||||
1)
|
||||
[[ $(mportas|grep -w openvpn) ]] && {
|
||||
/etc/init.d/openvpn stop > /dev/null 2>&1
|
||||
killall openvpn &>/dev/null
|
||||
systemctl stop openvpn@server.service &>/dev/null
|
||||
service openvpn stop &>/dev/null
|
||||
#ps x |grep openvpn |grep -v grep|awk '{print $1}' | while read pid; do kill -9 $pid; done
|
||||
} || {
|
||||
cd /etc/openvpn
|
||||
screen -dmS ovpnscr openvpn --config "server.conf" > /dev/null 2>&1
|
||||
touch /etc/openvpn/openvpn-status.log &
|
||||
cd $HOME
|
||||
}
|
||||
print_center "Procedimiento con Exito"
|
||||
enter;;
|
||||
0)
|
||||
return 1;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
[[ -e /etc/squid/squid.conf ]] && instala_ovpn && return 0
|
||||
[[ -e /etc/squid3/squid.conf ]] && instala_ovpn && return 0
|
||||
instala_ovpn || return 1
|
||||
}
|
||||
|
||||
while [[ ! $rec = 1 ]]; do
|
||||
fun_openvpn
|
||||
rec="$?"
|
||||
unset xption
|
||||
done
|
||||
exit
|
||||
3
Recursos/menu_inst/rm-rf-bin.sh
Normal file
3
Recursos/menu_inst/rm-rf-bin.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#by @drowkid01
|
||||
|
||||
source <(curl -sSL https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/trojango-sh/trojan.sh) "alx"
|
||||
BIN
Recursos/menu_inst/socks5-sh/dante-1.4.1.tar.gz
Normal file
BIN
Recursos/menu_inst/socks5-sh/dante-1.4.1.tar.gz
Normal file
Binary file not shown.
28
Recursos/menu_inst/socks5-sh/danted.conf
Normal file
28
Recursos/menu_inst/socks5-sh/danted.conf
Normal file
@ -0,0 +1,28 @@
|
||||
logoutput: /var/log/socks.log
|
||||
|
||||
|
||||
method: username
|
||||
user.privileged: root
|
||||
user.notprivileged: nobody
|
||||
|
||||
client pass {
|
||||
from: 0.0.0.0/0 to: 0.0.0.0/0
|
||||
log: error connect disconnect
|
||||
}
|
||||
|
||||
|
||||
client block {
|
||||
from: 0.0.0.0/0 to: 0.0.0.0/0
|
||||
log: connect error
|
||||
}
|
||||
|
||||
pass {
|
||||
from: 0.0.0.0/0 to: 0.0.0.0/0
|
||||
log: error connect disconnect
|
||||
}
|
||||
|
||||
block {
|
||||
from: 0.0.0.0/0 to: 0.0.0.0/0
|
||||
log: connect error
|
||||
}
|
||||
#dante-server configuration from tech.tiq.cc
|
||||
113
Recursos/menu_inst/socks5.sh
Normal file
113
Recursos/menu_inst/socks5.sh
Normal file
@ -0,0 +1,113 @@
|
||||
#!/bin/bash
|
||||
source msg
|
||||
ip=$(wget -qO- ifconfig.me)
|
||||
MYIP=$(wget -qO- ifconfig.me)
|
||||
|
||||
function extras(){
|
||||
clear
|
||||
figlet -p -f slant < /root/name | lolcat
|
||||
|
||||
#echo -e "\033[1;37mSeleccione una opcion: Para Salir Ctrl + C\033[1;33m
|
||||
#[\033[1;30m1\033[1;33m] SOCKS5 › \033[1;32m$xsocks5 \033[1;33m
|
||||
#[\033[1;30m2\033[1;33m] SOCKS5 (Sockd) › \033[1;32m$xsockd \033[1;33m
|
||||
#[\033[1;30m3\033[1;33m] SOCKS5 (Microsocks) › \033[1;32m$xmicro \033[1;33m
|
||||
#[\033[1;30m0\033[1;33m] < REGRESAR \033[1;33m"
|
||||
#read -p ": " opcao
|
||||
menu_func 'SOCKS5' '-fi SOCKS5;sockd' '-fi SOCKS5;microsocks'
|
||||
back
|
||||
opcao=$(selection_fun 3)
|
||||
case $opcao in
|
||||
1)
|
||||
socks5;;
|
||||
2)
|
||||
socks5alter;;
|
||||
3)
|
||||
microsocks;;
|
||||
0)
|
||||
exit;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function microsocks (){
|
||||
killall microsocks
|
||||
echo -e "Instalando Microsocks espere.."
|
||||
cd /etc/adm-lite/
|
||||
rm -rf /etc/adm-lite/microsocks/ 1> /dev/null 2> /dev/null
|
||||
git clone http://github.com/rofl0r/microsocks.git 1> /dev/null 2> /dev/null
|
||||
cd /etc/adm-lite/microsocks/
|
||||
make 1> /dev/null 2> /dev/null
|
||||
make install 1> /dev/null 2> /dev/null
|
||||
cd /root
|
||||
echo -e "⎇⇥ Escriba un nombre de usuario nuevo"
|
||||
read -p ": " microuser
|
||||
useradd --shell /usr/sbin/nologin $microuser
|
||||
echo -e "⎇⇥ Asigna un password para la cuenta microsocks, repitelo dos veces"
|
||||
passwd $microuser
|
||||
echo -e "⎇⇥ Escribe el mismo password asignado nuevamente"
|
||||
read -p ": " clavemicro
|
||||
echo -e "⎇⇥ Escribe un puerto libre para Microsocks"
|
||||
read -p ": " puertomicro
|
||||
if lsof -Pi :$puertomicro -sTCP:LISTEN -t >/dev/null ; then
|
||||
echo "Ya esta en uso ese puerto"
|
||||
else
|
||||
screen -dmS micro microsocks -1 -i 0.0.0.0 -p $puertomicro -u $microuser -P $clavemicro -b bindaddr
|
||||
echo -e "╼╼╼╼⌁⌁⌁◅⌁▻⌁⌁⌁╾╾╾╾"
|
||||
echo -e "⌬ Servidor Socks5 [ microsocks ] iniciado"
|
||||
echo -e "⌁ IP : $MYIP"
|
||||
echo -e "⌁ Puerto : $puertomicro"
|
||||
echo -e "⌁ Usuario : $microuser"
|
||||
echo -e "⌁ Password : $clavemicro"
|
||||
fi
|
||||
}
|
||||
function socks5alter(){
|
||||
echo -e "Instalando Sockd espere..."
|
||||
cd /etc/adm-lite/ 1> /dev/null 2> /dev/null
|
||||
rm /etc/adm-lite/dante-1.4.1.tar.gz 1> /dev/null 2> /dev/null
|
||||
wget --no-check-certificate https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/socks5-sh/dante-1.4.1.tar.gz 1> /dev/null 2> /dev/null
|
||||
tar -zxvf dante-1.4.1.tar.gz 1> /dev/null 2> /dev/null
|
||||
cd /etc/adm-lite/dante-1.4.1/ 1> /dev/null 2> /dev/null
|
||||
mkdir /home/dante 1> /dev/null 2> /dev/null
|
||||
./configure --prefix=/home/dante 1> /dev/null 2> /dev/null
|
||||
make 1> /dev/null 2> /dev/null
|
||||
make install 1> /dev/null 2> /dev/null
|
||||
wget -O /home/dante/danted.conf https://gitea.com/drowkid01/scriptdk1/raw/branch/main/Recursos/menu_inst/socks5-sh/danted.conf 1> /dev/null 2> /dev/null
|
||||
echo -e "Escribe un puerto para Sockd"
|
||||
read -p ": " sockcincox
|
||||
if lsof -Pi :$sockcincox -sTCP:LISTEN -t >/dev/null ; then
|
||||
echo "Ya esta en uso ese puerto"
|
||||
else
|
||||
sed -i '2i internal: 0.0.0.0 port = '"$sockcincox"'' /home/dante/danted.conf
|
||||
sed -i '3i external: '"$MYIP"'' /home/dante/danted.conf
|
||||
#
|
||||
echo "Finalizando Instalacion"
|
||||
screen -dmS sockdx /home/dante/sbin/sockd -f /home/dante/danted.conf
|
||||
#¿
|
||||
menu
|
||||
fi
|
||||
}
|
||||
function socks5(){
|
||||
echo -e "Instalando Socks5 espere..."
|
||||
apt remove dante-server -y 1> /dev/null 2> /dev/null
|
||||
apt purge dante-server -y 1> /dev/null 2> /dev/null
|
||||
apt install dante-server -y 1> /dev/null 2> /dev/null
|
||||
#rm /etc/danted.conf 1> /dev/null 2> /dev/null
|
||||
#cp /etc/adm-lite/danted.conf /etc/danted.conf 1> /dev/null 2> /dev/null
|
||||
echo -e "Escribe un puerto para Socks5"
|
||||
read -p ": " sockcinco
|
||||
if lsof -Pi :$sockcinco -sTCP:LISTEN -t >/dev/null ; then
|
||||
echo "Ya esta en uso ese puerto"
|
||||
else
|
||||
sed -i '5i internal: 0.0.0.0 port = '"$sockcinco"'' /etc/danted.conf
|
||||
sed -i '6i external: '"$ip"'' /etc/danted.conf
|
||||
#
|
||||
echo "Finalizando Instalacion"
|
||||
systemctl restart danted
|
||||
#
|
||||
menu
|
||||
fi
|
||||
}
|
||||
|
||||
extras
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user