Sandbox Evasion

(Stolen from PaFish macro: https://github.com/joesecurity/pafishmacro/blob/master/code.vba)

Check apps for any analysis tools using WMI.

Public Sub checkApps()

    printMsg "[*] WordBasic.AppGetNames ..."
    
    d = False
    tns = Array("vmware", "vmtools", "vbox", "process explorer", "processhacker", "procmon", "visual basic", "fiddler", "wireshark")
    Set ws = GetObject("winmgmts:\\.\root\cimv2")
    
    Dim names() As String
    ReDim names(WordBasic.AppCount())
    
    WordBasic.AppGetNames names
    
    For Each n In names
        For Each tn In tns
            If InStr(LCase(n), tn) > 0 Then
                d = True
            End If
        Next
    Next

    If d Then
    
        printMsg "DETECTED"
        
    Else
    
        printMsg "OK"
    End If
    
End Sub

Check how many processes are present

Check if the file name has been changed

Check if the file name hash has been changed

Check if the file name has been changed to anything bad

Check if any analysis tasks are present

Check the number of cores, if the number of cores is less than 3, return false.

Check the BIOS for any common virtual machine names:

Check the username

Check the number of recent documents open

Last updated

Was this helpful?