CQBW(服务器部分)

计算检材 4-A.rar 的 MD5(128bit)校验值。(答案格式: 字母大写)

image-20240206205234577

请写出镜像中系统(用户名: root 密码: btLUN5Tb)的操作系统版本名称;(答案格式: redhat; 小写、不带空格、特殊字符及版本号)

image-20240206205329680

也可以仿真来看

sed -i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/' /etc/ssh/sshd_config
sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config
sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config
service sshd restart

比武时可以使用

[root@localhost ~]# cat /etc/centos-release && cat /etc/redhat-release && cat /etc/issue
CentOS Linux release 7.6.1810 (Core) 
CentOS Linux release 7.6.1810 (Core) 
\S
Kernel \r on an \m

默认启动得图形界面改为字符界面

systemctl set-default multi-user.target
reboot

请写出系统搭建的集群中 namenode 节点的 id 是什么。(答案格式: 取前 12 位例 0123456789ab)

火眼看到了 docker 里面有,起一下

[root@localhost ~]# docker ps --no-trunc
CONTAINER ID                                                       IMAGE                  COMMAND                        CREATED             STATUS              PORTS               NAMES
ecb42063a46cb07c610765ed5691ef30b9390171900a7f445f2b2b9b412fdd1e   centos/hbase-cluster   "/etc/bootstrap.sh -d"         23 months ago       Up 6 seconds                            datanode2
db8d88d9c6e7a36a9a69a57b46ed5f355bae64b22db8fd22c0ce1eca9c50833a   centos/hbase-cluster   "/etc/bootstrap.sh -d"         23 months ago       Up 5 seconds                            datanode1
99131b4891b0197e6baa7e256281a338bd1e189530c05b5fe5f5771c643c5362   centos/hbase-cluster   "/etc/bootstrap.sh -dmaster"   23 months ago       Up 5 seconds                            namenode

一个主节点,两个子节点,检查一下

"Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/java/default/bin",
                "JAVA_HOME=/usr/java/default",
                "HADOOP_PREFIX=/usr/local/hadoop",
                "HADOOP_COMMON_HOME=/usr/local/hadoop",
                "HADOOP_HDFS_HOME=/usr/local/hadoop",
                "HADOOP_MAPRED_HOME=/usr/local/hadoop",
                "HADOOP_YARN_HOME=/usr/local/hadoop",
                "HADOOP_CONF_DIR=/usr/local/hadoop/etc/hadoop",
                "YARN_CONF_DIR=/usr/local/hadoop/etc/hadoop",
                "BOOTSTRAP=/etc/bootstrap.sh"
            ],

这些环境变量可能会用到

进去看他 history

[root@namenode /]# history 
    1  cat /etc/bootstrap.sh 
    2  clear
    3  l s-l
    4  cd /tmp
    5  cat hosts
    6  vi hosts 
    7  clear
    8  ifconfig
    9  ls -l
   10  clear
   11  ls
   12  cd name
   13  ls
   14  cd current/
   15  ls
   16  clear
   17  cd 
   18  df -h
   19  clear

查看/etc/bootstrap.sh ,也印证了主节点和子节点

if [[ $1 == "-dmaster" ]]; then

echo "waiting for datanode..."
sleep 1;

echo "I am master"

echo "Start DFS:"
$HADOOP_PREFIX/sbin/start-dfs.sh

echo "Start YARN"
$HADOOP_PREFIX/sbin/start-yarn.sh

sleep 1

/usr/local/hadoop/bin/hdfs dfsadmin -report

  while true; do sleep 1000; done

fi

if [[ $1 == "-d" ]]; then
 echo "I am datanode"
  while true; do sleep 1000; done
fi

if [[ $1 == "-bash" ]]; then
  /bin/bash
fi

跟着他的history一步一步跟下来

[root@namenode /]# cat /tmp/hosts 
127.0.0.1 localhost
172.20.0.2 namenode
172.20.0.3  datanode1
172.20.0.4  datanode2
[root@namenode /]# ping -c 4 datanode1 && ping -c 4 datanode2
PING datanode1 (172.20.0.3) 56(84) bytes of data.
64 bytes from datanode1 (172.20.0.3): icmp_seq=1 ttl=64 time=0.117 ms
64 bytes from datanode1 (172.20.0.3): icmp_seq=2 ttl=64 time=0.106 ms
64 bytes from datanode1 (172.20.0.3): icmp_seq=3 ttl=64 time=0.093 ms
64 bytes from datanode1 (172.20.0.3): icmp_seq=4 ttl=64 time=0.065 ms

