首页 新闻 会员 周边

网安操作员题目

0
悬赏园豆:10 [待解决问题]

(1)允许 SSH 流量(TCP 端口 22);
systemctl stop firewalld 关闭防火墙
systemctl disable firewalld
iptables -A INPUT -p tcp --dport 22 -j ACCEPT 追加禁用底层iptables命令
(2)禁止所有 ICMP 协议(禁 Ping);
iptables -A INPUT -p icmp -j DROP
(3)设置默认策略;
iptables -P INPUT DROP # 默认拒绝所有入站流量(需先允许 SSH)
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
(4)保存规则(持久化)。
mkdir /etc/iptables
iptables-save > /etc/iptables/rules.v4
(5)验证规则。
iptables -L -n -v # 查看当前规则
(6)查询虚拟机IP:ip addr(如192.168.20.130)
(7)改到物理机上操作:
Win+r:cmd
ping虚拟机IP(如192.168.20.130) 不通 三、firewalld配置流量访问控制规则。
具体考核要求:使用firewalld配置流量访问控制规则,禁用ICMP但是允许SSH流量

启动firewalld服务,并清空iptables规则;
允许 SSH 流量;
禁止 ICMP 协议(禁 Ping);
重新加载防火墙配置;
验证规则
(1)启动firewalld服务 ,并清空iptables规则
iptables -F
systemctl start firewalld
systemctl status firewalld
(2)允许 SSH 流量
firewall-cmd --permanent --add-service=ssh # 允许 SSH 服务(默认端口 22)

(3)禁止 ICMP 协议(禁Ping);
sudo firewall-cmd --permanent --add-icmp-block=echo-request # 阻止入站 Ping
sudo firewall-cmd --permanent --add-icmp-block=echo-reply # 阻止出站 Ping 响应

(4)重新加载防火墙配置;
sudo firewall-cmd --reload

(5)验证规则。
firewall-cmd --list-all # 查看生效的规则

(6)查虚拟机IP : ip addr
Win+r:物理机ping虚拟机

(7)物理机ssh远程虚拟机:(exit可退出)
ssh root@虚拟机IP

四、windows禁止未登录前关机
具体考核要求:使用iptables阻止外网对UDP 1434端口的访问(防范SQL Slammer蠕虫),保留SSH端口开放(windows server2016)
1)清空iptables规则
iptables -F
2)设置默认策略(允许所有流量,再逐步限制);
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
3)允许 SSH 端口(TCP 22);
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
4) 阻止 UDP 1434 端口(SQL Slammer 蠕虫防护),并保存规则;
iptables –A INPUT –p udp --dport 1434 –j DROP
mkdir /etc/iptables
iptables-save > /etc/iptables/rules.v4
5) 验证规则
iptables -L -n -v

五、firewalld防范 SYN Flood
实操(服务器:centos7,攻击机:kali)
具体考核要求:使用 firewalld 配置防御防御 SYN Flood,让syn连接保持在一个稳定范围内

启动firewalld和httpd,firewalld开放http端口;
防御 SYN Flood;
SYN Flood 攻击;
SYN Flood 防御验证;
启动firewalld和httpd,firewalld开放http端口,
systemctl start httpd
systemctl start firewalld
firewall-cmd --permanent --add-service=http # 仅开放业务端口
firewall-cmd --reload
防御 SYN Flood

使用 direct 模式调用 iptables 限制 SYN 包速率
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 10 -p tcp --syn -m limit --limit 50/s -j LOG --log-prefix "SYN_FLOOD: "
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 11 -p tcp --syn -m limit --limit 50/s -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 12 -p tcp --syn -j DROP
firewall-cmd --reload

SYN Flood 攻击

攻击机执行(kali)
hping3 -S -p 80 --flood --rand-source 192.168.20.193

SYN Flood 防御验证

目标服务器监控半连接数
watch -n 1 "ss -ant | grep SYN-RECV | wc -l"

查看 iptables 日志
tail -f /var/log/messages | grep "SYN_FLOOD"

六、linux用户账户与密码策略加固。
实操(centos7)
具体考核要求:配置强密码策略,限制用户权限,防止弱密码和非法提权

设置密码复杂度
配置密码有效期
锁定无用账户
限制sudo权限
验证密码策略
(1)设置密码复杂度
vim /etc/security/pwquality.conf

修改以下参数
minlen = 12
minclass = 3
password requisite pam_pwquality.so try_first_pass retry=3

(2)配置密码有效期
vim /etc/login.defs

修改参数
PASS_MAX_DAYS 90
PASS_MIN_DAYS 7
PASS_MIN_LEN 8
PASS_WARN_AGE 14

(3)新建用户并锁定无用账户
useradd test001
passwd -l test001 # 锁定示例账户

(4)限制 sudo 权限
sudo visudo

限制用户只能执行特定命令
test001 ALL=(ALL) /usr/bin/systemctl restart httpd

(5)验证

检查密码策略
chage -l test001

查看锁定账户状态
passwd -S test001

不愿透露姓名的侠客的主页 不愿透露姓名的侠客 | 初学一级 | 园豆:118
提问于:2026-07-21 12:28
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册