Git Product home page Git Product logo

mass-bruter's Introduction

Mass Bruter

Mass bruteforce network protocols

Info

Simple POC to quickly mass bruteforce common services in a large scale of network.

It will check for default credentials on ftp, ssh, mysql, mssql...etc.

This was made for authorized penetration testing purpose only.

How it works

  1. Use masscan(faster than nmap) to find alive hosts with common ports from network segment.
  2. Parse ips and ports from masscan result.
  3. Craft and run hydra commands to automatically bruteforce supported network services on devices.

Requirements

  • Kali linux or any preferred linux distribution
  • Python 3.10+
# Install required tools for the script
apt update && apt install seclists masscan hydra

# Clone the repo
git clone https://github.com/opabravo/mass-bruter
cd mass-bruter

How To Use

1. Scan for hosts and ports with masscan

For example, target a network segment:

Private ip range : 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12

Scan devices and ports from 172.16.0.0/12, then save output to ./result/masscan/masscan_<any_name>.<any_ext>

masscan -p 3306,1433,21,22,23,445,3389,5900,6379,27017,5432,5984,11211,9200,1521 172.16.0.0/12 | tee ./result/masscan/masscan_test.txt

PS : To resume a previous scan:

masscan --resume paused.conf | tee -a ./result/masscan/masscan_test.txt

2. Run the script

Load masscan result then start bruteforcing:

python3 mass_bruteforce.py -q -f ~/masscan_script.txt

Fetch cracked credentials:

python3 mass_bruteforce.py -s

Command Options

┌──(root㉿root)-[~/mass-bruter]
└─# python3 mass_bruteforce.py
Usage:  [OPTIONS]

  Mass Bruteforce Script

Options:
  -q, --quick           Quick mode (Only brute telnet, ssh, ftp , mysql,
                        mssql, postgres, oracle)
  -a, --all             Brute all services(Very Slow)
  -s, --show            Show result with successful login
  -f, --file-path PATH  The directory or file that contains masscan result
                        [default: ./result/masscan/]
  --help                Show this message and exit.

Todo

  • Migrate with dpl4hydra
  • Optimize the code and functions
  • MultiProcessing

Any contributions are welcomed!

mass-bruter's People

Contributors

opabravo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mass-bruter's Issues

Timeout

Maybe this is a feature request - IS it possible to have it automatically move on to the next IP number after a preset amount of fails or time limit. If I leave running and hit a machine that is turned off or not responding I get:

