列出最早登录这两个服务器的IP地址

image-20231031205846121

列出两个服务器的操作系统版本(如:CentOS Linux release 7.5.14)(版本号从小到大填写,分2项填写)

image-20231101171559109

image-20231101171611640

列出查看历史命令的linux命令

1
history

列出nginx配置的网站信息(直接填入域名如:www.baidu.com)

1
2
3
4
5
6
[root@iZbp1flwvntjadc39mcl4kZ ~]# cat /etc/nginx/nginx.conf | grep server_name | grep -v "#" | grep -v "localhost" | awk -F " " '{print $2}'
www.mmarri.com.cn;
yzp.api.fzyaxpu.cn;
invite.yzp.rziflzj.cn;
yzp.fkzizyi.cn;

列出后台网站前端所在目录(如:/root/data)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
worker_connections 1024;
}

http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

include /etc/nginx/mime.types;
default_type application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name www.mmarri.com.cn;
root /data/ns/admin/dist;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
try_files $uri $uri/ @router;
index index.html;
}

location /api/phoenix-console-backend/ {
proxy_pass http://172.16.14.66:8090/;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location @router {
rewrite ^.*$ /index.html last;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 8090;
#server_name houtai.mmarri.com.cn;
server_name localhost;
root /data/ns/yzp/dist;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
try_files $uri $uri/ @router;
index index.html;
}

