|
| 1 | +%! Licence = CC BY-NC-SA 4.0 |
| 2 | + |
| 3 | +%! Author = gianfluetsch |
| 4 | +%! Date = 30. Dez 2021 |
| 5 | +%! Project = cydef_summary |
| 6 | + |
| 7 | +\section{Active Directory} |
| 8 | +\begin{itemize} |
| 9 | + \item Active Directory (AD) is a directory service (database) developed by Microsoft |
| 10 | + \item Used for centralized management of computers, servers, users, … |
| 11 | + \item Performs authentication and authorization of users and computers |
| 12 | + \begin{itemize} |
| 13 | + \item It verifies the credentials of the users and defines their access rights |
| 14 | + \item It is based on LDAP, NTLM, Kerberos (Microsoft's version), DNS and other protocols |
| 15 | + \end{itemize} |
| 16 | + \item Structured in objects |
| 17 | + \begin{itemize} |
| 18 | + \item Resources (e.g. printers) |
| 19 | + \item Security Principals (e.g. users, groups, computer accounts) |
| 20 | + \end{itemize} |
| 21 | + \item Organizational Units |
| 22 | + \begin{itemize} |
| 23 | + \item Objects within a domain can be grouped into OUs |
| 24 | + \item OUs can provide a hierarchy to a domain. This simplifies administration |
| 25 | + \end{itemize} |
| 26 | + \item Logical divisions: forest, tree \& domain |
| 27 | + \item Active Directory stores |
| 28 | + \begin{itemize} |
| 29 | + \item password hash of every user |
| 30 | + \item computer hash of every computer |
| 31 | + \color{red} |
| 32 | + \item \textbf{Target for attackers!!!} |
| 33 | + \end{itemize} |
| 34 | +\end{itemize} |
| 35 | + |
| 36 | +\subsection{Active Directory Threats} |
| 37 | +\begin{itemize} |
| 38 | + \item The AD is a central target for attackers, because if compromised, everything is compromised |
| 39 | + \item AD infrastructure can be very complex and therefore hard to configure and maintain securely |
| 40 | + \item \textbf{Common misconfigurations and pitfalls} that can be abused by attackers: |
| 41 | + \begin{itemize} |
| 42 | + \item No segregation of \textbf{privileged access}, e.g. highly privileged admins interactively log on clients/servers |
| 43 | + \item Service (or User) Accounts with \textbf{weak passwords and SPN (Service Principal Name) set}, even worse if ownership is lost |
| 44 | + \item \textbf{Weak passwords} in general |
| 45 | + \item \textbf{Same local admin password} on all computers |
| 46 | + \item \textbf{Password re-use} in general |
| 47 | + \item \textbf{Credentials on shares} (e.g. Logon Scripts on SYSVOL) where Everyone has read/write access |
| 48 | + \item \textbf{Lack of least-privilege} principle in general |
| 49 | + \end{itemize} |
| 50 | +\end{itemize} |
| 51 | + |
| 52 | + |
| 53 | +\subsection{Logging} |
| 54 | +Über eine GPO kann ein Logging-Agent (z.B. der Wazuh-Agent) einfach auf allen gewünschten Servern installiert und konfiguriert werden. |
| 55 | +Diesen Agent sollte man so konfigurieren, dass er alle wichtigen und relevanten Logs (z.B. die RDP Logs) ebenfalls an Wazuh weiterleitet. |
| 56 | +Danach sind diese Logs auch innerhalb von Wazuh zentral ersichtlich und filterbar. |
| 57 | + |
| 58 | +Dabei werden die Events aus dem EventLog an Wazu weitergeleitet und es kann somit auch nach der \textit{EventID} gefiltert werden. |
| 59 | + |
| 60 | +\subsubsection{EventID 1149} |
| 61 | +Successful network authentication (successfully executed an RDP network connection). |
| 62 | + |
| 63 | +Event 1149 is logged when there is a successful RDP logon to the computer. Before Windows 7 and Windows Server 2012, 1149 would be logged for any initiation of an RDP connection, so it was not a useful indicator for an actual successful application of user credentials. |
| 64 | + |
| 65 | +But, that has changed, and all modern OS versions will only log 1149 if the username in the event was successfully authenticated. It also includes the IP address of the source of the connection, which is useful information. If an account is used and successfully authenticates but does not have |
| 66 | +permission to RDP to the computer due to other restrictions, event 1149 is not generated. |
| 67 | + |
| 68 | +\newpage |
| 69 | + |
| 70 | +\subsubsection{Phases of RDP-Connection} |
| 71 | + |
| 72 | +\begin{minipage}{0.45\linewidth} |
| 73 | + \begin{enumerate} |
| 74 | + \item Connection Initiation |
| 75 | + \item Basic Settings Exchange |
| 76 | + \item Channel Connection |
| 77 | + \item RDP Security Commencement |
| 78 | + \item Secure Settings Exchange |
| 79 | + \item Optional Connect-Time Auto-Detection |
| 80 | + \item Licensing |
| 81 | + \item Optional Multitransport Bootstrapping |
| 82 | + \item Capabilities Exchange |
| 83 | + \item Connection Finalization |
| 84 | + \end{enumerate} |
| 85 | +\end{minipage} |
| 86 | +\begin{minipage}{0.5\linewidth} |
| 87 | + \begin{center} |
| 88 | + \includegraphics[width=1.2\linewidth]{rdp_phases} |
| 89 | + \vspace{-8pt} |
| 90 | + \end{center} |
| 91 | +\end{minipage} |
| 92 | + |
| 93 | +\subsubsection{Explain how you filtered every RDP login attempt} |
| 94 | +The TerminalServices-RemoteConnectionManager Log is not forwarded to Wazuh.\\ |
| 95 | +Unable to filter for all the attempts. |
| 96 | +With the current Wazu setup, one must filter for Logon Type 3 \& 10 (remote logon types)\\ |
| 97 | + |
| 98 | +\begin{itemize} |
| 99 | + \item \lstinline|data.win.system.eventID = 4624| or \lstinline|data.win.system.eventID = 4625| |
| 100 | + \item \lstinline|data.win.sytem.eventID: 4624| and \lstinline|data.win.evendata.logonType: 3| |
| 101 | +\end{itemize} |
| 102 | + |
| 103 | +\subsubsection{Explain how you filtered unsuccessful RDP login attempts} |
| 104 | +Um erfolglose RDP Login Versuche im Event Viewer zu suchen, sucht man nach der \lstinline|Event ID: 4625|.\\ |
| 105 | + |
| 106 | +\begin{itemize} |
| 107 | + \item \lstinline|data.win.eventdata.logonType = 3| or \lstinline|data.win.eventdata.logonType = 10| |
| 108 | + \item \lstinline|data.win.system.eventID = 4625| and \lstinline|data.win.eventdata.logonType = 3| |
| 109 | +\end{itemize} |
| 110 | + |
| 111 | +\subsection{Kerberos} |
| 112 | +\begin{minipage}{0.45\linewidth} |
| 113 | + \begin{enumerate} |
| 114 | + \item Client $\rightarrow$ TGS (Ticket Granting Server = DC): \textit{Anfrage} |
| 115 | + \item TGS $\rightarrow$ Client: \textit{TGT (Ticket Granting Ticket)} |
| 116 | + \item Client $\rightarrow$ Fileserver (FS): \textit{TGT} |
| 117 | + \item FS $\rightarrow$ Client: \textit{schön und gut, will aber spezifisches Ticket} |
| 118 | + \item Client $\rightarrow$ TGS: \textit{Anfrage spezifisches Ticket für FS} |
| 119 | + \item TGS $\rightarrow$ Client: \textit{(spezifisches) Ticket für FS} |
| 120 | + \item Client $\rightarrow$ FS: \textit{(spezifisches) Ticket für FS} |
| 121 | + \item FS $\rightarrow$ Client: \textit{alles ok} |
| 122 | + \end{enumerate} |
| 123 | +\end{minipage} |
| 124 | +\begin{minipage}{0.5\linewidth} |
| 125 | + \begin{center} |
| 126 | + \includegraphics[width=0.9\linewidth]{kerberos} |
| 127 | + \vspace{-8pt} |
| 128 | + \end{center} |
| 129 | +\end{minipage} |
| 130 | + |
| 131 | + |
| 132 | + |
0 commit comments