1
2021年7月12日,上午8点左右,警方接到被害人张某(张有财)报案,声称自己被敲诈数万元;经询问,张某被嫌疑人诱导裸聊,下载了某“裸聊”软件,导致自己的通讯录和裸聊视频被嫌疑人获取,对其进行敲诈,最终张某不堪重负,选择了报警;警方从张某提供的本人手机中(手机号为18805533089),定向采集到了该“裸聊”软件,通个裸聊APK软件的分析,警方找到了后台服务器地址,并调取了服务器镜像(web.E01),请各位取证工作者回答下列问题:

检材web.E01的操作系统版本是

image-20230824193744299

检材web.E01中,操作系统的内核版本是

image-20230824193753190

检材web.E01服务器中,最后一条操作命令为:

image-20230824193809218

检材web.E01服务器中,远程连接服务所使用的端口号为:

下面对服务器进行分析

image-20230824200229207

image-20230824200310194

image-20230824200421623

image-20230824200517403

能够ping通,说明检材和我们物理机在同一个网段下

image-20230824200706808

检查端口开放情况,以及ssh

image-20230824200759511

检查ssh端口,但是无法用xshell连接,查看配置文件

image-20230824201731708

把注释符去掉,重启服务

image-20230824203331399

有www目录,cd进去,宝塔特征

先关闭宝塔烦人的限制

1
bt 23 && bt 11 && bt 12 && bt 13 && bt 24 && bt 5

image-20230824203633676

把nginx,mysql启起来

image-20230824204227724

宝塔里加个端口访问

image-20230824204342643

image-20230824204456411

成功重构,观察他的路由

image-20230824205656976

访问http://192.168.1.111:6324/admin/

image-20230824204709460

我们采取报错的方式来找到加密函数

image-20230824204756563

image-20230824204850632

Common.php

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
<?php
// +----------------------------------------------------------------------
// | Tplay [ WE ONLY DO WHAT IS NECESSARY ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017 http://tplay.pengyichen.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 听雨 < [email protected] >
// +----------------------------------------------------------------------


namespace app\admin\controller;

use \think\Cache;
use \think\Controller;
use think\Loader;
use think\Db;
use \think\Cookie;
use \think\Session;
class Common extends Controller
{
/**
* 清除全部缓存
* @return [type] [description]
*/
public function clear()
{
if(false == Cache::clear()) {
return $this->error('清除缓存失败');
} else {
return $this->success('清除缓存成功');
}
}


/**
* 图片上传方法
* @return [type] [description]
*/
public function upload($module='admin',$use='admin_thumb')
{
if($this->request->file('file')){
$file = $this->request->file('file');
}else{
$res['code']=1;
$res['msg']='没有上传文件';
return json($res);
}
$module = $this->request->has('module') ? $this->request->param('module') : $module;//模块
$web_config = Db::name('webconfig')->where('web','web')->find();
$info = $file->validate(['size'=>$web_config['file_size']*1024,'ext'=>$web_config['file_type']])->rule('date')->move(ROOT_PATH . 'public' . DS . 'uploads' . DS . $module . DS . $use);
if($info) {
//写入到附件表
$data = [];
$data['module'] = $module;
$data['filename'] = $info->getFilename();//文件名
$data['filepath'] = DS . 'uploads' . DS . $module . DS . $use . DS . $info->getSaveName();//文件路径
$data['fileext'] = $info->getExtension();//文件后缀
$data['filesize'] = $info->getSize();//文件大小
$data['create_time'] = time();//时间
$data['uploadip'] = $this->request->ip();//IP
$data['user_id'] = Session::has('admin') ? Session::get('admin') : 0;
if($data['module'] = 'admin') {
//通过后台上传的文件直接审核通过
$data['status'] = 1;
$data['admin_id'] = $data['user_id'];
$data['audit_time'] = time();
}
$data['use'] = $this->request->has('use') ? $this->request->param('use') : $use;//用处
$res['id'] = Db::name('attachment')->insertGetId($data);
$res['src'] = DS . 'uploads' . DS . $module . DS . $use . DS . $info->getSaveName();
$res['code'] = 2;
addlog($res['id']);//记录日志
return json($res);
} else {
// 上传失败获取错误信息
return $this->error('上传失败:'.$file->getError());
}
}

/**
* 登录
* @return [type] [description]
*/
public function login()
{
if(Session::has('admin') == false) {
if($this->request->isPost()) {
//是登录操作
$post = $this->request->post();
//验证 唯一规则: 表名,字段名,排除主键值,主键名
$validate = new \think\Validate([
['name', 'require|alphaDash', '用户名不能为空|用户名格式只能是字母、数字、——或_'],
['password', 'require', '密码不能为空'],
['captcha','require|captcha','验证码不能为空|验证码不正确'],
]);
//验证部分数据合法性
if (!$validate->check($post)) {
$this->error('提交失败:' . $validate->getError());
}
$name = Db::name('admin')->where('name',$post['name'])->find();
if(empty($name)) {
//不存在该用户名
return $this->error('用户名不存在');
} else {
//验证密码
$post['password'] = password($post['password']);
if($name['password'] != $post['password']) {
return $this->error('密码错误');
} else {
//是否记住账号
if(!empty($post['remember']) and $post['remember'] == 1) {
//检查当前有没有记住的账号
if(Cookie::has('usermember')) {
Cookie::delete('usermember');
}
//保存新的
Cookie::forever('usermember',$post['name']);
} else {
//未选择记住账号,或属于取消操作
if(Cookie::has('usermember')) {
Cookie::delete('usermember');
}
}
Session::set("admin",$name['id']); //保存新的
Session::set("admin_cate_id",$name['admin_cate_id']); //保存新的
//记录登录时间和ip
Db::name('admin')->where('id',$name['id'])->update(['login_ip' => $this->request->ip(),'login_time' => time()]);
//记录操作日志
addlog();
if(!cache('sessionIds')){
//创建一个数组,将id作为key把session_id作为值存到缓存中
$sessionIds = [];
$sessionIds[$name['id']] = session_id();
cache('sessionIds',$sessionIds);
}else{
//找到登录id 对应的session_id值并改变这个值
$sessionIds = cache('sessionIds');
$sessionIds[$name['id']] = session_id();
cache('sessionIds',$sessionIds);
}
return $this->success('登录成功,正在跳转...','admin/index/index');
}
}
} else {
if(Cookie::has('usermember')) {
$this->assign('usermember',Cookie::get('usermember'));
}
return $this->fetch();
}
} else {
$this->redirect('admin/index/index');
}
}

/**
* 管理员退出,清除名字为admin的session
* @return [type] [description]
*/
public function logout()
{
Session::delete('admin');
Session::delete('admin_cate_id');
if(Session::has('admin') or Session::has('admin_cate_id')) {
return $this->error('退出失败');
} else {
return $this->success('正在退出...','admin/common/login');
}
}
}

