Web Logs Tampering attacks involve an attacker injecting, deleting or otherwise tampering with the contents of web logs typically for the purposes of masking other malicious behavior. Additionally, writing malicious data to log files may target jobs, filters, reports, and other agents that process the logs in an asynchronous attack pattern. This pattern of attack is similar to \'Log Injection-Tampering-Forging\' except that in this case, the attack is targeting the logs of the web server and not the application.
Description
Attack Execution Flow
Step 1
Explore[Determine Application Web Server Log File Format] The attacker observes the system and looks for indicators of which logging utility is being used by the web server.
Determine logging utility being used by application web server (e.g. log4j), only possible if the application is known by the attacker or if the application returns error messages with logging utility information.
[Determina il formato del file di log del server web dell'applicazione] L'attaccante osserva il sistema e cerca indicatori di quale utility di logging venga utilizzata dal server web.
Determina quale utility di logging viene utilizzata dal server web dell'applicazione (ad esempio log4j), possibile solo se l'attaccante conosce l'applicazione o se l'applicazione restituisce messaggi di errore con informazioni sulla utility di logging.
Attack Techniques
-
Determine logging utility being used by application web server (e.g. log4j), only possible if the application is known by the attacker or if the application returns error messages with logging utility information.
Step 2
Experiment[Determine Injectable Content] The attacker launches various logged actions with malicious data to determine what sort of log injection is possible.
Attacker triggers logged actions with maliciously crafted data as inputs, parameters, arguments, etc.
Sperimentazione
[Determinare il contenuto iniettabile] L'attaccante esegue varie azioni registrate con dati dannosi per determinare quale tipo di iniezione nei log sia possibile.
L'attaccante attiva azioni registrate con dati manipolati in modo malevolo come input, parametri, argomenti, ecc.
Attack Techniques
-
Attacker triggers logged actions with maliciously crafted data as inputs, parameters, arguments, etc.
Step 3
Exploit[Manipulate Log Files] The attacker alters the log contents either directly through manipulation or forging or indirectly through injection of specially crafted request that the web server will receive and write into the logs. This type of attack typically follows another attack and is used to try to cover the traces of the previous attack.
Indirectly through injection, use carriage return and/or line feed characters to start a new line in the log file, and then, add a fake entry.
For example: The HTTP request for '/index.html%0A%0DIP_ADDRESS- - DATE_FORMAT] 'GET /forged-path HTTP/1.1' 200 - '-' USER_AGENT' may add the log line into Apache 'access_log' (for example). Different applications may require different encodings of the carriage return and line feed characters.
Directly through log file or database manipulation, use carriage return and/or line feed characters to start a new line in the log file, and then, add a fake entry.
For example: The HTTP request for '/index.html%0A%0DIP_ADDRESS- - DATE_FORMAT] 'GET /forged-path HTTP/1.1' 200 - '-' USER_AGENT' may add the log line into Apache 'access_log' (for example). Different applications may require different encodings of the carriage return and line feed characters.
Directly through log file or database manipulation, modify existing log entries.
[Manipolazione dei Log Files] L'attaccante altera il contenuto dei log, sia direttamente attraverso manipolazione o falsificazione, sia indirettamente tramite iniezione di richieste appositamente create che il server web riceve e scrive nei log. Questo tipo di attacco generalmente segue un altro attacco ed è utilizzato per cercare di coprire le tracce dell'attacco precedente.
Indirettamente, tramite iniezione, utilizza caratteri di carriage return e/o line feed per iniziare una nuova riga nel file di log e quindi aggiungere una voce falsa.
Ad esempio: La richiesta HTTP per "/index.html%0A%0DIP_ADDRESS- - DATE_FORMAT]" "GET /forged-path HTTP/1.1" 200 - "-" USER_AGENT" può aggiungere la riga di log nel file "access_log" di Apache (ad esempio). Diverse applicazioni potrebbero richiedere codifiche differenti dei caratteri di carriage return e line feed.
Direttamente, tramite manipolazione del file di log o del database, utilizza caratteri di carriage return e/o line feed per iniziare una nuova riga nel file di log e quindi aggiungere una voce falsa.
Ad esempio: La richiesta HTTP per "/index.html%0A%0DIP_ADDRESS- - DATE_FORMAT]" "GET /forged-path HTTP/1.1" 200 - "-" USER_AGENT" può aggiungere la riga di log nel file "access_log" di Apache (ad esempio). Diverse applicazioni potrebbero richiedere codifiche differenti dei caratteri di carriage return e line feed.
Direttamente, tramite manipolazione del file di log o del database, modificare le voci di log esistenti.
Attack Techniques
-
Directly through log file or database manipulation, use carriage return and/or line feed characters to start a new line in the log file, and then, add a fake entry. For example: The HTTP request for "/index.html%0A%0DIP_ADDRESS- - DATE_FORMAT] "GET /forged-path HTTP/1.1" 200 - "-" USER_AGENT" may add the log line into Apache "access_log" (for example). Different applications may require different encodings of the carriage return and line feed characters.
-
Indirectly through injection, use carriage return and/or line feed characters to start a new line in the log file, and then, add a fake entry. For example: The HTTP request for "/index.html%0A%0DIP_ADDRESS- - DATE_FORMAT] "GET /forged-path HTTP/1.1" 200 - "-" USER_AGENT" may add the log line into Apache "access_log" (for example). Different applications may require different encodings of the carriage return and line feed characters.IT: Direttamente tramite manipolazione del file di log o del database, utilizzare i caratteri di carriage return e/o line feed per iniziare una nuova riga nel file di log e successivamente aggiungere una voce falsa. Ad esempio: La richiesta HTTP per "/index.html%0A%0DIP_ADDRESS- - DATE_FORMAT]" "GET /forged-path HTTP/1.1" 200 - "-" USER_AGENT" può inserire la riga di log nel "access_log" di Apache (ad esempio). Diverse applicazioni potrebbero richiedere codifiche differenti dei caratteri di carriage return e line feed.
-
Directly through log file or database manipulation, modify existing log entries.IT: Direttamente tramite manipolazione del file di log o del database, utilizzare i caratteri di carriage return e/o line feed per iniziare una nuova riga nel file di log e successivamente aggiungere una voce falsa. Ad esempio: La richiesta HTTP per "/index.html%0A%0DIP_ADDRESS- - DATE_FORMAT]" "GET /forged-path HTTP/1.1" 200 - "-" USER_AGENT" può inserire la riga di log nel "access_log" di Apache (ad esempio). Diverse applicazioni potrebbero richiedere codifiche differenti dei caratteri di carriage return e line feed.