自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

域滲透——Hook PasswordChangeNotify

安全 數(shù)據(jù)安全
在之前的文章中介紹了兩種維持域控權(quán)限的方法——SSP和Skeleton Key,這兩種方法均需要借助Mimikatz來(lái)實(shí)現(xiàn),或多或少存在一些不足,所以這次接著介紹一個(gè)更加隱蔽且不需要使用Mimikatz的后門方法——Hook PasswordChangeNotify.

0x00 前言

在之前的文章中介紹了兩種維持域控權(quán)限的方法——SSP和Skeleton Key,這兩種方法均需要借助Mimikatz來(lái)實(shí)現(xiàn),或多或少存在一些不足,所以這次接著介紹一個(gè)更加隱蔽且不需要使用Mimikatz的后門方法——Hook PasswordChangeNotify.

域滲透——Hook PasswordChangeNotify

0x01 簡(jiǎn)介

Hook PasswordChangeNotify這個(gè)概念最早是在2013年9月15日由clymb3r提出,通過(guò)Hook PasswordChangeNotify攔截修改的帳戶密碼。

需要了解的相關(guān)背景知識(shí)如下:

在修改域控密碼時(shí)會(huì)進(jìn)行如下同步操作:

a. 當(dāng)修改域控密碼時(shí),LSA首先調(diào)用PasswordFileter來(lái)判斷新密碼是否符合密碼復(fù)雜度要求 b. 如果符合,LSA接著調(diào)用PasswordChangeNotify在系統(tǒng)上同步更新密碼

函數(shù)PasswordChangeNotify存在于rassfm.dll

rassfm.dll可理解為Remote Access Subauthentication dll,只存在于在Server系統(tǒng)下,xp、win7、win8等均不存在

可以使用dumpbin查看rassfm.dll導(dǎo)出函數(shù)來(lái)驗(yàn)證結(jié)論2:

1dumpbin /exports c:\windows\system32\rassfm.dll

如圖

域滲透——Hook PasswordChangeNotify

 

0x02 特點(diǎn)

對(duì)于之前介紹過(guò)的Security Support Provider,在實(shí)際使用過(guò)程中不可避免的會(huì)有以下不足:

安裝后需要重啟系統(tǒng)

需要在System32文件夾下放置dll

需要修改注冊(cè)表

而使用Hook PasswordChangeNotify卻有如下優(yōu)點(diǎn):

不需要重啟

不需要修改注冊(cè)表

甚至不需要在系統(tǒng)放置dll

可以說(shuō)在隱蔽性上,使用Hook PasswordChangeNotify優(yōu)于Security Support Provider

0x03 技術(shù)實(shí)現(xiàn)

根據(jù)clymb3r提供的poc,實(shí)現(xiàn)Hook PasswordChangeNotify共包含兩部分:

1、Hook dll

下載鏈接:

https://github.com/clymb3r/Misc-Windows-Hacking

(1)為PasswordChangeNotify創(chuàng)建一個(gè)inline Hook,將初始函數(shù)重定向到PasswordChangeNotifyHook

(2)在PasswordChangeNotifyHook中實(shí)現(xiàn)記錄密碼的操作,然后重新將控制權(quán)交給PasswordChangeNotify

2、dll注入

可以利用 Powershell tricks中的Process Injection將我們自己編寫的dll注入到lsass進(jìn)程,實(shí)現(xiàn)Hook功能

0x04 實(shí)際測(cè)試

測(cè)試環(huán)境:

Server 2008 R2 x64

Server 2012 R2 x64

測(cè)試步驟:

1、生成Hook dll

poc下載地址:

https://github.com/clymb3r/Misc-Windows-Hacking

使用VS2015開(kāi)發(fā)環(huán)境,MFC設(shè)置為在靜態(tài)庫(kù)中使用MFC

編譯工程,生成HookPasswordChange.dll

 

2、生成dll注入的powershell腳本

下載Powershell的dll注入腳本

https://github.com/clymb3r/PowerShell/blob/master/Invoke-ReflectivePEInjection/Invoke-ReflectivePEInjection.ps1

在代碼尾部添加如下代碼:

Invoke-ReflectivePEInjection -PEPath HookPasswordChange.dll –procname lsass

并命名為HookPasswordChangeNotify.ps1

3、Hook PasswordChangeNotify

上傳HookPasswordChangeNotify.ps1和HookPasswordChange.dll

管理員權(quán)限執(zhí)行:

1PowerShell.exe -ExecutionPolicy Bypass -File HookPasswordChangeNotify.ps1

如圖

 域滲透——Hook PasswordChangeNotify

4、自動(dòng)記錄新密碼

在Server 2012 R2 x64下,手動(dòng)修改域控密碼后

在C:\Windows\Temp下可以找到passwords.txt,其中記錄了新修改的密碼

如圖

域滲透——Hook PasswordChangeNotify 

在Server 2008 R2 x64下,同樣成功

如圖

域滲透——Hook PasswordChangeNotify

0x05 小結(jié)

本文依舊是對(duì)常規(guī)功能做了演示,后續(xù)可自定義dll代碼實(shí)現(xiàn)更多高級(jí)功能,如自動(dòng)上傳新密碼。

以下鏈接中的代碼可作為參考,其中實(shí)現(xiàn)了將獲取的新密碼上傳至Http服務(wù)器

http://carnal0wnage.attackresearch.com/2013/09/stealing-passwords-every-time-they.html

使用Hook PasswordChangeNotify來(lái)記錄新密碼,如果放在以前,進(jìn)程注入的操作很容易被檢測(cè),但是得益于Powershell應(yīng)用的發(fā)展,通過(guò)Powershell來(lái)進(jìn)程注入可以繞過(guò)常規(guī)的攔截。

當(dāng)然,Hook PasswordChangeNotify僅僅是眾多Hook方法中的一個(gè)。

我已經(jīng)Fork了clymb3r的代碼,并結(jié)合本文需要的代碼做了更新,下載地址如下:

https://github.com/3gstudent/Hook-PasswordChangeNotify

0x06 參考資料

https://clymb3r.wordpress.com/2013/09/15/intercepting-password-changes-with-function-hooking/

http://carnal0wnage.attackresearch.com/2013/09/stealing-passwords-every-time-they.html

http://www.processlibrary.com/en/directory/files/rassfm/305529/

https://github.com/clymb3r/Misc-Windows-Hacking/tree/master/HookPasswordChange

http://www.slideshare.net/nFrontSecurity/how-do-password-filters-work

責(zé)任編輯:藍(lán)雨淚 來(lái)源: 烏云知識(shí)庫(kù)
相關(guān)推薦

2016-12-13 08:45:48

2015-10-27 11:11:46

2020-09-28 10:03:36

滲透

2019-03-29 09:39:24

域滲透DNSWindows

2021-10-11 10:39:13

內(nèi)網(wǎng)信息收集

2012-11-29 16:11:06

2015-02-27 16:10:25

2013-04-18 17:07:36

2013-04-12 13:21:44

2010-08-03 22:09:16

2022-03-08 14:23:38

APIWeb前端

2013-11-06 16:38:59

2021-07-15 10:46:21

滲透測(cè)試網(wǎng)絡(luò)安全網(wǎng)絡(luò)攻擊

2016-09-09 01:14:17

2013-08-21 16:15:15

2022-06-12 21:36:57

Hooksreact

2018-02-07 15:25:41

2017-07-24 17:00:49

2016-05-31 10:11:51

2009-07-24 20:11:17

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)