Code Monkey home page Code Monkey logo

psex's Introduction

psex

A simple, fast and powerful password scanner engine tool was built by antx.

Description

psex is a simple, fast and powerful password scanner engine tool was built by antx. psex also support some useful features, which like fofa search and parse assets to verify. psex has been built in some weak username and password.

Install

pip3 install psex

Usage

PSE Sample:

# Title: xxxxxxx
# Author: antx-code
# Email: [email protected]

from loguru import logger
from redis import Redis
from psex import ScannerEngine
from psex.funcs.assetio import AssetIO
from psex.weaks import weak_passwords


class Scanner(ScannerEngine):
    def __init__(self):
        super(Scanner, self).__init__()

    @logger.catch(level='ERROR')
    def is_connected(self, connection):
        """
        check if the connection is connected.
        """
        try:
            connection.ping()
            return True
        except Exception as e:
            return False

    @logger.catch(level='ERROR')
    def create_connect(self, *args):
        """
        
        create a connection.
        
        """
        connection = Redis(host=args[0], port=args[1], password=args[3], db=0, socket_connect_timeout=self.timeout,
                           socket_timeout=self.timeout)
        return connection

    @logger.catch(level='ERROR')
    def dia(self):
        asset_io = AssetIO()
        ips = asset_io.get_file_assets('input/source_redis.csv')
        """
        
        or use fofa search and parse assets to verify.
        
        grammar = 'xxx'
        api_key='xxxxxxxxxxxxxxxxxxxxxx'
        api_email='[email protected]'
        ips = asset_io.get_fofa_assets(grammar, api_key, api_email, 'fofa_redis.csv')
        
        """
        
        passwords = weak_passwords('redis')
        for password in passwords:
            for ip_port in ips:
                ip_port = ip_port.strip()
                ip = ip_port.split(':')[0]
                port = int(ip_port.split(':')[1])
                logger.debug(f'Connecting to {ip} ......')
                logger.warning(f'Testing {ip_port} with password: "{password}" !')
                result = self.poc(ip, port, '', password)
                if result:
                    asset_io.save2file('redis_success', ip, port, '', password)


if __name__ == '__main__':
    ds = Scanner()
    ds.dia()

psex's People

Contributors

antx-code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.