목록전체 글 (81)
topcue
Bare-Metal Binary ModificationModifying Shared Library Behavior Using LD_PRELOADInjecting a Code SectionInjecting an ELF Section: A High-Level OverviewOverwriting the PT_NOTE SegmentRedirecting the ELF Entry PointUsing elfinject to Inject an ELF SectionCalling Injected CodeEntry Point ModificationHijacking Constructors and DestructorsHijacking GOT EntriesHijacking PLT EntriesRedirecting Direct a..
Binary Analysis PropertiesInterprocedural and Intraprocedural AnalysisFlow-SensitivityContext-SensitivityControl-Flow AnalysisLoop DetectionCycle DetectionData-Flow AnalysisReaching Definitions Analysisuse-def ChainsProgram Slicing참고 및 인용Binary Analysis PropertiesInterprocedural and Intraprocedural Analysis함수 단위 분석의 또 다른 이점은 규모 가변성(scalability)이다.일부 분석 방법은 실제로 적용할 때 제대로 동작하지 않는 경우가 많다. 발생 가능한 조건..
Static DisassemblyLinear DisassemblyRecursive DisassemblyDynamic DisassemblyCode Coverage StrategiesTest SuitesFuzzingSymbolic ExecutionStructuring Disassembled Code and DataStructuring CodeFunction DetectionControl Flow GraphsCall GraphsObject-Oriented CodeStructuring DataDecompileIntermediate RepresentationsEffects of Compiler Settings on Disassembly참고 및 인용Static Disassembly정적 디스어셈블(static dis..
StackStack FrameFunction CallsFunction PrologueFunction EpilogueCalling ConventionsCalling Conventions for x86Calling Conventions for x64Flow of ControlStack and Frame Analysis참고 및 인용Stack스택은 반환 주소(return address), 함수 매개 변수, 지역 변수 등 함수 호출과 관련된 데이터를 위한 메모리 영역이다.스택(Stack)은 후입선출(LIFO, Last-In-First-Out) 자료구조다. 바이너리의 스택이라는 이름이 여기서 유래되었다.Stack Layout (Reversed top-bottom for easy explanation).LIFO 방식..
Executable HeaderSection HeadersSectionsProgram HeadersLazy Binding참고 및 인용리눅스 기반 시스템의 기본 바이너리 형식인 ELF(Executable and Linkable Format)을 살펴보자.ELF는 실행 가능한 바이너리 파일, 목적 파일, 공유 라이브러리, 코어 덤프 등에서 사용되는 형식이다. 여기서는 64비트의 실행 가능한 바이너리 파일을 중심으로 살펴보겠다.A 64-bit ELF binary at a glanceELF 바이너리는 ELF 파일 헤더, 프로그램 헤더, 그리고 섹션들과 섹션 헤더들로 이루어져 있다.Executable Header모든 ELF 파일은 executable header로 시작하며, /usr/include/elf.h에서 확..
The C Compilation ProcessPreprocessingCompilationAssemblyLinkingSymbols and Stripped BinariesLoading and Executing a Binary참고 및 인용The C Compilation Process바이너리 코드(binary code)란 컴퓨터 시스템에 의해 실행되는 0과 1의 조합만으로 표현되는 일련의 기계어 명령의 집합을 말한다.프로그램 = 바이너리 코드(기계어 명령어) + 데이터(변수, 상수 등)일반적으로 binary executable file을 바이너리(binary)라고 부른다.컴파일이란 C/C++과 같은 프로그래밍 언어로 쓰인 소스코드를 컴퓨터 프로세서가 이해할 수 있는 기계어 코드로 바꾸는 과정을 말한다. 전체 컴..
지금까지는 Bridged로 가상머신의 서버에 직접 접속하거나, 공유기에서 각 서버로 포트 포워딩 설정을 해서 라우터 주소:포트로 서버에 접속했다.그러다 PC1 → PC2 → PC2의 서버로 접속할 필요가 생겨서 노트북을 이용한 포트 포워딩 방법을 정리하려 한다.윈도우 netsh의 PortProxy 기능을 이용하면 윈도우에서 포트 포워딩을 할 수 있다고 한다.사실 L7에서 netsh 프로그램이 패킷을 전달해 주는 방식이라 proxy에 해당하지만 다들 포트 포워딩이라고 부른다. 때문에 src IP 주소가 바뀐다고 한다.참고로 윈도우 방화벽의 인바운드 규칙에서 TCP와 포트를 설정해 줘야 한다.netsh의 portproxy 기능은 세 가지만 쓰면 될 것 같다.상태 확인netsh interface portpro..
The Way To ThinkOverall OrganizationFile Organization: The InodeDirectory OrganizationFree Space ManagementAccess Paths: Reading and WritingCaching and BufferingThe Way To ThinkUNIX의 전형적인 File system 형태인 VSFS(Very Simple File System)을 다룰 것이다.또한 data structures와 access methods 두 가지 관점에서 file system을 다룰 것이다.block: 4KB, Sector: 512B (atomic)Overall Organization디스크를 4KB block 단위로 나눌 수 있다.vsfs에서는 아래 ..