블로그 이미지
Flying Mr.Cheon youGom

Recent Comment»

Recent Post»

Recent Trackback»

« 2024/5 »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

 
 

AFL + Android / AOAP Porting and Fuzzing

보안/도구 | 2019. 6. 28. 12:25 | Posted by youGom

AOSP 를 다운로드 받고, 여기에 AFL 다운로드 받은 후 env 환경 설정 및 설치 진행

AOSP 다운받아보니 약 7.2기가정도 됨, 다운로드 실행시켜두고 다음날 확인했었음

git : https://github.com/ele7enxxh/android-afl

 

ele7enxxh/android-afl

Fuzzing Android program with american fuzzy lop (AFL) - ele7enxxh/android-afl

github.com

아래 접힌 내용은 위 git에서 설명 해주는 글 갈무리해둔 것임(영어임)

...더보기

android-afl

Fuzzing Android program with american fuzzy lop (AFL)

android-afl: Android-enabled version of AFL

android-afl is a modified version of AFL that supports fuzzing on Android, the SHM has been replaced with ASHMEM because of Android disable SHM in the kernel. Extra codes have been added in afl-gcc.c, afl-as.c and afl-as.h to support arm arch. Android.mk has been added to support Android build system and llvm_mode. Please refer to the android-afl.patch for more details.

Requirements

  • Android source code(e.g. 6.0.1) is needed.
  • llvm-5.0 and clang-5.0 are needed to provide support for llvm_mode on Android, you can install using apt-get install llvm clang on Ubuntu.

Build

first, download and build the Android open-source project (AOSP). then, download all the android-afl source code to AOSP folder:

cd AOSP

git clone https://github.com/ele7enxxh/android-afl

to build:

. build/envsetup.sh

cd android-afl mm

this will produce all afl binaries that you can use on host(e.g. Linux) or Android.

Usage

afl-gcc/afl-g++, afl-clang/afl-clang++ and afl-clang-fast/afl-clang-fast++ are all supported in android-afl. Please refer to android-afl-test for more details.

To fuzz

if you want fuzz on host, you should use the afl-fuzz in the $(HOST_OUT)/bin folder, otherwise you need to use the afl-fuzz in the $(target_OUT)/bin folder. To ingore bind_to_free_cpu, the AFL_NO_AFFINITY=1 should been set. Please refer to AFl README for more details.

Note

not all of the AFL tools have been tested on Android, but afl-fuzz has been working great on android-6.0.1 for me.

adb devices adb push ../out/target/product/generic/system/bin/ /data/local/tmp

 

한글로 간단히,

1) AOSP 다운받고 이 사이트에서 알려준데로 셋팅하고, Android open-source project (AOSP).

2) 'cd AOSP' 로 이동해서,

   AFL 받고,

   git clone https://github.com/ele7enxxh/android-afl

 

ele7enxxh/android-afl

Fuzzing Android program with american fuzzy lop (AFL) - ele7enxxh/android-afl

github.com

3) AOSP 폴더 위에서 환경셋 실행하고,

  . build/envsetup.sh

4) AFL을 빌드해준다

   cd android-afl

   mm

 

나는 빌드중에, O_CREAT 오류가 두군데 발생함, afl-fuzz.c, afl-showmap.c 여기서 발생했는데,

오류 내용이 open()함수 사용에서 O_CREAT 플래그 어쩌고 하길래, 그냥 그 플래그를 추가해주고 빌드시킴.

그랬더니, 약간의 수고 끝에 빌드 컴플릿 뜸. AFL 빌드시간 3분 54초 걸렸음.

 

Android 환경 셋 끝~

 

AOSP 다운로드 받고, 이 사이트에서 가이드 해주는게 더 빡센듯;; ㅋㅋ

'보안 > 도구' 카테고리의 다른 글

AFL fuzzer / fuzzing  (0) 2019.06.27
hollywood 스크립트 설치 (헐리우드)  (0) 2019.01.25
[도구] ADB 명령어 정리 내용 ( am/pm/capture/mongkey 등 )  (0) 2018.03.19
공유 게시판 이더패드  (0) 2015.03.30
[NMAP] MS-SQL pentest  (0) 2014.11.17
:

AFL fuzzer / fuzzing

보안/도구 | 2019. 6. 27. 17:42 | Posted by youGom

하기 사이트에 잘 정리 되어 있음

ref : https://www.lazenca.net/display/TEC/AFL+-+American+fuzzy+lop

 

AFL - American fuzzy lop - TechNote - Lazenca.0x0

Excuse the ads! We need some help to keep our site up. List Description AFL(American Fuzzy Lop)은 테스트 케이스의 코드 적용 범위(Code coverage)를 효율적으로 늘리기 위해 유전자 알고리즘(Genetic algorithm)을 사용하는 fuzzer입니다.지원 가능한 OS는 Linux, OpenBSD, FreeBSD, NetBSD의 32bit 및 64bit를 지원합니다.Mac

www.lazenca.net

...더보기
Description
  • AFL(American Fuzzy Lop)은 테스트 케이스의 코드 적용 범위(Code coverage)를 효율적으로 늘리기 위해 유전자 알고리즘(Genetic algorithm)을 사용하는 fuzzer입니다.
    • 지원 가능한 OS는 Linux, OpenBSD, FreeBSD, NetBSD의 32bit 및 64bit를 지원합니다.
      • MacOS X 및 Solaris에서도 작동하지만 일부 제약이 있습니다. 
    • 지원 가능한 프로그램 언어는 C, C++, Objective C를 지원합니다.
    • 지원 가능한 컴파일러는 gcc, g++, clang, clang++를 지원합니다.
    • 지원 가능한 테스트 방식은 White-box, Black-box를 지원합니다.
      • 리눅스에서는 QEMU 옵션을 사용해서 블랙 박스 바이너리를 퍼징 할 수 있습니다.

Site

Install

$ wget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz $ tar -xvf afl-latest.tgz $ cd afl-2.49b/ $ make $ sudo make install

Commands

CommandDescriptionBasic methods of useafl-analyzeafl-clangafl-clang++afl-cminafl-fuzzafl-g++afl-gccafl-gotcpuafl-plotafl-tminafl-whatsup

파일 포맷 분석기

afl-analyze -i <test case file> target_app

clang wrapper

clang 명령어와 동일합니다.

clang++ wrapper

clang++ 명령어와 동일합니다.

중복되는 테스트 케이스 제거

afl-cmin -i <test case dir> -o <output dir> target_app

AFL의 코드 퍼지

afl-fuzz -i <test case dir> -o <output dir> target_app

g++ wrapper

g++명령어와 동일합니다.