--- datanode1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.065/0.095/0.117/0.020 ms
PING datanode2 (172.20.0.4) 56(84) bytes of data.
64 bytes from datanode2 (172.20.0.4): icmp_seq=1 ttl=64 time=0.044 ms
64 bytes from datanode2 (172.20.0.4): icmp_seq=2 ttl=64 time=0.097 ms
64 bytes from datanode2 (172.20.0.4): icmp_seq=3 ttl=64 time=0.085 ms
64 bytes from datanode2 (172.20.0.4): icmp_seq=4 ttl=64 time=0.095 ms

--- datanode2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.044/0.080/0.097/0.022 ms

集群能互相连通

[root@namenode /]# cd /tmp/name/current/
[root@namenode current]# ls
edits_0000000000000000001-0000000000000000002  edits_inprogress_0000000000000000278  fsimage_0000000000000000002.md5  fsimage_0000000000000000277.md5  VERSION
edits_0000000000000000003-0000000000000000277  fsimage_0000000000000000002           fsimage_0000000000000000277      seen_txid
[root@namenode current]# cat VERSION
#Wed Feb 07 02:24:40 UTC 2024
namespaceID=166580657
clusterID=CID-8d5ed4d4-7eb8-473f-ba38-e8de8f3b9a27
cTime=0
storageType=NAME_NODE
blockpoolID=BP-2100813004-172.17.0.48-1453995058028
layoutVersion=-57

clusterID在这里

配置文件配置对象主要内容
hadoop-env.shhadoop运行环境用来定义Hadoop运行环境相关的配置信息;
core-site.xml集群全局参数定义系统级别的参数,包括HDFS URL、Hadoop临时目录等;
hdfs-site.xmlHDFS参数定义名称节点、数据节点的存放位置、文本副本的个数、文件读取权限等;
mapred-site.xmlMapReduce参数包括JobHistory Server 和应用程序参数两部分,如reduce任务的默认个数、任务所能够使用内存的默认上下限等;
yarn-site.xml集群资源管理系统参数配置ResourceManager ,nodeManager的通信端口,web监控端口等;

Hadoop启动datanode失败,clusterId有问题 - 汪神 - 博客园 (cnblogs.com)

请写出集群中存储的名称为 thomas 的手机号码;(答案格式: 13800000000)

  128  sh /usr/local/hadoop-2.5.2/sbin/start-all.sh 
  129  sh /usr/local/hbase-1.1.5/bin/start-hbase.sh 

启动服务的命令在history里面

[root@namenode hbase-1.1.5]# sh /usr/local/hbase-1.1.5/bin/stop-hbase.sh
stopping hbasecat: /tmp/hbase--master.pid: No such file or directory

datanode1: no zookeeper to stop because no pid file /tmp/hbase-root-zookeeper.pid
datanode2: no zookeeper to stop because no pid file /tmp/hbase-root-zookeeper.pid
namenode: no zookeeper to stop because no pid file /tmp/hbase-root-zookeeper.pid
[root@namenode hbase-1.1.5]# sh /usr/local/hadoop-2.5.2/sbin/start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
Starting namenodes on [namenode]
namenode: starting namenode, logging to /usr/local/hadoop/logs/hadoop-root-namenode-namenode.out
datanode1: starting datanode, logging to /usr/local/hadoop/logs/hadoop-root-datanode-datanode1.out
datanode2: starting datanode, logging to /usr/local/hadoop/logs/hadoop-root-datanode-datanode2.out
Starting secondary namenodes [namenode]
namenode: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-root-secondarynamenode-namenode.out
starting yarn daemons
starting resourcemanager, logging to /usr/local/hadoop/logs/yarn--resourcemanager-namenode.out
datanode2: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-datanode2.out
datanode1: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-datanode1.out
[root@namenode hbase-1.1.5]# sh /usr/local/hbase-1.1.5/bin/start-hbase.sh
namenode: starting zookeeper, logging to /usr/local/hbase-1.1.5/bin/../logs/hbase-root-zookeeper-namenode.out
datanode1: starting zookeeper, logging to /usr/local/hbase-1.1.5/bin/../logs/hbase-root-zookeeper-datanode1.out
datanode2: starting zookeeper, logging to /usr/local/hbase-1.1.5/bin/../logs/hbase-root-zookeeper-datanode2.out
starting master, logging to /usr/local/hbase-1.1.5/bin/../logs/hbase--master-namenode.out
datanode1: starting regionserver, logging to /usr/local/hbase-1.1.5/bin/../logs/hbase-root-regionserver-datanode1.out
namenode: starting regionserver, logging to /usr/local/hbase-1.1.5/bin/../logs/hbase-root-regionserver-namenode.out
datanode2: starting regionserver, logging to /usr/local/hbase-1.1.5/bin/../logs/hbase-root-regionserver-datanode2.out

