本站用于记录日常工作内容,虚拟化云计算,系统运维,数据库DBA,网络与安全。
Configuring router to run SDM( CISCO 3825路由器配置SDM功能)Follow the instructions below to configure a router to run SDM.Step 1: Connect to your router using Telnet, SSH or via console. Enter the global configuration mode using the command:Router>enable Router#conf terminalRouter(config)#Step 2 :Enable the router's HTTP/HTTPS server, using the following Cisco IOS commands:  Router(config)# ip http serverRouter(config)# ip http secure-serverRouter(config)# ip http authentication localNote:- HTTPS is enabled only for crypto enabled IOS images. Step 3:Create a user with privilege level 15. Router(config)# username <username> privilege 15 password 0 <password>Note:- Replace <username> and <password> with the username and password that you want to configure. Step 4:Configure SSH and Telnet for local login and privilege level 15: Router(config)# line vty 0 4Router(config-line)# privilege level 15Router(config-line)# login localRouter(config-li...
有时,我们使用代理服务器,由于各种原因,不希望别人共享。可采用用户论证方式使用kangle代理服务器。具体操作如下五步:第一步:下载、安装kangle代理服务器            点击下载kangle代理服务器第二步:在kangle代理服务器的安装目录下建一个文件。文件名没有特别要求。可以是*.txt 、 也可以是*.xml 等等例如:fly.txt文件内容是:帐户名:帐户密码  (帐号名和帐户密码之间必须使用冒号分隔)。例如:文件内容是 win:1234 中间用冒号分隔。第三步:登陆kangle代理服务器管理后台请求控制-->插入,出现如下界面:点击进入后,选择标记模块中“auth”如下图:进入如下界面:目标:选择“继续”file:填写在第二步骤中建立的文件名。例如:填写 fly.txtcrypt type:第二步建立文件中的帐户密码加密类型。有两种, plain 和 md5 。(注:plain是明文)auth type(论证类型):有两种, Basic 和 Digest 。realm:一般使用默认的“kangle-proxy”。Require:验证使用的帐户名是否被允许使用kangle代理服务器。如果是多个帐户名必须用“逗号”进行分隔。              &n...
当WEB站点受到严重的cc攻击,我们可以用iptables来防止web服务器被CC攻击,实现自动屏蔽IP的功能。1.系统要求(1) LINUX 内核版本:2.6.9-42ELsmp或2.6.9-55ELsmp(其它内核版本需要重新编译内核,比较麻烦,但是也是可以实现的)。(2) iptables版本:1.3.72. 安装安装iptables1.3.7和系统内核版本对应的内核模块kernel-smp-modules-connlimit3. 配置相应的iptables规则示例如下:(1) 控制单个IP的最大并发连接数iptables -I INPUT -p tcp --dport 80 -m connlimit --connlimit-above 30 -j REJECT#允许单个IP的最大连接数为 30(2) 控制单个IP在一定的时间(比如60秒)内允许新建立的连接数iptables -A INPUT -p tcp --dport 80 -m recent --name BAD_HTTP_ACCESS --update --seconds 60 --hitcount 30 -j REJECTiptables -A INPUT -p tcp --dport 80 -m recent --name BAD_HTTP_ACCESS --set -j ACCEPT#单个IP在60秒内只允许最多新建30个连接注意:为了增强iptables防止CC攻击的能力,最好调整一下ipt_recent的参数如下:#cat  /etc/modprobe.confoptions ipt_recent ip_list_tot=1000 ip_pkt_list_tot=60#记录1000个IP地址,每个地址记录60个数据包#modprobe ipt_recen
1.限制与80端口连接的IP最大连接数为10,可自定义修改。  代码如下复制代码 iptables -I INPUT -p tcp --dport 80 -m connlimit --connlimit-above 10 -j DROP 2.使用recent模块限制同IP时间内新请求连接数,recent更多功能请参考:Iptables模块recent应用。  代码如下复制代码 iptables -A INPUT -p tcp --dport 80 --syn -m recent --name webpool --rcheck --seconds 60 --hitcount 10 -j LOG --log-prefix 'DDOS:' --log-ip-options #60秒10个新连接,超过记录日志。 iptables -A INPUT -p tcp --dport 80 --syn -m recent --name webpool --rcheck --seconds 60 --hitcount 10 -j DROP #60秒10个新连接,超过丢弃数据包。 iptables -A INPUT -p tcp --dport 80 --syn -m recent --name webpool --set -j ACCEPT #范围内允许通过。 上面的相对比较简单,下面我来分析更具体的配置方法。CentOS/Redhat/Fedora在服务器执行  代码如下复制代码 vi /etc/sysconfig/iptables删除原来的内容输入如下内容 保存# Generated by iptables-save v1.3.5 on Sun Dec 12 23:55:59 2010*filter:INPUT DROP [385263:27864079]:FORWARD ACCEPT [0:0]:OUTPUT ...
当WEB站点受到严重的cc攻击,我们可以用iptables来防止web服务器被CC攻击,实现自动屏蔽IP的功能。1.系统要求(1) LINUX 内核版本:2.6.9-42ELsmp或2.6.9-55ELsmp(其它内核版本需要重新编译内核,比较麻烦,但是也是可以实现的)。(2) iptables版本:1.3.72. 安装安装iptables1.3.7和系统内核版本对应的内核模块kernel-smp-modules-connlimit3. 配置相应的iptables规则示例如下:(1) 控制单个IP的最大并发连接数iptables -I INPUT -p tcp --dport 80 -m connlimit --connlimit-above 30 -j REJECT#允许单个IP的最大连接数为 30(2) 控制单个IP在一定的时间(比如60秒)内允许新建立的连接数iptables -A INPUT -p tcp --dport 80 -m recent --name BAD_HTTP_ACCESS --update --seconds 60 --hitcount 30 -j REJECTiptables -A INPUT -p tcp --dport 80 -m recent --name BAD_HTTP_ACCESS --set -j ACCEPT#单个IP在60秒内只允许最多新建30个连接注意:为了增强iptables防止CC攻击的能力,最好调整一下ipt_recent的参数如下:#cat  /etc/modprobe.confoptions ipt_recent ip_list_tot=1000 ip_pkt_list_tot=60#记录1000个IP地址,每个地址记录60个数据包
shell 分析日志访问路径,统计访问IP,IPTABLES解与封 以下是shell的详细内容#!/bin/bash#特性:#1,可分析多个网站项目日志#2,每个网站项目日志可根据关键字进行统计分析#3,可调整访问IP次数的阀值(超过多少次加入到墙)#4,可调整IP封的时间#5,可在定时任务修改分析日志的时间间隔#6,防火墙在封的时候进行了去重,不会封同样的IP#-----zhaoll@###############################################################################################-----------------------------------------防火墙封IP-----------------------------------------################################################################################################当前时间戳,用于比较drop_ip.log里的时间戳ip_diff_time=`date +%s`IPTABLES=/sbin/iptables#防火墙时间阀值--默认10分钟,比较已封IP是否超过10分钟,如果超过10分钟,则解封ip_return_time=$((10*60))#ip_return_time=43200#ip_return_time=86400for i in `cat /data0/shells/drop_ip.log | awk -F ":" '{if('$ip_diff_time'-$1>='$ip_return_time'-60){print}}'`doIPLIST1=`echo $...
DDoS deflate–Iptables减轻被DDOS/CC攻击互联网上被DDOS,CC是家常便饭,在没有硬防的情况下,寻找软件代替是最直接的方法,比如用iptables,但是iptables不能在自动屏蔽,只能手动屏蔽,今天我给大家介绍的就是一款可以自动屏蔽DDOS,CC,SYN攻击的软件:DDoS Deflate。DDoS deflate官方地址:http://deflate.medialayer.com/DOS DEFLATE是一个轻量级的bash shell脚本,以协助用户阻止DDOS攻击,它利用下面的命令创建一个连接到服务器的IP地址列表,以及与他们连接总数。它是在软件层面上的简单和最容易安装的解决方案之一。如何查看是否被攻击 输入上面的命令查看#: netstat-ntu | awk'{print $5}'| cut-d: -f1 | sort| uniq-c | sort-n下面是安装教程#: wget http://www.inetbase.com/scripts/ddos/install.sh#: chmod 0700 install.sh#: ./install.sh安装完以后,你会看到一大篇协议,按q退出即可 :安装后文件说明 安装目录为:/usr/local/ddos/ddos.conf ? DDoS-Deflate 的配置文件,其中配置防止ddos时的各种行为ddos.sh ? DDoS-Deflate 的主程序,使用shell编写的,整个程序的功能模块ignore.ip.list ? 白名单,该文件中的ip超过设定的连接数时,也不被 DDoS-Def...
Linux下防御或减轻DDOS攻击方法今天上午服务器被ddos攻击,还好对方只是使用了一台电脑,没有搞成千上万个木马来,要不然那服务器直接就垮了。在网上找了教程,成功解决。于是把本次防御ddos的方法记录一下了。查看攻击IP首先使用以下代码,找出攻击者IPnetstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n将会得出类似如下的结果:1 114.226.9.1321 174.129.237.1571 58.60.118.1421 Address1 servers)2 118.26.131.783 123.125.1.2023 220.248.43.1194 117.36.231.2534 119.162.46.1246 219.140.232.1288 220.181.61.312311 67.215.242.196前面的数字表示IP连接的次数,可见最后一个IP 67.215.242.196连接服务器2311次,每个IP几个、十几个或几十个连接数都还算比较正常,如果像上面成百上千肯定就不正常了。解决方法,使用DDoS deflate+iptablesDDoS deflate是一款免费的用来防御和减轻DDoS攻击的脚本。它通过netstat监测跟踪创建大量网络连接的IP地址,在检测到某个结点超过预设的限制时,该程序会通过APF或IPTABLES禁止或阻挡这些IP.安装DDoS deflatewget http://www.inetbase.com/scripts/ddos/install.sh //下载DDoS deflatechmod 0700 instal...
linux csf 防火墙 防止少量的ddos cc攻击很有效 测试服务器,也没有想到会受到攻击,什么防范措施也没有做。装了csf的防火墙,在应对少量ddos,cc攻击的,还是挺管用的,以前也用过apf也挺不错,请参考linux apf 防火墙 安装 配置。下面记录一下,我是怎么发现攻击,并且是怎么解决的。1,调整apache的连接,总是会被占满,系统资源消耗的很厉害,测试服务器,没有装监控,nagios,cacti,munin,我的博客里面都有。可以自己搜索一下。2,查看了一下apache的日志,发现某一个IP,请求某一个php,二天内达到9万多,apache的log做了滚动的,所以说正常情况下,不可能有这么多,并且这是测试服务器。看下图。ddos 攻击下面说一下安装配置过程一,下载安装wget http://www.configserver.com/free/csf.tgz tar -zxvf csf.tgz cd csf sh install.sh如果报perl模块错误,yum install perl-libwww-perl perl  测试一下csf[root@rudder csf]# perl /etc/csf/csftest.pl Testing ip_tables/iptable_filter...OK Testing ipt_LOG...OK Testing ipt_multiport/xt_multiport...OK Testing ipt_REJECT...OK Testing ipt_state/xt_state...OK Testing ipt_limit/xt_...
About (D)DoS Deflate is a lightweight bash shell script designed to assist in the process of blocking a denial of service attack. It utilizes the command below to create a list of IP addresses connected to the server, along with their total number of connections. It is one of the simplest and easiest to install solutions at the software level. netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n IP addresses with over a pre-configured number of connections are automatically blocked in the server's firewall, which can be direct iptables or Advanced Policy Firewall (APF). (We highly recommend that you use APF on your server in general, but deflate will work without it.) Notable Features It is possible to whitelist IP addresses, via /usr/local/ddos/ignore.ip.list.Simple configuration file: /usr/local/ddos/ddos.confIP addresses are automatically unblocked after a preconfigured time limit (default: 600 seconds)The script can run at a...
    总共15页,当前第6页 | 页数:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15