题目
IP配置
网关配置 vmnet8 ens32
[root@localhost gp]# ip ad
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens32: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:10:71:9a brd ff:ff:ff:ff:ff:ff
inet 192.168.21.129/24 brd 192.168.21.255 scope global noprefixroute dynamic ens32
valid_lft 1725sec preferred_lft 1725sec
inet6 fe80::26d7:c1bd:84db:79b/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: ens33: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:10:71:90 brd ff:ff:ff:ff:ff:ff
4: ens34: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:10:71:a4 brd ff:ff:ff:ff:ff:ff
inet6 fe80::b0b0:4252:8c07:41cd/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@localhost gp]# vim /etc/sysconfig/network-scripts/ifcfg-ens32
[root@localhost gp]# cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
BOOTPROTO=dhcp
NAME=ens32
DEVICE=ens32
ONBOOT=yes
vmnet1配置 ens33
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.1.254
NETMASK=255.255.255.0
DNS1=114.114.114.114
DNS2=8.8.8.8
vmnet2配置 ens34
[root@localhost gp]# vim /etc/sysconfig/network-scripts/ifcfg-ens34
[root@localhost gp]# cat /etc/sysconfig/network-scripts/ifcfg-ens34
TYPE=Ethernet
BOOTPROTO=static
NAME=ens34
DEVICE=ens34
ONBOOT=yes
IPADDR=172.16.1.254
NETMASK=255.255.255.0
DNS1=114.114.114.114
DNS2=8.8.8.8
[root@localhost gp]# systemctl restart network
server1 ip 配置
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=172.16.1.100
NETMASK=255.255.255.0
GATEWAY=172.16.1.254
DNS1=114.114.114.114
DNS2=8.8.8.8
[root@localhost ~]# systemctl restart network
client配置
syslog服务器配置
[root@localhost gp]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
[root@localhost gp]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=172.16.1.200
NETMASK=255.255.255.0
GATEWAY=172.16.1.254
DNS1=114.114.114.114
DNS2=8.8.8.8
[root@localhost gp]#
发送端配置
[root@localhost gp]# cp /etc/rsyslog.conf /etc/rsyslog.conf.bak
[root@localhost gp]# vim /etc/rsyslog.conf
此行为修改内容authpriv.* @@172.16.1.200:514
[root@localhost gp]# systemctl restart rsyslog.service
接收端配置
:fromhost-ip,isequal,"172.16.1.100" /var/log/client_secure/172.16.1.100.log
systemctl restart rsyslog.service
[root@localhost gp]# ss -anptl | grep "514"
LISTEN 0 25 *:514 *:* users:(("rsyslogd",pid=3575,fd=3))
LISTEN 0 25 :::514 :::* users:(("rsyslogd",pid=3575,fd=4))
[root@localhost gp]#
路由转发配置
[root@localhost ~]# vim /etc/sysctl.conf
[root@localhost ~]# sysctl -p
net.ipv4.ip_forward = 1
[root@localhost ~]# grep -v "^#" /etc/sysctl.conf
net.ipv4.ip_forward = 1
服务管理操作
[root@localhost ~]# netstat -anptl | grep "23"
[root@localhost ~]# systemctl list-unit-files | grep "telnet"
[email protected] static
telnet.socket disabled
[root@localhost ~]# systemctl start telnet.socket
[root@localhost ~]# netstat -anptl | grep "23"
tcp6 0 0 :::23 :::* LISTEN 1/systemd
挂载光盘yum源
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost yum.repos.d]# mkdir bak
[root@localhost yum.repos.d]# mv * bak
mv: cannot move ‘bak’ to a subdirectory of itself, ‘bak/bak’
[root@localhost yum.repos.d]#
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim localDVD.repo
[root@localhost yum.repos.d]# cat localDVD.repo
[localDVD.repo]
name=localDVD
baseurl=file:/misc/cd
gpgcheck=0
[root@localhost yum.repos.d]#
telnet远程连接
telnet IP
ssh登录及爆破
[root@localhost ~]# systemctl list-unit-files |grep "ssh"
anaconda-sshd.service static
sshd-keygen.service static
sshd.service enabled
[email protected] static
sssd-ssh.service indirect
sshd.socket disabled
sssd-ssh.socket disabled
[root@localhost ~]# systemctl start sshd.service
[root@localhost ~]# netstat -anptl | grep "22"
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5795/sshd
tcp6 0 0 :::22 :::* LISTEN 5795/sshd
[root@localhost ~]#
配置kali ip
──(kalikali)-[~]
└─$ cd /etc/network
┌──(kalikali)-[/etc/network]
└─$ sudo vim interfaces
[sudo] password for kali:
┌──(kalikali)-[/etc/network]
└─$
ssh爆破
hydra ssh://172.16.1.100 -L /home/kali/tools/wordlists/test_username.dic -P /home/kali/tools/wordlists/top_password.txt -f -vV -e nsr -t 64