Kalix1 3 年之前
父節點
當前提交
6bad2a511d

二進制
ChuGH-5.7u/Bot/update.tar/update.tar


+ 278 - 0
ChuGH-5.7u/Bot/update.tar/update/PDirect.py

@@ -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 - 0
ChuGH-5.7u/Bot/update.tar/update/PGet.py

@@ -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 - 0
ChuGH-5.7u/Bot/update.tar/update/POpen.py

@@ -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 - 0
ChuGH-5.7u/Bot/update.tar/update/PPriv.py

@@ -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 - 0
ChuGH-5.7u/Bot/update.tar/update/PPub.py

@@ -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()
+

文件差異過大導致無法顯示
+ 3 - 0
ChuGH-5.7u/Bot/update.tar/update/cabecalho


+ 474 - 0
ChuGH-5.7u/Bot/update.tar/update/fai2ban

@@ -0,0 +1,474 @@
+#!/bin/bash
+
+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)
+if [ "$openssh" != "" ]; then
+s1="ssh"
+fi
+if [ "$squid" != "" ]; then
+s2="squid"
+fi
+if [ "$dropbear" != "" ]; then
+s3="dropbear"
+fi
+if [ "$apache" != "" ]; then
+s4="apache"
+fi
+echo -e "${cor[1]} =================================== ${cor[0]}"
+
+#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]} ${txt[144]}"
+echo -e "${cor[2]} |2| >${cor[3]} ${txt[145]}"
+echo -e "${cor[1]} =================================== ${cor[0]}"
+read -p " [1|2]: " lo_og
+if [ "$lo_og" = "2" ]; then
+cat /var/log/fail2ban.log
+fi
+if [ "$lo_og" = "1" ]; then
+echo -e "${cor[1]} =================================== \033[1;37m"
+fun_bar "apt-get remove fail2ban -y"
+fi
+echo -e "${cor[1]} =================================== ${cor[0]}"
+return
+fi
+
+echo -e "${cor[5]} ${txt[146]}"
+echo -e "${cor[5]} ${txt[147]}"
+echo -e "${cor[5]} ${txt[148]}"
+echo -e "${cor[5]} ${txt[149]}"
+echo -e "${cor[5]} ${txt[150]}"
+echo -e "${cor[5]} ${txt[151]}"
+echo -e "${cor[5]} ${txt[152]}"
+echo -e "${cor[1]} =================================== \033[1;37m"
+read -p " [S/N]: " fail2ban
+if [[ "$fail2ban" = "s" || "$fail2ban" = "S" ]]; then
+echo -e "${cor[1]} =================================== \033[1;37m"
+fun_bar "apt-get install fail2ban -y"
+cd $HOME
+wget -O fail2ban https://github.com/ChumoGH/chumogh-gmail.com/raw/master/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
+echo -e "${cor[1]} =================================== ${cor[0]}"
+echo -e "${cor[5]} ${txt[153]}"
+echo -e "${cor[5]} ${txt[154]}"
+if [ "$s1" != "" ]; then
+echo -ne " $s1"
+fi
+if [ "$s2" != "" ]; then
+echo -ne " $s2"
+fi
+if [ "$s3" != "" ]; then
+echo -ne " $s3"
+fi
+if [ "$s4" != "" ]; then
+echo -ne " $s4"
+fi
+echo -e ""
+echo -e "${cor[1]} =================================== ${cor[0]}"
+echo -e "${cor[5]} ${txt[155]}"
+read -p " [S/N]: " sim_nao
+if [[ "$sim_nao" = "s" || "$sim_nao" = "S" ]]; then
+if [ "$s1" != "" ]; then
+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
+else
+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
+fi
+if [ "$s2" != "" ]; then
+echo '[squid]
+enabled = true
+port     =  80,443,3128,8080
+logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
+else
+echo '[squid]
+port     =  80,443,3128,8080
+logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
+fi
+if [ "$s3" != "" ]; then
+echo '[dropbear]
+enabled = true
+port     = ssh
+logpath  = %(dropbear_log)s
+backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
+else
+echo '[dropbear]
+port     = ssh
+logpath  = %(dropbear_log)s
+backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
+fi
+if [ "$s4" != "" ]; then
+echo '[apache-auth]
+enabled = true
+port     = http,https
+logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
+else
+echo '[apache-auth]
+port     = http,https
+logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
+fi
+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]} ${txt[156]}"
+ fi
+fi
+echo -e "${cor[1]} =================================== ${cor[0]}"
+return
+}
+
+fail2ban_function
+[[ -e $HOME/fail2ban ]] && rm $HOME/fail2ban
+[[ -d $HOME/fail2ban-0.9.4 ]] && rm -rf $HOME/fail2ban-0.9.4
+

文件差異過大導致無法顯示
+ 3 - 0
ChuGH-5.7u/Bot/update.tar/update/ferramentas


文件差異過大導致無法顯示
+ 1 - 0
ChuGH-5.7u/Bot/update.tar/update/menu


+ 1 - 0
ChuGH-5.7u/Bot/update.tar/update/menu_credito

@@ -0,0 +1 @@
+@ChumoGH - OFFICIAL

文件差異過大導致無法顯示
+ 1 - 0
ChuGH-5.7u/Bot/update.tar/update/menu_inst


+ 755 - 0
ChuGH-5.7u/Bot/update.tar/update/payloads

@@ -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 GMT0„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]
+
+-----------------------------------------------------------------------------
+

+ 1247 - 0
ChuGH-5.7u/Bot/update.tar/update/shadowsocks.sh