gcc wrapper

gcc 명령어와 동일합니다.

CPU 선점 비율 출력

afl-gotcpu

진행률 출력- "gnuplot" 설치 필요

afl-plot <afl state dir> <graph output dir>

테스트 케이스 최소화

afl-tmin -i <test case file> -o <output file> target_app

상태 점검 도구

afl-whatsup <afl_sync_dir>

Description of commands

afl-fuzz

  • 해당 도구는 바이너리를 대상으로 다양한 퍼징을 시도합니다.

White-box, Black-box test

  • 해당 도구는 White-box, Black-box 테스트를 지원합니다.
    • White-box를 사용하기 위해서 afl에서 제공하는 컴파일러를 이용해 바이너리를 빌드해야 합니다.
    • Black-box를 사용하기 위해 afl에서는 QEMU를 사용하며, -Q 옵션을 이용해 사용할 수 있습니다.
  • 다음과 같이 White-box 테스트를 할 수 있습니다.

White-box

afl-fuzz -i <test case dir> -o <output dir> target_app

  • 다음과 같이 black-box 테스트를 할 수 있습니다.

Black-box

afl-fuzz -Q -i <test case dir> -o <output dir> target_app

데이터 입력 옵션

Standard input

afl-fuzz -i <test case dir> -o <output dir> target_app [params...]

File input

afl-fuzz -i <test case dir> -o <output dir> target_app @@

Parallel fuzzing

  • 해당 도구는 병렬 퍼징을 지원합니다.

    • afl-fuzz의 모든 복사본은 하나의 CPU 코어를 차지합니다. 

    • 즉,n 코어 시스템에서는 거의 항상 성능 저하없이 거의 동시 n 개의 동시 퍼징 작업을 실행할 수 있습니다 

      • afl-gotcpu 도구를 사용하여 확인할 수 있음

    • 사실 멀티 코어 시스템에서 단 하나의 작업에만 의존한다면 하드웨어를 충분히 활용 하지 못할 것 입니다.

    • 병렬 처리가 일반적으로 올바른방법입니다.

Single-system parallelization

  • 단일 시스템 병렬화를 이용하기 위해 로컬 시스템의 여러 코어에 단일 작업을 병렬로 연결하기위한 빈 디렉토리("sync dir")를 생성합니다.

    • 해당 디렉토리에 모든 인스턴스가 공유됩니다.

  • 다음과 같이 마스터 인스턴스(-M)를 실행합니다.

마스터 인스턴스

./afl-fuzz -i testcase_dir -o sync_dir -M fuzzer01 [...other stuff...]

    • 다음과 같이 보조 인스턴스(-S)를 실행합니다.

보조 인스턴스

$ ./afl-fuzz -i testcase_dir -o sync_dir -S fuzzer02 [...other stuff...] $ ./afl-fuzz -i testcase_dir -o sync_dir -S fuzzer03 [...other stuff...]

Multi-system parallelization

  • 다중 시스템 병렬화 처리의 기본 작동 원리는 단일 시스템 병렬화에서 설명한 메커니즘과 비슷합니다. 
  • 두 가지 작업을 수행하는 간단한 스크립트가 필요합니다.
  • 로컬 시스템에서 모든 <fuzzer_id> 디렉토리의 "/queue/" 경로 아래에 있는 파일들을 압축합니다.

for s in {1..10}; do ssh user@host${s} "tar -czf - sync/host${s}_fuzzid*/[qf]*" >host${s}.tgz done

  • 압축된 파일을 모든 컴퓨터에 파일을 배포하고 압축을 해제합니다

for s in {1..10}; do for d in {1..10}; do test "$s" = "$d" && continue ssh user@host${d} 'tar -kxzf -' <host${s}.tgz done done

Parallel fuzzing using AFL

afl-analyze

  • 해당 도구는 Test case의 파일 포맷을 분석합니다.

    • 데이터 스트림으로 부터 순차적으로 전달되는 데이터들을 가져오며, 매 입력마다 바이너리의 동작을 관찰합니다.

  • 다음과 같은 정보를 유추 할 수 있습니다.

    • no-op block

    • Critical stream

    • "magic value" 섹션

    • 내용으로 의심되는 영역

    • 길이 필드로 의심되는 영역

    • 체크섬 블럭으로 의심되는 영역

    • 체크썸 또는 Magic 값으로 의심되는 영역

  • 다음과 같이 사용할 수 있습니다.

afl-analyze -i testcase/test1.txt ./test

lazenca0x0@ubuntu:~/Documents/AFL/test$ afl-analyze -i testcase/test1.txt ./test afl-analyze 2.49b by <lcamtuf@google.com> [+] Read 4 bytes from 'testcase/test1.txt'. [*] Performing dry run (mem limit = 50 MB, timeout = 1000 ms)... [*] Analyzing input file (this may take a while)... 01 - no-op block 01 - suspected length field 01 - superficial content 01 - suspected cksum or magic int 01 - critical stream 01 - suspected checksummed block 01 - "magic value" section [000000] a #0a a #0a [+] Analysis complete. Interesting bits: 0.00% of the input file. [+] We're done here. Have a nice day! lazenca0x0@ubuntu:~/Documents/AFL/test$

afl-cmin

  • 해당 도구는 Test case의 중복을 최소화 합니다.
  • 다음과 같이 가장 적합한 test case만을 분리 합니다.
    • 4개의 test case에서 7개의 tuple을 발견했으며, 2개의 파일로 축소했습니다.
    • 여기서 사용된 test case는 아래 "Create to Test cases."에서 생성한 파일을 사용했습니다.

afl-cmin -i testcase/ -o newTestCase/ ./test

lazenca0x0@ubuntu:~/Documents/AFL/test$ afl-cmin -i testcase/ -o newTestCase/ ./test corpus minimization tool for afl-fuzz by <lcamtuf@google.com> [*] Testing the target binary... [+] OK, 4 tuples recorded. [*] Obtaining traces for input files in 'testcase/'... Processing file 4/4... [*] Sorting trace sets (this may take a while)... [+] Found 7 unique tuples across 4 files. [*] Finding best candidates for each tuple... Processing file 4/4... [*] Sorting candidate list (be patient)... [*] Processing candidates and writing output files... Processing tuple 7/7... [+] Narrowed down to 2 files, saved in 'newTestCase/'. lazenca0x0@ubuntu:~/Documents/AFL/test$ cd newTestCase/ lazenca0x0@ubuntu:~/Documents/AFL/test/newTestCase$ ls -al total 16 drwxrwxr-x 2 lazenca0x0 lazenca0x0 4096 Aug 15 20:08 . drwxrwxr-x 5 lazenca0x0 lazenca0x0 4096 Aug 15 20:08 .. -rw-rw-r-- 2 lazenca0x0 lazenca0x0 4 Aug 9 00:18 test1.txt -rw-rw-r-- 2 lazenca0x0 lazenca0x0 9 Aug 9 00:19 test3.txt lazenca0x0@ubuntu:~/Documents/AFL/test/newTestCase$

