Windows可信任路徑代碼執行漏洞

來源:互聯網
上載者:User

標籤:directory   主線程   strong   create   沒有   程式   body   空值   bsp   

烏雲裡有很多這樣的案例,當然在開發過程中也會存在這樣的問題

搜尋:可信任路徑漏洞

調用案例中的描述:

Microsoft Windows API使用CreateProcess()函數建立新的進程及其主線程。
CreateProcess()函數的格式如下:
BOOL CreateProcess(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
lpApplicationName變數包含有將要執行模組的名稱,但可能是空值。在這種情況下,所執行的模組名稱將會是lpCommandLine字串中的第一個空白劃定符。
如果lpApplicationName中包含有空值,lpCommandLine變數中的完整模組路徑包含有空白且沒有包含在引號中的話,就可能執行其他程式,如下所示:
CreateProcess(
NULL,
c:\program files\sub dir\program.exe,
...
);
在這種情況下,系統在解釋檔案路徑時會擴充字元串,直到遇到執行模組。上面例子中的字串可能被解釋為:
c:\program.exe files\sub dir\program name
c:\program files\sub.exe dir\program name
c:\program files\sub dir\program.exe
因此,如果c:\目錄中存在名為program.exe的檔案的話,就可能執行該檔案而不是預期的應用程式。

 

修複建議:

對傳入給CreateProcess函數的名稱和參數用雙引號””進行包含

官方參考資料:

https://msdn.microsoft.com/zh-cn/library/ms682425.aspx

Windows可信任路徑代碼執行漏洞

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.