资源简介
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
- 上一篇:LS-DYNA材料模型及参数
- 下一篇:STM32之can +代码解析.c
相关资源
- 自定义控件.txt
- 刷客——至善网刷课软件.rar
- caodv.zip
- haarcascade_frontalface_default.rar
- Sbus.rar
- TOOL0006V3600cracked.zip
- voc.txt
- 电位器.PcbLib
- zw_华为-器件和封装知识.zip
- zw_BloomFilter.zip
- zw_STC_单片机原理图库.zip
- zw_license.zip
- zw_vectshapes_src.zip
- zw_(linuxc)linux进程监控和进程守护程
- zw_FindMaxSubString.zip
- zw_HMC5883L模块资料电路图源代码.zip
- zw_DS1302.zip
- m0_37845686_11026319.zip
- zw_wolfe.zip
- zw_MLX90620_Example-master.zip
- zw_GPS_INS组合导航程序.zip
- 5071zw_第三方登录.zip
- zw_worldAddress.zip
- zw_输入捕获模式测量频率.zip
- zw_伺服电机(电流环速度环位置环)
- zw_arcengine属性表操作.zip
- 实现Cache模拟器.zip
- unity3d插件-脚本-图像识别OpenCVforUnit
- TIA链接密码.txt
- C窗体局域网、广域网斗地主游戏.ra
评论
共有 条评论