afl-tmin

  • 해당 도구는 Test case의 최적화를 진행합니다.
  • 최적화되는 내용은 다음과 같습니다.
    • 데이터 블럭의 최소화
    • 기호의 최소화
    • 문자의 최소화
  • 다음과 같이 Test case를 최소화 할 수 있습니다.
    • 68개의 문자가 56개로 변경되었습니다.
    • 임의 문자들이 숫자 0(0x30)으로 변경되었습니다.
    • Test case에 기호가 없었기 때문에 기호의 최소화는 진행되지 않았습니다.

afl-tmin -i result/crashes/id\:000000\,sig\:11\,src\:000000\,op\:havoc\,rep\:128 -o testcaseMin ./test

lazenca0x0@ubuntu:~/Documents/AFL/test$ afl-tmin -i result/crashes/id\:000000\,sig\:11\,src\:000000\,op\:havoc\,rep\:128 -o testcaseMin ./test afl-tmin 2.49b by <lcamtuf@google.com> [+] Read 68 bytes from 'result/crashes/id:000000,sig:11,src:000000,op:havoc,rep:128'. [*] Performing dry run (mem limit = 50 MB, timeout = 1000 ms)... [+] Program exits with a signal, minimizing in crash mode. [*] Stage #0: One-time block normalization... [+] Block normalization complete, 68 bytes replaced. [*] --- Pass #1 --- [*] Stage #1: Removing blocks of data... Block length = 4, remaining size = 68 Block length = 2, remaining size = 56 Block length = 1, remaining size = 56 [+] Block removal complete, 12 bytes deleted. [*] Stage #2: Minimizing symbols (1 code point)... [+] Symbol minimization finished, 0 symbols (0 bytes) replaced. [*] Stage #3: Character minimization... [+] Character minimization done, 0 bytes replaced. [*] --- Pass #2 --- [*] Stage #1: Removing blocks of data... Block length = 4, remaining size = 56 Block length = 2, remaining size = 56 Block length = 1, remaining size = 56 [+] Block removal complete, 0 bytes deleted. File size reduced by : 17.65% (to 56 bytes) Characters simplified : 121.43% Number of execs done : 33 Fruitless execs : path=12 crash=0 hang=0 [*] Writing output to 'testcaseMin'... [+] We're done here. Have a nice day! lazenca0x0@ubuntu:~/Documents/AFL/test$ hexdump result/crashes/id\:000000\,sig\:11\,src\:000000\,op\:havoc\,rep\:128 0000000 81b9 ad13 0000 76e1 04ff 007f eee7 ffff 0000010 64ff 0000 798a 9379 7980 7979 7966 e100 0000020 ff76 7fc0 e700 ffee ffff ffff 7f04 e700 0000030 ffee ffff 0064 6900 7979 7993 7979 0079 0000040 0100 ff00 0000044 lazenca0x0@ubuntu:~/Documents/AFL/test$ hexdump testcaseMin 0000000 3030 3030 3030 3030 3030 3030 3030 3030 * 0000038 lazenca0x0@ubuntu:~/Documents/AFL/test$ cat testcaseMin 00000000000000000000000000000000000000000000000000000000

afl-gotcpu

  • 해당 도구는 afl-fuzz에서 사용중인 cpu 선점 비율을 출력합니다.

afl-gotcpu

lazenca0x0@ubuntu:~$ afl-gotcpu afl-gotcpu 2.49b by <lcamtuf@google.com> [*] Measuring per-core preemption rate (this will take 1.00 sec)... Core #0: CAUTION (231%) >>> CAUTION: You may still have 1 core available. <<< lazenca0x0@ubuntu:~$

afl-plot

  • 해당 도구는 fuzz의 진행 상황을 그래프로 출력합니다.
  • 다음과 같이 해당 프로그램을 실행하면, index.html 파일이 생성됩니다.

afl-plot result/ graph/

lazenca0x0@ubuntu:~/Documents/AFL/test$ afl-plot result/ graph/ progress plotting utility for afl-fuzz by <lcamtuf@google.com> [*] Generating plots... [*] Generating index.html... [+] All done - enjoy your charts! lazenca0x0@ubuntu:~/Documents/AFL/test$

index.html

 

alf-whatsup

  • 해당 도구는 병렬 퍼징을 진행했을 때 개별 fuzzer의 상태를 확인할 수 있습니다.

afl-whatsup result/

lazenca0x0@ubuntu:~/Documents/AFL/test$ afl-whatsup result/ status check tool for afl-fuzz by <lcamtuf@google.com> Individual fuzzers ================== >>> fuzzer1 (0 days, 0 hrs) <<< cycle 1, lifetime speed 1 execs/sec, path 0/2 (0%) pending 2/2, coverage 0.01%, no crashes yet >>> fuzzer2 (0 days, 0 hrs) <<< cycle 1, lifetime speed 1 execs/sec, path 0/2 (0%) pending 2/2, coverage 0.01%, no crashes yet Summary stats ============= Fuzzers alive : 2 Total run time : 0 days, 0 hours Total execs : 0 million Cumulative speed : 2 execs/sec Pending paths : 4 faves, 4 total Pending per fuzzer : 2 faves, 2 total (on average) Crashes found : 0 locally unique lazenca0x0@ubuntu:~/Documents/AFL/test$

Example

Example code

  • 아래 코드는 다음과 같은 동작을 합니다.
    • 사용자로 부터 ID, Password를 입력받습니다.
    • 입력받은 값이 프로그램이 요구하는 값과 일치하면 "Success"를 출력합니다.
    • 그렇지 않을 경우 "Fail"을 출력합니다.
  • 여기서 중요한 부분은 사용자로부터 입력 받는 값에 대한 길이 제한이 없다는 것입니다.
    • 이로 인해 Stack Buffer Overflow가 발생합니다.

test.c

#include <stdio.h> #include <string.h> int main(void){ char login[16]; char password[16]; printf("Login : "); scanf("%s",login); printf("Password : "); scanf("%s",password); if(strcmp(login,"root") == 0){ if(strcmp(password,"toor") == 0){ printf("Success.\n"); return 0; } } printf("Fail.\n"); return 1; }