location /api/phoenix-console-backend/ {
proxy_pass http://172.16.14.77:8089/;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location @router {
rewrite ^.*$ /index.html last;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

server {
listen 80;
#server_name gsh.mmarri.com.cn;
server_name yzp.api.fzyaxpu.cn;
#server_name api.stock.w5zq.com;
#root /data/ns/admin;
root /data/ns/yzp_agreement;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
try_files $uri $uri/ @router;
index index.html;
}

location /api/phoenix/ {
proxy_pass http://172.16.14.77:9009/;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location /money126/ {
proxy_pass http://img1.money.126.net/;

proxy_redirect off;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location /hq {
proxy_pass http://hq.sinajs.cn/hq?;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location @router {
rewrite ^.*$ /index.html last;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

server {
listen 8089;
server_name localhost;
root /data/ns/yzp_agreement;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
try_files $uri $uri/ @router;
index index.html;
}

location /api/phoenix/ {
proxy_pass http://172.16.14.77:9009/;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location @router {
rewrite ^.*$ /index.html last;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

server {
listen 80;
server_name invite.yzp.rziflzj.cn;
root /data/ns/yzpinvite/dist;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
try_files $uri $uri/ @router;
index index.html;
}

location /api/phoenix/ {
proxy_pass http://172.16.14.65:9009/;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location /money126/ {
proxy_pass http://img1.money.126.net/;

proxy_redirect off;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location /hq {
proxy_pass http://hq.sinajs.cn/hq?;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}


location @router {
rewrite ^.*$ /index.html last;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

server {
listen 80;
server_name yzp.fkzizyi.cn;
root /data/ns/yzp_home;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
try_files $uri $uri/ @router;
index index.html;
}

location @router {
rewrite ^.*$ /index.html last;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 8099;
server_name localhost;
root /data/ns/yzp_home;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
try_files $uri $uri/ @router;
index index.html;
}

location @router {
rewrite ^.*$ /index.html last;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}





# Settings for a TLS enabled server.
#
# server {
# listen 443 ssl http2 default_server;
# listen [::]:443 ssl http2 default_server;
# server_name _;
# root /usr/share/nginx/html;
#
# ssl_certificate "/etc/pki/nginx/server.crt";
# ssl_certificate_key "/etc/pki/nginx/private/server.key";
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 10m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
#
# # Load configuration files for the default server block.
# include /etc/nginx/default.d/*.conf;
#
# location / {
# }
#
# error_page 404 /404.html;
# location = /40x.html {
# }
#
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# }
# }

}

1
2
3
4
5
6
7
8
9
10
[root@iZbp1flwvntjadc39mcl4kZ ~]# systemctl start nginx
[root@iZbp1flwvntjadc39mcl4kZ ~]# netstat -nlpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1075/sshd
tcp 0 0 0.0.0.0:8089 0.0.0.0:* LISTEN 1358/nginx: master
tcp 0 0 0.0.0.0:8090 0.0.0.0:* LISTEN 1358/nginx: master
tcp 0 0 0.0.0.0:8099 0.0.0.0:* LISTEN 1358/nginx: master
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1358/nginx: master
tcp6 0 0 :::80 :::* LISTEN 1358/nginx: master

image-20231101175834886

反查配置文件里端口8090

1
/data/ns/yzp/dist

nginx配置信息中管理后台网站的访问端口是

1
8090

nginx配置信息中,反向代理API接口是(标准格式:以/结尾)

proxy_pass 是 Nginx 配置指令,用于配置反向代理。它指定了请求应该被代理到哪个上游服务器或后端服务。当客户端向 Nginx 发送请求时,Nginx可以代表客户端将请求传递给另一个服务器,然后将响应传递回客户端。

具体来说,proxy_pass 指令的语法如下:

1
proxy_pass URL;

其中,URL 是上游服务器的地址。这个地址可以是一个 HTTP 或 HTTPS URL,也可以是一个本地 socket 地址或一个 IP 地址。

举例来说,以下是一个使用 proxy_pass 配置反向代理的示例:

1
2
3
location /example/ {
proxy_pass http://backend-server/;
}

在这个示例中,当客户端访问 /example/ 路径时,Nginx会将请求代理到 http://backend-server/ 这个上游服务器。上游服务器可以是另一个 Web 服务器、应用服务器或任何能够处理该请求的后端服务。

proxy_pass 还可以包括其他参数,以根据需要进一步配置代理行为,如设置请求头、重定向、缓存等。它是实现反向代理的核心指令之一,允许 Nginx 充当代理服务器,将客户端请求路由到不同的后端服务器,以实现负载均衡、安全性、性能优化等目标。

1
2
3
4
5
6
7
8
9
10
 location /api/phoenix/ {
proxy_pass http://172.16.14.77:9009/;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

这段 Nginx 配置代码定义了一个 location 块,该块处理以 /api/phoenix/ 开头的请求路径。下面是对这段配置的解释:

  • location /api/phoenix/ { ... }:这行定义了 location 块,指定了要处理的请求路径,即以 /api/phoenix/ 开头的请求。

  • proxy_pass http://172.16.14.77:9009/;:这行指令告诉 Nginx 将匹配到的请求代理到指定的上游服务器。具体来说,它将请求代理到 http://172.16.14.77:9009/ 这个地址。这意味着所有匹配 /api/phoenix/ 的请求将被发送到 http://172.16.14.77:9009/ 这个服务器上。

  • proxy_redirect off;:这行指令将代理重定向关闭,这意味着 Nginx不会修改来自上游服务器的响应中的任何重定向标头。

  • proxy_set_header Host $host;:这行指令用于设置请求头中的 Host 标头,将其设置为与客户端请求中的 Host 标头相同。这有助于确保上游服务器能够正确处理请求。

  • proxy_set_header X-real-ip $remote_addr;:这行指令设置了一个名为 “X-real-ip” 的自定义请求头,其值是客户端的真实 IP 地址(通过 $remote_addr 变量获取)。这可以帮助上游服务器了解客户端的 IP 地址。

  • proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;:这行指令设置了一个名为 “X-Forwarded-For” 的自定义请求头,其值包括了客户端的 IP 地址以及通过代理链路传递的其他 IP 地址。这有助于跟踪请求的来源。

综合来看,这段配置的作用是将以 /api/phoenix/ 开头的请求代理到指定的上游服务器 http://172.16.14.77:9009/,并且设置了一些请求头信息,以便上游服务器能够正确处理请求并获取客户端的 IP 地址和请求链路信息。

nginx启动完成后,查询nginx进程的命令

1
ps -ef|grep nginx

列出管理后台网站的配置文件所在目录(如:/root/log)

image-20231101181813205

列出可以直接搭建起来的网站前端的域名(不包括后台管理平台如:www.baidu.com)

image-20231101182722978

一个个访问

image-20231101182746077

image-20231101182757288

1
2
invite.yzp.rziflzj.cn
yzp.fkzizyi.cn

列出java网站监听端口的配置信息中connectionTimeout=_______(如:<con……..redirectPort =“8848”>)

image-20231101184921313

去/opt目录一探究竟

image-20231101185016846

发现了两个tomcat站点

1
2
3
4
[root@iZbp1flwvntjadc39mcl4nZ bg]# cat ./conf/server.xml | grep -i connectionTimeout
connectionTimeout="20000"
connectionTimeout="20000"

列出java网站后台数据库连接配置文件所在文件和目录(路径加文件名,如:/data/kk/ww.jar)

image-20231102144916528

image-20231102144909437

1
/opt/bg/webapps/ROOT/WEB-INF/lib/bg-core-1.0-SNAPSHOT.jar

前端管理后台对应的java网站连接的数据库名称为

1
2
3
4
5
6
phoenix_jdbc_url=jdbc:mysql://rm-bp1088br30459kz82.mysql.rds.aliyuncs.com/yzp_strategy?characterEncoding=utf-8&useSSL=false
phoenix_user=yzp_prod
phoenix_password=GXuuCg8xNYqN8hwASU9t9fe
jedis.host=172.16.14.77
jedis.port=6379
jedis.auth=*&yzprspCa
1
yzp_strategy

前端管理后台对应的java网站连接的数据库账号为

1
yzp_prod

列出启动java网站的命令代码./opt/bg/bin/___

1
startup.sh

tomcat常识题,之前写的博客GDBW做到过

列出java网站中保存的管理员登录账号表格名称为

讲道理后面都要重构来完成,但是我看数据库配置文件里面有redis服务,但是本地没有redis,那么重构的可能性就不存在了,后面就只能手搓数据库

本地重构数据库,替换data目录下所有文件,my.ini绕密

image-20231102145441403

image-20231102145513196

管理员登录密码加密方式为(标准格式:大写)

image-20231102145816842

找到超级管理员,cmd5跑一下

image-20231102145858294

(BW的尿性……)

1
SHA1

管理员账号是(1),明文密码(2)

1
2
15057301199
123456

该网站的用户总人数为(1)用户余额数为(2)

image-20231102150036054

image-20231102150136402

列出登录后台地址记录的APP下载地址并判断IP所属地域,APP下载地址(1) ; IP地域所属国家是(2)

image-20231102150341557

1
2
3
4
5
6
7
8
9
10
[root@iZbp1flwvntjadc39mcl4nZ opt]# curl www.cip.cc/8.56.55.9
IP : 8.56.55.9
地址 : 美国 美国

数据二 : 美国

数据三 : 美国 | Level3

URL : http://www.cip.cc/8.56.55.9