ARP 欺骗检测软件 - 安全防护,守护您的网络
ARP 欺骗检测软件 - 安全防护,守护您的网络
本软件是一款功能强大的 ARP 欺骗检测工具,旨在帮助用户实时监测网络流量,有效防范 ARP 欺骗攻击,保护您的网络安全。软件提供用户注册登录功能,并支持 ICMP Flood、TCP 攻击、ARP 欺骗等多种攻击检测,以及局域网主机扫描和攻击源定位功能。
主要功能
- 用户注册登录: 提供用户注册和登录功能,保障软件使用安全。
- ICMP Flood 攻击检测: 实时监测网络流量,识别并告警 ICMP Flood 攻击。
- TCP 攻击检测: 检测 TCP 协议层面的攻击行为,提供安全保障。
- ARP 欺骗攻击检测: 实时监测 ARP 协议,识别并告警 ARP 欺骗攻击。
- 扫描局域网主机: 扫描局域网内的所有主机,并记录其 IP 地址和 MAC 地址。
- 检测攻击源: 根据扫描到的主机信息,定位攻击源 IP 地址和 MAC 地址。
- 查看检测记录: 记录所有检测结果,方便用户查看历史信息。
软件使用方法
- 安装软件: 下载软件并安装到您的计算机上。
- 注册登录: 首次使用软件需要注册账号,并使用账号登录。
- 启动检测: 登录后,软件会自动开始检测网络流量。
- 查看结果: 软件会实时显示检测结果,并记录检测历史信息。
- 手动扫描: 您可以手动扫描局域网主机,以获取更详细的网络信息。
技术实现
软件使用 Python 语言开发,基于 Scapy 和 Tkinter 库实现。
- Scapy: 用于网络数据包的解析和构建。
- Tkinter: 用于创建图形用户界面。
代码示例
import os
import time
import sys
import platform
from scapy.all import *
from tkinter import *
from tkinter import messagebox
# 设置界面
root = Tk()
root.title('ARP 欺骗检测软件')
root.geometry('400x300')
# 注册界面
def register():
register_window = Toplevel(root)
register_window.title('注册')
register_window.geometry('300x200')
Label(register_window, text='请输入用户名:').pack()
username = Entry(register_window)
username.pack()
Label(register_window, text='请输入密码:').pack()
password = Entry(register_window, show='*')
password.pack()
def register_confirm():
with open('user.txt', 'a') as f:
f.write(username.get() + ' ' + password.get() + '\n')
messagebox.showinfo('提示', '注册成功!')
register_window.destroy()
Button(register_window, text='确认', command=register_confirm).pack()
# 登录界面
def login():
login_window = Toplevel(root)
login_window.title('登录')
login_window.geometry('300x200')
Label(login_window, text='请输入用户名:').pack()
username = Entry(login_window)
username.pack()
Label(login_window, text='请输入密码:').pack()
password = Entry(login_window, show='*')
password.pack()
def login_confirm():
with open('user.txt', 'r') as f:
users = f.readlines()
for user in users:
if user.split()[0] == username.get() and user.split()[1] == password.get():
messagebox.showinfo('提示', '登录成功!')
login_window.destroy()
return
messagebox.showerror('错误', '用户名或密码错误!')
Button(login_window, text='确认', command=login_confirm).pack()
# ICMP flood攻击检测
def icmp_flood():
sniff_filter = 'icmp'
sniff_timeout = 10
sniff_count = 0
sniff_packets = sniff(filter=sniff_filter, timeout=sniff_timeout)
for packet in sniff_packets:
sniff_count += 1
if sniff_count > 100:
messagebox.showwarning('警告', '检测到ICMP flood攻击!')
else:
messagebox.showinfo('提示', '未检测到ICMP flood攻击!')
# TCP攻击检测
def tcp_attack():
sniff_filter = 'tcp'
sniff_timeout = 10
sniff_count = 0
sniff_packets = sniff(filter=sniff_filter, timeout=sniff_timeout)
for packet in sniff_packets:
sniff_count += 1
if sniff_count > 100:
messagebox.showwarning('警告', '检测到TCP攻击!')
else:
messagebox.showinfo('提示', '未检测到TCP攻击!')
# ARP欺骗攻击检测
def arp_spoofing():
sniff_filter = 'arp'
sniff_timeout = 10
sniff_count = 0
sniff_packets = sniff(filter=sniff_filter, timeout=sniff_timeout)
for packet in sniff_packets:
sniff_count += 1
if sniff_count > 100:
messagebox.showwarning('警告', '检测到ARP欺骗攻击!')
else:
messagebox.showinfo('提示', '未检测到ARP欺骗攻击!')
# 扫描局域网主机
def scan_network():
network = '192.168.1.0/24'
arp_request = ARP(pdst=network)
broadcast = Ether(dst='ff:ff:ff:ff:ff:ff')
arp_broadcast = broadcast/arp_request
answered_list = srp(arp_broadcast, timeout=1, verbose=False)[0]
clients = []
for element in answered_list:
client = {'ip': element[1].psrc, 'mac': element[1].hwsrc}
clients.append(client)
with open('clients.txt', 'w') as f:
for client in clients:
f.write(client['ip'] + ' ' + client['mac'] + '\n')
messagebox.showinfo('提示', '扫描完成!')
# 检测攻击源
def detect_attack():
with open('clients.txt', 'r') as f:
clients = f.readlines()
for client in clients:
ip = client.split()[0]
mac = client.split()[1]
sniff_filter = 'arp and src host ' + ip
sniff_timeout = 10
sniff_count = 0
sniff_packets = sniff(filter=sniff_filter, timeout=sniff_timeout)
for packet in sniff_packets:
sniff_count += 1
if sniff_count > 100:
messagebox.showwarning('警告', '检测到攻击源IP地址为' + ip + ',MAC地址为' + mac + '!')
else:
messagebox.showinfo('提示', '未检测到攻击源IP地址为' + ip + ',MAC地址为' + mac + '的攻击!')
# 查看检测记录
def view_detection_log():
log_window = Toplevel(root)
log_window.title('检测记录')
log_window.geometry('400x300')
log_text = Text(log_window)
log_text.pack(fill=BOTH, expand=YES)
try:
with open('detection_log.txt', 'r') as f:
log_text.insert(END, f.read())
except FileNotFoundError:
log_text.insert(END, '未找到检测记录!')
# 创建用户和客户端记录文件
if not os.path.exists('user.txt'):
open('user.txt', 'w').close()
if not os.path.exists('clients.txt'):
open('clients.txt', 'w').close()
# 创建按钮
register_button = Button(root, text='注册', command=register)
register_button.pack(pady=10)
login_button = Button(root, text='登录', command=login)
login_button.pack(pady=10)
icmp_flood_button = Button(root, text='检测ICMP flood攻击', command=icmp_flood)
icmp_flood_button.pack(pady=10)
tcp_attack_button = Button(root, text='检测TCP攻击', command=tcp_attack)
tcp_attack_button.pack(pady=10)
ar_spoofing_button = Button(root, text='检测ARP欺骗攻击', command=arp_spoofing)
ar_spoofing_button.pack(pady=10)
scan_network_button = Button(root, text='扫描局域网主机', command=scan_network)
scan_network_button.pack(pady=10)
detect_attack_button = Button(root, text='检测攻击源', command=detect_attack)
detect_attack_button.pack(pady=10)
view_detection_log_button = Button(root, text='查看检测记录', command=view_detection_log)
view_detection_log_button.pack(pady=10)
root.mainloop()
使用说明
- 运行代码: 将代码保存为 Python 文件,并使用 Python 解释器运行。
- 注册用户: 点击 “注册” 按钮,输入用户名和密码,并点击 “确认” 完成注册。
- 登录软件: 点击 “登录” 按钮,输入用户名和密码,并点击 “确认” 登录软件。
- 进行检测: 点击 “检测 ICMP flood 攻击”、“检测 TCP 攻击”、“检测 ARP 欺骗攻击” 按钮,软件会自动开始检测网络流量。
- 扫描局域网: 点击 “扫描局域网主机” 按钮,软件会扫描局域网内的所有主机。
- 检测攻击源: 点击 “检测攻击源” 按钮,软件会根据扫描到的主机信息,定位攻击源。
- 查看记录: 点击 “查看检测记录” 按钮,软件会显示所有检测结果的记录。
注意事项
- 软件需要在具有管理员权限的环境下运行。
- 软件会使用系统网络接口,请确保您的网络连接正常。
- 软件会记录所有检测结果,请确保您了解并同意软件的数据收集和使用政策。
联系方式
如果您在使用软件过程中遇到任何问题,请联系我们。
邮箱: [您的邮箱地址] 网站: [您的网站地址]
版权所有 © [您的公司名称]
原文地址: https://www.cveoy.top/t/topic/jn1n 著作权归作者所有。请勿转载和采集!