π Python Cyber Security Tool – Network & Port Scanner (GUI-Based Ethical Hacking Tool)
Demo :
Click Video πππ
π Blogger Features:
✅ Full Python Source Code π
✅ Modern GUI-Based Cyber Security Tool π¨
✅ Step-by-Step Guide to Use the Tool π
✅ SEO Optimized for Google Ranking π
✅ Embedded YouTube Video + Download Link πΊ
Code :
import tkinter as tk
from tkinter import messagebox, ttk
import socket
import threading
# ---- GUI Setup ----
root = tk.Tk()
root.title("Cyber Security Tool - Network & Port Scanner")
root.geometry("600x400")
root.configure(bg="#222222")
# ---- Functions ----
def scan_ports():
target_ip = ip_entry.get()
if not target_ip:
messagebox.showerror("Error", "Please enter a valid IP Address!")
return
output_text.delete("1.0", tk.END)
output_text.insert(tk.END, f"Scanning Ports on {target_ip}...\n")
def port_scan():
for port in range(20, 1025):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(0.5)
result = s.connect_ex((target_ip, port))
if result == 0:
output_text.insert(tk.END, f"Port {port} is OPEN ✅\n")
s.close()
thread = threading.Thread(target=port_scan)
thread.start()
def get_ip():
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
messagebox.showinfo("Your IP Address", f"Your IP: {ip_address}")
# ---- UI Components ----
tk.Label(root, text="Cyber Security - Network & Port Scanner", fg="white", bg="#222222", font=("Arial", 16, "bold")).pack(pady=10)
tk.Label(root, text="Enter Target IP:", fg="white", bg="#222222", font=("Arial", 12)).pack(pady=5)
ip_entry = tk.Entry(root, font=("Arial", 12), width=30)
ip_entry.pack(pady=5)
scan_button = tk.Button(root, text="Scan Open Ports", font=("Arial", 12, "bold"), bg="red", fg="white", command=scan_ports)
scan_button.pack(pady=10)
ip_button = tk.Button(root, text="Get My IP", font=("Arial", 12, "bold"), bg="blue", fg="white", command=get_ip)
ip_button.pack(pady=10)
output_text = tk.Text(root, font=("Arial", 12), height=10, width=70, bg="black", fg="white")
output_text.pack(pady=10)
# Run GUI
root.mainloop()
Comments
Post a Comment