Create to Test cases.

  • 다음과 같이 Test case를 생성합니다.
    • ID가 틀린 경우
    • Password가 틀린 경우
    • ID, Password 모두 틀린 경우
    • ID, Password 정확한 경우

Create to test cases.

lazenca0x0@ubuntu:~/Documents/AFL/test$ mkdir testcase lazenca0x0@ubuntu:~/Documents/AFL/test$ cd testcase lazenca0x0@ubuntu:~/Documents/AFL/test$ echo -e "a\toor" > test1.txt lazenca0x0@ubuntu:~/Documents/AFL/test$ echo -e "root\na" > test2.txt lazenca0x0@ubuntu:~/Documents/AFL/test$ echo -e "a\na" > test3.txt lazenca0x0@ubuntu:~/Documents/AFL/test$ echo -e "root\toor" > test4.txt lazenca0x0@ubuntu:~/Documents/AFL/test$

White-box testing

Build using afl-gcc.

  • 다음과 같이 AFL에서 제공하는 컴파일러를 이용해 빌드합니다.
    • 빌드된 파일이 정상적으로 동작하는 것을 확인 할 수 있습니다.
    • 테스트를 위해 Canary를 제거 합니다. (-fno-stack-protector)

afl-gcc -o test test.c

lazenca0x0@ubuntu:~/Documents/AFL/test$ afl-gcc -fno-stack-protector -o test test.c afl-cc 2.49b by <lcamtuf@google.com> test.c: In function 'main': test.c:9:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%s",login); ^ test.c:11:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%s",password); ^ afl-as 2.49b by <lcamtuf@google.com> [+] Instrumented 8 locations (64-bit, non-hardened mode, ratio 100%). lazenca0x0@ubuntu:~/Documents/AFL/test$ ./test Login : root Password : toor Success. lazenca0x0@ubuntu:~/Documents/AFL/test$ ./test Login : a Password : a Fail. lazenca0x0@ubuntu:~/Documents/AFL/test$

Run afl-fuzz

  • 다음과 같이 AFL을 실행하면 "uniq crashes"를 발견할 수 있습니다.
    • 테스트 프로그램에서 2개의 Uniq crashes를 발견하였습니다.
  • 옵션은 다음과 같습니다.
    • -i : Test case가 저장된 디렉토리 경로
    • -o : 탐지된 결과를 저장할 디렉토리 경로

Run AFL-fuzz

lazenca0x0@ubuntu:~/Documents/AFL/test$ echo core > /proc/sys/kernel/core_pattern lazenca0x0@ubuntu:~/Documents/AFL/test$ mkdir result lazenca0x0@ubuntu:~/Documents/AFL/test$ afl-fuzz -i testcase/ -o result/ ./test afl-fuzz 2.49b by <lcamtuf@google.com> [+] You have 1 CPU core and 2 runnable tasks (utilization: 200%). [*] Checking core_pattern... [*] Setting up output directories... [+] Output directory exists but deemed OK to reuse. [*] Deleting old session data... [+] Output dir cleanup successful. [*] Scanning 'testcase/'... [+] No auto-generated dictionary tokens to reuse. [*] Creating hard links for all input files... [*] Validating target binary... [*] Attempting dry run with 'id:000000,orig:test1.txt'... [*] Spinning up the fork server... [+] All right - fork server is up. len = 4, map size = 34, exec speed = 1428 us [*] Attempting dry run with 'id:000001,orig:test2.txt'... len = 7, map size = 37, exec speed = 596 us [*] Attempting dry run with 'id:000002,orig:test3.txt'... len = 14, map size = 38, exec speed = 740 us [+] All test cases processed. [+] Here are some useful stats: Test case count : 3 favored, 0 variable, 3 total Bitmap range : 34 to 38 bits (average: 36.33 bits) Exec timing : 596 to 1428 us (average: 921 us) [*] No -t option specified, so I'll use exec timeout of 20 ms. [+] All set and ready to roll! american fuzzy lop 2.49b (test) ┌─ process timing ─────────────────────────────────────┬─ overall results ─────┐ │ run time : 0 days, 0 hrs, 0 min, 17 sec │ cycles done : 16 │ │ last new path : none yet (odd, check syntax!) │ total paths : 3 │ │ last uniq crash : 0 days, 0 hrs, 0 min, 11 sec │ uniq crashes : 2 │ │ last uniq hang : none seen yet │ uniq hangs : 0 │ ├─ cycle progress ────────────────────┬─ map coverage ─┴───────────────────────┤ │ now processing : 1 (33.33%) │ map density : 0.06% / 0.07% │ │ paths timed out : 0 (0.00%) │ count coverage : 1.00 bits/tuple │ ├─ stage progress ────────────────────┼─ findings in depth ────────────────────┤ │ now trying : havoc │ favored paths : 3 (100.00%) │ │ stage execs : 136/256 (53.12%) │ new edges on : 3 (100.00%) │ │ total execs : 29.8k │ total crashes : 242 (2 unique) │ │ exec speed : 1729/sec │ total tmouts : 0 (0 unique) │ ├─ fuzzing strategy yields ───────────┴───────────────┬─ path geometry ────────┤ │ bit flips : 0/176, 0/173, 0/167 │ levels : 1 │ │ byte flips : 0/22, 0/19, 0/13 │ pending : 0 │ │ arithmetics : 0/1228, 0/148, 0/0 │ pend fav : 0 │ │ known ints : 0/118, 0/532, 0/572 │ own finds : 0 │ │ dictionary : 0/0, 0/0, 0/24 │ imported : n/a │ │ havoc : 2/13.6k, 0/12.9k │ stability : 100.00% │ │ trim : 14.29%/4, 0.00% ├────────────────────────┘ ^C────────────────────────────────────────────────────┘ [cpu:313%] +++ Testing aborted by user +++ [+] We're done here. Have a nice day! lazenca0x0@ubuntu:~/Documents/AFL/test$

Black-box testing

Install library files

  • Black box 테스트를 진행하기 위해 다음과 같은 설정이 필요합니다.
    • 설치 라이브러리 : libini-config-dev, libtool-bin, automake, bison, libglib2.0-dev, qemu

Install library files

lazenca0x0@ubuntu:~/Documents/AFL/afl-2.49b$ apt-get install libini-config-dev libtool-bin automake bison libglib2.0-dev qemu -y lazenca0x0@ubuntu:~/Documents/AFL/afl-2.49b$ cd qemu_mode/ lazenca0x0@ubuntu:~/Documents/AFL/afl-2.49b/qemu_mode/$ ./build_qemu_support.sh lazenca0x0@ubuntu:~/Documents/AFL/afl-2.49b/qemu_mode/$ cd .. lazenca0x0@ubuntu:~/Documents/AFL/afl-2.49b$ sudo make install