1
if($name['password'] == $post['password']) {

修改逻辑

image-20230824205151198

其实做到这里,这套题差不多已经做完了

我们返回到题目里,端口号在我们连接ssh的时候已经知道了

7001

该后台服务器中,在案发前,管理员最后一次登陆服务器的IP地址为(答案格式111.111.111.111)

题干问的是案发前,报警时间是2021年7月12日,所以我们要看这之前的last记录

image-20230824205938753

检材web.E01中,嫌疑人架设网站使用了何种工具架设了网站

image-20230824193958022

接上一题,请问架设网站的工具的登陆用户名为:

image-20230824194008269

该后台网站对外提供服务所使用的端口号为:

image-20230824210144879

请分析该网站的后台登陆地址的url为:

http://192.168.1.111:6324/admin/common/login.shtml

该网站后台所使用的数据库类型为:

image-20230824194314898

该网站所使用的数据库的库名(database名)为

image-20230824194115352

该网站所使用的数据库的root密码为

image-20230824210159557

请计算/www/wwwroot/www.honglian7001.com/app目录下的文件"database.php"的SHA256值

image-20230824194234976

已知,该网站后台对于账号的密码采用加盐加密,该salt值为:

对登录的函数进行审计

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
<?php
// +----------------------------------------------------------------------
// | Tplay [ WE ONLY DO WHAT IS NECESSARY ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017 http://tplay.pengyichen.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 听雨 < [email protected] >
// +----------------------------------------------------------------------


namespace app\admin\controller;

use \think\Cache;
use \think\Controller;
use think\Loader;
use think\Db;
use \think\Cookie;
use \think\Session;
class Common extends Controller
{
/**
* 清除全部缓存
* @return [type] [description]
*/
public function clear()
{
if(false == Cache::clear()) {
return $this->error('清除缓存失败');
} else {
return $this->success('清除缓存成功');
}
}


/**
* 图片上传方法
* @return [type] [description]
*/
public function upload($module='admin',$use='admin_thumb')
{
if($this->request->file('file')){
$file = $this->request->file('file');
}else{
$res['code']=1;
$res['msg']='没有上传文件';
return json($res);
}
$module = $this->request->has('module') ? $this->request->param('module') : $module;//模块
$web_config = Db::name('webconfig')->where('web','web')->find();
$info = $file->validate(['size'=>$web_config['file_size']*1024,'ext'=>$web_config['file_type']])->rule('date')->move(ROOT_PATH . 'public' . DS . 'uploads' . DS . $module . DS . $use);
if($info) {
//写入到附件表
$data = [];
$data['module'] = $module;
$data['filename'] = $info->getFilename();//文件名
$data['filepath'] = DS . 'uploads' . DS . $module . DS . $use . DS . $info->getSaveName();//文件路径
$data['fileext'] = $info->getExtension();//文件后缀
$data['filesize'] = $info->getSize();//文件大小
$data['create_time'] = time();//时间
$data['uploadip'] = $this->request->ip();//IP
$data['user_id'] = Session::has('admin') ? Session::get('admin') : 0;
if($data['module'] = 'admin') {
//通过后台上传的文件直接审核通过
$data['status'] = 1;
$data['admin_id'] = $data['user_id'];
$data['audit_time'] = time();
}
$data['use'] = $this->request->has('use') ? $this->request->param('use') : $use;//用处
$res['id'] = Db::name('attachment')->insertGetId($data);
$res['src'] = DS . 'uploads' . DS . $module . DS . $use . DS . $info->getSaveName();
$res['code'] = 2;
addlog($res['id']);//记录日志
return json($res);
} else {
// 上传失败获取错误信息
return $this->error('上传失败:'.$file->getError());
}
}

/**
* 登录
* @return [type] [description]
*/
public function login()
{
if(Session::has('admin') == false) {
if($this->request->isPost()) {
//是登录操作
$post = $this->request->post();
//验证 唯一规则: 表名,字段名,排除主键值,主键名
$validate = new \think\Validate([
['name', 'require|alphaDash', '用户名不能为空|用户名格式只能是字母、数字、——或_'],
['password', 'require', '密码不能为空'],
['captcha','require|captcha','验证码不能为空|验证码不正确'],
]);
//验证部分数据合法性
if (!$validate->check($post)) {
$this->error('提交失败:' . $validate->getError());
}
$name = Db::name('admin')->where('name',$post['name'])->find();
if(empty($name)) {
//不存在该用户名
return $this->error('用户名不存在');
} else {
//验证密码
$post['password'] = password($post['password']);
if($name['password'] != $post['password']) {
return $this->error('密码错误');
} else {
//是否记住账号
if(!empty($post['remember']) and $post['remember'] == 1) {
//检查当前有没有记住的账号
if(Cookie::has('usermember')) {
Cookie::delete('usermember');
}
//保存新的
Cookie::forever('usermember',$post['name']);
} else {
//未选择记住账号,或属于取消操作
if(Cookie::has('usermember')) {
Cookie::delete('usermember');
}
}
Session::set("admin",$name['id']); //保存新的
Session::set("admin_cate_id",$name['admin_cate_id']); //保存新的
//记录登录时间和ip
Db::name('admin')->where('id',$name['id'])->update(['login_ip' => $this->request->ip(),'login_time' => time()]);
//记录操作日志
addlog();
if(!cache('sessionIds')){
//创建一个数组,将id作为key把session_id作为值存到缓存中
$sessionIds = [];
$sessionIds[$name['id']] = session_id();
cache('sessionIds',$sessionIds);
}else{
//找到登录id 对应的session_id值并改变这个值
$sessionIds = cache('sessionIds');
$sessionIds[$name['id']] = session_id();
cache('sessionIds',$sessionIds);
}
return $this->success('登录成功,正在跳转...','admin/index/index');
}
}
} else {
if(Cookie::has('usermember')) {
$this->assign('usermember',Cookie::get('usermember'));
}
return $this->fetch();
}
} else {
$this->redirect('admin/index/index');
}
}

/**
* 管理员退出,清除名字为admin的session
* @return [type] [description]
*/
public function logout()
{
Session::delete('admin');
Session::delete('admin_cate_id');
if(Session::has('admin') or Session::has('admin_cate_id')) {
return $this->error('退出失败');
} else {
return $this->success('正在退出...','admin/common/login');
}
}
}

1
$post['password'] = password($post['password']);

加密函数叫password

推荐用phpstorm审计,跟踪函数方便

1
2
3
4
5
function password($password, $password_code='lshi4AsSUrUOwWV')
{
return md5(md5($password) . md5($password_code));
}

3次加密,盐为lshi4AsSUrUOwWV

在对后台账号的密码加密处理过程中,后台一共计算几次MD5值

见上

请问,网站后台的创建时间最早的管理员账号为:

image-20230824210847159

请综合分析并重构网站,本案中受害者张某的最后登陆IP是多少(答案格式111.111.111.111)

1
警方从张某提供的本人手机中(手机号为18805533089)

image-20230824210829623

请综合分析并重构网站,本案中嫌疑人所掌握的后台共获取了多少设备记录

image-20230824210738288

请综合分析并重构网站,本案中受害者张某的手机型号在后台记录中显示为

1
警方从张某提供的本人手机中(手机号为18805533089)

image-20230824210720526

请综合分析并重构网站,本案中受害者张某的手机通讯录中,名为“许总”的电话号码为(不需要填写空格,答案格式:18811112222)

image-20230824210500847

请综合分析并重构网站,分析该网站第一次用于诈骗活动的时间(填写到日,格式为:2000-01-01)

image-20230824211003427

请综合分析并重构网站,分析该网站设定的邀请码为

image-20230824210329200

请综合分析并重构网站,分析该网站共记录的通信录数量为

image-20230824210357757

请综合分析并重构网站,分析最常登录后台的角色昵称为

image-20230824210601966