삽질블로그
[Kali_Linux] Restrict Device Access | bWAPP | Missing Functional Level Access Control 본문
[Kali_Linux] Restrict Device Access | bWAPP | Missing Functional Level Access Control
삽질장인 2020. 9. 4. 13:40본 내용은 교육 과정에서 필요한 실습 목적으로 구성된 것이며, 혹시라도 개인적인 용도 및 악의적인 목적으로 사용할 경우, 법적 책임은 본인에게 있다는 것을 알려드립니다.
1. Missing Functional Level Access Control
- OWASP Top 10 A7 - 기능 수준의 접근 통제 누락
- 접근 통제 및 검증이 서버 설정, 관리 부분에서 제대로 구성되지 않았을 때 중요 자원 접근이 가능한 취약점이다.
- Ex) 디렉토리 접근, 파일 접근, 파일 다운로드 및 업로드
2. Restrict Device Access
- PC와 모바일 웹 서비스를 동일한 환경에서 관리될 경우, 두개 중에 하나라도 취약점이 있다면 문제가 발생한다.
- 그렇기 때문에 PC와 모바일 웹 서비스 환경을 분리하여 관리하는 것을 권장하며, 클라이언트 장치에 따라서 웹 서비스 연결을 제공해야 한다.
3. 'Use-Agent Switcher' 다운로드
- 웹 페이지 접속시 user-agent를 변경하여 접속이 가능한 프로그램
- 다운로드 사이트 : https://addons.mozilla.org/ko/firefox/addon/user-agent-switcher-revived/?src=search
============================실습=========================================
1) 첫 화면 (스마트폰/테블릿 PC가 아니라는 메세지 출력 확인)
2) User-Agent Switcher를 다운로드 했다면 보인다. 클릭
3) apple을 클릭하고 페이지 새로고침
4) 스마트폰/테블릿 PC라는 메세지 출력 확인
5) Burp Suite > Intercept is on으로 변경
6) User-Agent Switcher > 안드로이드 클릭하고 새로고침
7) User-Agent 'Android' 확인 > Inttercept is off
8) 스마트폰/테블릿 PC라는 메세지 출력 확인
9) 'restrict_device_access.php' 파일 내용 확인
bee@bee-box:/var/www/bWAPP$ vi restrict_device_access.php
~ 중간 생략 ~
include("functions_external.php");
include("selections.php");
$message = "";
$authorized_device = false;
// No differences between the security levels
switch($_COOKIE["security_level"])
{
case "0" :
$authorized_device = check_user_agent();
break;
case "1" :
$authorized_device = check_user_agent();
break;
case "2" :
$authorized_device = check_user_agent();
break;
default :
$authorized_device = check_user_agent();
break;
}
function check_user_agent()
{
$user_agent = $_SERVER["HTTP_USER_AGENT"];
// Debugging
// echo $user_agent;
$authorized_device = false;
$devices = array("iPhone", "iPad", "iPod", "Android");
// Searches for a string in an array
foreach($devices as $str)
{
// echo $str;
if(strpos($user_agent, $str) !== false)
{
// Debugging
// echo $user_agent . " contains the word " . $str;
$authorized_device = true;
}
}
return $authorized_device;
}
~ 중간 생략 ~
<?php
if($authorized_device != false)
{
$message = "<font color=\"green\">This is a smartphone or a tablet computer!</font>";
}
else
{
$message = "<font color=\"red\">This is not a smartphone or a tablet computer (Apple/Android)!</font>";
}
echo $message;
?>
:q!