Build using gcc

  • 다음과 같이 gcc를 이용해 빌드합니다.

Build using gcc

lazenca0x0@ubuntu:~/Documents/AFL/test$ gcc -fno-stack-protector -o test test.c

Run afl-fuzz

  • 다음과 같이 Black box test를 진행할 수 있습니다.
    • Black box test를 진행하기 위해 -Q 옵션만 추가하면 됩니다.
    • White box test와 같이 2개의 uniq crashes를 발견하였습니다.

Run AFL-fuzz

lazenca0x0@ubuntu:~/Documents/AFL/test$ afl-fuzz -Q -i testcase/ -o result/ ./test afl-fuzz 2.49b by <lcamtuf@google.com> [+] You have 1 CPU core and 3 runnable tasks (utilization: 300%). [*] Checking core_pattern... [*] Setting up output directories... [+] Output directory exists but deemed OK to reuse. [*] Deleting old session data... [+] Output dir cleanup successful. [*] Scanning 'testcase/'... [+] No auto-generated dictionary tokens to reuse. [*] Creating hard links for all input files... [*] Validating target binary... [*] Attempting dry run with 'id:000000,orig:test1.txt'... [*] Spinning up the fork server... [+] All right - fork server is up. len = 4, map size = 33, exec speed = 1898 us [*] Attempting dry run with 'id:000001,orig:test2.txt'... len = 6, map size = 33, exec speed = 1048 us [!] WARNING: No new instrumentation output, test case may be useless. [*] Attempting dry run with 'id:000002,orig:test3.txt'... len = 9, map size = 36, exec speed = 790 us [*] Attempting dry run with 'id:000003,orig:test4.txt'... len = 6, map size = 33, exec speed = 806 us [!] WARNING: No new instrumentation output, test case may be useless. [+] All test cases processed. [!] WARNING: Some test cases look useless. Consider using a smaller set. [+] Here are some useful stats: Test case count : 2 favored, 0 variable, 4 total Bitmap range : 33 to 36 bits (average: 33.75 bits) Exec timing : 790 to 1898 us (average: 1135 us) [*] No -t option specified, so I'll use exec timeout of 20 ms. [+] All set and ready to roll! american fuzzy lop 2.49b (test) ┌─ process timing ─────────────────────────────────────┬─ overall results ─────┐ │ run time : 0 days, 0 hrs, 0 min, 10 sec │ cycles done : 5 │ │ last new path : none yet (odd, check syntax!) │ total paths : 4 │ │ last uniq crash : 0 days, 0 hrs, 0 min, 2 sec │ uniq crashes : 2 │ │ last uniq hang : none seen yet │ uniq hangs : 0 │ ├─ cycle progress ────────────────────┬─ map coverage ─┴───────────────────────┤ │ now processing : 1* (25.00%) │ map density : 0.05% / 0.06% │ │ paths timed out : 0 (0.00%) │ count coverage : 1.00 bits/tuple │ ├─ stage progress ────────────────────┼─ findings in depth ────────────────────┤ │ now trying : splice 7 │ favored paths : 2 (50.00%) │ │ stage execs : 30/32 (93.75%) │ new edges on : 2 (50.00%) │ │ total execs : 16.2k │ total crashes : 1204 (2 unique) │ │ exec speed : 1533/sec │ total tmouts : 0 (0 unique) │ ├─ fuzzing strategy yields ───────────┴───────────────┬─ path geometry ────────┤ │ bit flips : 0/128, 0/124, 0/116 │ levels : 1 │ │ byte flips : 0/16, 0/12, 0/4 │ pending : 0 │ │ arithmetics : 0/890, 0/176, 0/0 │ pend fav : 0 │ │ known ints : 0/80, 0/336, 0/176 │ own finds : 0 │ │ dictionary : 0/0, 0/0, 0/2 │ imported : n/a │ │ havoc : 1/7936, 1/6184 │ stability : 100.00% │ │ trim : 42.86%/4, 0.00% ├────────────────────────┘ ────────────────────────────────────────────────────┘ [cpu:303%] +++ Testing aborted by user +++ [+] We're done here. Have a nice day! lazenca0x0@ubuntu:~/Documents/AFL/test$

Check for the crash.

  • 다음과 같이 발견된 uniq crashes는 result 폴더에 저장되어 있습니다.
    • 해당 파일을 이용해 crash를 재현 할 수 있습니다.

Check for the crash.

lazenca0x0@ubuntu:~/Documents/AFL/test$ ls -al result/crashes/ total 20 drwx------ 2 lazenca0x0 lazenca0x0 4096 Aug 9 01:26 . drwxrwxr-x 5 lazenca0x0 lazenca0x0 4096 Aug 9 01:26 .. -rw------- 1 lazenca0x0 lazenca0x0 68 Aug 9 01:26 id:000000,sig:11,src:000000,op:havoc,rep:128 -rw------- 1 lazenca0x0 lazenca0x0 86 Aug 9 01:26 id:000001,sig:11,src:000002+000003,op:splice,rep:128 -rw------- 1 lazenca0x0 lazenca0x0 604 Aug 9 01:26 README.txt lazenca0x0@ubuntu:~/Documents/AFL/test$ ./test < result/crashes/id\:000000\,sig\:11\,src\:000000\,op\:havoc\,rep\:128 Login : Password : Fail. Segmentation fault lazenca0x0@ubuntu:~/Documents/AFL/test$ ./test < result/crashes/id\:000001\,sig\:11\,src\:000002+000003\,op\:splice\,rep\:128 Login : Password : Fail. Segmentation fault lazenca0x0@ubuntu:~/Documents/AFL/test$

  • 다음은 생성 crash 파일의 내용입니다.
    • 저장된 내용은 특별한 의미를 가지지 않습니다.

Crash file

lazenca0x0@ubuntu:~/Documents/AFL/test$ hexdump result/crashes/id\:000000\,sig\:11\,src\:000000\,op\:havoc\,rep\:128 0000000 81b9 ad13 0000 76e1 04ff 007f eee7 ffff 0000010 64ff 0000 798a 9379 7980 7979 7966 e100 0000020 ff76 7fc0 e700 ffee ffff ffff 7f04 e700 0000030 ffee ffff 0064 6900 7979 7993 7979 0079 0000040 0100 ff00 0000044 lazenca0x0@ubuntu:~/Documents/AFL/test$ hexdump result/crashes/id\:000001\,sig\:11\,src\:000002+000003\,op\:splice\,rep\:128 0000000 6f72 746f 0000 0004 5774 aaaa aaaa aaaa 0000010 aa97 aaaa 0000 8000 5774 aaaa 97a4 aaaa 0000020 00aa 0000 7480 aa57 9faa 72aa 6f6f aa74 0000030 aaaa 97a4 aaaa 16aa aaaa 619c aa57 aaaa 0000040 aaaa 97aa aaaa 00aa 0000 aa80 6f6f aaaa 0000050 72aa 6f6f 6f74 0000056