@@ -0,0 +1,1247 @@
+eval PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
+export PATH
+red='\033[0;31m'
+green='\033[0;32m'
+yellow='\033[0;33m'
+plain='\033[0m'
+[[ $EUID -ne 0 ]] && echo -e "[${red}Error${plain}] This script must be run as root!" && exit 1
+cur_dir=$( pwd )
+software=(Shadowsocks-Python ShadowsocksR Shadowsocks-Go Shadowsocks-libev)
+libsodium_file="libsodium-1.0.17"
+libsodium_url="https://github.com/jedisct1/libsodium/releases/download/1.0.17/libsodium-1.0.17.tar.gz"
+mbedtls_file="mbedtls-2.16.0"
+mbedtls_url="https://tls.mbed.org/download/mbedtls-2.16.0-gpl.tgz"
+shadowsocks_python_file="shadowsocks-master"
+shadowsocks_python_url="https://github.com/shadowsocks/shadowsocks/archive/master.zip"
+shadowsocks_python_init="/etc/init.d/shadowsocks-python"
+shadowsocks_python_config="/etc/shadowsocks-python/config.json"
+shadowsocks_python_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks"
+shadowsocks_python_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-debian"
+shadowsocks_r_file="shadowsocksr-3.2.2"
+shadowsocks_r_url="https://github.com/shadowsocksrr/shadowsocksr/archive/3.2.2.tar.gz"
+shadowsocks_r_init="/etc/init.d/shadowsocks-r"
+shadowsocks_r_config="/etc/shadowsocks-r/config.json"
+shadowsocks_r_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR"
+shadowsocks_r_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR-debian"
+shadowsocks_go_file_64="shadowsocks-server-linux64-1.2.2"
+shadowsocks_go_url_64="https://dl.lamp.sh/shadowsocks/shadowsocks-server-linux64-1.2.2.gz"
+shadowsocks_go_file_32="shadowsocks-server-linux32-1.2.2"
+shadowsocks_go_url_32="https://dl.lamp.sh/shadowsocks/shadowsocks-server-linux32-1.2.2.gz"
+shadowsocks_go_init="/etc/init.d/shadowsocks-go"
+shadowsocks_go_config="/etc/shadowsocks-go/config.json"
+shadowsocks_go_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-go"
+shadowsocks_go_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-go-debian"
+shadowsocks_libev_init="/etc/init.d/shadowsocks-libev"
+shadowsocks_libev_config="/etc/shadowsocks-libev/config.json"
+shadowsocks_libev_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev"
+shadowsocks_libev_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev-debian"
+common_ciphers=(
+aes-256-gcm
+aes-192-gcm
+aes-128-gcm
+aes-256-ctr
+aes-192-ctr
+aes-128-ctr
+aes-256-cfb
+aes-192-cfb
+aes-128-cfb
+camellia-128-cfb
+camellia-192-cfb
+camellia-256-cfb
+xchacha20-ietf-poly1305
+chacha20-ietf-poly1305
+chacha20-ietf
+chacha20
+salsa20
+rc4-md5
+)
+go_ciphers=(
+aes-256-cfb
+aes-192-cfb
+aes-128-cfb
+aes-256-ctr
+aes-192-ctr
+aes-128-ctr
+chacha20-ietf
+chacha20
+salsa20
+rc4-md5
+)
+r_ciphers=(
+none
+aes-256-cfb
+aes-192-cfb
+aes-128-cfb
+aes-256-cfb8
+aes-192-cfb8
+aes-128-cfb8
+aes-256-ctr
+aes-192-ctr
+aes-128-ctr
+chacha20-ietf
+chacha20
+salsa20
+xchacha20
+xsalsa20
+rc4-md5
+)
+protocols=(
+origin
+verify_deflate
+auth_sha1_v4
+auth_sha1_v4_compatible
+auth_aes128_md5
+auth_aes128_sha1
+auth_chain_a
+auth_chain_b
+auth_chain_c
+auth_chain_d
+auth_chain_e
+auth_chain_f
+)
+obfs=(
+plain
+http_simple
+http_simple_compatible
+http_post
+http_post_compatible
+tls1.2_ticket_auth
+tls1.2_ticket_auth_compatible
+tls1.2_ticket_fastauth
+tls1.2_ticket_fastauth_compatible
+)
+obfs_libev=(http tls)
+libev_obfs=""
+disable_selinux(){
+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
+}
+check_sys(){
+local checkType=$1
+local value=$2
+local release=''
+local systemPackage=''
+if [[ -f /etc/redhat-release ]]; then
+release="centos"
+systemPackage="yum"
+elif grep -Eqi "debian|raspbian" /etc/issue; then
+release="debian"
+systemPackage="apt"
+elif grep -Eqi "ubuntu" /etc/issue; then
+release="ubuntu"
+systemPackage="apt"
+elif grep -Eqi "centos|red hat|redhat" /etc/issue; then
+release="centos"
+systemPackage="yum"
+elif grep -Eqi "debian|raspbian" /proc/version; then
+release="debian"
+systemPackage="apt"
+elif grep -Eqi "ubuntu" /proc/version; then
+release="ubuntu"
+systemPackage="apt"
+elif grep -Eqi "centos|red hat|redhat" /proc/version; then
+release="centos"
+systemPackage="yum"
+fi
+if [[ "${checkType}" == "sysRelease" ]]; then
+if [ "${value}" == "${release}" ]; then
+return 0
+else
+return 1
+fi
+elif [[ "${checkType}" == "packageManager" ]]; then
+if [ "${value}" == "${systemPackage}" ]; then
+return 0
+else
+return 1
+fi
+fi
+}
+version_ge(){
+test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"
+}
+version_gt(){
+test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"
+}
+check_kernel_version(){
+local kernel_version=$(uname -r | cut -d- -f1)
+if version_gt ${kernel_version} 3.7.0; then
+return 0
+else
+return 1
+fi
+}
+check_kernel_headers(){
+if check_sys packageManager yum; then
+if rpm -qa | grep -q headers-$(uname -r); then
+return 0
+else
+return 1
+fi
+elif check_sys packageManager apt; then
+if dpkg -s linux-headers-$(uname -r) > /dev/null 2>&1; then
+return 0
+else
+return 1
+fi
+fi
+return 1
+}
+getversion(){
+if [[ -s /etc/redhat-release ]]; then
+grep -oE  "[0-9.]+" /etc/redhat-release
+else
+grep -oE  "[0-9.]+" /etc/issue
+fi
+}
+centosversion(){
+if check_sys sysRelease centos; then
+local code=$1
+local version="$(getversion)"
+local main_ver=${version%%.*}
+if [ "$main_ver" == "$code" ]; then
+return 0
+else
+return 1
+fi
+else
+return 1
+fi
+}
+autoconf_version(){
+if [ ! "$(command -v autoconf)" ]; then
+echo -e "[${green}Info${plain}] Starting install package autoconf"
+if check_sys packageManager yum; then
+yum install -y autoconf > /dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf"
+elif check_sys packageManager apt; then
+apt-get -y update > /dev/null 2>&1
+apt-get -y install autoconf > /dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf"
+fi
+fi
+local autoconf_ver=$(autoconf --version | grep autoconf | grep -oE "[0-9.]+")
+if version_ge ${autoconf_ver} 2.67; then
+return 0
+else
+return 1
+fi
+}
+get_ip(){
+local IP=$( ip addr | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | egrep -v "^192\.168|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-2]\.|^10\.|^127\.|^255\.|^0\." | head -n 1 )
+[ -z ${IP} ] && IP=$( wget -qO- -t1 -T2 ipv4.icanhazip.com )
+[ -z ${IP} ] && IP=$( wget -qO- -t1 -T2 ipinfo.io/ip )
+echo ${IP}
+}
+get_ipv6(){
+local ipv6=$(wget -qO- -t1 -T2 ipv6.icanhazip.com)
+[ -z ${ipv6} ] && return 1 || return 0
+}
+get_libev_ver(){
+libev_ver=$(wget --no-check-certificate -qO- https://api.github.com/repos/shadowsocks/shadowsocks-libev/releases/latest | grep 'tag_name' | cut -d\" -f4)
+[ -z ${libev_ver} ] && echo -e "[${red}Error${plain}] Get shadowsocks-libev latest version failed" && exit 1
+}
+get_opsy(){
+[ -f /etc/redhat-release ] && awk '{print ($1,$3~/^[0-9]/?$3:$4)}' /etc/redhat-release && return
+[ -f /etc/os-release ] && awk -F'[= "]' '/PRETTY_NAME/{print $3,$4,$5}' /etc/os-release && return
+[ -f /etc/lsb-release ] && awk -F'[="]+' '/DESCRIPTION/{print $2}' /etc/lsb-release && return
+}
+is_64bit(){
+if [ `getconf WORD_BIT` = '32' ] && [ `getconf LONG_BIT` = '64' ] ; then
+return 0
+else
+return 1
+fi
+}
+debianversion(){
+if check_sys sysRelease debian;then
+local version=$( get_opsy )
+local code=${1}
+local main_ver=$( echo ${version} | sed 's/[^0-9]//g')
+if [ "${main_ver}" == "${code}" ];then
+return 0
+else
+return 1
+fi
+else
+return 1
+fi
+}
+download(){
+local filename=$(basename $1)
+if [ -f ${1} ]; then
+echo "${filename} [found]"
+else
+echo "${filename} not found, download now..."
+wget --no-check-certificate -c -t3 -T60 -O ${1} ${2}
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] Download ${filename} failed."
+exit 1
+fi
+fi
+}
+download_files(){
+cd ${cur_dir}
+if   [ "${selected}" == "1" ]; then
+download "${shadowsocks_python_file}.zip" "${shadowsocks_python_url}"
+if check_sys packageManager yum; then
+download "${shadowsocks_python_init}" "${shadowsocks_python_centos}"
+elif check_sys packageManager apt; then
+download "${shadowsocks_python_init}" "${shadowsocks_python_debian}"
+fi
+elif [ "${selected}" == "2" ]; then
+download "${shadowsocks_r_file}.tar.gz" "${shadowsocks_r_url}"
+if check_sys packageManager yum; then
+download "${shadowsocks_r_init}" "${shadowsocks_r_centos}"
+elif check_sys packageManager apt; then
+download "${shadowsocks_r_init}" "${shadowsocks_r_debian}"
+fi
+elif [ "${selected}" == "3" ]; then
+if is_64bit; then
+download "${shadowsocks_go_file_64}.gz" "${shadowsocks_go_url_64}"
+else
+download "${shadowsocks_go_file_32}.gz" "${shadowsocks_go_url_32}"
+fi
+if check_sys packageManager yum; then
+download "${shadowsocks_go_init}" "${shadowsocks_go_centos}"
+elif check_sys packageManager apt; then
+download "${shadowsocks_go_init}" "${shadowsocks_go_debian}"
+fi
+elif [ "${selected}" == "4" ]; then
+get_libev_ver
+shadowsocks_libev_file="shadowsocks-libev-$(echo ${libev_ver} | sed -e 's/^[a-zA-Z]//g')"
+shadowsocks_libev_url="https://github.com/shadowsocks/shadowsocks-libev/releases/download/${libev_ver}/${shadowsocks_libev_file}.tar.gz"
+download "${shadowsocks_libev_file}.tar.gz" "${shadowsocks_libev_url}"
+if check_sys packageManager yum; then
+download "${shadowsocks_libev_init}" "${shadowsocks_libev_centos}"
+elif check_sys packageManager apt; then
+download "${shadowsocks_libev_init}" "${shadowsocks_libev_debian}"
+fi
+fi
+}
+get_char(){
+SAVEDSTTY=$(stty -g)
+stty -echo
+stty cbreak
+dd if=/dev/tty bs=1 count=1 2> /dev/null
+stty -raw
+stty echo
+stty $SAVEDSTTY
+}
+error_detect_depends(){
+local command=$1
+local depend=`echo "${command}" | awk '{print $4}'`
+echo -e "[${green}Info${plain}] Starting to install package ${depend}"
+${command} > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] Failed to install ${red}${depend}${plain}"
+exit 1
+fi
+}
+config_firewall(){
+if centosversion 6; then
+/etc/init.d/iptables status > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+iptables -L -n | grep -i ${shadowsocksport} > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport ${shadowsocksport} -j ACCEPT
+iptables -I INPUT -m state --state NEW -m udp -p udp --dport ${shadowsocksport} -j ACCEPT
+/etc/init.d/iptables save
+/etc/init.d/iptables restart
+else
+echo -e "[${green}Info${plain}] port ${green}${shadowsocksport}${plain} already be enabled."
+fi
+else
+echo -e "[${yellow}Warning${plain}] iptables looks like not running or not installed, please enable port ${shadowsocksport} manually if necessary."
+fi
+elif centosversion 7; then
+systemctl status firewalld > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+default_zone=$(firewall-cmd --get-default-zone)
+firewall-cmd --permanent --zone=${default_zone} --add-port=${shadowsocksport}/tcp
+firewall-cmd --permanent --zone=${default_zone} --add-port=${shadowsocksport}/udp
+firewall-cmd --reload
+else
+echo -e "[${yellow}Warning${plain}] firewalld looks like not running or not installed, please enable port ${shadowsocksport} manually if necessary."
+fi
+fi
+}
+config_shadowsocks(){
+if check_kernel_version && check_kernel_headers; then
+fast_open="true"
+else
+fast_open="false"
+fi
+if   [ "${selected}" == "1" ]; then
+if [ ! -d "$(dirname ${shadowsocks_python_config})" ]; then
+mkdir -p $(dirname ${shadowsocks_python_config})
+fi
+cat > ${shadowsocks_python_config}<<-EOF
+{
+"server":"0.0.0.0",
+"server_port":${shadowsocksport},
+"local_address":"127.0.0.1",
+"local_port":1080,
+"password":"${shadowsockspwd}",
+"timeout":300,
+"method":"${shadowsockscipher}",
+"fast_open":${fast_open}
+}
+EOF
+elif [ "${selected}" == "2" ]; then
+if [ ! -d "$(dirname ${shadowsocks_r_config})" ]; then
+mkdir -p $(dirname ${shadowsocks_r_config})
+fi
+cat > ${shadowsocks_r_config}<<-EOF
+{
+"server":"0.0.0.0",
+"server_ipv6":"::",
+"server_port":${shadowsocksport},
+"local_address":"127.0.0.1",
+"local_port":1080,
+"password":"${shadowsockspwd}",
+"timeout":120,
+"method":"${shadowsockscipher}",
+"protocol":"${shadowsockprotocol}",
+"protocol_param":"",
+"obfs":"${shadowsockobfs}",
+"obfs_param":"",
+"redirect":"",
+"dns_ipv6":false,
+"fast_open":${fast_open},
+"workers":1
+}
+EOF
+elif [ "${selected}" == "3" ]; then
+if [ ! -d "$(dirname ${shadowsocks_go_config})" ]; then
+mkdir -p $(dirname ${shadowsocks_go_config})
+fi
+cat > ${shadowsocks_go_config}<<-EOF
+{
+"server":"0.0.0.0",
+"server_port":${shadowsocksport},
+"local_port":1080,
+"password":"${shadowsockspwd}",
+"method":"${shadowsockscipher}",
+"timeout":300
+}
+EOF
+elif [ "${selected}" == "4" ]; then
+local server_value="\"0.0.0.0\""
+if get_ipv6; then
+server_value="[\"[::0]\",\"0.0.0.0\"]"
+fi
+if [ ! -d "$(dirname ${shadowsocks_libev_config})" ]; then
+mkdir -p $(dirname ${shadowsocks_libev_config})
+fi
+if [ "${libev_obfs}" == "y" ] || [ "${libev_obfs}" == "Y" ]; then
+cat > ${shadowsocks_libev_config}<<-EOF
+{
+"server":${server_value},
+"server_port":${shadowsocksport},
+"password":"${shadowsockspwd}",
+"timeout":300,
+"user":"nobody",
+"method":"${shadowsockscipher}",
+"fast_open":${fast_open},
+"nameserver":"8.8.8.8",
+"mode":"tcp_and_udp",
+"plugin":"obfs-server",
+"plugin_opts":"obfs=${shadowsocklibev_obfs}"
+}
+EOF
+else
+cat > ${shadowsocks_libev_config}<<-EOF
+{
+"server":${server_value},
+"server_port":${shadowsocksport},
+"password":"${shadowsockspwd}",
+"timeout":300,
+"user":"nobody",
+"method":"${shadowsockscipher}",
+"fast_open":${fast_open},
+"nameserver":"8.8.8.8",
+"mode":"tcp_and_udp"
+}
+EOF
+fi
+fi
+}
+install_dependencies(){
+if check_sys packageManager yum; then
+echo -e "[${green}Info${plain}] Checking the EPEL repository..."
+if [ ! -f /etc/yum.repos.d/epel.repo ]; then
+yum install -y epel-release > /dev/null 2>&1
+fi
+[ ! -f /etc/yum.repos.d/epel.repo ] && echo -e "[${red}Error${plain}] Install EPEL repository failed, please check it." && exit 1
+[ ! "$(command -v yum-config-manager)" ] && yum install -y yum-utils > /dev/null 2>&1
+[ x"$(yum-config-manager epel | grep -w enabled | awk '{print $3}')" != x"True" ] && yum-config-manager --enable epel > /dev/null 2>&1
+echo -e "[${green}Info${plain}] Checking the EPEL repository complete..."
+yum_depends=(
+unzip gzip openssl openssl-devel gcc python python-devel python-setuptools pcre pcre-devel libtool libevent
+autoconf automake make curl curl-devel zlib-devel perl perl-devel cpio expat-devel gettext-devel
+libev-devel c-ares-devel git qrencode
+)
+for depend in ${yum_depends[@]}; do
+error_detect_depends "yum -y install ${depend}"
+done
+elif check_sys packageManager apt; then
+apt_depends=(
+gettext build-essential unzip gzip python python-dev python-setuptools curl openssl libssl-dev
+autoconf automake libtool gcc make perl cpio libpcre3 libpcre3-dev zlib1g-dev libev-dev libc-ares-dev git qrencode
+)
+apt-get -y update
+for depend in ${apt_depends[@]}; do
+error_detect_depends "apt-get -y install ${depend}"
+done
+fi
+}
+install_check(){
+if check_sys packageManager yum || check_sys packageManager apt; then
+if centosversion 5; then
+return 1
+fi
+return 0
+else
+return 1
+fi
+}
+install_select(){
+if ! install_check; then
+echo -e "[${red}Error${plain}] Your OS is not supported to run it!"
+echo "Please change to CentOS 6+/Debian 7+/Ubuntu 12+ and try again."
+exit 1
+fi
+clear
+while true
+do
+echo  "Cual servidor Shadowsocks quieres instalar (recomendado 4):"
+for ((i=1;i<=${#software[@]};i++ )); do
+hint="${software[$i-1]}"
+echo -e "${green}${i}${plain}) ${hint}"
+done
+read -p "Escribe un numero (Default ${software[0]}):" selected
+[ -z "${selected}" ] && selected="1"
+case "${selected}" in
+1|2|3|4)
+echo
+echo "Escogiste = ${software[${selected}-1]}"
+echo
+break
+;;
+*)
+echo -e "[${red}Error${plain}] Por favor escribe un numero del [1-4]"
+;;
+esac
+done
+}
+install_prepare_password(){
+echo "Escribe una contraseña ${software[${selected}-1]}"
+read -p "(Default password: chumogh):" shadowsockspwd
+[ -z "${shadowsockspwd}" ] && shadowsockspwd="chumogh"
+echo
+echo "password = ${shadowsockspwd}"
+echo
+}
+install_prepare_port() {
+while true
+do
+dport=$(shuf -i 9000-19999 -n 1)
+echo -e "Por favor escribe un puerto ${software[${selected}-1]} [1-65535]"
+read -p "(Default port: ${dport}):" shadowsocksport
+[ -z "${shadowsocksport}" ] && shadowsocksport=${dport}
+expr ${shadowsocksport} + 1 &>/dev/null
+if [ $? -eq 0 ]; then
+if [ ${shadowsocksport} -ge 1 ] && [ ${shadowsocksport} -le 65535 ] && [ ${shadowsocksport:0:1} != 0 ]; then
+echo
+echo "port = ${shadowsocksport}"
+echo
+break
+fi
+fi
+echo -e "[${red}Error${plain}] Por favor escribe un numero entre [1-65535]"
+done
+}
+install_prepare_cipher(){
+while true
+do
+echo -e "Escribe el tipo de encriptacion ${software[${selected}-1]}:"
+if   [[ "${selected}" == "1" || "${selected}" == "4" ]]; then
+for ((i=1;i<=${#common_ciphers[@]};i++ )); do
+hint="${common_ciphers[$i-1]}"
+echo -e "${green}${i}${plain}) ${hint}"
+done
+read -p "Encriptacion(Default: ${common_ciphers[0]}):" pick
+[ -z "$pick" ] && pick=1
+expr ${pick} + 1 &>/dev/null
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero"
+continue
+fi
+if [[ "$pick" -lt 1 || "$pick" -gt ${#common_ciphers[@]} ]]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero entre 1 y ${#common_ciphers[@]}"
+continue
+fi
+shadowsockscipher=${common_ciphers[$pick-1]}
+elif [ "${selected}" == "2" ]; then
+for ((i=1;i<=${#r_ciphers[@]};i++ )); do
+hint="${r_ciphers[$i-1]}"
+echo -e "${green}${i}${plain}) ${hint}"
+done
+read -p "Encriptacion(Default: ${r_ciphers[1]}):" pick
+[ -z "$pick" ] && pick=2
+expr ${pick} + 1 &>/dev/null
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero"
+continue
+fi
+if [[ "$pick" -lt 1 || "$pick" -gt ${#r_ciphers[@]} ]]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero entre 1 y ${#r_ciphers[@]}"
+continue
+fi
+shadowsockscipher=${r_ciphers[$pick-1]}
+elif [ "${selected}" == "3" ]; then
+for ((i=1;i<=${#go_ciphers[@]};i++ )); do
+hint="${go_ciphers[$i-1]}"
+echo -e "${green}${i}${plain}) ${hint}"
+done
+read -p "Encriptacion(Default: ${go_ciphers[0]}):" pick
+[ -z "$pick" ] && pick=1
+expr ${pick} + 1 &>/dev/null
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero"
+continue
+fi
+if [[ "$pick" -lt 1 || "$pick" -gt ${#go_ciphers[@]} ]]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero entre 1 y ${#go_ciphers[@]}"
+continue
+fi
+shadowsockscipher=${go_ciphers[$pick-1]}
+fi
+echo
+echo "cipher = ${shadowsockscipher}"
+echo
+break
+done
+}
+install_prepare_protocol(){
+while true
+do
+echo -e "Escoge un protocolo ${software[${selected}-1]}:"
+for ((i=1;i<=${#protocols[@]};i++ )); do
+hint="${protocols[$i-1]}"
+echo -e "${green}${i}${plain}) ${hint}"
+done
+read -p "Protocolo(Default: ${protocols[0]}):" protocol
+[ -z "$protocol" ] && protocol=1
+expr ${protocol} + 1 &>/dev/null
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero"
+continue
+fi
+if [[ "$protocol" -lt 1 || "$protocol" -gt ${#protocols[@]} ]]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero entre 1 y ${#protocols[@]}"
+continue
+fi
+shadowsockprotocol=${protocols[$protocol-1]}
+echo
+echo "protocol = ${shadowsockprotocol}"
+echo
+break
+done
+}
+install_prepare_obfs(){
+while true
+do
+echo -e "Please select obfs for ${software[${selected}-1]}:"
+for ((i=1;i<=${#obfs[@]};i++ )); do
+hint="${obfs[$i-1]}"
+echo -e "${green}${i}${plain}) ${hint}"
+done
+read -p "Obfs(Default: ${obfs[0]}):" r_obfs
+[ -z "$r_obfs" ] && r_obfs=1
+expr ${r_obfs} + 1 &>/dev/null
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero"
+continue
+fi
+if [[ "$r_obfs" -lt 1 || "$r_obfs" -gt ${#obfs[@]} ]]; then
+echo -e "[${red}Error${plain}] Por favor escoge un numero entre 1 y ${#obfs[@]}"
+continue
+fi
+shadowsockobfs=${obfs[$r_obfs-1]}
+echo
+echo "obfs = ${shadowsockobfs}"
+echo
+break
+done
+}
+install_prepare_libev_obfs(){
+if autoconf_version || centosversion 6; then
+while true
+do
+echo -e "Quieres instalar simple-obfs para ${software[${selected}-1]}? [y/n]"
+read -p "(default: n):" libev_obfs
+[ -z "$libev_obfs" ] && libev_obfs=n
+case "${libev_obfs}" in
+y|Y|n|N)
+echo
+echo "Escogiste = ${libev_obfs}"
+echo
+break
+;;
+*)
+echo -e "[${red}Error${plain}] Por favor solo escribe [y/n]"
+;;
+esac
+done
+if [ "${libev_obfs}" == "y" ] || [ "${libev_obfs}" == "Y" ]; then
+while true
+do
+echo -e "Por favor selecciona el simple-obfs:"
+for ((i=1;i<=${#obfs_libev[@]};i++ )); do
+hint="${obfs_libev[$i-1]}"
+echo -e "${green}${i}${plain}) ${hint}"
+done
+read -p "Obfs(Default: ${obfs_libev[0]}):" r_libev_obfs
+[ -z "$r_libev_obfs" ] && r_libev_obfs=1
+expr ${r_libev_obfs} + 1 &>/dev/null
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero"
+continue
+fi
+if [[ "$r_libev_obfs" -lt 1 || "$r_libev_obfs" -gt ${#obfs_libev[@]} ]]; then
+echo -e "[${red}Error${plain}] Por favor escribe un numero entre 1 y ${#obfs_libev[@]}"
+continue
+fi
+shadowsocklibev_obfs=${obfs_libev[$r_libev_obfs-1]}
+echo
+echo "obfs = ${shadowsocklibev_obfs}"
+echo
+break
+done
+fi
+else
+echo -e "[${green}Info${plain}] autoconf version is less than 2.67, simple-obfs for ${software[${selected}-1]} installation has been skipped"
+fi
+}
+install_prepare(){
+if  [[ "${selected}" == "1" || "${selected}" == "3" || "${selected}" == "4" ]]; then
+install_prepare_password
+install_prepare_port
+install_prepare_cipher
+if [ "${selected}" == "4" ]; then
+install_prepare_libev_obfs
+fi
+elif [ "${selected}" == "2" ]; then
+install_prepare_password
+install_prepare_port
+install_prepare_cipher
+install_prepare_protocol
+install_prepare_obfs
+fi
+echo
+echo "Presiona cualquier tecla para continuar...o Presiona Ctrl+C para cancelar"
+char=`get_char`
+}
+install_libsodium(){
+if [ ! -f /usr/lib/libsodium.a ]; then
+cd ${cur_dir}
+download "${libsodium_file}.tar.gz" "${libsodium_url}"
+tar zxf ${libsodium_file}.tar.gz
+cd ${libsodium_file}
+./configure --prefix=/usr && make && make install
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] ${libsodium_file} install failed."
+install_cleanup
+exit 1
+fi
+else
+echo -e "[${green}Info${plain}] ${libsodium_file} already installed."
+fi
+}
+install_mbedtls(){
+if [ ! -f /usr/lib/libmbedtls.a ]; then
+cd ${cur_dir}
+download "${mbedtls_file}-gpl.tgz" "${mbedtls_url}"
+tar xf ${mbedtls_file}-gpl.tgz
+cd ${mbedtls_file}
+make SHARED=1 CFLAGS=-fPIC
+make DESTDIR=/usr install
+if [ $? -ne 0 ]; then
+echo -e "[${red}Error${plain}] ${mbedtls_file} install failed."
+install_cleanup
+exit 1
+fi
+else
+echo -e "[${green}Info${plain}] ${mbedtls_file} already installed."
+fi
+}
+install_shadowsocks_python(){
+cd ${cur_dir}
+unzip -q ${shadowsocks_python_file}.zip
+if [ $? -ne 0 ];then
+echo -e "[${red}Error${plain}] unzip ${shadowsocks_python_file}.zip failed, please check unzip command."
+install_cleanup
+exit 1
+fi
+cd ${shadowsocks_python_file}
+python setup.py install --record /usr/local/shadowsocks_python.log
+if [ -f /usr/bin/ssserver ] || [ -f /usr/local/bin/ssserver ]; then
+chmod +x ${shadowsocks_python_init}
+local service_name=$(basename ${shadowsocks_python_init})
+if check_sys packageManager yum; then
+chkconfig --add ${service_name}
+chkconfig ${service_name} on
+elif check_sys packageManager apt; then
+update-rc.d -f ${service_name} defaults
+fi
+else
+echo
+echo -e "[${red}Error${plain}] ${software[0]} install failed."
+install_cleanup
+exit 1
+fi
+}
+install_shadowsocks_r(){
+cd ${cur_dir}
+tar zxf ${shadowsocks_r_file}.tar.gz
+mv ${shadowsocks_r_file}/shadowsocks /usr/local/
+if [ -f /usr/local/shadowsocks/server.py ]; then
+chmod +x ${shadowsocks_r_init}
+local service_name=$(basename ${shadowsocks_r_init})
+if check_sys packageManager yum; then
+chkconfig --add ${service_name}
+chkconfig ${service_name} on
+elif check_sys packageManager apt; then
+update-rc.d -f ${service_name} defaults
+fi
+else
+echo
+echo -e "[${red}Error${plain}] ${software[1]} install failed."
+install_cleanup
+exit 1
+fi
+}
+install_shadowsocks_go(){
+cd ${cur_dir}
+if is_64bit; then
+gzip -d ${shadowsocks_go_file_64}.gz
+if [ $? -ne 0 ];then
+echo -e "[${red}Error${plain}] Decompress ${shadowsocks_go_file_64}.gz failed."
+install_cleanup
+exit 1
+fi
+mv -f ${shadowsocks_go_file_64} /usr/bin/shadowsocks-server
+else
+gzip -d ${shadowsocks_go_file_32}.gz
+if [ $? -ne 0 ];then
+echo -e "[${red}Error${plain}] Decompress ${shadowsocks_go_file_32}.gz failed."
+install_cleanup
+exit 1
+fi
+mv -f ${shadowsocks_go_file_32} /usr/bin/shadowsocks-server
+fi
+if [ -f /usr/bin/shadowsocks-server ]; then
+chmod +x /usr/bin/shadowsocks-server
+chmod +x ${shadowsocks_go_init}
+local service_name=$(basename ${shadowsocks_go_init})
+if check_sys packageManager yum; then
+chkconfig --add ${service_name}
+chkconfig ${service_name} on
+elif check_sys packageManager apt; then
+update-rc.d -f ${service_name} defaults
+fi
+else
+echo
+echo -e "[${red}Error${plain}] ${software[2]} install failed."
+install_cleanup
+exit 1
+fi
+}
+install_shadowsocks_libev(){
+cd ${cur_dir}
+tar zxf ${shadowsocks_libev_file}.tar.gz
+cd ${shadowsocks_libev_file}
+./configure --disable-documentation && make && make install
+if [ $? -eq 0 ]; then
+chmod +x ${shadowsocks_libev_init}
+local service_name=$(basename ${shadowsocks_libev_init})
+if check_sys packageManager yum; then
+chkconfig --add ${service_name}
+chkconfig ${service_name} on
+elif check_sys packageManager apt; then
+update-rc.d -f ${service_name} defaults
+fi
+else
+echo
+echo -e "[${red}Error${plain}] ${software[3]} install failed."
+install_cleanup
+exit 1
+fi
+}
+install_shadowsocks_libev_obfs(){
+if [ "${libev_obfs}" == "y" ] || [ "${libev_obfs}" == "Y" ]; then
+cd ${cur_dir}
+git clone https://github.com/shadowsocks/simple-obfs.git
+[ -d simple-obfs ] && cd simple-obfs || echo -e "[${red}Error:${plain}] Failed to git clone simple-obfs."
+git submodule update --init --recursive
+if centosversion 6; then
+if [ ! "$(command -v autoconf268)" ]; then
+echo -e "[${green}Info${plain}] Starting install autoconf268..."
+yum install -y autoconf268 > /dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf268."
+fi
+sed -i 's/autoreconf/autoreconf268/' autogen.sh
+sed -i 's@^#include <ev.h>@#include <libev/ev.h>@' src/local.h
+sed -i 's@^#include <ev.h>@#include <libev/ev.h>@' src/server.h
+fi
+./autogen.sh
+./configure --disable-documentation
+make
+make install
+if [ ! "$(command -v obfs-server)" ]; then
+echo -e "[${red}Error${plain}] simple-obfs for ${software[${selected}-1]} install failed."
+install_cleanup
+exit 1
+fi
+[ -f /usr/local/bin/obfs-server ] && ln -s /usr/local/bin/obfs-server /usr/bin
+fi
+}
+install_completed_python(){
+clear
+${shadowsocks_python_init} start
+echo
+echo -e "Felicidades, ${green}${software[0]}${plain} server install completed!"
+echo -e "IP        : ${red} $(get_ip) ${plain}"
+echo -e "Port      : ${red} ${shadowsocksport} ${plain}"
+echo -e "Password         : ${red} ${shadowsockspwd} ${plain}"
+echo -e "Metodo de Encriptacion: ${red} ${shadowsockscipher} ${plain}"
+}
+install_completed_r(){
+clear
+${shadowsocks_r_init} start
+echo
+echo -e "Felicidades, ${green}${software[1]}${plain} server install completed!"
+echo -e "IP        : ${red} $(get_ip) ${plain}"
+echo -e "Port      : ${red} ${shadowsocksport} ${plain}"
+echo -e "Password         : ${red} ${shadowsockspwd} ${plain}"
+echo -e "Protocol         : ${red} ${shadowsockprotocol} ${plain}"
+echo -e "Obfs             : ${red} ${shadowsockobfs} ${plain}"
+echo -e "Metodo de Encriptacion: ${red} ${shadowsockscipher} ${plain}"
+}
+install_completed_go(){
+clear
+${shadowsocks_go_init} start
+echo
+echo -e "Felicidades, ${green}${software[2]}${plain} server install completed!"
+echo -e "IP        : ${red} $(get_ip) ${plain}"
+echo -e "Port      : ${red} ${shadowsocksport} ${plain}"
+echo -e "Password         : ${red} ${shadowsockspwd} ${plain}"
+echo -e "Metodo de Encriptacion: ${red} ${shadowsockscipher} ${plain}"
+}
+install_completed_libev(){
+clear
+ldconfig
+${shadowsocks_libev_init} start
+echo
+echo -e "Felicidades, ${green}${software[3]}${plain} instalacion completada!"
+echo -e "IP        : ${red} $(get_ip) ${plain}"
+echo -e "Port      : ${red} ${shadowsocksport} ${plain}"
+echo -e "Password         : ${red} ${shadowsockspwd} ${plain}"
+if [ "$(command -v obfs-server)" ]; then
+echo -e "Obfs             : ${red} ${shadowsocklibev_obfs} ${plain}"
+fi
+echo -e "Metodo de Encriptacion: ${red} ${shadowsockscipher} ${plain}"
+}
+qr_generate_python(){
+if [ "$(command -v qrencode)" ]; then
+local tmp=$(echo -n "${shadowsockscipher}:${shadowsockspwd}@$(get_ip):${shadowsocksport}" | base64 -w0)
+local qr_code="ss://${tmp}"
+echo
+echo "Codigo QR: (Para Shadowsocks Windows, OSX, Android y iOS)"
+echo -e "${green} ${qr_code} ${plain}"
+echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_python_qr.png
+echo "Tu codigo QR fue guardado en la siguiente direccion:"
+echo -e "${green} ${cur_dir}/shadowsocks_python_qr.png ${plain}"
+fi
+}
+qr_generate_r(){
+if [ "$(command -v qrencode)" ]; then
+local tmp1=$(echo -n "${shadowsockspwd}" | base64 -w0 | sed 's/=//g;s/\//_/g;s/+/-/g')
+local tmp2=$(echo -n "$(get_ip):${shadowsocksport}:${shadowsockprotocol}:${shadowsockscipher}:${shadowsockobfs}:${tmp1}/?obfsparam=" | base64 -w0)
+local qr_code="ssr://${tmp2}"
+echo
+echo "Codigo QR: (Para ShadowsocksR Windows, Android)"
+echo -e "${green} ${qr_code} ${plain}"
+echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_r_qr.png
+echo "Tu codigo QR fue guardado en la siguiente direccion como PNG:"
+echo -e "${green} ${cur_dir}/shadowsocks_r_qr.png ${plain}"
+fi
+}
+qr_generate_go(){
+if [ "$(command -v qrencode)" ]; then
+local tmp=$(echo -n "${shadowsockscipher}:${shadowsockspwd}@$(get_ip):${shadowsocksport}" | base64 -w0)
+local qr_code="ss://${tmp}"
+echo
+echo "Codigo QR: (Para Shadowsocks Windows, OSX, Android y iOS)"
+echo -e "${green} ${qr_code} ${plain}"
+echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_go_qr.png
+echo "Tu codigo QR fue guardado en la siguiente direccion como PNG:"
+echo -e "${green} ${cur_dir}/shadowsocks_go_qr.png ${plain}"
+fi
+}
+qr_generate_libev(){
+if [ "$(command -v qrencode)" ]; then
+local tmp=$(echo -n "${shadowsockscipher}:${shadowsockspwd}@$(get_ip):${shadowsocksport}" | base64 -w0)
+local qr_code="ss://${tmp}"
+echo
+echo "Codigo QR: (Para Shadowsocks Windows, OSX, Android y iOS)"
+echo -e "${green} ${qr_code} ${plain}"
+echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_libev_qr.png
+echo "Tu codigo QR fue guardado en la siguiente direccion como PNG:"
+echo -e "${green} ${cur_dir}/shadowsocks_libev_qr.png ${plain}"
+fi
+}
+install_main(){
+install_libsodium
+if ! ldconfig -p | grep -wq "/usr/lib"; then
+echo "/usr/lib" > /etc/ld.so.conf.d/lib.conf
+fi
+ldconfig
+if   [ "${selected}" == "1" ]; then
+install_shadowsocks_python
+install_completed_python
+qr_generate_python
+elif [ "${selected}" == "2" ]; then
+install_shadowsocks_r
+install_completed_r
+qr_generate_r
+elif [ "${selected}" == "3" ]; then
+install_shadowsocks_go
+install_completed_go
+qr_generate_go
+elif [ "${selected}" == "4" ]; then
+install_mbedtls
+install_shadowsocks_libev
+install_shadowsocks_libev_obfs
+install_completed_libev
+qr_generate_libev
+fi
+echo
+echo "ChumoGH - Shadowsocks"
+echo "t.me/ChumoGH"
+echo
+}
+install_cleanup(){
+cd ${cur_dir}
+rm -rf simple-obfs
+rm -rf ${libsodium_file} ${libsodium_file}.tar.gz
+rm -rf ${mbedtls_file} ${mbedtls_file}-gpl.tgz
+rm -rf ${shadowsocks_python_file} ${shadowsocks_python_file}.zip
+rm -rf ${shadowsocks_r_file} ${shadowsocks_r_file}.tar.gz
+rm -rf ${shadowsocks_go_file_64}.gz ${shadowsocks_go_file_32}.gz
+rm -rf ${shadowsocks_libev_file} ${shadowsocks_libev_file}.tar.gz
+}
+install_shadowsocks(){
+disable_selinux
+install_select
+install_prepare
+install_dependencies
+download_files
+config_shadowsocks
+if check_sys packageManager yum; then
+config_firewall
+fi
+install_main
+install_cleanup
+}
+uninstall_shadowsocks_python(){
+printf "Estas seguro que quieres desinstalar ${red}${software[0]}${plain}? [y/n]\n"
+read -p "(default: n):" answer
+[ -z ${answer} ] && answer="n"
+if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+${shadowsocks_python_init} status > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+${shadowsocks_python_init} stop
+fi
+local service_name=$(basename ${shadowsocks_python_init})
+if check_sys packageManager yum; then
+chkconfig --del ${service_name}
+elif check_sys packageManager apt; then
+update-rc.d -f ${service_name} remove
+fi
+rm -fr $(dirname ${shadowsocks_python_config})
+rm -f ${shadowsocks_python_init}
+rm -f /var/log/shadowsocks.log
+if [ -f /usr/local/shadowsocks_python.log ]; then
+cat /usr/local/shadowsocks_python.log | xargs rm -rf
+rm -f /usr/local/shadowsocks_python.log
+fi
+echo -e "[${green}Info${plain}] ${software[0]} desinstalacion exitosa"
+else
+echo
+echo -e "[${green}Info${plain}] ${software[0]} desinstalacion cancelada..."
+echo
+fi
+}
+uninstall_shadowsocks_r(){
+printf "Estas seguro que quieres desinstalar ${red}${software[1]}${plain}? [y/n]\n"
+read -p "(default: n):" answer
+[ -z ${answer} ] && answer="n"
+if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+${shadowsocks_r_init} status > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+${shadowsocks_r_init} stop
+fi
+local service_name=$(basename ${shadowsocks_r_init})
+if check_sys packageManager yum; then
+chkconfig --del ${service_name}
+elif check_sys packageManager apt; then
+update-rc.d -f ${service_name} remove
+fi
+rm -fr $(dirname ${shadowsocks_r_config})
+rm -f ${shadowsocks_r_init}
+rm -f /var/log/shadowsocks.log
+rm -fr /usr/local/shadowsocks
+echo -e "[${green}Info${plain}] ${software[1]} Desinstalacion exitosa"
+else
+echo
+echo -e "[${green}Info${plain}] ${software[1]} Desinstalacion cancelada..."
+echo
+fi
+}
+uninstall_shadowsocks_go(){
+printf "Estas seguro que quieres desinstalar ${red}${software[2]}${plain}? [y/n]\n"
+read -p "(default: n):" answer
+[ -z ${answer} ] && answer="n"
+if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+${shadowsocks_go_init} status > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+${shadowsocks_go_init} stop
+fi
+local service_name=$(basename ${shadowsocks_go_init})
+if check_sys packageManager yum; then
+chkconfig --del ${service_name}
+elif check_sys packageManager apt; then
+update-rc.d -f ${service_name} remove
+fi
+rm -fr $(dirname ${shadowsocks_go_config})
+rm -f ${shadowsocks_go_init}
+rm -f /usr/bin/shadowsocks-server
+echo -e "[${green}Info${plain}] ${software[2]} desinstalacion exitosa"
+else
+echo
+echo -e "[${green}Info${plain}] ${software[2]} desinstalacion cancelada..."
+echo
+fi
+}
+uninstall_shadowsocks_libev(){
+printf "Estas seguro que quieres desinstalar ${red}${software[3]}${plain}? [y/n]\n"
+read -p "(default: n):" answer
+[ -z ${answer} ] && answer="n"
+if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+${shadowsocks_libev_init} status > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+${shadowsocks_libev_init} stop
+fi
+local service_name=$(basename ${shadowsocks_libev_init})
+if check_sys packageManager yum; then
+chkconfig --del ${service_name}
+elif check_sys packageManager apt; then
+update-rc.d -f ${service_name} remove
+fi
+rm -fr $(dirname ${shadowsocks_libev_config})
+rm -f /usr/local/bin/ss-local
+rm -f /usr/local/bin/ss-tunnel
+rm -f /usr/local/bin/ss-server
+rm -f /usr/local/bin/ss-manager
+rm -f /usr/local/bin/ss-redir
+rm -f /usr/local/bin/ss-nat
+rm -f /usr/local/bin/obfs-local
+rm -f /usr/local/bin/obfs-server
+rm -f /usr/local/lib/libshadowsocks-libev.a
+rm -f /usr/local/lib/libshadowsocks-libev.la
+rm -f /usr/local/include/shadowsocks.h
+rm -f /usr/local/lib/pkgconfig/shadowsocks-libev.pc
+rm -f /usr/local/share/man/man1/ss-local.1
+rm -f /usr/local/share/man/man1/ss-tunnel.1
+rm -f /usr/local/share/man/man1/ss-server.1
+rm -f /usr/local/share/man/man1/ss-manager.1
+rm -f /usr/local/share/man/man1/ss-redir.1
+rm -f /usr/local/share/man/man1/ss-nat.1
+rm -f /usr/local/share/man/man8/shadowsocks-libev.8
+rm -fr /usr/local/share/doc/shadowsocks-libev
+rm -f ${shadowsocks_libev_init}
+echo -e "[${green}Info${plain}] ${software[3]} desinstalacion exitosa"
+else
+echo
+echo -e "[${green}Info${plain}] ${software[3]} desinstalacion cancelada..."
+echo
+fi
+}
+uninstall_shadowsocks(){
+while true
+do
+echo  "Cual servidor Shadowsocks quieres desinstalar?"
+for ((i=1;i<=${#software[@]};i++ )); do
+hint="${software[$i-1]}"
+echo -e "${green}${i}${plain}) ${hint}"
+done
+read -p "Escoge un numero [1-4]:" un_select
+case "${un_select}" in
+1|2|3|4)
+echo
+echo "Escogiste = ${software[${un_select}-1]}"
+echo
+break
+;;
+*)
+echo -e "[${red}Error${plain}] escoge un numero [1-4]"
+;;
+esac
+done
+if   [ "${un_select}" == "1" ]; then
+if [ -f ${shadowsocks_python_init} ]; then
+uninstall_shadowsocks_python
+else
+echo -e "[${red}Error${plain}] ${software[${un_select}-1]} no instalado, por favor verifica e intenta de nuevo."
+echo
+exit 1
+fi
+elif [ "${un_select}" == "2" ]; then
+if [ -f ${shadowsocks_r_init} ]; then
+uninstall_shadowsocks_r
+else
+echo -e "[${red}Error${plain}] ${software[${un_select}-1]} no instalado, por favor verifica e intenta de nuevo."
+echo
+exit 1
+fi
+elif [ "${un_select}" == "3" ]; then
+if [ -f ${shadowsocks_go_init} ]; then
+uninstall_shadowsocks_go
+else
+echo -e "[${red}Error${plain}] ${software[${un_select}-1]} no instalado, por favor verifica e intenta de nuevo."
+echo
+exit 1
+fi
+elif [ "${un_select}" == "4" ]; then
+if [ -f ${shadowsocks_libev_init} ]; then
+uninstall_shadowsocks_libev
+else
+echo -e "[${red}Error${plain}] ${software[${un_select}-1]} no instalado, por favor verifica e intenta de nuevo."
+echo
+exit 1
+fi
+fi
+}
+action=$1
+[ -z $1 ] && action=install
+case "${action}" in
+install|uninstall)
+${action}_shadowsocks
+;;
+*)
+echo "Arguments error! [${action}]"
+echo "Usage: $(basename $0) [install|uninstall]"
+;;
+esac

+ 81 - 0
ChuGH-5.7u/Bot/update.tar/update/ultrahost

@@ -0,0 +1,81 @@
+#!/bin/bash
+
+subdom () {
+SUBDOM="$1"
+[[ "$SUBDOM" = "" ]] && return
+randomize="$RANDOM"
+    for sites in `cat $log`; do
+    [[ $(echo ${DNS[@]}|grep $sites) = "" ]] && DNS+=($sites)
+    [[ $(echo ${DNS[@]}|grep $sites) != "" ]] && cat $log|grep -v "$sites" > $log
+    done
+    while true; do
+    [[ "$(pidof lynx | wc -w)" -lt "20" ]] && break
+    done
+    (
+    HOST[$randomize]="$SUBDOM"
+    curl -sSL "${HOST[$randomize]}"|grep -Eoi '<a [^>]+>'|grep -Eo 'href="[^\"]+"'|grep -Eo '(http|https)://[a-zA-Z0-9./*]+'|sort -u|awk -F "://" '{print $2}' >> $log
+    ) > /dev/null 2>&1 &
+}
+
+iniciar () {
+SUB_DOM=$1
+limite=$2
+[[ ${SUB_DOM} = "" ]] && read -p "Site Alvo: " SUB_DOM
+[[ ${limite} = "" ]] && limite="300"
+#CRIA LOG
+log="./loog" && touch $log
+#INICIA PRIMEIRA BUSCA
+_DOM=$(curl -sSL "$SUB_DOM"|grep -Eoi '<a [^>]+>'|grep -Eo 'href="[^\"]+"'|grep -Eo '(http|https)://[a-zA-Z0-9./*]+'|sort -u|awk -F "://" '{print $2}')
+  for _DOMS in `echo $_DOM`; do
+ [[ $(echo ${DNS[@]}|grep ${_DOMS}) = "" ]] && DNS+=(${_DOMS})
+  done
+#INICIA THREADS
+i=0
+while true; do
+DOMAIN=$(echo "${DNS[$i]}")
+[[ $DOMAIN = "" ]] && break
+ if [[ $(echo -e "${PESQ[@]}"|grep "$DOMAIN") = "" ]]; then
+  subdom "$DOMAIN"
+  echo -e "\033[1;31m(Scan\033[1;32m $((${#PESQ[@]}+1))\033[1;31m de \033[1;32m${#DNS[@]}\033[1;31m) - Escaneando ---> \033[1;36mhttp://$DOMAIN\033[1;37m"
+  PESQ+=($DOMAIN)
+ fi
+[[ "$(echo ${#DNS[@]})" -gt "$limite" ]] && break
+i=$(($i+1))
+sleep 1s
+done
+rm $log
+echo -e "\033[1;31m====================================\n\033[1;32mScan Finalizado!, Iniciando Coleta de IPs\033[1;31m\n====================================\033[0m"
+[[ -e $HOME/subresult ]] && rm $HOME/subresult
+[[ ! -e $HOME/subresult ]] && touch $HOME/subresult
+
+for result in $(echo "${DNS[@]}"); do
+(
+rand="$RANDOM"
+dns[rand]="$result"
+scan[rand]=$(echo ${result}|cut -d'/' -f1)
+IP[rand]=$(nslookup "${scan[rand]}"|grep -Eo 'Address: [0-9.]+'|grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'|tail -1) > /dev/null 2>&1
+echo -e "====================================\nDNS: ${dns[rand]}\nIP: ${IP[rand]}\n====================================" >> $HOME/subresult
+unset IP
+) &
+done
+while true; do
+[[ $(pidof nslookup|wc -w) -lt "1" ]] && break
+done
+RSLT=$(($(cat $HOME/subresult|wc -l)/4)) && echo -e "\033[1;31m====================================\n\033[1;32m$RSLT Hosts Capturados\n\033[1;31m====================================\033[0m"
+echo -ne "Desea Imprimir los Resultados? [S/N]: "; read yn
+   [[ $yn = @(s|S|y|Y) ]] && {
+   echo -ne "\033[1;32m"
+   cat $HOME/subresult|grep -v =
+   echo -e "\033[1;31m====================================\033[0m"
+   }
+return 0
+}
+
+#INICIA SCRIPT
+echo -e "\033[1;31m====================================\033[0m"
+echo -e "\033[1;33m INICIALIZANDO PROCEDIMENTOS (SCAN)"
+echo -e "\033[1;31m====================================\033[0m"
+iniciar $1 $2
+[[ $? = "0" ]] &&
+echo -e "\033[1;32mRegistro Generado en : $HOME/subresult\033[0m" &&
+echo -e "\033[1;31m====================================\033[0m"

文件差異過大導致無法顯示
+ 1 - 0
ChuGH-5.7u/Bot/update.tar/update/usercodes


+ 1 - 0
ChuGH-5.7u/Bot/update.tar/update/v-local.log

@@ -0,0 +1 @@
+V5.7U

+ 181 - 0
ChuGH-5.7u/Bot/update.tar/update/verifica

@@ -0,0 +1,181 @@
+#!/bin/bash
+#CREADOR Henry Chumo | 06/06/2022
+#Alias : @ChumoGH
+# -*- ENCODING: UTF-8 -*-
+
+dropbear_pids () {
+  port_dropbear=`ps aux|grep 'dropbear'|awk NR==1|awk '{print $17;}'`
+
+  log=/var/log/auth.log
+  loginsukses='Password auth succeeded'
+
+  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
+}
+
+mostrar_usuarios () {
+for u in `cat "/etc/passwd"|grep 'home'|grep 'false'|grep -v 'syslog' | cut -d: -f1`; do
+echo "$u"
+done
+}
+
+function_onlines () {
+	users=$(cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|awk -F ':' '{print $1}')
+	dpids=$(dropbear_pids)
+	time=$(date +%s)
+	[[ -e /etc/openvpn/openvpn-status.log ]] && ovpn_log=$(cat /etc/openvpn/openvpn-status.log)
+	n='0'
+	i='0'
+	conect='0'
+	for _user in $(mostrar_usuarios); do
+		[[ -z "$(ps -u $_user|grep sshd)" ]] && sqd=0 || sqd=1
+		[[ -z "$(echo $ovpn_log|grep -E ,"$_user",)" ]] && ovp=0 || ovp=1
+        [[ -z "$(echo $dpids|grep -w "$_user")" ]] && drop=0 || drop=1
+        conex=$(($sqd + $ovp + $drop))
+        [[ $conex -ne 0 ]] && let conect++
+		if [[ $(chage -l $_user |grep 'Account expires' |awk -F ': ' '{print $2}') != never ]]; then
+			[[ $time -gt $(date '+%s' -d "$(chage -l $_user |grep "Account expires" |awk -F ': ' '{print $2}')") ]] && let n++
+		fi
+	done
+_tuser=$(echo "$users"|sed '/^$/d'|wc -l)
+#echo "${conect}" > /etc/adm-lite/onlines
+#echo "${n}" > /etc/adm-lite/vencidos
+#echo "${_tuser}" > /etc/adm-lite/total
+}
+
+fun_ovpn_onl () {
+for userovpn in `cat /etc/passwd | grep ovpn | awk -F: '{print $1}'`; do
+us=$(cat /etc/openvpn/openvpn-status.log | grep $userovpn | wc -l)
+[[ "$us" != "0" ]] && echo "$userovpn"
+done
+}
+
+function_usertime () {
+declare -A data
+declare -A time
+declare -A time2
+declare -A timefinal
+tempousers="./tempo_conexao"
+usr_pids_var="./userDIR"
+[[ ! -e $tempousers ]] && touch $tempousers
+_data_now=$(date +%s)
+ for user in `cat "/etc/passwd"|grep 'home'|grep 'false'|grep -v 'syslog' | cut -d: -f1`; do
+ unset ssh
+ [[ -e $usr_pids_var/$user.pid ]] && source $usr_pids_var/$user.pid
+ssh+="$(ps -u $user | grep sshd |wc -l)+"
+ssh+="$(dropbear_pids | grep "$user" | wc -l)+"
+[[ -e /etc/openvpn/server.conf ]] && ssh+="$(fun_ovpn_onl | grep "$user" | wc -l)+"
+ssh+="0"
+user_pid=$(echo $ssh|bc)
+if [ "$user_pid" -gt "0" ]; then
+ [[ "${data[$user]}" = "" ]] && data[$user]="$_data_now"
+ fi
+if [ "$user_pid" = "0" ]; then
+unset data[$user]
+[[ -e "$usr_pids_var/$user.pid" ]] && rm -f $usr_pids_var/$user.pid
+[[ -e $usr_pids_var/$user.pid2 ]] && rm -f $usr_pids_var/$user.pid2
+fi
+if [ "${data[$user]}" != "" ]; then
+time[$user]=$(($_data_now - ${data[$user]}))
+time2[$user]=$(cat $tempousers | grep "$user" | awk '{print $2}')
+  [[ "${time2[$user]}" = "" ]] && time2[$user]="0"
+timefinal[$user]=$((${time2[$user]} + ${time[$user]}))
+_arquivo=$(cat $tempousers |grep -v "$user")
+echo "$_arquivo" > $tempousers
+echo "$user ${timefinal[$user]}" >> $tempousers
+echo "data[$user]=$_data_now" > $usr_pids_var/$user.pid
+fi
+ done
+}
+
+fun_net () {
+(
+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
+done
+#INICIA TCP
+tcpdump -s 50 -n &> /dev/null
+#ANALIZA USER
+for user in `cat "/etc/passwd"|grep 'home'|grep 'false'|grep -v 'syslog' | cut -d: -f1`; 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
+ 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
+}
+
+function_onlines > /dev/null 2>&1
+#function_usertime > /dev/null 2>&1
+#fun_net > /dev/null 2>&1
+killall verifica > /dev/null 2>&1

部分文件因文件數量過多而無法顯示