0% found this document useful (0 votes)
297 views3 pages

Exploit:W32/JPG Vulnerability, Exploit:W32/JPG Vulnerability, MS04-028 Exploit

There are several scenarios where viewing a JPEG file could potentially run malicious code: 1. Opening a fake JPEG file that is actually an executable file type could run malware installed by the file. 2. There may be vulnerabilities in applications used to open JPEG files that allow injected code to execute arbitrary code. 3. JPEG files loaded from servers could contain embedded code like PHP that executes if the web application parsing the file has security issues. 4. Files with a JPEG extension may actually be other file types like JavaScript that could install keyloggers or other malware, especially on older browsers.

Uploaded by

jonnybanana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
297 views3 pages

Exploit:W32/JPG Vulnerability, Exploit:W32/JPG Vulnerability, MS04-028 Exploit

There are several scenarios where viewing a JPEG file could potentially run malicious code: 1. Opening a fake JPEG file that is actually an executable file type could run malware installed by the file. 2. There may be vulnerabilities in applications used to open JPEG files that allow injected code to execute arbitrary code. 3. JPEG files loaded from servers could contain embedded code like PHP that executes if the web application parsing the file has security issues. 4. Files with a JPEG extension may actually be other file types like JavaScript that could install keyloggers or other malware, especially on older browsers.

Uploaded by

jonnybanana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

is possible when there is a security hole in the application which you are using to open JPG file (or

any other file), unless it's fake JPEG image.


So there are few scenarios:
• running fake JPEG
Non-experienced user downloaded file and thinks it's the image (because the icon looks like
an image and OS doesn't show you extension), but it could be any executable file (.exe,
.vbs, .msi, .cmd, .bat, etc.). So if your operating system doesn't warn you when you
run fake image file, the image could be shown with keylogger installed. So always check
your extension before opening suspicious files.
• opening JPEG
Any media file (and other) could carry some injected code designed to trick specific
applications. They could have some flaws in parsing some data (e.g. in EXIF). So if
application is buggy, the injected data could trick the application to run some arbitrary code.
For example: Exploit:W32/JPG Vulnerability, Exploit:W32/JPG Vulnerability, MS04-028
exploit
• loading JPEG from the server
You could inject some programming code into JPEG, so once it's parsed by web application,
it can execute any code in the given language. For example JPEG file can include special
tags (<?php, ?>) and when parsed by badly coded application from the webhosting
company (file_get_contents(), fopen(), readfile()), it could erase your
www account.
Example JPEG: php-logo-virus.jpg
which has this code embedded into the file:
ÿØÿàJFIF``ÿáfExifMM* éV@HQQQ<style>body{font-size: 0;}
h1{font-size: 12px !important;}</style><h1><?php echo
"<hr />THIS IMAGE COULD ERASE YOUR WWW ACCOUNT, it
shows you the PHP info instead...<hr />"; phpinfo();
__halt_compiler(); ?></h1>

So once you open above image, add view-source: before the address, so you'll see the
injected PHP script. Note that the above image is just the example, and it won't do anything.
Source: Code injection – a simple PHP virus carried in a JPEG image
• loading JPEG file which isn't JPEG file
When you see the link such as: http://www.example.com/foo.jpeg, you think it's
an image, but it doesn't have to. It all depends on its MIME type and by loading it, you
actually can load the script (such as Javascript), and on vulnerable/old browser, could install
a keylogger. On the other hand, your browser doesn't have to be old to achieve that.
For example, you're visiting the page which is fake bank website, or can be real bank (with
some forum where somebody uploaded fake JPEG via XSS). So to implement XSS
Keylogger, you just need document.onkeypress + AJAX calls. See: XSS Keylogger
Also check: XSS Filter Evasion Cheat Sheet
• loading JPEG which is SVG
Sometimes when you load media file and web-browser recognise it as different image, it
fallback to the format which was recognised. And what you can do in SVG files, you can
include html and JavaScript into it (if your web-browser allows that), see: Create a table in
SVG (and another one).

è possibile quando c'è un buco di sicurezza nell'applicazione che stai usando per aprire il file JPG (o
qualsiasi altro file), a meno che non sia un'immagine JPEG falsa.

Quindi ci sono pochi scenari:

in esecuzione JPEG fasullo

L'utente non esperto ha scaricato il file e pensa che sia l'immagine (perché l'icona ha l'aspetto di
un'immagine e il sistema operativo non mostra l'estensione), ma potrebbe essere qualsiasi file
eseguibile (.exe, .vbs, .msi, .cmd,. pipistrello, ecc.). Quindi se il tuo sistema operativo non ti avvisa
quando esegui file immagine falsi, l'immagine potrebbe essere mostrata con keylogger installato.
Quindi controlla sempre la tua estensione prima di aprire file sospetti.

aprendo JPEG

Qualsiasi file multimediale (e altro) potrebbe contenere un codice iniettato progettato per
ingannare applicazioni specifiche. Potrebbero avere alcuni difetti nell'analisi di alcuni dati (ad
esempio in EXIF). Quindi, se l'applicazione è bacata, i dati inseriti potrebbero ingannare
l'applicazione per eseguire codice arbitrario.

Ad esempio: Exploit: Vulnerabilità W32 / JPG, Exploit: W32 / JPG Vulnerability, MS04-028
exploit

caricamento JPEG dal server

È possibile inserire del codice di programmazione in JPEG, quindi una volta analizzato
dall'applicazione Web, è possibile eseguire qualsiasi codice nella lingua specificata. Ad esempio il
file JPEG può includere tag speciali (<? Php,?>) E se analizzato da un'applicazione mal codificata
dalla società di web hosting (file_get_contents (), fopen (), readfile ()), potrebbe cancellare il tuo
account www.

Esempio JPEG: php-logo-virus.jpg

che ha questo codice incorporato nel file:

ÿØÿàJFIF``ÿáfExifMM *
éV @ HQQQ <style> body {font-size: 0;} h1 {font-size: 12px! important;} </ style> <h1> <?
php echo "<hr /> QUESTA IMMAGINE POTREBBE CANCELLARE IL TUO ACCOUNT
WWW, ti mostra invece le informazioni PHP ... <hr /> "; phpinfo (); __halt_compiler (); ?> </ H1>

Quindi, una volta aperta l'immagine sopra, aggiungi view-source: prima dell'indirizzo, così vedrai
lo script PHP iniettato. Nota che l'immagine sopra è solo un esempio e non farà nulla.
Fonte: iniezione di codice: un semplice virus PHP contenuto in un'immagine JPEG

caricamento del file JPEG che non è un file JPEG

Quando vedi il link come: http://www.example.com/foo.jpeg, pensi che sia un'immagine, ma non
è necessario. Dipende tutto dal suo tipo MIME e caricandolo, puoi effettivamente caricare lo script
(come Javascript), e su browser vulnerabile / vecchio, potresti installare un keylogger. D'altra parte,
il tuo browser non deve essere vecchio per raggiungere questo obiettivo.

Ad esempio, stai visitando la pagina che è un falso sito web della banca, o può essere una vera
banca (con qualche forum in cui qualcuno ha caricato il falso JPEG tramite XSS). Quindi per
implementare XSS Keylogger, devi solo document.onkeypress + chiamate AJAX. Vedi: XSS
Keylogger

Controllare anche: XSS Filter Evasion Cheat Sheet

caricamento di JPEG che è SVG

A volte quando si carica il file multimediale e il browser Web lo riconosce come immagine
diversa, esegue il fallback sul formato che è stato riconosciuto. E cosa puoi fare nei file SVG, puoi
includere html e JavaScript (se il tuo browser lo consente), vedi: Creare una tabella in SVG (e
un'altra).

You might also like