티스토리 뷰

System/Linux

qira 설치 및 사용법

Tribal 2016. 7. 31. 23:16

qira 사이트 : http://qira.me/

Github : https://github.com/BinaryAnalysisPlatform/qira


-----------------------------------------------------------------------------------------------------------------------

설치방법(64bit Ubuntu 추천)


- wget을 이용한 방법

cd ~/ && wget -qO- https://github.com/BinaryAnalysisPlatform/qira/archive/v1.2.tar.gz | tar zx && cd qira-1.2 && ./install.sh
cs


- git을 이용한 방법

apt-get install git
cd ~/
git clone https://github.com/BinaryAnalysisPlatform/qira.git
~/qira/install.sh
cs


- 추가 설치

~/qira/fetchlibs.sh                # 라이브러리 패치
~/qira/tracers/pin_build.sh        # QIRA PIN plugin 설치 및 --pin 작업 허용
cs



----------------------------------------------------------------------------------------------------------------------

사용방법


테스트용 예제 파일

1
2
3
4
5
6
7
8
9
10
11
12
/* hackerschoo ftz level11 */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
 
int main(int argc, char* argv[])
{
    char str[256];
 
    strcpy(str, argv[1]);
    printf(str);
}
cs


qira 실행

qira ./level11 Hello
cs


qira 디버거 접속(웹 브라우저의 주소창에 VM의 IP:3002 입력)

연결될 경우 위의 사진의 오른쪽처럼 client connected라고 출력된다.


qira 명령어(웹 브라우저에서 입력) - qira.git 참고

-- next invocation of instruction
-- prev invocation of instruction
 
shift--- next toucher of data
shift--- prev toucher of data
 
-- go to return from current function
-- go to start of current function
 
-- zoom out max on vtimeline
 
left  -- -1 fork
right -- +1 fork
up    -- -1 clnum
down  -- +1 clnum
 
esc -- back
 
shift--- clear all forks
 
-- rename instruction
shift--- rename data
-- add comment at instruction
shift--- add comment at data
 
-- go to change, address, or name
space -- toggle flat/function view
 
-- analyze function at iaddr
-- make code at iaddr, one instruction
-- make ascii at iaddr
-- make data at iaddr
-- make undefined at iaddr
cs

※ qira는 timeless debugger이기 때문에 방향키(up, down)으로 instruction 창에서 명령어를 이동하는 것으로 레지스트리가 변하는 것을 볼 수 있음.


마우스 사용

사진의 마지막 설명이 중요하다. 

(명령어는 빨간색 표시, 데이터는 노란색 표시, 레지스터들은 다양한 색으로 표현)


마우스로 빨간색이나 노란색의 주소를 클릭하면 Data를 볼 수 있다. ex) ESP의 값을 마우스로 클릭하면 Stack의 최상위


IDA 출력

qira -S ./filename        # qira using static mode(IDA)
cs

qira를 정적으로 실행시켜 IDA로 보여준다.


요렇게...



기본적인건 여기까지이며, 나머진 사용하기 나름...

댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
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