[STATUS] 258.00 tries/min, 258 tries in 00:01h, 6 to do in 00:01h, 4 active
[STATUS] 129.00 tries/min, 258 tries in 00:02h, 6 to do in 00:01h, 4 active
[STATUS] 86.00 tries/min, 258 tries in 00:03h, 6 to do in 00:01h, 4 active
[STATUS] 64.50 tries/min, 258 tries in 00:04h, 6 to do in 00:01h, 4 active
[STATUS] 51.60 tries/min, 258 tries in 00:05h, 6 to do in 00:01h, 4 active
[STATUS] 43.00 tries/min, 258 tries in 00:06h, 6 to do in 00:01h, 4 active
[STATUS] 36.86 tries/min, 258 tries in 00:07h, 6 to do in 00:01h, 4 active
[STATUS] 32.25 tries/min, 258 tries in 00:08h, 6 to do in 00:01h, 4 active
[STATUS] 28.67 tries/min, 258 tries in 00:09h, 6 to do in 00:01h, 4 active
[STATUS] 25.80 tries/min, 258 tries in 00:10h, 6 to do in 00:01h, 4 active
[STATUS] 23.45 tries/min, 258 tries in 00:11h, 6 to do in 00:01h, 4 active
[STATUS] 21.50 tries/min, 258 tries in 00:12h, 6 to do in 00:01h, 4 active
[STATUS] 19.85 tries/min, 258 tries in 00:13h, 6 to do in 00:01h, 4 active
[STATUS] 18.43 tries/min, 258 tries in 00:14h, 6 to do in 00:01h, 4 active
[STATUS] 17.20 tries/min, 258 tries in 00:15h, 6 to do in 00:01h, 4 active
[STATUS] 16.12 tries/min, 258 tries in 00:16h, 6 to do in 00:01h, 4 active
[STATUS] 15.18 tries/min, 258 tries in 00:17h, 6 to do in 00:01h, 4 active
[STATUS] 14.33 tries/min, 258 tries in 00:18h, 6 to do in 00:01h, 4 active
[STATUS] 13.58 tries/min, 258 tries in 00:19h, 6 to do in 00:01h, 4 active
[STATUS] 12.90 tries/min, 258 tries in 00:20h, 6 to do in 00:01h, 4 active
[STATUS] 12.29 tries/min, 258 tries in 00:21h, 6 to do in 00:01h, 4 active
[STATUS] 11.73 tries/min, 258 tries in 00:22h, 6 to do in 00:01h, 4 active
[STATUS] 11.22 tries/min, 258 tries in 00:23h, 6 to do in 00:01h, 4 active
[STATUS] 10.75 tries/min, 258 tries in 00:24h, 6 to do in 00:01h, 4 active
[STATUS] 10.32 tries/min, 258 tries in 00:25h, 6 to do in 00:01h, 4 active
[STATUS] 9.92 tries/min, 258 tries in 00:26h, 6 to do in 00:01h, 4 active
[STATUS] 9.56 tries/min, 258 tries in 00:27h, 6 to do in 00:01h, 4 active
[STATUS] 9.21 tries/min, 258 tries in 00:28h, 6 to do in 00:01h, 4 active
[STATUS] 8.90 tries/min, 258 tries in 00:29h, 6 to do in 00:01h, 4 active
[STATUS] 8.60 tries/min, 258 tries in 00:30h, 6 to do in 00:01h, 4 active
[STATUS] 8.32 tries/min, 258 tries in 00:31h, 6 to do in 00:01h, 4 active
[STATUS] 8.06 tries/min, 258 tries in 00:32h, 6 to do in 00:01h, 4 active
[STATUS] 7.82 tries/min, 258 tries in 00:33h, 6 to do in 00:01h, 4 active
[STATUS] 7.59 tries/min, 258 tries in 00:34h, 6 to do in 00:01h, 4 active
[STATUS] 7.37 tries/min, 258 tries in 00:35h, 6 to do in 00:01h, 4 active
[STATUS] 7.17 tries/min, 258 tries in 00:36h, 6 to do in 00:01h, 4 active
[STATUS] 6.97 tries/min, 258 tries in 00:37h, 6 to do in 00:01h, 4 active
[STATUS] 6.79 tries/min, 258 tries in 00:38h, 6 to do in 00:01h, 4 active
[STATUS] 6.62 tries/min, 258 tries in 00:39h, 6 to do in 00:01h, 4 active
[STATUS] 6.45 tries/min, 258 tries in 00:40h, 6 to do in 00:01h, 4 active
[STATUS] 6.29 tries/min, 258 tries in 00:41h, 6 to do in 00:01h, 4 active
[STATUS] 6.14 tries/min, 258 tries in 00:42h, 6 to do in 00:01h, 4 active
[STATUS] 6.00 tries/min, 258 tries in 00:43h, 6 to do in 00:02h, 4 active
[STATUS] 5.86 tries/min, 258 tries in 00:44h, 6 to do in 00:02h, 4 active
[STATUS] 5.73 tries/min, 258 tries in 00:45h, 6 to do in 00:02h, 4 active
[STATUS] 5.61 tries/min, 258 tries in 00:46h, 6 to do in 00:02h, 4 active
[STATUS] 5.49 tries/min, 258 tries in 00:47h, 6 to do in 00:02h, 4 active
[STATUS] 5.38 tries/min, 258 tries in 00:48h, 6 to do in 00:02h, 4 active
[STATUS] 5.27 tries/min, 258 tries in 00:49h, 6 to do in 00:02h, 4 active
[STATUS] 5.16 tries/min, 258 tries in 00:50h, 6 to do in 00:02h, 4 active
[STATUS] 5.06 tries/min, 258 tries in 00:51h, 6 to do in 00:02h, 4 active

Until I manually skip or move it along.

this way there is no stall for days while waiting

thanks

Jeff

multiple errors

errors out even though paths are correct - running as root or user.

python3 mass_bruteforce.py -q -f /home/test/mass-bruter/result/masscan/masscan_test.txt
Traceback (most recent call last):
File "/home/test/mass-bruter/mass_bruteforce.py", line 123, in
main()
File "/usr/lib/python3/dist-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/test/mass-bruter/mass_bruteforce.py", line 119, in main
return brute_force(ip_and_port, ports_to_brute)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/test/mass-bruter/mass_bruteforce.py", line 44, in brute_force
excluded_ip_port = load_excluded()
^^^^^^^^^^^^^^^
File "/home/test/mass-bruter/utils.py", line 49, in load_excluded
with open("settings.json", encoding="utf-8") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'settings.json'

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.