Hacking Machines
Hacking Machines
101
Furkan ÖZER
July 2023
1
About
• Yıldız Technical University – Computer Engineering
• frknozr.github.io / forestall.io/blog
• Twitter/Github/Gitlab - frknozr
2
Intro
• Hacking
○ refers to computers, servers, network device, or even specific types of digital machines like ATMs, POS, or
voting machines
3
How do we start?
• What is the target?
○ Is it laptop, server, firewall or atm?
4
Reconnaissance
5
Reconnaissance/Information
Gathering/Enumeration
• First, we need to gather the necessary info about the target, to answer questions before
○ Gathering information with establishing a different kind of connections with the target
6
Active Information Gathering
• Manual methods and various automated tools can be used for active information gathering.
• Nmap ("Network Mapper") is a free and open source command-line tool for network discovery and security auditing
○ Detecting vulnerabilities
7
Lab Setup
8
Active Information Gathering
# Identifying our IP address and network range
$> ifconfig
9
Active Information Gathering
# Scanning network with nmap to find active hosts
$> nmap 192.168.231.0/24
10
Active Information Gathering
# Scanning target with nmap
# -Pn -> Disable host discovery. Port scan only.
# -v -> Enable verbose mode
# -sT -> TCP connect port scan
# -sV -> Attempts to determine the version of the service running on port
# -p- -> Scan all ports
$> nmap -Pn -v -sT -sV -p- 192.168.231.168
11
How can we use this info?
12
Vulnerability Assessment
13
Vulnerability Assessment
• Vulnerability
○ Common Vulnerabilities and Exposures system provides a reference method for publicly known information-security vulnerabilities
and exposures.
○ Manual methods
14
Vulnerability Assessment – Apache Tomcat
# Enumerating Apache Tomcat
nmap -Pn -sT -A -p 8080 192.168.231.168
15
Metasploit
• Metasploit is a powerful and widely used open-source tool for penetration testing and cybersecurity research.
• The framework includes various tools, ready-made exploits, and payload options to discover, exploit, and verify
vulnerabilities.
• Metasploit also provides the infrastructure to establish a command and control channel over a target system.
16
Vulnerability Assessment – Apache Tomcat
Default Username and Password Usage on Apache Tomcat
17
Exploitation
18
Exploitation
• Exploit
○ is a method, program, or piece of code, designed to find and take advantage of a security vulnerability in an application or
computer system
• After we find the vulnerable service/input etc, we can use the suitable exploit for different purposes
19
Exploitation – Apache Tomcat
20
Exploitation – Apache Tomcat
21
Vulnerability Assessment – Web Server
# Enumerating Web Server
nmap -Pn -sT -A -p 80 192.168.231.168
22
Vulnerability Assessment – Web Server
23
Vulnerability Assessment – Web Server
24
Exploitation – Web Server
Command Injection on PHPMoAdmin
25
Nikto
• Nikto is a free software command-line vulnerability scanner that scans web servers for dangerous files/CGIs, outdated
server software and other vulnerabilities.
# Running Nikto
nikto -h http://192.168.231.168
26
Vulnerability Assessment – Web Server
ShellShock Vulnerability
27
Vulnerability Assessment – Web Server
28
Exploitation – Web Server
ShellShock Vulnerability
29
What do we do now?
• We gained access on the target with several ways
30
Privilege Escalation
31
Privilege Escalation
32
Privilege Escalation
33
Privilege Escalation
34
Privilege Escalation
35
Cyber Kill Chain
36
Mitre ATT&CK Matrix
37
Free Labs
• Hack the Box (https://app.hackthebox.com/)
• VulnHub (https://www.vulnhub.com/)
38