• 大小: 0.02M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-24
  • 语言: 其他
  • 标签: 其他  

资源简介

reGeorg-master.zip

资源截图

代码片段和文件信息

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import logging
import argparse
import signal
import sys
import atexit
import httplib
import urllib3
from threading import Thread
from urlparse import urlparse
from socket import *
from threading import Thread
from time import sleep
#import struct

# Constants
SOCKTIMEOUT = 5
RESENDTIMEOUT=300
VER=“\x05“
METHOD=“\x00“
SUCCESS=“\x00“
SOCKFAIL=“\x01“
NETWORKFAIL=“\x02“
HOSTFAIL=“\x04“
REFUSED=“\x05“
TTLEXPIRED=“\x06“
UNSUPPORTCMD=“\x07“
ADDRTYPEUNSPPORT=“\x08“
UNASSIGNED=“\x09“

BASICCHECKSTRING = “Georg says ‘All seems fine‘“



# Globals
READBUFSIZE = 1024

#Logging
RESET_SEQ = “\033[0m“
COLOR_SEQ = “\033[1;%dm“
BOLD_SEQ = “\033[1m“

BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE = range(8)

LEVEL = {“INFO“ : logging.INFO
    “DEBUG“ : logging.DEBUG
}

logLevel = “INFO“

COLORS = {
    ‘WARNING‘  : YELLOW
    ‘INFO‘     : WHITE
    ‘DEBUG‘    : BLUE
    ‘CRITICAL‘ : YELLOW
    ‘ERROR‘    : RED
    ‘RED‘      : RED
    ‘GREEN‘    : GREEN
    ‘YELLOW‘   : YELLOW
    ‘BLUE‘     : BLUE
    ‘MAGENTA‘  : MAGENTA
    ‘CYAN‘     : CYAN
    ‘WHITE‘    : WHITE
}

def formatter_message(message use_color = True):
    if use_color:
        message = message.replace(“$RESET“ RESET_SEQ).replace(“$BOLD“ BOLD_SEQ)
    else:
        message = message.replace(“$RESET“ ““).replace(“$BOLD“ ““)
    return message

class ColoredFormatter(logging.Formatter):
    def __init__(self msg use_color = True):
        logging.Formatter.__init__(self msg)
        self.use_color = use_color

    def format(self record):
        levelname = record.levelname
        if self.use_color and levelname in COLORS:
            levelname_color = COLOR_SEQ % (30 + COLORS[levelname]) + levelname + RESET_SEQ
            record.levelname = levelname_color
        return logging.Formatter.format(self record)
        
class ColoredLogger(logging.Logger):
    
    def __init__(self name):
        FORMAT = “[$BOLD%(levelname)-18s$RESET]  %(message)s“
        COLOR_FORMAT = formatter_message(FORMAT True)
        logging.Logger.__init__(self name logLevel)     
        if (name == “transfer“):
            COLOR_FORMAT = “\x1b[80D\x1b[1A\x1b[K%s“ % COLOR_FORMAT
        color_formatter = ColoredFormatter(COLOR_FORMAT)
        
        console = logging.StreamHandler()
        console.setFormatter(color_formatter)

        self.addHandler(console)
        return


logging.setLoggerClass(ColoredLogger)        
log = logging.getLogger(__name__)
transferLog = logging.getLogger(“transfer“)

class SocksCmdNotImplemented(Exception):
    pass

class SocksProtocolNotImplemented(Exception):
    pass

class RemoteConnectionFailed(Exception):
    pass

class session(Thread):
    def __init__(selfpSocketconnectString):
        Thread.__init__(self)
        self.pSocket = pSocket
        self.connectString = connectString
        o = urlparse(connectString)
        try:
            self.httpPort = o.port
        except:
            

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-02-09 12:52  reGeorg-master\
     文件         820  2016-02-09 12:52  reGeorg-master\LICENSE.html
     文件         214  2016-02-09 12:52  reGeorg-master\LICENSE.txt
     文件        1929  2016-02-09 12:52  reGeorg-master\README.md
     文件       16227  2016-02-09 12:52  reGeorg-master\reGeorgSocksProxy.py
     文件        4628  2016-02-09 12:52  reGeorg-master\tunnel.ashx
     文件        4959  2016-02-09 12:52  reGeorg-master\tunnel.aspx
     文件        5952  2016-02-09 12:52  reGeorg-master\tunnel.js
     文件        4800  2016-02-09 12:52  reGeorg-master\tunnel.jsp
     文件        5974  2016-02-09 12:52  reGeorg-master\tunnel.nosocket.php
     文件        5720  2016-02-09 12:52  reGeorg-master\tunnel.php
     文件        4769  2016-02-09 12:52  reGeorg-master\tunnel.tomcat.5.jsp

评论

共有 条评论