icmp

Linux防火墙firewalld安全设置

爷,独闯天下 提交于 2019-12-05 06:29:53
背景描述 防火墙是具有很好的保护作用。入侵者必须首先穿越防火墙的安全防线,才能接触目标计算机。在公司里数据安全是最重要的,要求安全部门进行全公司进行服务器防火墙安全搭建,在原有的基础上进行安全的防火墙设置,大多数生产环境都建议开启,这样才能有效避免安全隐患等问题;本文文字偏多,但是建议大家还是花个十多分钟好好看一下防火墙的原理,这样便于后期问题排查,最后一小节也会有常用命令操作。 主要内容 1 详细了解防火墙相关配置; 2 详细解读相关安全配置方法; 3 详细解读firewalld防火墙的基础知识; 4 了解firewalld防火墙的配置; 5 了解firewalld防火墙相关命令的使用。 1.Linux防火墙概述 防火墙是指设置在不同网络或网络安全域之间的一系列部件的组合,它能增强机构内部网络的安全性。它通过访问控制机制,确定哪些内部服务允许外部访问,以及允许哪些外部请求可以访问内部服务。它可以根据网络传输的类型决定IP包是否可以传进或传出内部网。 防火墙通过审查经过的每一个数据包,判断它是否有相匹配的过滤规则,根据规则的先后顺序进行一一比较,直到满足其中的一条规则为止,然后依据控制机制做出相应的动作。如果都不满足,则将数据包丢弃,从而保护网络的安全。 Linux系统的防火墙功能是由内核实现的。在2.4 版及以后的内核中,包过滤机制是netfilter.CentOS

Limiting ICMP echo replies when creating a PING program

时光怂恿深爱的人放手 提交于 2019-12-05 05:53:57
问题 I was writing a multithreaded ping program. I created rawsockets on each thread (for each IP) and sent ICMP Echo Request to each using sendto() and then I did recvfrom() in each thread. I am getting messages from IPs in various sockets(like if I had used socket S1 for sendto for IP1, I get echo-replies from IP1 to S1, S2 etc). Do I need to do a bind? Also another problem is that even though I send only 1 ICMP request I get back many echo replies from target. Is there any way I can limit this?

How do I implement ICMP ping in Ruby using only the standard the socket library?

北城以北 提交于 2019-12-05 04:13:16
It should be possible send and receive ICMP packets using the Ruby socket library but I do not see any good documentation on this. I do not want to use net-ping, icmp, ping, and all of these other libraries that either fail because of cross-platform issues, require devkit and custom building, which fail during the build process, are neglected and have not been updated for a lengthy time, and/or are just in general buggy. Does anyone have any good documentation on how to accomplish this? I want to send ICMP echo replies, not TCP or UDP packets. Reading Daniel Berger's code on his Net-ping

DOS攻击——ICMP报文洪水攻击

为君一笑 提交于 2019-12-05 03:13:11
代码 flooder.h #pragma once #include <iostream> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/ip_icmp.h> #include <arpa/inet.h> #include <linux/types.h> #include <string.h> #include <unistd.h> #include <pthread.h> __u32 share_dst_ip; __s32 share_pk_size; __s8 *share_pk; void *floodFunction(void *data) { __s32 sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (!sock) { return 0; } int val = 1; if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, &val, sizeof(val)) == -1) { close(sock); return 0; } if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &val, sizeof(val)

Is ICMP a transport layer protocol?

痞子三分冷 提交于 2019-12-05 01:37:24
I was going through a video lecture on networking and there the lecturer mentions ICMP as a transport layer protocol. However, Googling it shows various forums describing it as network layer protocol. This has confused me a lot. Can someone clarify? Transport layer protocols are concerned with send data from end-to-end and ensuring (or explicitly not ensuring) reliability. TCP is used to send data from one computer to another and includes logic necessary to ensure that the data is transported correctly, while UDP is used to send data from one computer to another while hopefully getting

what would cause ICMPsendEcho to fail when ping.exe succeeds

