Skip to content

Automated python scripts for customized packet creation and modeling DOS attack, Port scanning (XMAS, HALF, FULL) and Reverse Shell creation. using socket programming.

Notifications You must be signed in to change notification settings

mhuzaifi0604/Port-Knocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Port-Knocker

Automated python scripts for customized packet creation and modeling DOS attack, Port scanning (XMAS, HALF, FULL) and Reverse Shell creation. using socket programming.

  • Author - Muhammad Huzaifa.

Descirption

The repository contains following Module

  • Dos.py ➡️ A script for creating customized TCP headers + plus packets to overwhelm the target IP address that the script takes as arguments using 'Argparser'.
  • Port_Scanner.py ➡️ Python script for scanning ports using any type of flag format i.e., XMAS, Full/ Half scan, FIN, NULL Scans.
  • Assembler.py ➡️ Is a header file included in Port_Scanner for creating packets with customized headers using different scanning techniques.
  • dosscript.sh ➡️ Is a bashcript that automates the execution of Dos,py on target Linux syatem.
  • pass.sh ➡️ Contains password of target system in case you need to run file with Sudo permissions you can use it with SUDO_ASKPASS='./pass.sh' command.
  • Server.py ➡️ Server using socket programming listening on --> change the IP address to your own attacking machines IP.
  • victim.py ➡️ Client side code to connect to the server and creation of a reverse shell.

Clone the Repository using following command

git clone https://github.com/huzaifi0604/Port-Knocker.git

move inside the project using cd Port-Knocker

Dos Attack

1st of all use sudo python Dos.py -h to check available argparser tags. You will see something like this:

Helper Menu
You can see in the screenshot above that which tags are used for what purposes.

Run Dos.py file as:

sudo python Dos.py -sip 127.0.0.1 -dip 127.0.0.1 -sport 8000 -dport 6969 -hr

Replace Ip addressses with you attacking and victim device's IP addresses.

You will see the Dos script running. You can use Wireshark to capture the traffic for DOS as well.

Traffic

Port Scanning

1st of all use sudo python Port_Scanner.py -h to check available argparser tags. You will see something like this:

Helper Menu
You can see in the screenshot above that which tags are used for what purposes.

Run Port_Scanner.py file as:

sudo python Dos.py -sip 127.0.0.1 -dip 127.0.0.1 -l 85 -u 85 -scan xmas

Replace Ip addressses and lower and upper ranges with you attacking and victim device's IP addresses.

You will see the Dos script running. You can use Wireshark to capture the traffic for DOS as well.

Traffic
It may take sometime to scan for results
Traffic

Reverse Shell - Python Client-Server Communication

I first of all ran a server from my attacking machine using python -m http.server 6969 command.

Traffic
Than I ran server on my Linux machine and victim on my host

  • Server Listening
    Traffic
  • victim on Linux Traffic

    As you can see that a simple reverse shell got created on my windows machine.

    Traffic
    I can also use my dosscript with pass.sh (if i know the victim's password - Recon) to run a Dos attack on victim machine.
    br< Traffic

Note:

This is an open source project, but the author will not be responsible for the involvement of source code in any kind of malicious activity.

About

Automated python scripts for customized packet creation and modeling DOS attack, Port scanning (XMAS, HALF, FULL) and Reverse Shell creation. using socket programming.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published