[WebGoat 5.4-02] Access Control Flaws
1. Using an Access Control Matrix
Role(역할)기반의 접근제어에서 role은 액세스허용과 권한을 표현한다. 사용자는 하나 이상의 role을 할당 받을 수 있다.
role기반의 접근제어는 role허용관리와 role할당으로 구성된다.
잘못된 관리는 허용되지 않은 사용자가 리소스에 접근할 수 있는 취약점을 가지게 된다.
이 문제에서는 이 사이트에 접근제어규칙을 탐색하는 것이다. [Admin]그룹만 "Account Manager"리소스에 접근할 수 있다.
해답: 단순하게 Account manger 리소스에 접근할 수 있는 사용자를 순서대로 찾아본다.
select resource: 를 "Account Manager"로 선택하고, Change user 값을 순서대로 바꿔 [Check Access]
버튼을 클릭해보면 "Larry"가 권한을 가지고 있다는 메시지가 출력된다.
2. Bypass a Path Based Access Control Scheme
경로에 기초한 Access Control에서 공격자는 적절한 경로정보를 유추해서 쉽게 원하는 경로에 침입할 수 있다. 그로 인해 공격자는 자신이 유추한 경로를 사용하여 원하는 파일에 접근할 수 있다.
톰켓의 사용자 환경설정 파일인 tomcat/conf/tomcat-users.xml 파일에 접근해 본다.
[해답]
현재 디렉토리는d:\Security\LABS\WebGoat-5.4-OWASP_Standard_Win32\WebGoat-5.4\tomcat\webapps\WebGoat\lesson_plans\English 이다.
TamperData 에서 start tamper해둔 상태로,
화면에서 파일을 하나 선택해서 [View File] 버튼을 클릭한다.
POST파라메터인 File을 /../../../../../conf/tomcat-users.xml 로 변경하여 요청을 전송한다.
LAB: Role Based Access Control
개념: 역할 기반의 접근 통제에서 역할이란 접근 허가와 특권을 의미한다. 이런 방식의 접근 통제에서는 역할허가관리와 역할할당의 두 부분으로 이루어지는데 결함이 존재하는 접근 통제 체계에서는 유저에게 허가되지 않은 접근을 허용할 수 있다.
Stage 1: Bypass Business Layer Access Control
사원데이터 삭제 기능은 관리자 권한이 주어져야 수행할 수 있다.
하지만 권한 체크가 제대로 이루어져 있지 않은 경우라면 일반 사원인 tom이 해당 정보를 삭제하는
취약점을 가질 수 있다.
해답: Tom으로 login한다.
[ViewProfile] 버튼을 클릭하여 전달되는 요청을 Tamper Data 한다.
action을 ViewProfile 에서 DeleteProfile로 변경하여 전송한다.
Tom의 Profile이 삭제되었다는 성공메시지가 출력되는것을 확인할 수 있다.
Stage 2: Add Business Layer Access Control
Developer 버전에서만 수행할 수 있다.
Stage 3: Bypass Data Layer Access Control
일반사원의 권한으로 다른 사원의 정보를 볼 수 있는 결함을 찾는다.
Tom으로 로그인하여 ViewProfile을 클릭한다.
TamperData를 통해 employee_id를 108(Bruce)로 수정하여 전송하면, Bruce의 사원정보를 확인할 수 있다.
Stage 4: Add Data Layer Access Control
Developer 버전에서만 수행할 수 있다.
3. Remote Admin Access
어플리케이션은 관리자 인터페이스를 가지고 있다. 특정권한을 가진 사용자에게만 접근 가능하게 하고 일반 유저에게는 보이지 않는다.
[해답]
tomcat의 관리자 계정은 /admin으로 접근 가능하다.
즉 http://localhost/WebGoat/attack?admin=true
WebGoat: Access Control Flaws 솔루션 비디오 보기
- Using an Access Control Matrix [View | Download]
- Bypass a Path Based Access Control Scheme [View | Download]
- LAB: Role Based Access Control
- Remote Admin Access [View | Download]
In a role-based access control scheme, a role represents a set of access permissions and privileges. A user can be assigned one or more roles. A role-based access control scheme normally consists of two parts: role permission management and role assignment. A broken role-based access control scheme might allow a user to perform accesses that are not allowed by his/her assigned roles, or somehow allow privilege escalation to an unauthorized role.In a path based access control scheme, an attacker can traverse a path by providing relative path information. Therefore an attacker can use relative paths to access files that normally are not directly accessible by anyone, or would otherwise be denied if requested directly. Remote Admin Access: applications will often have an administrative interface that allows privileged users access to functionality that normal users shouldn't see. The application server will often have an admin interface as well. Size: N/A