Task: Write a port scanner using Scapy
Language: Python
Pre requirements: Python and scapy.
Once you successfully installed python and scapy, type scapy in your terminal.
User Input for the program.
- Destination IP Address
- Port range
- Protocol [TCP/UDP]
Output from the program.
- Entered ports are open or not
Functions inside the Program
- _PortScanUDP à Scan for UDP port
- _PortScanTCP à Scan for TCP port
- _Print_Status à Print port status
Scan for TCP traffic
User input IP and port are passing to “_PortScanTCP” function.
If we received reply packet with flag 0x14 (RST-ACK), that is mean destination port is closed.
If the destination port is open, we have to send RST with ACK packet to terminate the communication.
Scan for UDP traffic
User input IP and port are passing to “_PortScanUDP” function.
Scan Results
Source Code
Click below like to get source code.






This is an awesome post which gives almost perfect idea about UDP Port Checker.
ReplyDeleteUDP Port Checker