Beebox[iFrame Injection]
목차
❓ iFrame : HTML문서 내 다른 HTML을 출력하는 태그
❓iFrame Injection : HTML인젝션에서 사용하는 것처럼 iFrame 태그를 삽입하는데
URL을 입력 후 프레임크기를 0으로 설정하면 희생자의 페이지에는 표시되지 않으며
악성사이트에 접근하는 등의 공격을 할 수 있음
1. LOW
(1) 실행
![Beebox[iFrame Injection] - 1. LOW - undefined - (1) 실행 Beebox[iFrame Injection] - 1. LOW - undefined - (1) 실행](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
현재페이지의 소스코드를 보니
iFrame에 있는 내용을 보여주고 있네요
출력한 페이지는 robots.txt, 크기는 가로세로 250인 정사각형!
iframe에 호출할 페이지를 하나 만들어 놓을게요
![Beebox[iFrame Injection] - 1. LOW - undefined - (1) 실행 Beebox[iFrame Injection] - 1. LOW - undefined - (1) 실행](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
iframe으로 출력할 페이지를 만들었어요
(2) 소스코드 확인
![Beebox[iFrame Injection] - 1. LOW - undefined - (2) 소스코드 확인 Beebox[iFrame Injection] - 1. LOW - undefined - (2) 소스코드 확인](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
확인해보니 첫 번째 파라미터에 iframe의 주소가 들어가고
나머지는 높이와 너비로 들어가는 것을 확인할 수 있네요
그러면 첫번째 파라미터에 싹다 적어주면 되겠네요
(3) 공격
![Beebox[iFrame Injection] - 1. LOW - undefined - (3) 공격 Beebox[iFrame Injection] - 1. LOW - undefined - (3) 공격](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
http://172.17.234.101/bWAPP/iframei.php?ParamUrl=robots.txt" width=250 height=1000></iframe>
<iframe src="iframe_hacked.php" width=0 height=0></iframe>
&ParamWidth=0&ParamHeight=0
▶ [그림3] URL창에 입력한 내용
우선 해당 파라미터가 어떻게 들어가는지를 확인했으니
ParamUrl에 있는 robots.txt를 그대로 출력하기위해 "로 닫는 것을 추가!
바로 뒤에 iframe의 크기를 직접 입력!(250, 1000)
▶ 높이를 1000으로 하는 이유는 뒤에 파라미터가 출력되기 때문에..
이걸 한참아래로 보내기위해서?
그리고 </frame>으로 닫고,
호출할 iframe을 작성!!
▶ 호출한 페이지를 너비와 높이를 0으로 하는 이유는 보이지 않도록 하기 위해서!
원래있던 파라미터도 맨 뒤에 붙여주면 됩니다.
(파라미터를 삭제하면 정상적으로 안나오기 때문이죠!!)
![Beebox[iFrame Injection] - 1. LOW - undefined - (3) 공격 Beebox[iFrame Injection] - 1. LOW - undefined - (3) 공격](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
iframe에서 호출한 것을 확인할 수 있네요!!
![Beebox[iFrame Injection] - 1. LOW - undefined - (3) 공격 Beebox[iFrame Injection] - 1. LOW - undefined - (3) 공격](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
쿠키정보를 알림으로 출력하라네요
![Beebox[iFrame Injection] - 1. LOW - undefined - (3) 공격 Beebox[iFrame Injection] - 1. LOW - undefined - (3) 공격](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
정상적인페이지와 크게 차이는 없지만 쿠키정보를 출력하게 되었네요!!
2. Medium & High
(1) 대응방안
![Beebox[iFrame Injection] - Beebox[iFrame Injection] -](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
htmlspecialchars함수는
", ', &, <, >을 UTF-8로 변환해요.
'Wargame > BeeBox' 카테고리의 다른 글
Beebox[OS Command Injection - Blind] (0) | 2021.03.30 |
---|---|
Beebox[OS Command Injection] (0) | 2021.03.29 |
Beebox[HTML Injection - Stored (Blog)] (0) | 2021.03.29 |
Beebox[HTML Injection - Reflected (URL)] (0) | 2021.03.29 |
Beebox[HTML Injection - Reflected (POST)] (0) | 2021.03.27 |
댓글