Posts

Showing posts from 2022

通過ADCS申請證書並連接 winrm over https

Image
禁止轉載,可以引用來源,by mane。 Introduction 下面介紹如何通過ADCS申請證書,然後連接到SSL版本的Winrm(端口是5986)。 環境:需要一個AD環境,一個有權限通過Winrm登錄的賬號,這個賬號可以通過ADCS申請證書,且AD只允許5986去登錄。 Quick to find ADCS service if installed 從兩個地方可以快速判斷到AD有沒有開啓ADCS,第一種方法是利用smb看看有沒有 CertEnroll ​這個文件夾: $smbmap -u amanda -p 'Ashare1972' -H 10.129.190.139 [+] IP: 10.129.190.139:445 Name: 10.129.190.139 Disk Permissions Comment ---- ----------- ------- ADMIN$ NO ACCESS Remote Admin C$ NO ACCESS Default share CertEnroll READ ONLY Active Directory Certificate Services share Department Shares READ ONLY IPC$ READ ONLY

Using exists cer.key to access HTTPS via Self-signed cert

Image
Write by mane. Reproduction is not allowed (禁止轉載) !!! Introduction Some web servers NEED to verify the HTTPS certificate to allow access to the service, In pentester, if you get the ca.key file, you can self-signed to access the https service, because you can download ca.crt which include public key in HTTPS server. Private key is not allowed to be leaked, attacker can use this private key to generate new self-signed certificate and sign it in firefox, the firefox need to import PKCS#12 certificate. In general, to generate PKCS#12 to firefox, you need to obtain two files whose ca.ket and ca.crt . A Private Key Here have a example, Assuming you have obtained a ca.key file. $cat ca.key -----BEGIN PRIVATE KEY----- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDPczpU3s4Pmwdb 7MJsi//m8mm5rEkXcDmratVAk2pTWwWxudo/FFsWAC1zyFV4w2KLacIU7w8Yaz0/ 2m+jLx7wNH2SwFBjJeo5lnz+ux3HB+NhWC/5rdRsk07h71J3dvwYv7hcjPNKLcRl uXt2Ww6GXj4oHhwziE2ETkHgrxQp7jB8pL96SDIJFNEQ1Wqp3eLNnPPbfbLLMW8M YQ4UlXO

DFSCoerce NTLM Relay Attack to Domain Admin

Image
Write by mane, 請勿轉載 。 0x0 介紹 近年來AD經常被大佬們搞,在今年5月份微軟修復的漏洞中,其中最離譜的是ADCS,CVE-2022-26923,只需要修改SPN就可以拿到Domain Admin的權限。在這個星期内又爆出了一個針對RPC攻擊的工具, DFSCoerce 。 現在已經有很多針對RPC攻擊的工具,這些工具通常都是做 NTLM Relay 攻擊,NTLM 攻擊可大可小,通常都是視環境而定,有一些工具無需密碼就拿下Domain Admin。 0x1 DFSCoerce 原理 根據文檔,它使用了 NetrDfsRemoveStdRoot 和 NetrDfsAddStdRoot 的RPC接口 MS-DFSNM 來主動請求第三方服務器,這樣可以把第三方服務器設定爲攻擊機,就可以拿到這臺機器的NTLM,從而做些壞事,RPC 接口具體參考 這裏 。 0x2 準備環境 && 要求 ( 隔壁 借張圖,具體原理看上面的圖) 有三臺機器 : 第一個是AD(我的環境叫 DC:192.168.182.139),做 Domain Controller 。 第二個是CA機(我的環境叫 MANECA:192.168.182.140),裏面跑ADCS服務,join了上面AD的domain。 第三個是Kali:192.168.182.132。 設定的環境比較苛刻: 由於這個工具使用了 NetrDfsRemoveStdRoot 和 NetrDfsAddStdRoot ,所以要在DC上安裝 Distributed File System (DFS): Namespace Management . DC 和 ADCS 要分開兩臺機器,如果把服務都集成在DC裏面會攻擊失敗,kali做中間人攻擊。 ADCS 服務器上要跑醜陋的證書注冊網頁,比如: http://CA/certsrv/ ,只能是HTTP,而且沒有啓用NTLM 中继保护。 如果啓用了smart card 或者winrm的https版就可以直接省去後面Add computer的動作,懶的話直接用Certipy獲取NT hash。 一個在DC裏面的低權限的賬號。 備注: 我用的AD和ADCS都是Windows S

Play note block or midi with your minecraft

Image
在你的 Minecraft 世界裏播放音樂吧! Play note block or midi with your minecraft ! Introduction Who all have dreams of playing music in minecraft :P Require Mods and any modpacks include: CC: Tweaked This article will teach you how to get the nbs file from midi files and then play the nbs file in minecraft. The article will use my github project to do the demo. Demo: Setup Video Demo Video Introduction the playable files .nbs In the first, we need to make the playable files, the playable files extension name is *.nbs . It mean, you need to download Minecraft Note Block Studio to make a *.nbs files from HERE , and the Minecraft Note Block Studio is an open source editor. Making the playable files When you need to make a playable files, you need to prepare the midi files, the example midi files Never-Gonna-Give-You-Up-3.mid will be download in HERE . Click Create a new song Click file -> Import from MIDI... and import your midi files. When you try to import the m

Setup VIM Copy Mode in Tmux

更新時間:2022年2月10日 @Mane 吐槽:tmux自帶的複製粘貼模式真的好難用,按錯了好多次,有時候習慣了vim大法換到tmux卻不知道按什麽,在網上搜索了一段時間找到了 這篇文章 ,還好tmux内置的複製器支持vim的按鍵。 Edit ~/.tmux.conf this file. apt -y install xclip 配置文件如下: GLIST setw -g mode-keys vi bind -T copy-mode-vi v send -X begin-selection bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel bind P paste-buffer bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' set -g mouse on bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' 以前是: Enter ‘copy mode’ by pressing CTRL+b, [. Use the arrow keys to go to the position from where you want to start copying. Press CTRL+SPACE to start copying. Use arrow keys to go to the end of text you want to copy. Press ALT+w or CTRL+w to copy into Tmux buffer. Press CTRL+b, ] to paste in a possibly different Tmux pane/window. Source 現在是: Enter ‘copy mode’ by pressing CTRL+b , [ . Yeah, you enter the vim