5 Ethical Hacking Tools That Every Developer Should Use
- Ali Tuna
- Nov 1
- 4 min read

Introduction
Understanding how attackers reconnoiter, probe, and test systems is invaluable for defenders. This article explains five essential security tools — Nmap, Burp Suite, Metasploit, Wireshark (tshark) and Hydra — focusing on why each tool is used, safe lab-ready command snippets you can copy/paste on localhost, minimal Python helpers that parse their output, and exactly what actions defenders should take when findings appear. All examples are intentionally non-destructive and use 127.0.0.1, lo, or simulated checks; never run the commands against systems you do not own or have written permission to test.
Nmap
Nmap is the go-to tool for discovering hosts, enumerating open ports, and collecting service banners so you can build an accurate asset inventory and spot exposed, outdated services. A short, safe scan that targets only your machine produces machine-readable output you can feed into patch-prioritization workflows. Run this local scan to capture the top 100 ports and write XML output for automated parsing:
nmap --top-ports 100 -oX nmap_local.xml 127.0.0.1
To collect banner and version information in a non-intrusive way, use the service/version switch while keeping the target to localhost:
nmap -sV -Pn -oN nmap_local_verbose.txt 127.0.0.1
A simple Python parser converts the XML into a compact JSON inventory so teams can triage by service and version:
# parse_nmap.py
import sys, xml.etree.ElementTree as ET, json
fn = sys.argv[1]
tree = ET.parse(fn)
root = tree.getroot()
host_el = root.find('host')
addr = host_el.find('address').get('addr') if host_el is not None else 'unknown'
report = {'ip': addr, 'ports': []}
for port in root.findall('.//port'):
portid = int(port.get('portid'))
proto = port.get('protocol')
state = port.find('state').get('state')
svc = port.find('service')
svcname = svc.get('name') if svc is not None else None
svcver = svc.get('version') if svc is not None else None
report['ports'].append({
'port': portid, 'proto': proto, 'state': state,
'service': svcname, 'version': svcver
})
print(json.dumps(report, indent=2))
When Nmap returns a service with an old version string, prioritize patching that host and consider network segmentation to reduce blast radius. Replace unnecessary public services with firewalled, internal-only management channels.
Burp Suite
Burp Suite is a proxy that reveals exactly what a browser or client sends to an application and what the server returns. Use it to verify whether sensitive headers, tokens or form fields are handled securely. Point curl at the Burp proxy to capture and inspect requests without touching remote infrastructure:
curl -x http://127.0.0.1:8080 -I http://127.0.0.1:8000/
curl -x http://127.0.0.1:8080 -d "username=alice&password=secret" -X POST http://127.0.0.1:5000/login
If Burp highlights a server that constructs SQL from raw form data, fix the server by using parameterized queries; the code below shows the defensive approach with Flask and SQLite:
# safe_login.py
from flask import Flask, request, jsonify
import sqlite3
app = Flask(__name__)
def authenticate(username, password):
con = sqlite3.connect('users.db')
cur = con.cursor()
cur.execute("SELECT id FROM users WHERE username=? AND password=?", (username, password))
row = cur.fetchone()
con.close()
return bool(row)
@app.route('/login', methods=['POST'])
def login():
if authenticate(request.form.get('username'), request.form.get('password')):
return jsonify({'ok': True})
return jsonify({'ok': False}), 401
if __name__ == '__main__':
app.run(port=5000)
When Burp exposes insecure patterns — such as tokens in URLs, missing HSTS, insecure cookies, or insufficient input validation — enforce server-side fixes, enable HTTPS everywhere, and adopt secure cookie flags and CSP headers.
Metasploit
Metasploit provides a large library of exploit modules and auxiliary scanners; defenders use it to understand whether a publicly known exploit exists for a discovered service. Use search and info to gather metadata and prioritize remediation, but do not execute exploit modules against production systems unless you have written authorization and a controlled test plan. Start the console and query module metadata:
msfconsole -q
# Inside msfconsole:
# search vsftpd
# info auxiliary/scanner/ssh/ssh_version
# show options
You can also script a metadata export to determine whether a particular product has public exploit modules:
msfconsole -q -x "search apache; exit" | sed -n '1,200p'
If Metasploit shows public exploit modules against a version you run in production, treat that finding as high priority: patch or mitigate immediately, apply access controls, and validate fixes in a staging environment.
Wireshark / tshark
Wireshark and its CLI sibling tshark let you inspect network traffic to detect protocol misconfigurations and cleartext credentials. Capture a short, safe trace on the loopback interface and write a pcap file:
tshark -i lo -a duration:15 -w /tmp/local_loopback.pcap
Extract HTTP request lines for quick reviews:
tshark -r /tmp/local_loopback.pcap -Y http.request -T fields -e ip.src -e http.request.method -e http.host -e http.request.uri
Use a small Python helper to detect HTTP Basic Authorization headers in a capture, which indicate credentials sent without TLS:
# detect_basic_auth.py
import pyshark, sys
cap = pyshark.FileCapture(sys.argv[1], display_filter='http.authorization')
for pkt in cap:
try:
auth = pkt.http.authorization
print("Found HTTP Authorization header:", auth)
except AttributeError:
pass
cap.close()
If you find cleartext credentials or sensitive data in PCAPs, immediately migrate affected services to TLS, deprecate legacy cleartext protocols, and rotate any exposed credentials.
Hydra
Hydra demonstrates how attackers might perform credential-guessing attacks, and defenders use it in labs to test rate limiting and lockout policies. For safety, run a single, controlled authentication attempt on localhost:
hydra -l testuser -p testpass -t 4 ssh://127.0.0.1
Rather than brute-forcing a remote service, simulate multiple failed authentication attempts locally to verify lockout and throttling logic:
# test_lockout.py
from time import sleep
def local_auth(username, password):
return username == "admin" and password == "SuperSecret123!"
attempts = ["wrong1","wrong2","wrong3","wrong4","wrong5","SuperSecret123!"]
counter = 0
for p in attempts:
ok = local_auth("admin", p)
counter += 0 if ok else 1
print(f"Attempt {counter}: password={p} success={ok}")
if counter >= 5:
print("Simulated lockout triggered")
break
sleep(0.2)
When testing shows an endpoint accepts weak passwords or lacks throttling, require strong passwords, implement multi-factor authentication, and configure rate-limits and temporary lockouts.
Complete Example
A practical defender workflow stitches these tools together: inventory with Nmap, validate app behavior with Burp and short curl requests, inspect traffic with Wireshark captures, check public exploit availability with Metasploit metadata, and verify authentication defenses with local Hydra-style simulations. For every finding, produce a concise remediation recommendation, prioritize by risk and exploitability, enforce least privilege and network segmentation, and verify fixes in staging before rolling to production.
Conclusion
These snippets are intended for lab use and defensive verification only. Never scan, probe, or attempt to brute force systems without explicit written permission. Misuse of these tools can be illegal and harmful. Include a short written scope and authorization when doing any sanctioned security testing.



Comments