Computer Science%/System

Fuzzing GUI applications: AbiWord

ch4rli3kop 2021. 10. 12. 11:36
반응형

Original Article : https://blog.gypsyengineer.com/en/security/fuzzing-gui-applications-abiword.html

 

Tip 1. batch mode 사용하기

몇 어플리케이션은 batch mode를 지원한다.

예를 들어 abiword의 경우 다음과 같은 기능을 터미널 상에서 사용할 수 있다.

ch4rli3kop in [~/Desktop] 4:16:31 › abiword -help
Usage:
  abiword [OPTION…] [FILE...] - commandline options

Help Options:
  -h, --help                                                Show help options
  --help-all                                                Show all help options
  --help-gtk                                                Show GTK+ Options

Application Options:
  -g, --geometry=GEOMETRY                                   Set initial frame geometry
  -t, --to=FORMAT                                           Target format of the file (abw, zabw, rtf, txt, utf8, html, ...), depends on available filter plugins
  --verbose=LEVEL                                           Set verbosity level (0, 1, 2), with 2 being the most verbose
  -p, --print='Printer name' or '-' for default printer     Print this file to printer
  -E, --plugin                                              Execute plugin NAME instead of the main application
  -m, --merge=FILE                                          Mail-merge
  -i, --imp-props=CSS String                                Importer Arguments
  -e, --exp-props=CSS String                                Exporter Arguments
  --thumb=                                                  Make a thumb nail of the first page
  -S, --sizeXY=VALxVAL                                      Size of PNG thumb nail in pixels
  -o, --to-name                                             Name of output file
  --import-extension                                        Override document type detection by specifying a file extension
  -u, --userprofile                                         Use specified user profile.
  --version                                                 Print AbiWord version
  --display=DISPLAY                                         X display to use

 

Tip 2. Virtual Display 사용하기

GUI 어플리케이션에 디스플레이를 직접 선택할 수 있는 경우, 가상 디스플레이를 이용하여 디스플레이를 안 뜨게 할 수 있음.

Xvfb와 같은 디스플레이 서버를 통해 GUI 디스플레이를 송출함

Xvfb (X virtual frame buffer)

  • X window 에뮬레이터
  • 디스플레이 장치가 없고 물리적인 입력장치가 없는 장치에서 구동되는 X 서버
  • 디스플레이의 모든 동작은 똑같이 수행하나, 마지막에 송출하지는 않음.

Xvfb 디스플레이 서버 실행

ch4rli3kop in [~/Desktop] 4:40:32 › Xvfb :1 -screen 0 1024x768x16 &

 

Abiword 사용 예시

ch4rli3kop in [~/Desktop] 4:40:09 › abiword --display=:1

(abiword:10571): Gtk-CRITICAL **: 04:40:19.778: gtk_render_background: assertion 'GTK_IS_STYLE_CONTEXT (context)' failed

(abiword:10571): Gtk-CRITICAL **: 04:40:19.778: gtk_render_frame: assertion 'GTK_IS_STYLE_CONTEXT (context)' failed

Tip 3. Timeout command 사용하기

X 서버를 컨트롤 할 수 있는 도구인 `xdotool`을 이용하여 `alt+F4` 명령어를 계속 보냄

#!/bin/bash

while true ; do
    sleep 1
    DISPLAY=:1 xdotool key alt+F4
done
반응형