본문 바로가기

전체 글

(304)
Dreamhack : patch 문제 링크https://dreamhack.io/wargame/challenges/49 patchflag를 그리는 루틴을 분석하고 가려진 flag를 보이게 해주세요. Reference GDI+ - Win32 apps | Microsoft Docs Graphics Functions - Win32 apps | Microsoft Docs File — x64dbg documentationdreamhack.io 풀이 기존의 exe 파일을 실행하면 아래와 같다. 검은색의 박스가 정답 flag를 가리고 있다는 생각이 든다. 그렇다면 해당 검정 박스를 그리는 로직이 코드 내에 있을 것이고, 아래에서 살펴보도록 한다. 0FF000000h 는 ARGB 형식으로 완전 불투명한 검정을 의미한다. 참고 (ARGB)더보기..
Dreamhack : simple-operation 문제 링크https://dreamhack.io/wargame/challenges/836 simple-operationDescription 우리의 친구 아모가 미션을 주었습니다. "내가 원하는 결과가 나오도록 값을 입력해 줘!" 주어진 바이너리를 분석하고 알맞은 값을 입력하면 플래그가 출력됩니다. 플래그는 flag 파일에dreamhack.io 풀이 해당 문제는 nc로 해당 호스트에 접근 시, Random number 가 출력이 되고, Input? 이 printf 된 이후에 사용자 입력 값을 받는다. 그 후에 Result 값과 Try again이라는 문자열이 반환된다. 위 그림 2에서 Try again 문자열을 확인할 수 있고, 위 분기문을 확인했을 때, strcmp 비교를 한 후 왼쪽과 오른쪽 분기로..
portswigger : Modifying serialized data types 문제 링크https://portswigger.net/web-security/deserialization/exploiting/lab-deserialization-modifying-serialized-data-types Lab: Modifying serialized data types | Web Security AcademyThis lab uses a serialization-based session mechanism and is vulnerable to authentication bypass as a result. To solve the lab, edit the serialized object ...portswigger.net 풀이 이전 문제와 같이, wiener 계정으로 로그인 시, 세션이 생성되며, b..
portswigger : Modifying serialized objects 문제 링크https://portswigger.net/web-security/deserialization/exploiting/lab-deserialization-modifying-serialized-objects Lab: Modifying serialized objects | Web Security AcademyThis lab uses a serialization-based session mechanism and is vulnerable to privilege escalation as a result. To solve the lab, edit the serialized object in ...portswigger.net  풀이 wiener 계정으로 로그인 시, 위 그림 1과 같이 세션이 생성된다.   해당..
portswigger : Information disclosure in error messages 문제 링크https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-in-error-messages Lab: Information disclosure in error messages | Web Security AcademyThis lab's verbose error messages reveal that it is using a vulnerable version of a third-party framework. To solve the lab, obtain and submit the version ...portswigger.net  풀이  오류 메시지를 통해 프레임워크의 버전을 알아내는 문제이다.   원래 파라미터 p..
Dreamhack : rev-basic-5 문제 링크https://dreamhack.io/wargame/challenges/19 rev-basic-5Reversing Basic Challenge #5 이 문제는 사용자에게 문자열 입력을 받아 정해진 방법으로 입력값을 검증하여 correct 또는 wrong을 출력하는 프로그램이 주어집니다. 해당 바이너리를 분석하여 correct를 출dreamhack.io  풀이  위 그림 1에서 빨간 박스는 해당 문제의 주요 로직을 나타낸다.   디컴파일하여 위 그림 2와 같이 확인이 가능하다. 그림 1의 어셈블리 연산에서도 확인이 가능했지만, 사용자 입력 값 배열의 앞, 뒤 원소를 더한 값이 아래 그림 3의 chall05의 원소들과 같아야 한다.   chall05_byte = [ 0xAD, 0xD8, 0xC..
Dreamhack : rev-basic-4 문제 링크https://dreamhack.io/wargame/challenges/18 rev-basic-4Reversing Basic Challenge #4 이 문제는 사용자에게 문자열 입력을 받아 정해진 방법으로 입력값을 검증하여 correct 또는 wrong을 출력하는 프로그램이 주어집니다. 해당 바이너리를 분석하여 correct를 출dreamhack.io 풀이  해당 문제에서 주요한 부분은 위 그림 1과 같다.   해당 로직을 디컴파일(F5)하여 확인하면 위와 같다.  사용자 입력 값을 대상으로 4비트 이동 ( >> 4 )을 하고, 16을 곱하기 (   정답 배열의 메모리 주소가 가리키는 값은 위 그림 3과 같다.  Python>list(get_bytes(0x00007FF659DF3000,28))[..
Dreamhack : rev-basic-3 문제 링크https://dreamhack.io/wargame/challenges/17 rev-basic-3Reversing Basic Challenge #3 이 문제는 사용자에게 문자열 입력을 받아 정해진 방법으로 입력값을 검증하여 correct 또는 wrong을 출력하는 프로그램이 주어집니다. 해당 바이너리를 분석하여 correct를 출dreamhack.io  풀이 이번 문제는 바로 정답을 찾기보다는 좀 더 메모리 구조와 흐름을 이해해보기 위해 자세히 포스팅 해보았다.  먼저, Bp를 아래 그림 1을 기준으로 scanf를 받은 후 나오는 call 함수에 걸었다.   [rsp+32]가 가리키는 주소에는 사용자가 입력한 문자열이 위치해 있다. 이때, 위 그림 1과 같이 lea rcx, [rsp+32]를 통..