An adversary exploits weaknesses in input validation on web-mail servers to execute commands on the IMAP/SMTP server. Web-mail servers often sit between the Internet and the IMAP or SMTP mail server. User requests are received by the web-mail servers which then query the back-end mail server for the requested information and return this response to the user. In an IMAP/SMTP command injection attack, mail-server commands are embedded in parts of the request sent to the web-mail server. If the web-mail server fails to adequately sanitize these requests, these commands are then sent to the back-end mail server when it is queried by the web-mail server, where the commands are then executed. This attack can be especially dangerous since administrators may assume that the back-end server is protected against direct Internet access and therefore may not secure it adequately against the execution of malicious commands.
Description
Attack Execution Flow
Step 1
Explore[Identify Target Web-Mail Server] The adversary first identifies the web-mail server they wish to exploit.
[Identifica il server Web-Mail di destinazione] L'avversario identifica innanzitutto il server web-mail che desidera sfruttare.
Step 2
Experiment[Identify Vulnerable Parameters] Once the adversary has identified a web-mail server, they identify any vulnerable parameters by altering their values in requests. The adversary knows that the parameter is vulnerable if the web-mail server returns an error of any sort. Ideally, the adversary is looking for a descriptive error message.
Assign a null value to a parameter being used by the web-mail server and observe the response.
Assign a random value to a parameter being used by the web-mail server and observe the response.
Add additional values to a parameter being used by the web-mail server and observe the response.
Add non standard special characters (i.e.: \, ', ', @, #, !, |) to a parameter being used by the web-mail server and observe the response.
Eliminate a parameter being used by the web-mail server and observe the response.
[Identificare Parametri Vulnerabili] Una volta che l'attaccante ha identificato un server web-mail, individua eventuali parametri vulnerabili modificandone i valori nelle richieste. L'attaccante sa che il parametro è vulnerabile se il server web-mail restituisce un errore di qualsiasi tipo. Idealmente, l'attaccante cerca un messaggio di errore descrittivo.
Assegna un valore nullo a un parametro utilizzato dal server web-mail e osserva la risposta.
Assegna un valore casuale a un parametro utilizzato dal server web-mail e osserva la risposta.
Aggiungi valori aggiuntivi a un parametro utilizzato dal server web-mail e osserva la risposta.
Aggiungi caratteri speciali non standard (ad esempio: \, ', ", @, #, !, |) a un parametro utilizzato dal server web-mail e osserva la risposta.
Elimina un parametro utilizzato dal server web-mail e osserva la risposta.
Attack Techniques
-
Assign a null value to a parameter being used by the web-mail server and observe the response.
-
Add non standard special characters (i.e.: \, ', ", @, #, !, |) to a parameter being used by the web-mail server and observe the response.IT: Assegna un valore nullo a un parametro utilizzato dal server di web-mail e osserva la risposta.
-
Assign a random value to a parameter being used by the web-mail server and observe the response.IT: Assegna un valore nullo a un parametro utilizzato dal server di web-mail e osserva la risposta.
-
Add additional values to a parameter being used by the web-mail server and observe the response.IT: Assegna un valore nullo a un parametro utilizzato dal server di web-mail e osserva la risposta.
-
Eliminate a parameter being used by the web-mail server and observe the response.IT: Assegna un valore nullo a un parametro utilizzato dal server di web-mail e osserva la risposta.
Step 3
Experiment[Determine Level of Injection] After identifying all vulnerable parameters, the adversary determines what level of injection is possible.
Evaluate error messages to determine what IMAP/SMTP command is being executed for the vulnerable parameter. Sometimes the actually query will be placed in the error message.
If there aren't descriptive error messages, the adversary will analyze the affected functionality to deduce the possible commands that could be being used by the mail-server.
[Determinare il livello di injection] Dopo aver identificato tutti i parametri vulnerabili, l'attaccante determina quale livello di injection è possibile.
Valuta i messaggi di errore per determinare quale comando IMAP/SMTP viene eseguito per il parametro vulnerabile. A volte la query effettiva sarà inserita nel messaggio di errore.
Se non ci sono messaggi di errore descrittivi, l'attaccante analizzerà la funzionalità interessata per dedurre i possibili comandi che potrebbero essere utilizzati dal mail-server.
Attack Techniques
-
Evaluate error messages to determine what IMAP/SMTP command is being executed for the vulnerable parameter. Sometimes the actually query will be placed in the error message.
-
If there aren't descriptive error messages, the adversary will analyze the affected functionality to deduce the possible commands that could be being used by the mail-server.IT: Valuta i messaggi di errore per determinare quale comando IMAP/SMTP viene eseguito per il parametro vulnerabile. A volte, la query effettiva verrà inserita nel messaggio di errore.
Step 4
Exploit[Inject IMAP/SMTP Commands] The adversary manipulates the vulnerable parameters to inject an IMAP/SMTP command and execute it on the mail-server.
Structure the injection as a header, body, and footer. The header contains the ending of the expected message, the body contains the injection of the new command, and the footer contains the beginning of the expected command.
Each part of the injection payload needs to be terminated with the CRLF (%0d%0a) sequence.
[Inject IMAP/SMTP Commands] L'attore malevolo manipola i parametri vulnerabili per iniettare un comando IMAP/SMTP ed eseguirlo sul mail-server.
Struttura l'iniezione come intestazione, corpo e piè di pagina. L'intestazione contiene la fine del messaggio previsto, il corpo contiene l'iniezione del nuovo comando, e il piè di pagina contiene l'inizio del comando atteso.
Ogni parte del payload di iniezione deve essere terminata con la sequenza CRLF (%0d%0a).
Attack Techniques
-
Structure the injection as a header, body, and footer. The header contains the ending of the expected message, the body contains the injection of the new command, and the footer contains the beginning of the expected command.
-
Each part of the injection payload needs to be terminated with the CRLF (%0d%0a) sequence.IT: Struttura l'iniezione come intestazione, corpo e piè di pagina. L'intestazione contiene la fine del messaggio atteso, il corpo contiene l'iniezione del nuovo comando e il piè di pagina contiene l'inizio del comando atteso.
Consequences
Consequence Information
{'impacts': [], 'impacts_translate': [], 'scopes': [], 'scopes_translate': []}