重启一下服务

[root@namenode hbase-1.1.5]# bin/hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hbase-1.1.5/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.5.2/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.1.5, r239b80456118175b340b2e562a5568b5c744252e, Sun May  8 20:29:26 PDT 2016

hbase(main):001:0> list
TABLE                                                                                                                                                                          
contact                                                                                                                                                                        
zippass                                                                                                                                                                        
2 row(s) in 0.3000 seconds

=> ["contact", "zippass"]
hbase(main):002:0> scan 'contact'
ROW                                          COLUMN+CELL                                                                                                                       
 001                                         column=UserInfo:name, timestamp=1645364086922, value=thomas                                                                       
 001                                         column=UserInfo:phone, timestamp=1645364120154, value=18930289713                                                                 
1 row(s) in 0.1980 seconds

hbase(main):003:0> scan 'zippass'
ROW                                          COLUMN+CELL                                                                                                                       
 001                                         column=PASSWORD:backup, timestamp=1645364259209, value=payment-backup.zip                                                         
 001                                         column=PASSWORD:pass, timestamp=1645364291404, value=OjSH79iA                                                                     
1 row(s) in 0.0360 seconds

hbase(main):004:0> 

HBase入门:shell 常用命令_列族前缀和列的名字-CSDN博客

镜像中保存了网站的数据备份文件, 请找出并计算备份文件的 md5 校验值。(答案格式: 字母大写)

[root@localhost ~]# find / -name 'payment-backup.zip'
/opt/payment-backup.zip
[root@localhost ~]# md5sum /opt/payment-backup.zip 
e250176cc6ff45f73467f03a7b4e81ea  /opt/payment-backup.zip

