ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Frida] Hooking ws2_32.dll (send)
    #1 - Security/Reversing 2020. 5. 27. 10:43

    진단 중 TCP 통신을 하는 CS프로그램을 본다면 대부분 TCP 통신으로 되어있다.

    MSDN에 나와있는 ws2_32.dll 의 send 함수를 본다.

    2번째 인자값으로 buf 데이터를 보내는 것으로 확인이 된다.

     

    Frida를 사용하여 buf 인자로 들어오는 값을 프린트하고 수정하는 스크립트 작성한다.

    var sendAddress = Module.findExportByName("ws2_32.dll", "send"); 
    console.log('send address: ' + sendAddress.toString()); 
    	Interceptor.attach(sendAddress, {
        	onEnter: function (args) {
            	console.log("buf : " + Memory.readCString(args[1]));
                Memory.protect(sendAddress, 1028 ,'rw-');
                Memory.writeAnsiString(args[1],"바꿀내용");
                Memory.protect(sendAddress, 1028 ,'r--');
                console.log("replaced buf : " + Memory.readCString(args[1]));
                }, 
            onLeave: function (ret) {
            	console.log(ret)
            } 
        });
    

     

    '#1 - Security > Reversing' 카테고리의 다른 글

    ARM/ARM64 어셈블리  (0) 2020.05.20

    댓글

Designed by Tistory.