[WebGoat] General_HTTP Basics
·
Webhacking/WebGoat
Concept브라우저와 웹 애플리케이션 간의 데이터 전송을 이해하기 위한 기본 사항과 HTTP Proxy를 사용하여 요청/응답을 트랩하는 방법을 설명한다.Goals사용자는 버튼을 조작하여 힌트 보기, HTTP 요청 매개변수 표시, HTTP 요청 쿠키 표시, Java 소스 코드 보기 등을 통해 WebGoat의 기능에 익숙해진다.OWASP Zed Attack Proxy를 처음 사용해 볼 수도 있다.How HTTP works모든 HTTP 트랜잭션은 동일한 일반 형식을 따른다. 각 클라이언트 요청과 서버 응답은 요청 또는 응답 라인, 헤더 섹션, 엔티티 본문의 세 부분으로 구성된다.클라이언트는 다음과 같이 거래를 시작한다.클라이언트는 서버에 접속하여 문서 요청을 보낸다. GET 요청은 URL 매개변수를 포함할 ..
[WebGoat] 설치 및 WebWolf 연동 방법
·
Webhacking/WebGoat
사전 준비WebGoat Github 에서 파일을 다운로드 한다.jdk version 11 이상으로 다운로드 한다.해당 사진에서 빨간색 박스 표시가 된 webgoat-server-8.2.2.jar, webwolf-8.2.2.jar 을 다운받는다.WebGoat Settingjava 최소 version 11 이상으로 설치해준다.[Window + R] -> [sysdm.cpl] -> [고급] -> [환경 변수] -> [시스템 변수] 순으로 클릭한다.CMD 에서 java version 확인java -versionWebGoat 설치 경로 이동 및 확인cd E:\webgoatjava -jar webgoat-server-8.2.2.jar정상적으로 설치되었다.WebWolf 설치 경로 이동 및 확인java -jar web..
[WAF] ModSecurity + OWASP CRS: Apache 구축 과정 정리
·
Webhacking
Apache ModSecurity 설치sudo apt install libapache2-mod-security2ModSecurity 설정 파일 복사 및 수정sudo cp /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.confsudo vim /etc/modsecurity/modsecurity.confSecRuleEngine DetectionOnly -> SecRuleEngine On 으로 수정한 후 :wq! 로 저장한다.security2 모듈 활성화sudo a2enmod security2Apache 설정에서 Include 설정sudo vim /etc/apache2/sites-enabled/000-default.conf ..
[WAF] ModSecurity + OWASP CRS: Nginx 구축 과정 정리
·
Webhacking
ModSecurity 설정설정 파일 복사 및 수정sudo cp modsecurity.conf-recommended modsecurity.confmodsecurity.conf-recommemded 가 원본 설정파일이다.modsecurity.conf-recommemded 원본 파일을 modsecurity.conf 로 복사한다.sudo vim modsecurity.conf SecRuleEngine DetectionOnly -> SecRuleEngine On 으로 바꿔준 후 :wq! 로 저장한다.Nginx, ModSecurity 모듈 빌드ModSecurity-nginx 모듈 클론cd ~git clone --depth 1 https://github.com/SpiderLabs/ModSecurity-nginx.git..
[Dreamhack] blind-command
·
Webhacking/Dreamhack
blind-commandRead the flag file XD Reference Web Hackingdreamhack.ioCode#!/usr/bin/env python3from flask import Flask, requestimport osapp = Flask(__name__)@app.route('/' , methods=['GET'])def index(): cmd = request.args.get('cmd', '') if not cmd: return "?cmd=[cmd]" if request.method == 'GET': '' else: os.system(cmd) return cmdapp.run(host='0.0.0.0', port=800..
[Dreamhack] Carve Party
·
Webhacking/Dreamhack
Carve PartyDescription 할로윈 파티를 기념하기 위해 호박을 준비했습니다! 호박을 10000번 클릭하고 플래그를 획득하세요!dreamhack.io코드 설명$(function() { $('#jack-target').click(function () { counter += 1; if (counter 호박을 클릭했을 때 실행되는 함수이다.최초 선언된 count=0 이 10000 이 될때까지 1씩 카운트를 늘려가며 pumkin[ ] 리스트 값을 전환한다.count가 10000 이 되면, make( ) 함수를 호출하여 flag를 표시한다.해당 함수가 10000번 실행하게 된다면 html 상에서 클릭을 10000 번 했다고 인지한다.문제 풀이익스플로잇var i = 0;while(i위의 코..
[Dreamhack] web-ssrf
·
Webhacking/Dreamhack
web-ssrfflask로 작성된 image viewer 서비스 입니다. SSRF 취약점을 이용해 플래그를 획득하세요. 플래그는 /app/flag.txt에 있습니다. Reference Exercise: SSRFdreamhack.iocode#!/usr/bin/python3from flask import ( Flask, request, render_template)import http.serverimport threadingimport requestsimport os, random, base64from urllib.parse import urlparseapp = Flask(__name__)app.secret_key = os.urandom(32)try: FLAG = open("./flag..
[Dreamhack] file-download-1
·
Webhacking/Dreamhack
file-download-1File Download 취약점이 존재하는 웹 서비스입니다. flag.py를 다운로드 받으면 플래그를 획득할 수 있습니다. Reference Introduction of Webhackingdreamhack.iocode#!/usr/bin/env python3import osimport shutilfrom flask import Flask, request, render_template, redirectfrom flag import FLAGAPP = Flask(__name__)UPLOAD_DIR = 'uploads'@APP.route('/')def index(): files = os.listdir(UPLOAD_DIR) return render_template('index...
[Dreamhack] image-storage
·
Webhacking/Dreamhack
image-storagephp로 작성된 파일 저장 서비스입니다. 파일 업로드 취약점을 이용해 플래그를 획득하세요. 플래그는 /flag.txt에 있습니다. Reference Server-side Basicdreamhack.iocode Image Storage Home List Upload Upload and Share Image ! index.php 이다. Image Storage ..
[Dreamhack] command-injection-1
·
Webhacking/Dreamhack
command-injection-1특정 Host에 ping 패킷을 보내는 서비스입니다. Command Injection을 통해 플래그를 획득하세요. 플래그는 flag.py에 있습니다. Reference Exercise: Command Injectiondreamhack.iocode#!/usr/bin/env python3import subprocessfrom flask import Flask, request, render_template, redirectfrom flag import FLAGAPP = Flask(__name__)@APP.route('/')def index(): return render_template('index.html')@APP.route('/ping', methods=['GET',..