请写出支付网站代码的绝对路径目录;(答案格式:/var/log

[root@localhost ~]# systemctl start nginx
Failed to start nginx.service: Unit not found.
[root@localhost ~]# systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

没有nginx,是apache2

[root@localhost ~]# cat /etc/httpd/conf/httpd.conf | grep Root | grep -v '#'
ServerRoot "/etc/httpd"
DocumentRoot "/var/www/html"

请写出支付网站提供服务的端口号;(答案格式: 1234)

[root@localhost ~]# cat /etc/httpd/conf/httpd.conf | grep Listen | grep -v '#'
Listen 63201

请写出网站连接数据库的密码;(答案格式: 123456)

[root@localhost html]# cat Conf/db.php 
<?php
return array(

    'DB_TYPE'               => 'mysql',     // 数据库类型
        'DB_HOST'               => 'localhost', // 服务器地址
        'DB_NAME'               => 'cGF5bWVudA==',          // 数据库名
        'DB_USER'               => 'emhpZnV1c2Vy',      // 用户名
        'DB_PWD'                => 'R1FyT2gqI0s=',          // 密码
        'DB_PORT'               => '3306',        // 端口
    'DB_PREFIX'             => 'pay_',    // 数据库表前缀


);
?>
[root@localhost html]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2024-02-06 18:22:42 PST; 24min ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 6195 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 5541 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 6198 (mysqld)
    Tasks: 28
   Memory: 82.0M
   CGroup: /system.slice/mysqld.service
           └─6198 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Feb 06 18:22:37 localhost.localdomain systemd[1]: Starting MySQL Server...
Feb 06 18:22:42 localhost.localdomain systemd[1]: Started MySQL Server.
[root@localhost html]# mysql -uemhpZnV1c2Vy -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'emhpZnV1c2Vy'@'localhost' (using password: YES)

账密加密过了

[root@localhost html]# grep -rn "DB_USER"
Conf/db.php:7:  'DB_USER'               => 'emhpZnV1c2Vy',      // 用户名
ThinkPHP/Conf/convention.php:60:        'DB_USER'               => 'ZF59yjX1',      // 用户名
ThinkPHP/Extend/Driver/Session/SessionDb.class.php:62:       $DBUser = base64_decode(C('DB_USER'));
ThinkPHP/Extend/Engine/Sae/Conf/convention_sae.php:7:   'DB_USER'=> SAE_MYSQL_USER,    // 用户名
ThinkPHP/Extend/Engine/Sae/SaeImit/config.php:11:    'db_user'=>isset($appConfig['DB_USER'])?$appConfig['DB_USER']:'root',
ThinkPHP/Extend/Mode/Amf/Db.class.php:432:                'username'  =>   C('DB_USER'),
ThinkPHP/Extend/Mode/Cli/Db.class.php:430:                'username'  =>   C('DB_USER'),
ThinkPHP/Extend/Mode/Lite/Db.class.php:430:                'username'  =>   C('DB_USER'),
ThinkPHP/Extend/Mode/Phprpc/Db.class.php:428:                'username'  =>   C('DB_USER'),
ThinkPHP/Extend/Mode/Thin/Db.class.php:385:                'username'  =>   C('DB_USER'),
ThinkPHP/Lib/Core/Db.class.php:184:                    'username'  =>   base64_decode(C('DB_USER')),

请写出存储网站管理员信息的数据表名称;(答案格式: admin)

image-20240207105058780

密码在hbase里面

数据库skip-grant-tables绕个密,Navicat连接

image-20240207105221561

发现报错,搜一下

MySQL 报错 incorrect datetime value ‘0000-00-00 00:00:00‘ for column-CSDN博客

1 如果具备系统权限那么直接修改my.ini 配置文件,找到sql_mode行,修改为如下重启mysql即可。sql_mode = ‘STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER’

2 在没有系统权限,我们有本地库权限情况下如何处理,我们可以使用

  SELECT @@sql_mode;

就可以查到当前系统的SQL_mode配置,发现配置里有NO_ZERO_DATE,NO_ZERO_IN_DATE,这时我们使用以下命令,临时设置SQLmode模式,它只对本次会话有效,如果系统刷新后就需要我们重新设置。

SET @@sql_mode = 'STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER';

3 还有办法,不需要更改系统的SQL_mode模式,可以修改表结构,即将表中的date/datetime字段临时修改为VarChar字段,

ALTER TABLE mytemp CHANGE c10 c10 VARCHAR(100) NULL

这时进行数据更新,将‘0000-00-00’ 替换为正常的日期字符串,在使用ALTER 命令修改表字段,这时表中的字段会自动转为日期类型,字段中不能有非法字符,也可以在VarChar类型时将字段设为NULL再将字段改回日期类型。经过验证此方法不会丢失字段的值。这个方法对于系统影响最小,需要的系统权限也最小。

image-20240207105414397

导入成功

image-20240207105459870

请写出商户陈欧的的身份证号码;(答案格式: 18 位数字)

SELECT * FROM `payment`.`pay_listuser` WHERE `payment`.`pay_listuser`.`Shh` LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`UserName` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR `payment`.`pay_listuser`.`UserType` LIKE '%陈欧%' OR `payment`.`pay_listuser`.`status` LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`RegDate` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`qq` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`Compellation` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`MobilePhone` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`Tel` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`IdentificationCard` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`Address` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`Province` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`City` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR `payment`.`pay_listuser`.`Zt` LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`AffirmTitle` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR CAST(`payment`.`pay_listuser`.`AffirmAnswer` AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci LIKE '%陈欧%' OR `payment`.`pay_listuser`.`t0` LIKE '%陈欧%' OR `payment`.`pay_listuser`.`PayBank` LIKE '%陈欧%' OR `payment`.`pay_listuser`.`Diaodan_OnOff` LIKE '%陈欧%' OR `payment`.`pay_listuser`.`money` LIKE '%陈欧%' OR `payment`.`pay_listuser`.`Diaodan_User_OnOff` LIKE '%陈欧%'

513212521252325123
登录后台查看–商户 或者数据库中查询
SELECT IdentificationCard FROM pay_listuser where Compellation =‘陈欧’;

请写出商户编号为 10020 总的提款数额。(答案格式保留 3 位小数如: 0.123)

重构网站看起来直观一点,之前就差起apache2这一步了,查看报错

[root@localhost html]# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root@localhost html]# journalctl -xe
                                                     Do
                                                     allow this access for now by executing:
                                                     # ausearch -c 'httpd' --raw | audit2allow -M my-httpd
                                                     # semodule -i my-httpd.pp
                                                     
Feb 06 18:58:55 localhost.localdomain setroubleshoot[13533]: SELinux is preventing /usr/sbin/httpd from name_bind access on the tcp_socket port 63201. For complete SELinux mes
Feb 06 18:58:55 localhost.localdomain python[13533]: SELinux is preventing /usr/sbin/httpd from name_bind access on the tcp_socket port 63201.

开了selinux,关关掉掉再重启就行了

/etc/selinux/config

image-20240207110021621

[root@localhost ~]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2024-02-06 19:01:05 PST; 10s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 6183 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 5525 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 6245 (mysqld)
    Tasks: 27
   CGroup: /system.slice/mysqld.service
           └─6245 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Feb 06 19:01:01 localhost.localdomain systemd[1]: Starting MySQL Server...
Feb 06 19:01:05 localhost.localdomain systemd[1]: Started MySQL Server.
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# 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:111             0.0.0.0:*               LISTEN      1/systemd           
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      6047/dnsmasq        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      5533/sshd           
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      5526/cupsd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      5925/master         
tcp6       0      0 :::3306                 :::*                    LISTEN      6245/mysqld         
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
tcp6       0      0 :::22                   :::*                    LISTEN      5533/sshd           
tcp6       0      0 ::1:631                 :::*                    LISTEN      5526/cupsd          
tcp6       0      0 ::1:25                  :::*                    LISTEN      5925/master         
tcp6       0      0 :::63201                :::*                    LISTEN      6334/httpd   

image-20240207110210861

找后台

[root@localhost ~]# cat /var/log/httpd/access_log* | grep admin | head -n 10 | awk -F ' ' '{print $11}'
"-"
"http://192.168.100.151:63201/admin"
"http://192.168.100.151:63201/admin"
"http://192.168.100.151:63201/admin"
"http://192.168.100.151:63201/admin"
"http://192.168.100.151:63201/admin"
"-"
"-"
"http://192.168.100.151:63201/admin"
"-"

登录,抓包,查报错

image-20240207110559196

[root@localhost html]# grep -rn '账号或密码错误'
Lib/Action/User/AppAction.class.php:78:                            "ReturnMessage" => $this->TransCode("账号或密码错误")
Lib/Action/User/AppAction.class.php:135:                            "ReturnMessage" => $this->TransCode("账号或密码错误")
Runtime/Cache/Home/c88bee5f8db8fa729e887a4d64452806.php:35:                                     alert("账号或密码错误!"+data);
Runtime/Cache/SjtAdminSjt/c88bee5f8db8fa729e887a4d64452806.php:35:                                      alert("账号或密码错误!"+data);
Tpl/SjtAdminSjt/Index/login.html:35:                                    alert("账号或密码错误!"+data);
Tpl/SjtAdminSjt/Index/loginlogin.html:40:                                       alert("账号或密码错误!"+str);
[root@localhost html]# cat Tpl/SjtAdminSjt/Index/login.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><{:C("WEB_NAME")}>管理后台登录</title>
<js href='/Public/User/js/jquery-1.7.2.js' />
<script type="text/javascript">
function check(){

        if($("#UserName").val() == ""){
                alert("用户名不能为空!");
                $("#UserName").focus();
                return false;
        }

        if($("#PassWord").val() == ""){
                alert("密码不能为空!");
                $("#PassWord").focus();
                return false;
        }


        /
        $.ajax({
                        type:'POST',
                        url:"/SjtAdminSjt_Sjtadminsjt_denglu.html",
                        data:"UserName="+ $("#UserName").val() + "&PassWord=" + $("#PassWord").val(),
                        dataType:'text',
                        success:function(data){
                                if(data==1){
                                        alert("登录成功!");
                                        location.href = "/SjtAdminSjt";
                                }else{

                                        alert("账号或密码错误!"+data);

                                        }
                                ///
                                },
                        error:function(str){
                                //
                                }
                        });
        

        return false;

}

和抓包的结果一样,向/SjtAdminSjt_Sjtadminsjt_denglu.html发起请求,应该是配置了伪静态

image-20240207111128751

   if($UserName == NULL || $UserName == "" || $PassWord == NULL || $PassWord == "" ){
            exit("no");
        }else{
            $Sjtadminsjt = M("Sjtadminsjt");
            $list = $Sjtadminsjt->where("SjtUserName = '".$UserName."' and SjtPassWord = '".md5($PassWord)."'")->select();
            $SjtUserType = $Sjtadminsjt->where("SjtUserName = '".$UserName."' and SjtPassWord = '".md5($PassWord)."'")->getField("SjtUserType");
            if($list){
                session("SjtUserName",$UserName);
                //$_SESSION["SjtUserName"] = $UserName;
                session("SjtUserType",$SjtUserType);
                //$_SESSION["SjtUserType"] = $SjtUserType;
                //exit("ok".session("SjtUserName")."|".session("SjtUserType"));
                echo 1;
                                exit;
            }else{
                exit("no");
            }
        }

密码就是简单的md5加密,自己配一个123456加上去就可以了

image-20240207111247159

image-20240207111335908image-20240207112034574

  • 13
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值