This attack is a form of Cross-Site Scripting (XSS) where malicious scripts are embedded in elements that are not expected to host scripts such as image tags (<img>), comments in XML documents (< !-CDATA->), etc. These tags may not be subject to the same input validation, output validation, and other content filtering and checking routines, so this can create an opportunity for an adversary to tunnel through the application's elements and launch a XSS attack through other elements. As with all remote attacks, it is important to differentiate the ability to launch an attack (such as probing an internal network for unpatched servers) and the ability of the remote adversary to collect and interpret the output of said attack.
Description
Attack Execution Flow
Step 1
Explore[Survey the application for user-controllable inputs] Using a browser or an automated tool, an adversary records all entry points for inputs that happen to be reflected in a client-side non-script element. These non-script elements can be located in the HTML content (head, body, comments), in an HTML tag, XML, CSS, etc.
Use a spidering tool to follow and record all non-static links that are likely to have input parameters (through forms, URL, fragments, etc.) actively used by the Web application.
Use a proxy tool to record all links visited during a manual traversal of the web application.
Use a browser to manually explore the website and analyze how it is constructed. Many browsers' plugins are available to facilitate the analysis or automate the discovery.
[Esamina l'applicazione alla ricerca di input controllabili dall'utente] Utilizzando un browser o uno strumento automatizzato, un adversary registra tutti i punti di ingresso per gli input che vengono riflessi in un elemento non script lato client. Questi elementi non script possono trovarsi nel contenuto HTML (head, body, commenti), in un tag HTML, XML, CSS, ecc.
Utilizza uno strumento di spidering per seguire e registrare tutti i link non statici che probabilmente contengono parametri di input (tramite form, URL, frammenti, ecc.) attivamente utilizzati dall'applicazione Web.
Utilizza uno strumento proxy per registrare tutti i link visitati durante una navigazione manuale dell'applicazione web.
Utilizza un browser per esplorare manualmente il sito web e analizzare come è costruito. Sono disponibili numerosi plugin per browser che facilitano l'analisi o automatizzano la scoperta.
Attack Techniques
-
Use a spidering tool to follow and record all non-static links that are likely to have input parameters (through forms, URL, fragments, etc.) actively used by the Web application.
-
Use a proxy tool to record all links visited during a manual traversal of the web application.IT: Utilizza uno strumento di spidering per seguire e registrare tutti i link non statici che probabilmente contengono parametri di input (tramite form, URL, frammenti, ecc.) attivamente utilizzati dall'applicazione Web.
-
Use a browser to manually explore the website and analyze how it is constructed. Many browsers' plugins are available to facilitate the analysis or automate the discovery.IT: Utilizza uno strumento di spidering per seguire e registrare tutti i link non statici che probabilmente contengono parametri di input (tramite form, URL, frammenti, ecc.) attivamente utilizzati dall'applicazione Web.
Step 2
Experiment[Probe identified potential entry points for XSS vulnerability] The adversary uses the entry points gathered in the 'Explore' phase as a target list and injects various common script payloads to determine if an entry point actually represents a vulnerability and to characterize the extent to which the vulnerability can be exploited.
Manually inject various script payloads into each identified entry point using a list of common script injection probes that typically work in a client-side non-script elements context and observe system behavior to determine if script was executed. Since these probes may have to be injected in many different types of non-script elements, they should cover a variety of possible contexts (CSS, HTML tag, XML, etc.).
Use an automated injection attack tool to inject various script payloads into each identified entry point using a list of common script injection probes that typically work in a client-side non-script elements context and observe system behavior to determine if script was executed. Since these probes may have to be injected in many different types of non-script elements, they should cover a variety of possible contexts (CSS, HTML tag, XML, etc.).
Use a proxy tool to record results of the created requests.
Sperimentazione
[Probe identificata potenziali punti di ingresso per vulnerabilità XSS] L’avversario utilizza i punti di ingresso raccolti nella fase "Explore" come lista di obiettivi e inietta vari payload di script comuni per determinare se un punto di ingresso rappresenta effettivamente una vulnerabilità e per caratterizzare l’estensione dello sfruttamento possibile della vulnerabilità.
Inietta manualmente vari payload di script in ogni punto di ingresso identificato utilizzando una lista di probe di iniezione di script comuni che tipicamente funzionano nel contesto di elementi non script lato client e osserva il comportamento del sistema per determinare se lo script è stato eseguito. Poiché questi probe potrebbero dover essere iniettati in molti diversi tipi di elementi non script, devono coprire una varietà di possibili contesti (CSS, tag HTML, XML, ecc.).
Utilizza uno strumento di attacco di injection automatizzato per iniettare vari payload di script in ogni punto di ingresso identificato utilizzando una lista di probe di iniezione di script comuni che tipicamente funzionano nel contesto di elementi non script lato client e osserva il comportamento del sistema per determinare se lo script è stato eseguito. Poiché questi probe potrebbero dover essere iniettati in molti diversi tipi di elementi non script, devono coprire una varietà di possibili contesti (CSS, tag HTML, XML, ecc.).
Utilizza uno strumento proxy per registrare i risultati delle richieste create.
Attack Techniques
-
Use an automated injection attack tool to inject various script payloads into each identified entry point using a list of common script injection probes that typically work in a client-side non-script elements context and observe system behavior to determine if script was executed. Since these probes may have to be injected in many different types of non-script elements, they should cover a variety of possible contexts (CSS, HTML tag, XML, etc.).
-
Manually inject various script payloads into each identified entry point using a list of common script injection probes that typically work in a client-side non-script elements context and observe system behavior to determine if script was executed. Since these probes may have to be injected in many different types of non-script elements, they should cover a variety of possible contexts (CSS, HTML tag, XML, etc.).IT: Utilizzare uno strumento di attacco di injection automatizzato per iniettare vari payload di script in ciascun punto di ingresso identificato utilizzando un elenco di sondaggi di injection di script comuni che tipicamente funzionano in un contesto di elementi non script lato client e osservare il comportamento del sistema per determinare se lo script è stato eseguito. Poiché questi sondaggi potrebbero dover essere iniettati in molti diversi tipi di elementi non script, essi dovrebbero coprire una varietà di possibili contesti (CSS, tag HTML, XML, ecc.).
-
Use a proxy tool to record results of the created requests.IT: Utilizzare uno strumento di attacco di injection automatizzato per iniettare vari payload di script in ciascun punto di ingresso identificato utilizzando un elenco di sondaggi di injection di script comuni che tipicamente funzionano in un contesto di elementi non script lato client e osservare il comportamento del sistema per determinare se lo script è stato eseguito. Poiché questi sondaggi potrebbero dover essere iniettati in molti diversi tipi di elementi non script, essi dovrebbero coprire una varietà di possibili contesti (CSS, tag HTML, XML, ecc.).
Step 3
Experiment[Create malicious XSS content] Once the adversary has determined which entry points are vulnerable to XSS, they will interact with the web application to store the malicious content. Because of the nature of this attack, it is mostly carried out through stored XSS, although it is possible to perform this attack using reflected XSS. The adversary can have many goals, from stealing session IDs, cookies, credentials, and page content from a victim.
Store a malicious script on a page, disguised as a non-script element, that will execute when viewed by the victim.
Use a tool such as BeEF to store a hook into the web application. This will alert the adversary when the victim has accessed the content and will give the adversary control over the victim's browser, allowing them access to cookies, user screenshot, user clipboard, and more complex XSS attacks.
[Creare contenuto XSS dannoso] Una volta che l'attore malevolo ha determinato quali punti di ingresso sono vulnerabili a XSS, interagirà con l'applicazione web per memorizzare il contenuto dannoso. A causa della natura di questo attacco, viene principalmente eseguito tramite XSS memorizzato, anche se è possibile effettuare questo attacco utilizzando XSS riflesso. L'attaccante può avere molteplici obiettivi, dal rubare session ID, cookie, credenziali e contenuti della pagina da una vittima.
Memorizza uno script dannoso su una pagina, mascherato come un elemento non-script, che verrà eseguito quando visualizzato dalla vittima.
Utilizza uno strumento come BeEF per memorizzare un hook nell'applicazione web. Questo avviserà l'attore malevolo quando la vittima ha accessato il contenuto e darà all'attaccante il controllo sul browser della vittima, consentendogli di accedere a cookie, screenshot dell'utente, clipboard dell'utente e di eseguire attacchi XSS più complessi.
Attack Techniques
-
Use a tool such as BeEF to store a hook into the web application. This will alert the adversary when the victim has accessed the content and will give the adversary control over the victim's browser, allowing them access to cookies, user screenshot, user clipboard, and more complex XSS attacks.
-
Store a malicious script on a page, disguised as a non-script element, that will execute when viewed by the victim.IT: Utilizza uno strumento come BeEF per memorizzare un hook all'interno dell'applicazione web. Questo avviserà l'avversario quando la vittima avrà accesso al contenuto e conferirà all'avversario il controllo sul browser della vittima, consentendogli di accedere ai cookie, agli screenshot dell'utente, agli appunti dell'utente e di eseguire attacchi XSS più complessi.
Step 4
Exploit[Get victim to view stored content] In order for the attack to be successful, the victim needs to view the stored malicious content on the webpage.
Send a phishing email to the victim containing a URL that will direct them to the malicious stored content.
Simply wait for a victim to view the content. This is viable in situations where content is posted to a popular public forum.
[Indurre la vittima a visualizzare contenuti memorizzati] Perché l'attacco abbia successo, la vittima deve visualizzare il contenuto malevolo memorizzato sulla pagina web.
Invia un'email di phishing alla vittima contenente un URL che la indirizzerà al contenuto memorizzato malevolo.
Semplicemente attendi che la vittima visualizzi il contenuto. Questo metodo è praticabile in situazioni in cui i contenuti vengono pubblicati su un forum pubblico molto frequentato.
Attack Techniques
-
Send a phishing email to the victim containing a URL that will direct them to the malicious stored content.
-
Simply wait for a victim to view the content. This is viable in situations where content is posted to a popular public forum.IT: Invia un'email di phishing alla vittima contenente un URL che la indirizzerà al contenuto memorizzato dannoso.