1

我正在通过机器学习方法进行 Windows 恶意软件研究。看了PE格式,用dumpbin提取PE文件,发现里面有很多部分。例如:.idata .edata .pdata .data .rdata .sxdata .text .rscr .tls... 但并非所有这些都用于操作/行为。我只关心他们的行为并在下一步之前减少大数据。谢谢

4

4 回答 4

4

由于您正在分析恶意软件,因此您不应该查看这些部分的名称。恶意软件开发人员更改节的名称并不难,而且 msvc 编译器还允许您创建自定义节。

相反,您应该做的是查看这些部分的特征。通过读取 IMAGE_SECTION_HEADER,可以查看该部分是否包含可执行代码、静态数据、是否可写等。

于 2017-04-04T11:52:19.183 回答
1

我找到了微软的官方文档。这里只是单词文件。我读到 .text 是代码部分。

于 2017-03-21T07:34:21.430 回答
1

我通过@user2073973 弄清楚了。他的意思是该部分在标题部分有“代码”一词。像这样:

SECTION HEADER #1
   .text name
   522B9 virtual size
    1000 virtual address (00401000 to 004532B8)
   52400 size of raw data
     400 file pointer to raw data (00000400 to 000527FF)
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
60000020 flags
         Code
         Execute Read

他是对的,不仅 .text 部分有代码。自定义名称部分也有代码。

于 2017-04-24T10:45:12.113 回答
0

如果您正在寻找一个 powershell DLL,这是一个很好的:

<#
.Synopsis
    Gets the DLLs loaded by processes on the system.
.DESCRIPTION
   Gets the DLLs loaded by processes on the system.
.EXAMPLE
   Get-Dll -ProcessName Notepad
.EXAMPLE
   Get-Dll -ModuleName mydll.dll
#>
function Get-Dll
{
    [CmdletBinding()]
    param(
    # The process to get the DLLs of
    [Parameter(ValueFromPipeline=$true, ParameterSetName="Process")]
    [System.Diagnostics.Process]$Process,
    # The process name to get the DLLs of
    [Parameter(ValueFromPipeline=$true, ParameterSetName="ProcessName")]
    [String]$ProcessName = "",
    # The process ID to get the DLLs of
    [Parameter(ValueFromPipeline=$true, ParameterSetName="ProcessId")]
    [Int]$ProcessId = 0,
    # The module name to search for
    [Parameter()]
    [String]$ModuleName,
    # Whether to returned only unsigned modules
    [Parameter()]
    [Switch]$Unsigned
    )

    Begin{
        $script:Modules = @()
        $script:Processes = @()
    }

    Process {
        if ($Process -ne $null)
        {
            $Modules += $Process.Modules 
        }
        elseif (-not [String]::IsNullOrEmpty($ProcessName))
        {
            $Modules += Get-Process -Name $ProcessName | Select-Object -ExpandProperty Modules 
        }
        elseif ($ProcessId -ne 0)
        {
            $Modules += Get-Process -Id $ProcessId | Select-Object -ExpandProperty Modules
        }
        elseif(-not [String]::IsNullOrEmpty($ModuleName))
        {
            $Processes =  Get-Process | Where-Object { ($_.Modules).ModuleName -Contains $ModuleName }
        }
        else 
        {
            $Modules += Get-Process | Select-Object -ExpandProperty Modules
        }
    }

    End {
        if ($Processes.Length -gt 0)
        {
            $Processes
            return
        }

        if (-not [String]::IsNullOrEmpty($ModuleName))
        {
            $Modules = $Modules | Where-Object { $_.ModuleName -eq $ModuleName }
        }

        if ($Unsigned)
        {
            $Modules = $Modules | Where { -not [PoshInternals.AuthenticodeTools]::IsTrusted($_.FileName) }
        }

        $Modules
    }
}

站点:PowerShell 画廊

于 2021-11-16T01:21:09.507 回答