티스토리 뷰

728x90
반응형

[Reversing] Wscript & VBA Tip

 

난독화를 일일이 해제하기에는 시간이 너무 많이 걸리며 쉽지 않은 작업이다. 난독화를 MsgBox를 띄어 복호화된 실행 코드를 확인 할 수 있는 내용을 정리한다.

 

VBA 난독화 > MsgBox

 

난독화 된 매크로 VBA 코드이다.

 

MsgBox "" & 매개변수

명령어를 추가하여 복호화된 VBA 코드를 확인 할 수 있다.

 

Debug.Print 직접실행

예시)

cdevfrqweasdzxc(20) = Smoking("D;]]xjoepxt]]Tztobujwf]]wcpyusbz/fyf")

cdevfrqweasdzxc(20) = Smoking("D;]]xjoepxt]]Tztobujwf]]WCpyDpouspm/fyf")

 

 Dim TYUIOPGHJJKL As Integer

 For TYUIOPGHJJKL = 1 To 30

 Debug.Print cdevfrqweasdzxc(TYUIOPGHJJKL)

 If Dir(cdevfrqweasdzxc(TYUIOPGHJJKL)) <> vbNullString Then

        TestDir = TestDir + 1

 End If

 Next

 

 

End Function

 

 

난독화 > MsgBox

살펴보게 되면 execute 실행시키는 것을 확인 할 수 있다.

Wscript.echo 

명령어를 변경하여 복호화된 VBA 코드를 확인 할 수 있다.

 

PowerShell 입출력
Out-File 명령어를 이용한 파일 저장 (Set-Content와 다르게 모든 값이 저장)
$ex | Out-File -FilePath "경로"


PowerShell 메시지박스 (ex_ps_msgbox.zip)

[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');

[System.Windows.Forms.MessageBox]::Show($r87b12,"Title",[System.Windows.Forms.MessageBoxButtons]::OKCancel)

 

 

PowerShell 출력
iex > write-host 변경 

728x90
반응형
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today