Related information

 

기본설치와 실행은 잘되지만, qemu_mode 설치 및 실행은 원활히 되지 않고, 오류가 발생함

오류 내용은 memfd.c 에서 발생하고, 이에 대해 해결한 코드는 아래 git에 있음

ref : https://github.com/abiondo/afl

 

abiondo/afl

My fork of American Fuzzy Lop. Contribute to abiondo/afl development by creating an account on GitHub.

github.com

qemu build 스크립트와 paches 내용이 적용되어 qemu_mode도 정상 작동함

현재 2019.6.27 일자로 qemu_mode 2.10.0을 다운로드 받아서 설치함.

 

아래 내용은 위 내용을 간략히 정리.

위 AFL 버젼은 2.49이지만, 테스트한 버젼은 2.52b 버젼임

 

기본 설치 내용

$ wget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz

$ tar -xvf afl-latest.tgz

$ cd afl-2.49b/

$ make $ sudo make install

 

기본 테스트

$ afl-gcc -fno-stack-protector -o test test.c

# test.c 내용은 위에 상세히 적어둠

 

qemu_mode 설치 내용

$ apt-get install libini-config-dev libtool-bin automake bison libglib2.0-dev qemu -y

$ cd qemu_mode/

$ ./build_qemu_support.sh

$ cd ..

$ sudo make install

# afl_qemu_strace를 생성을 위해서 make install을 다시한번 더 함

 

최종 테스트

$ gcc -fno-stack-protector -o test test.c

# 기존 test파일은 afl-gcc로 만들어 진 것임

$ afl-fuzz -Q -i testcase/ -o result/ ./test @@

:

hollywood 스크립트 설치 (헐리우드)

보안/도구 | 2019. 1. 25. 14:57 | Posted by youGom


sudo apt install hollywood
sudo apt-add-repository ppa:hollywood/ppa
sudo apt-get update
sudo apt-get install byobu hollywood



Hollywood on GitHub





Hollywood hacking terminal in Linux

 








아래와 같은 에러 발생 시 : byobu 관련 오류

  error can't open /usr/share/applications/byobu.desktop no such file directory


원본 : https://www.hiroom2.com/2017/09/21/parrotsec-3-8-byobu-en/

1 Error with installing byobu

The following error will be occured when installing byobu.

$ sudo apt install -y byobu
<snip>
update-parrot-menu: error: can't open
/usr/share/applications/byobu.desktop: No such file or directory
E: Problem executing scripts DPkg::Post-Invoke '[ ! -x
/usr/share/parrot-menu/update-parrot-menu ] ||
/usr/share/parrot-menu/update-parrot-menu wait_dpkg'
E: Sub-process returned an error code

2 Install byobu

Create lacked file after installing byobu and reinstall byobu.

$ sudo apt install -y byobu || true
$ cat <<EOF | sudo tee /usr/share/applications/byobu.desktop
[Desktop Entry]
Name=Byobu Terminal
Comment=Advanced Command Line and Text Window Manager
Icon=byobu
Exec=gnome-terminal --app-id us.kirkland.terminals.byobu -e byobu
Type=Application
Categories=GNOME;GTK;Utility;
X-GNOME-Gettext-Domain=byobu
EOF
$ sudo apt install --reinstall -y byobu


'보안 > 도구' 카테고리의 다른 글

AFL + Android / AOAP Porting and Fuzzing  (0) 2019.06.28
AFL fuzzer / fuzzing  (0) 2019.06.27
[도구] ADB 명령어 정리 내용 ( am/pm/capture/mongkey 등 )  (0) 2018.03.19
공유 게시판 이더패드  (0) 2015.03.30
[NMAP] MS-SQL pentest  (0) 2014.11.17
:


* 출처 : http://www.dreamy.pe.kr/zbxe/CodeClip/163974

ADB PM 명령어 정리 ( pkg 파일 가져오기 )




출처: http://www.dreamy.pe.kr/zbxe/CodeClip/163972

* ADB AM 명령어 정리 ( Activity 실행하기 )


출처 : http://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html

* ADB Capture 정리



* 출처 : http://www.dreamy.pe.kr/zbxe/index.php?mid=CodeClip&category=113507&page=3&document_srl=165558

* mongkey 테스트 ( 무작위 테스트 )


'보안 > 도구' 카테고리의 다른 글

AFL fuzzer / fuzzing  (0) 2019.06.27
hollywood 스크립트 설치 (헐리우드)  (0) 2019.01.25
공유 게시판 이더패드  (0) 2015.03.30
[NMAP] MS-SQL pentest  (0) 2014.11.17
[Security] Fillder Menual / UseCase  (0) 2014.02.27
:

공유 게시판 이더패드

보안/도구 | 2015. 3. 30. 17:58 | Posted by youGom

아놔 이거 못찾아서 해맷네;

자꾸 ethernet card가 나옴 ㅋㅋㅋㅋㅋ


etherpad 이거임 ㅡ.ㅡㅋ


http://etherpad.org/

http://etherpad.org/#download

:

[NMAP] MS-SQL pentest

보안/도구 | 2014. 11. 17. 14:05 | Posted by youGom





* nmap -Pn 192.168.1.3

   -> 1433 port, SQL 살아 있는 것을 확인

* nmap -p1433 --script ms-sql-info 192.168.1.3

   -> SQL 정보 확인

* nmap -p1433 --script ms-sql-brute 192.168.1.3

   -> 기본적인 내용으로 id/pw 공격

* nmap -p1433 --script ms-sql-brute --script-args userdb=/root/Destop/user.txt,passdb=/usr/share/wordlist/fasttrack.txt 192.168.1.3

   -> custom id/pw 입력해서 공격

* nmap -p1433 --script ms-sql-tables --script-args mssql.username=sa,password=a12345 192.168.1.3

   -> 찾아낸 ID/PW로 테이블 내용 가져오기

* nmap -p1433 --script ms-sql-dump-hashes --script-args mssql.username=sa,password=a12345 192.168.1.3

   -> 찾아낸 ID/PW로 Database password 해쉬값 가져오기




'보안 > 도구' 카테고리의 다른 글

