ASL Persistent Mode

시스템 2022. 10. 22. 22:23

Persistent mode

두가지 방법이 있다.

  • app.c 파일을 수정하는 방법
  • AFL_LOOP 매크로를 for 반복 루프 내에 포함시킨다.

gint i;

for(i=0;filenames[i] != NULL; i++){
	if (run_loop){
		#ifdef __AFL_COMPILER
			while(__AFL_LOOP(1000)){
				file_open_from_command_line (gimp, filenames[i], as_new);
			}
			exit(0);

		#else
			file_open_from_command_line (gimp, filenames[i], as_new);
		#endif
		}
  • AFL_LOOP를 xcf_load_invoker 함수 내에 포함시킨다.
--- ../xcf.c	2014-08-20 08:27:58.000000000 -0700
+++ ./app/xcf/xcf.c	2021-10-11 13:02:42.800831192 -0700
@@ -277,6 +277,10 @@
 
   filename = g_value_get_string (&args->values[1]);
 
+#ifdef __AFL_COMPILER
+  while(__AFL_LOOP(10000)){
+#endif
+
   info.fp = g_fopen (filename, "rb");
 
   if (info.fp)
@@ -366,6 +370,12 @@
   if (success)
     gimp_value_set_image (&return_vals->values[1], image);
 
+#ifdef __AFL_COMPILER
+  }
+#endif
+
+  exit(0);
+
   gimp_unset_busy (gimp);
 
   return return_vals;

첫 번째 방법은 다른 입력 형식도 타겟으로 할 수 있지만 두 번째 방법은 xcf만 대상으로 하므로 더 빠르게 버그를 찾을 수 있다.

 

 

 

'시스템' 카테고리의 다른 글

Init 프로세스  (0) 2022.10.23
Radamsa Fuzzer  (0) 2022.10.22
AFL Fuzzer Error  (0) 2022.10.22
AFL fuzzer & Exploit  (0) 2022.10.22
AFL Fuzzer  (0) 2022.10.22
블로그 이미지

wtdsoul

,