Building a Port Scanner in 16 Lines of Code

Image for post
Image for post

Introduction

Building the Tool

Conclusion

$ portscan.py "8.8.8.8"
Port: 25 Open
Port: 53 Open
Port: 110 Open
Port: 119 Open
Port: 143 Open
Port: 443 Open
Port: 465 Open
Port: 563 Open
Port: 587 Open
Port: 853 Open
Port: 993 Open
Port: 995 Open
Scanning completed in: 0:16:52.479625

Cybersecurity Analyst and Finance Enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store