[도구] ADB 명령어 정리 내용 ( am/pm/capture/mongkey 등 )  (0) 2018.03.19
공유 게시판 이더패드  (0) 2015.03.30
[Security] Fillder Menual / UseCase  (0) 2014.02.27
unix util commands  (0) 2013.12.10
putty connection manager  (0) 2013.10.07
:

[Security] Fillder Menual / UseCase

보안/도구 | 2014. 2. 27. 10:28 | Posted by youGom

Fiddler는 개인PC의 웹브라우저와 Internet 사이에서 발생하는 모든 HTTP 트래픽을 로깅하는 HTTP Debugging Proxy이다. 사용법은 간단하다. Fiddler를 실행하고 브라우저에서 해당 URL을 열면 트래픽 정보를 보여준다.
이때 빨간아이콘이 보이면 클릭하면 상세 지연시간등을 확인할 수 있다.

- jamesku - 

다운로드 사이트 
http://www.fiddler2.com/fiddler2/

현재 페이지에서 다운로드 ->   Fiddler2Setup.zip

 



1. What is Fiddler?

웹 디버깅 프록시는 귀하의 컴퓨터와 인터넷 사이의 트래픽을 모든 HTTP (S)를 기록합니다설정 중단점 및 들어오는 또는 나가는 데이터를 캡쳐스크립팅 서브 시스템 기반그리고 . NET의 언어 트래픽 모든 HTTP(S)를 열람 할 수 있습니다.

또한 FreeWare 이며 다양한 프로그램으로부터 트래픽 디버깅을 할 수 있으며 Internet Explorer, Mozilla Firefox, Opera 등에 사용할 수 있습니다.

아래는 원문이다.

 Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" withincoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

Fiddler is freeware and can debug traffic from virtually any application, including Internet

Explorer, Mozilla Firefox, Opera, and thousands more.


 

2. Fiddler의 작동 방식




3. HTTPS Traffic Description

-  HTTP 요청에 의한 HTTP Session List   를 볼수있습니다.

- Fiddler를 켜 놓는것만으로도 HTTP Session 을 실시간으로 가져올수있습니다.
-우측 Tab들을 이용 Session값에 대한 정보 들을 알수있습니다.





4. Fiddler UI : Session List


#          해당하는 URL의 아이콘을 표시합니다) URL:/flash/03.swf =>Flash 파일 표시

Result    : Session의 고유아이디

Protocol : Session을 주고 받는 방식

Host      값이 출발하는 장소

URL        주소입니다.

Body      전송량

Content-Type : 컨텐츠의 종류를 나타냄  문서웹페이지,프로그램….

Process  : Session을 이용하고있는 프로그램과 프로그램아이디(PID)를 표시



5. Fiddler UI : Inspectors

 

 Ajax관련 기능을 디버깅 할때 제일 많이 사용하는 기능입니다.

세션리스트에서 세션을 선택하면 해당 세션에 대한 정보를 보여줍니다.

해당 세션의 request의 다양한 정보와 response의 정보 그리고 response의 내용도 볼 수 있습니다.

추가적으로 페이지를 수정 할 수 있는 기능이 있습니다.



6. Fiddler Script Rules


 자바 스크립트를 사용하여 요청이나 응답, 헤더 또는 entity 본문 조작을 할 수 있습니다


7. Extending Fiddler UI


  Fiddler Scripts와 확장된 메뉴와 Tab을 이용하여 세밀한 작업이 가능하다.



8. Using Simple Filters


  Fiddler에서 지원하는 다양한 필터 기능을 사용하여 자신이 원하는 값을 손쉽게 찾아 낼수 있습니다.


9. Auto Responder


 Session List 를 선택하여 AutoResponder란에 추가할수 있으며 그 값을 생성  생성 이전의 트래픽을 캡처할수 있습니다.



10. Fiddler 활용의 예 I - 다운로드 지연시간 시뮬레이션

oSession["request-trickle-delay"] = "300"; 

oSession["response-trickle-delay"] = "150"; 

부분 수정 .


Rules > Performance > Simulate Modem Speeds 를 선택했을때 해당값 적용.


11. Fiddler 활용의 예 II - Flex나 Flash활용


 Flex(air)나 Flash에서의 활용 

Flex나 Flash의 결과물은 SWF로써 대부분 사용자 PC 에서 다운로드 후에 플레이(실행)되는 특성을 가진다여기서 주목해야 할 부분이 SWF가 만약에 호스트(이하 서버)와 클라이언트 관계를 가지며 서로 통신해야 할 경우를 생각하여 보자.  특히 개발중의 상태라 한다면 무리 없이 서버와 SWF간 통신을 직간접적으로 디버깅하며 모니터링 할 수 있다.

반면 서비스 개발이 끝나는 시점이를테면 실 서버에 배포가 된 상황이며현재 SWF가 정상적으로 작동하지 않는다고 가정하여 보자. 2가지 상황을 가정할 수 있는데 하나는 기능상의 버그를또 다른 하나는 네트워크 데이터 통신의 장애(에러)를 들 수 있다.

 

우리 개발자에게 있어 문제를 해결하는데 가장 빠른 방법은 똑같은 장애 사항을 수동으로 개발자 본인이 직접 재연할 수 있다면 99% 해결 된다고 볼 수 있다문제의 원인을 확실하게 알고 있다는 극명한 증거이기 때문이다여기서 SWF와 서버간 네트워크 장애를 판별 할 수 있게 하는  가장 손쉬운 방법이 네트워크 디버거를 이용하여 HTTP, HTTPS,SOAP, Socket에서 들어오고 나가는 데이터를

살펴 봄으로써 장애의 원인을 분석할 수 있다.

'보안 > 도구' 카테고리의 다른 글

공유 게시판 이더패드  (0) 2015.03.30
[NMAP] MS-SQL pentest  (0) 2014.11.17
unix util commands  (0) 2013.12.10
putty connection manager  (0) 2013.10.07
FTK Imager  (0) 2013.09.13
:

unix util commands

보안/도구 | 2013. 12. 10. 14:19 | Posted by youGom

명령어 다운로드 주소 : http://sourceforge.net/projects/unxutils/


위 주소에서 다운로드 받아서


시스템 환경설정의 path값에 해당 경로는 추가해 준다.

경로는 '{압축해제폴더}/usr/local/wbin' 이다.


cygwin 설치해서 쓰려고 했는데, 루트설정 및 설정된 경로로 제한되어 있어서, 해당 명령어 모음집을 검색해서 사용했다.


'보안 > 도구' 카테고리의 다른 글

[NMAP] MS-SQL pentest  (0) 2014.11.17
[Security] Fillder Menual / UseCase  (0) 2014.02.27
putty connection manager  (0) 2013.10.07
FTK Imager  (0) 2013.09.13
[ 책, 보안 ] BackTrack 5 Wireless Penetration Testing  (0) 2013.05.28
:

