20201202 cisco KDLinux
課堂資料

建立一個 router 和 Linux,並將它們設置 IP
int e0/0ip addr 192.168.1.1 255.255.255.0no shut
line vty 0 4loginpassword ciscotransport input telnet
ip addr add 192.168.1.2/24 brd + dev eth0ping 192.168.1.1
telnet 192.168.1.1

eth0 自帶 IP,可以直接 Ping
8.8.8.8和www.google.com

時間設置
timedatectl set-timezone Asia/Taipei更新
systemctl restart ntp.servicentpdapt updateapt install curl wget
useradd usermkdir /home/user -pchown user:user /home/usersu - userbashgit clone https://github.com/reverse-shell/routersploitcd routersploit/python3 -m pip install -r requirements.txtpython3 rsf.py
use scanners/routers/router_scanset target 12.1.1.1runexit
課堂練習

int e0/0ip add 12.1.1.1 255.255.255.0no shutrouter ripver 2no auto-summarynetwork 12.1.1.0exitip domain-name test.comcrypto key generate rsaip ssh ver 2line vty 0 4login localtransport input sshusername root privilege 15 password 12345endshow running-config | inc username
int e0/0ip add 12.1.1.2 255.255.255.0no shutint e0/1ip add 192.168.1.1 255.255.255.0no shutrouter ripver 2no auto-summarynetwork 12.1.1.0network 192.168.1.0
endssh -l root 12.1.1.1
ip addr add 192.168.1.2/24 brd + dev eth0ip route add default via 192.168.1.1ping 192.168.1.1ping 12.1.1.1
cd Downloadsvim test.txt123
1234
12345
123456
111
222hydra -l root -p test.txt ssh://12.1.1.1 -t 4

int e0/2ip addr dhcpno shutdo sh ip int brief
exitenable password 12345line vty 0 4password 12345logintransport input telnetping 192.168.8.135
yum install telnettelnet 192.168.8.135yum install python-pippip install pexpect
yum install python3 python3-pip
python3import pexpectchild=pexpect.spawn('telnet 192.168.157.143')child=expect('Password:')child=sendline('12345')child=expect('R2#')child=sendline('sh ip int brief')child=expect('R2#')child.beforecd /tmpip ro sh./test.pyLast updated
Was this helpful?