GithubHelp home page GithubHelp logo

shoriwe / bftool Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 253 KB

A custom worker pool to handle the distribution of function between threads and processes

Home Page: https://pypi.org/project/bftool-pkg-sulcud/

License: MIT License

Python 100.00%
concurrency module multiprocessing multithreading package parallel-computing parallelism python

bftool's Introduction

$ whoami

Hello! I'm Antonio, a Software Engineer, DevOps engineer, and Hacker from Colombia. Here are some highlights about me:

  • ๐Ÿ”— Checkout my Portfolio
  • ๐Ÿš€ I have a strong passion for low-latency solutions.
  • ๐Ÿฅท Information security and horizontal scaling are at the forefront of my concerns.
  • ๐ŸŽ† My personal endeavors mainly revolve around networking, cybersecurity, DeFi and automation.
  • ๐Ÿค I'm always keen to contribute to projects that align with my values and beliefs.

shorier-trophy

๐Ÿ› ๏ธ My tools ๐Ÿ”ง

Go Docker kubernetes jenkins gh-actions hackthebox svelte js

๐Ÿฑโ€๐Ÿ’ป Maybe we cross paths at HackTheBox

htb

Stats related to my work

langs shoriwe stats

๐Ÿค” What kind of projects you will find here?

You will find a proxy, a programming language, a custom function distribution library, python hacks, cool school projects and the list goes on and on. In resume Cool stuff made with passion

Contact

LinkedIn

bftool's People

Contributors

shoriwe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

bftool's Issues

`itertools.product` instead of `bftool.CartesianProduct.product`

After some tests and source code review could notice that Python implements it's 'itertools module with C and very well, so the assumptions that it was in pure python are wrong, also it's implementation is 900% faster than mine. Based on that bftool will implement the vanilla itertools.product function now on.

Documentation

Create precise documentation of the usage in the Wiki section

1. In code

  • Add useful comments in the python code
  • Add a rich documentation with python docstring

2. Wiki

  • Approach pydoc to generate the necessary files for Wiki

Loading entire file issue

BfTool need a way to handle big files, this because it is hard to load files with more than one thousand words; this feature needs to work like a queue that run in the main program or similar, this way it can be acceded multiple processes and threads at the same time

Memory argument

Implement an argument that can be of unspecific type to handle the communication between functions

It should be

  • Thread safe
  • Type independent
  • Configurable by argparse

Using bftool as a script failing

By the moment using:

python3 -m bftool ...

Is not an option. Looks like the last update break this feature, a detailed study is required

Combine wordlist for the same argument

It will be interesting to combine wordlist for the same argument, it means that if the user specify two file wordlist for the same argument, it will combine both, instead of overwriting the first one

Itertools cartesian product resource consumption too high

The python module itertools has a implemented Cartesian product function (itertools.product) that appear to consume a of memory, based on it's implementation

Python official documentation

def product(*args, repeat=1):
    # product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy
    # product(range(2), repeat=3) --> 000 001 010 011 100 101 110 111
    pools = [tuple(pool) for pool in args] * repeat
    result = [[]]
    for pool in pools:
        result = [x+[y] for x in result for y in pool]
    for prod in result:
        yield tuple(prod)

It is possible to notice that it first prepare the cartesian product result, and then it iterates over it.

There should be a way to handle the creation of a cartesian product generator with as arguments python generators that don't consume a lot of memory

Currently itertools.product is used in:

  • bftool/useful_functions.py:merge_wordlists
  • bftool/useful_functions.py:pure_bruteforce_rul
  • bftool/WordlistHandler.py:WordlistHandler.setup

Example functions to test

Example directory structure:

examples
โ””โ”€โ”€ thematic
    โ””โ”€โ”€ specific-subject
        โ”œโ”€โ”€ README.md
        โ”œโ”€โ”€ specific-subject.py
        โ”œโ”€โ”€ wordlist-1.txt
        โ”œโ”€โ”€ wordlist-2.txt
        โ””โ”€โ”€ wordlist-N.txt

The README.md should contain:

  • The script Requirements (like external modules)
  • The steps to install all the requirements.
  • Function Description
  • The Command to run the function

Optional

The wordlists are optional as the function can run the generated one

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.