putty connection manager

보안/도구 | 2013. 10. 7. 16:00 | Posted by youGom



putty session manager by zuko ( http://puttymanager.sourceforge.net/ )

 - http://puttymanager.sourceforge.net/index.php?option=com_content&view=article&id=2&Itemid=8


putty connection manager : 

 - http://millernet.us/wp-content/uploads/2011/04/puttycm.exe

 http://citylock.tistory.com/attachment/cfile9.uf@110739274AFA3B3F359BF9.exe )


putty download links : ( http://www.chiark.greenend.org.uk/~sgtatham/putty/links.html )



tty ( multi window ) : http://ttyplus.com/downloads.html


putty multi command sender : http://www.millardsoftware.com/puttycs


'보안 > 도구' 카테고리의 다른 글

[Security] Fillder Menual / UseCase  (0) 2014.02.27
unix util commands  (0) 2013.12.10
FTK Imager  (0) 2013.09.13
[ 책, 보안 ] BackTrack 5 Wireless Penetration Testing  (0) 2013.05.28
Cain&Abel  (0) 2011.05.31
:

FTK Imager

보안/도구 | 2013. 9. 13. 11:42 | Posted by youGom





  사용 환경 :  AccessData FTK Imager 3.1.3

 

 

 

기본 설명

 

 

 간단한 FTK Imager를 이용하여 파일 복구 하기를 해보자.  

 

 

 

내용 

 1) 다운로드 및 설치

한국 포렌식 학회 :  FTK Imager 3.0.1

 설치는 간단하다.. 그냥 다운 받고 다음 다음 다음 하면 끗.

그리고 준비할거 하나더 USB에 그림 파일 같은것을 만들었다가 지운뒤

 

  2) USB 셋팅

 

USB 있는 사람은 궂이 다운 받을 필요가 없다.

일단 아무 USB에다가

그림파일도 넣고 이상하게 변조된 파일도 하나 넣어보자

실습 할때는 jpg인 파일을 .exe로 변경했놧다.

 

그리고 사진 3개를 지워버렸다. 휴지통에도 않날리고 지워버렸다 후후...

 

지워진 사진을 복구 하고, exe로 변경된 파일을 한번 유심히 분석해보도록 하자

 

3) AccessData FTK Imager

실행 시켜보자

File - Create Disk Image... 쿨릭


여러가지 옵션이 있지만 우리는 실제 USB를 사용 할 것이기 때문에

맨위에 Physical Drive(물리 장치) 를 선택 하도록 하자.

만약 USB가 없어서 올려논 자료를 써볼 사람은 잠시 대기! 아래쪽에서 설명을 한번더 하도록 하겠다.

 

아무거나 써도 된다. 이툴은 실제 사건현장에서 쓰이는 툴이기 쓰다가 보면

이렇게 무슨 기록 하는 부분이 꽤 많다 .

그리고 다음을 누른뒤 저장할 경로를 지정하도록 하자. 그리고 나머지 부분은 일단 Defalut로 지정하도록 하자.

추후에 Study 진행하면서 확실하게 체크 할 기회가 있을 것이다. 

Finish 이후 Start를 진행하고 기다려보자.

이걸 하는 이유는 포렌식에 있어서 법적으로 증명을 할때

실제 원본 증거(USB)를 가지고 증거 수집하는 경우는 거의 없다. 원본이 훼손되면 법정가서 증거로 못쓰기 때문이다.

무튼.. 이걸 한 이유는 실제 USB는 이미징 작업을 한 이후에는 그냥 뽑아서 집어던져도 된다.

이미지 뜬 걸 가지고 분석을 할 것이기 때문이다.

 

약 1기가당 1분 걸린다고 생각 하면 된다. 내깐 8기가라서 8분 정도 걸린다.

근데 이미징 작업후 한번더 뜬다.. 확인 하는 작업이다.

 

 

해쉬 값이 나온다. 동일하면 정상적으로 된 것이다.

해쉬값.. 어디서 들어봣을 것이다. 수업시간에도 교수님들이 꾀나 여러번 이야기 했을 것이다.

이게 대체 뭐냐??

만약 USB가 조금이라도 변형이 생기면 hash값은 변하게 된다. 이걸 이용하여 증거가 변하지 않았다는 것을 증명한다고 생각 하면 좋을 것이다.

무튼.. 일단 우리의 목표는 해쉬고 나발이고 그림 지워진걸 복구 해보자.

USB 빼도 된다. 후후

 

4) 분석

여기서 부터는 위에서 다운로드 받은걸 써서 진행하면 실습을 진행해 볼 수 있다.

 

 

File - Add Evidence Item 클릭

Image File 선택

※ 만약 USB가 연결 되어 있는 상태라면 Physical Drive 선택하고 바로 USB를 선택해도 되지만 위에서 말한것 처럼

포렌식에 있어서 원본을 그대로 분석하는 경우는 거의 없다. 

 

다운로드 받은 파일이나.

위에서 본인 USB의 이미징 해놨던 파일을 열어보도록 하자.

 

아래 경로를 찾아가보면 삭제된 파일은 X표시로 되어 있는걸 알 수 있다.

수업시간에도 배웠지만 헤더만 날라갔을 뿐 실제로 파일이 남아 있는 걸 알 수 있다.

 

우클릭 - Export Files 후 경로를 지정하면 경로지정한 곳으로 파일이 출력된다.


 

정상적인 파일과exe로 바꾼 파일의 hex 헤더 부분을 비교해보도록 하자.

이미져만 있어도 이런걸 비교하여서 대부분은 분석할 수 있지만. 노가다성이 강할 것이다...

 

 

※주의사항

 절대 남의 집.. 특히 연인의 하드디스크를 분석 하진 말자..

 지워진 므흣한 영상들이 발견되거나 예전에 찍은 사진들이 부활하여 않좋은 방향으로 갈 수.......

 

정리

 간단한 실습을 해보도록 하였다 고고고.



출처 : http://blog.naver.com/bitnang?Redirect=Log&logNo=70175434418

관련 다운로드 사이트 : http://www.accessdata.com/support/product-downloads/ftk-download-page 





cnfcj

[출처] FTK Imager|작성자 bitnang


'보안 > 도구' 카테고리의 다른 글

[Security] Fillder Menual / UseCase  (0) 2014.02.27
unix util commands  (0) 2013.12.10
putty connection manager  (0) 2013.10.07
[ 책, 보안 ] BackTrack 5 Wireless Penetration Testing  (0) 2013.05.28
Cain&Abel  (0) 2011.05.31
: