본문 바로가기
해킹/DVWA

DVWA 실습 9. Weak Session IDs (Medium)

by yenua 2022. 5. 29.
반응형
Objective
This module uses four different ways to set the dvwaSession cookie value, the objective of each level is to work out how the ID is generated and then infer the IDs of other system users.

쿠키 'dvwaSession'이 생성되는 규칙을 찾아내보자.

 

generate 버튼을 눌러보았을 때, 쿠키 값이 아래와 같이 뒷자리들만 조금씩 증가하는 것을 볼 수 있었다.

1653930246

1653930266

1653930274

1653930283

...

 

계속해서 눌러본 결과, 1초에 1씩 증가하는 것 같다.

실제로 코드를 보면, php에서 time()으로 받아온 값을 세션키로 발급해주고 있었다.

<?php

$html = "";

if ($_SERVER['REQUEST_METHOD'] == "POST") {
    $cookie_value = time();
    setcookie("dvwaSession", $cookie_value);
}
?>

 

반응형