*爱你&永不变心* 提交于 2019-12-04 22:02:09
问题 I have an interesting situation on my hands, and I'm not quite sure how to go about troubleshooting it. I did a few searches for something similar to my situation, but nothing quite matches it. If the answer already exists somewhere here, I would appreciate anyone that could point me in the right direction. Ok, to the point. I'm writing a watchdog application for monitoring internet connectivity. Its designed to ping a set of domains at a set interval, and when any of them respond to the ping

【DNS域名解析命令】 ping

偶尔善良 提交于 2019-12-04 20:16:05
ping, ping6 - send ICMP ECHO_REQUEST to network hosts ping命令向网络主机发送ICMP回传请求 详细描述: ping使用ICMP协议强制ECHO_REQUEST(回传请求)数据报从主机或网关获取ICMP协议的ECHO_RESPONSE(回传响应)。ECHO_REQUEST(回传请求)数据报(“ping”)有一个IP和ICMP头,之后是一个结构时间值,再之后是一个任意数量的“pad”字节,用于填充数据包。 语法: ping [ -LRUbdfnqrvVaAB] [ -c count] [ -i interval] [ -l preload] [ -p pattern] [ -s packetsize] [ -t ttl] [ -w deadline] [ -F flowlabel] [-I interface] [ -M hint] [ -Q tos] [ -S sndbuf] [ -T timestamp option] [ -W timeout] [ hop ...] destination 参数: -b 允许ping网关地址 -c count 发送count次ECHO_REQUEST(回传请求)数据包。当有deadline选项(最后期限,-w选项),在超时之前,ping等待ECHO_REPLY(回传响应)直到count次。

Kubernetes Service监控(Blackbox_exporter)

a 夏天 提交于 2019-12-04 20:06:29
Blackbox_exporter 主动监测主机与服务状态 Prometheus 官方提供的 exporter 之一,可以提供 http、dns、tcp、icmp 的监控数据采集 官方github: https://github.com/prometheus/blackbox_exporter 部署Blackbox_exporter [sss@prometheus01 ]$ cd /usr/local/blackbox_exporter/ [sss@prometheus01 ]$ wget https://github.com/prometheus/blackbox_exporter/releases/download/v0.12.0/blackbox_exporter-0.12.0.linux-amd64.tar.gz [sss@prometheus01 ]$ tar zxvf blackbox_exporter-0.12.0.linux-amd64.tar.gz [sss@prometheus01 blackbox_exporter-0.12.0.linux-amd64]$ cd blackbox_exporter-0.12.0.linux-amd64 [sss@prometheus01 blackbox_exporter-0.12.0.linux-amd64]$ ll

Centos 7 配置静态IP

寵の児 提交于 2019-12-04 17:52:57
前言 最近用 VM 虚拟机安装了 Centos7,采用了最新安装模式,现在记录一下如何配置静态IP 第一步:将网关配置成 dhcp(动态ip模式) [root@localhost network-scripts]# ls /etc/sysconfig/network-scripts/ifcfg-* /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-lo # 备份网卡 [root@localhost network-scripts]# cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-ens33.bak [root@localhost network-scripts]# yum install -y vim [root@localhost network-scripts]# vim /etc/sysconfig/network-scripts/ifcfg-ens33 修改内容如下: BOOTPROTO=dhcp ONBOOT=yes 重启网卡 [root@localhost network-scripts]# service network restart

Block ping in Windows Server 2008 R2

☆樱花仙子☆ 提交于 2019-12-04 10:16:39
I have deployed my Asp.Net web application on Windows Server 2008 R2 , and I want to block all ping requests to this server without effecting my application . Thanks in advance Satinder singh Go to Start → Administrative Tools → Windows Firewall with Advanced Security → Inbound Rules → File and Printer Sharing (Echo Request – ICMPv4-IN) → right click and select Enable Rule . My application now works fine and when I try to ping my server I do not receive any response. Using the solution provided by Satinder, you should further refine the scope of which computer/server and/or IP range(s) can