Coder Social home page Coder Social logo

adrianjan / simple_python_network_scanner Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 8 KB

I created a two scripts for port network scanning. If 22 is open, then script tries to provoide a brute-force attack. If it cracks the password, writes it in the command line.

Python 100.00%
bruteforce bruteforce-attacks network programming python python3 scanner scanning-tool

simple_python_network_scanner's Introduction

Simple network scanner and port 22 brute force script in python

Both scripts perform a port scan on a user-specified IP address and identifi open ports. If port 22 is open, it prompts the user to perform a brute force attack to gain unauthorized access to the SSH server.

Script_1

How does it work.

  1. Imports the necessary libraries - scapy, paramiko.
  2. Defines the target IP address, port range, and an empty list to store open ports.
  3. Defines functions for scanning a single port, checking the reachability of the target IP address, and performing a brute force attack using a password list.
  4. Calls the main function, which scans for open ports on the specified IP address.
  5. If port 22 is open, it prompts the user to perform a brute force attack. If the user agrees, the script performs a brute force attack using a list of passwords from a file named "PasswordList.txt".

Script_2

  1. Libraries - argparse, socket, paramiko

The program starts by parsing the command line arguments and constructing a list of ports to scan. It then scans each port using the scan_port function and builds a list of open ports. If port 22 (the SSH port) is open, it reads the list of passwords from the specified file and attempts to brute-force the SSH login using the ssh_brute_force function.

The scan_port function uses the Python socket module to create a TCP socket and attempts to connect to the specified port on the target host. If the connection is successful, it returns True, indicating that the port is open. Otherwise, it returns False.

The ssh_brute_force function uses the Paramiko library to attempt to connect to the SSH service on the target host using the specified username and a list of passwords. It loops through the password list and tries each one until it finds one that works, at which point it prints a message indicating that the login was successful and returns True. If none of the passwords work, it returns False.

Note

Script appears to be a security vulnerability scanner, and the brute force attack is potentially harmful and illegal if used without permission. Therefore, it is important to use such scripts ethically and legally.

simple_python_network_scanner's People

Contributors

adrianjan avatar

Watchers

 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.