SlideShare a Scribd company logo
8
Most read
9
Most read
13
Most read
Modul Praktikum Keamanan Jaringan
==============================
1
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
Lab - Basic Pentesting: 1 CTF Walkthrough
This small boot2root VM contains multiple remote vulnerabilities and multiple privilege
escalation vectors. The validation for this walkthrough used VirtualBox, which is the
recommended platform. It may also work with VMware.
Hardware Requirements
• Installation of VirtualBox
• One virtual install of Kali Linux
• One virtual install of the Basic Pentesting OVA file, which can be downloaded from here.
Ensure the network adapter for both machines to set to either bridged or NAT.
This VM will not boot until you go into the settings and disable the USB controller.
This CTF is specifically intended for those new to penetration testing. If you’re a beginner, you
should hopefully find the difficulty of the VM to be just right.
Your goal is to attack this VM and gain root privileges remotely.
Organization
Create a folder on the desktop of your Kali machine. Name the folder, pentest. When using a
terminal, change the directory to the pentest folder and run all your commands from this
location. Save any downloads or captured files to this location.
Modul Praktikum Keamanan Jaringan
==============================
2
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
Enumeration
We begin with the basics (always) by enumerating the machine for its IP address and any open
ports and running services.
There’s no harm in getting the network ranges by doing an IFCONFIG from your Kali terminal.
Once we have our network range, we can discover the target machine’s IP address using
netdiscover, Nmap, or ARP.
Using netdiscover
netdiscover -r 192.168.0.0/24
Modul Praktikum Keamanan Jaringan
==============================
3
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
Using ARP
arp-scan -l
We’re now ready to do a Nmap scan. This is my IP address for my target! Your target IP address
will differ!
nmap -sS -AT4 192.168.0.30
The -sS switch looks for open ports and services, while the -AT4 switch looks for OS
information.
From the results, we look for the low-hanging fruit first.
Modul Praktikum Keamanan Jaringan
==============================
4
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
Port: 21
There is an ftp server listening on port 21. Nmap informs us that the ftp service is likely
ProFTPD 1.3.3c.
Port: 22
There is an ssh service listening on port 22. Nmap informs us that it is likely OpenSSH 7.2p2
Ubuntu 4ubuntu 2.2.
Port: 80
There is an HTTP server listening on port 80. It is likely Apache httpd 2.4.18.
Since we have HTTP running on port 80, let’s conduct a web server scan using Nikto and dirb.
This is my IP address for my target! Your target IP address will differ!
nikto -host 192.168.0.30
Modul Praktikum Keamanan Jaringan
==============================
5
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
dirb http://192.168.0.30
This is my IP address for my target! Your target IP address will differ!
DIRB is a Web Content Scanner. It looks for existing or hidden Web Objects. It works by
launching a dictionary-based attack against a web server and analyzing the response.
Nikto and dirb both indicate the existence of a secret directory at /secret/. Furthermore, the files
and directories discovered by dirb suggest that /secret/ is a WordPress site. Visiting the page
confirms this, so we will run a scan to enumerate the site.
Modul Praktikum Keamanan Jaringan
==============================
6
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
Using our browser and the IP address of the target, we get the default page for the site.
Appending/secret to the front of the IP address gives up the hidden page.
The website is distorted, but we now know this is a WordPress site. Let’s add the domain name
to our Kali host file to see if we can get the theme page.
This is my IP address for my target! Your target IP address will differ!
echo "192.168.0.30 vtcsec" >> /etc/hosts
Modul Praktikum Keamanan Jaringan
==============================
7
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
Using the same IP and URL for the /secret/ page, we now get the WordPress theme page
properly rendered.
Scroll down the page until you come to the link for the login.
Nearly all well know applications and networking devices come preconfigured with a default
username and password. We should always try the well-known default username password when
attempting to guess the login information. For example, for a Cisco appliance out of the box, the
default username and password are cisco: cisco, and for a WordPress site, admin: admin.
Modul Praktikum Keamanan Jaringan
==============================
8
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
We attempt to login into the word press site using the default username and password of admin:
admin.
And we are in! We now have complete administrative access to the WordPress site. This is more
common than you might think. As a pentester or hacker, you will find plenty of default
usernames and passwords being used.
We need not waste our time trying to guess login credentials. These can be discovered using any
number of vulnerability scanners with a signature file that will attempt to log in using the default
credentials.
For WordPress, we can use wpscan scan to brute-force the login credentials for a WordPress
site.
wpscan --url http://192.168.0.30/secret/
This is my IP address for my target! Your target IP address will differ!
Modul Praktikum Keamanan Jaringan
==============================
9
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
We can now use wpscan with a wordlist to try and brute force the password.
wpscan --url 192.168.0.30/secret --passwords
/usr/share/wordlists/dirb/big.txt --threads 2
Reading the scan results, it seems we did not recover a password, but there is an error message
“We received an unknown response for login: admin and password: admin.” So we did brute-
force the site and recovered admin: admin as the username and password.
We type in admin as the username and admin as the password back to our WordPress login page.
Success!
We have logged onto the WordPress site with full administrative access; this will allow us to
upload and run files on the server.
Modul Praktikum Keamanan Jaringan
==============================
10
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
Vulnerability Analysis
We have two additional ports to examine. Using searchsploit, we can look for any known exploit
that might be used against the FTP service and version running on the server, ProFTPD 1.3.3c
FTP
Searchsploit indicates that this version of ProFTPD can be backdoored, and there is a Metasploit
module for the exploit. We will return to this opportunity later.
SSH
searchsploit OpenSSH 7.2p2
We find a vulnerability in this version of OpenSSH that allows username enumeration. Still,
since we are likely to get a shell through either FTP or HTTP, we can mark this as the last
chance for romance-type possibility.
Modul Praktikum Keamanan Jaringan
==============================
11
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
Exploitation
We can search Metasploit for the FTP exploit we found earlier using searchsploit.
We found our exploit, and it is rated as excellent. We next need to load the exploit. Use the
show options command to see what setting to configure.
Modul Praktikum Keamanan Jaringan
==============================
12
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
For this exploit, all we need to set is the remote host’s IP address, which is our target IP
address.
Next, set the payload.
To see what payloads are available, use the show payload command. We can use the number
associated with the payload. For this lab, we can use payload 0.
set payload 0
Modul Praktikum Keamanan Jaringan
==============================
13
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
At the prompt, type in the exploit command.
We’re not going to see a prompt, but it’s there. We next need to use a bit of Python coding to
improve our situation.
python -c 'import pty; pty.spawn("/bin/bash")'
We have root access to the machine!
Summary –
This was an easy CTF to complete. There are plenty of walkthroughs for this CTF on the
Internet. I tried many of them and ended up taking bits and pieces for two or three of the best to
get one that would work with the latest version of Kali and the software. We exploited FTP,
HTTP, and WordPress.
You were shown how to use wpscan to brute-force a username and password on the
WordPress site. You were introduced to a bit of Python code to take a limited shell to full root
access. This lab had something for everyone and used the hacking methodology to gain root
access.
Get used to building and organizing your attack. You don’t want files scattered all over your
desktop. For every step shown in the walkthrough, there are 3 or 4 others that will get you the
same result.
Modul Praktikum Keamanan Jaringan
==============================
14
© 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang
Everything shown is reusable and, over time, and with enough practice, you will start to recall
some of your favorite exploits.
End of the Walkthrough!

More Related Content

PPTX
Planning in Artificial Intelligence
PPT
Distributed data processing
PPT
Aggrement protocols
PPT
Asymptotic Notation and Complexity
PPTX
SYNCHRONIZATION
PPT
Big O Notation.ppt
PDF
Demystifying Differentiable Neural Computers and Their Brain Inspired Origin...
PPTX
Insertion in singly linked list
Planning in Artificial Intelligence
Distributed data processing
Aggrement protocols
Asymptotic Notation and Complexity
SYNCHRONIZATION
Big O Notation.ppt
Demystifying Differentiable Neural Computers and Their Brain Inspired Origin...
Insertion in singly linked list

What's hot (20)

PDF
Magnitude Comparator and types of MC
PPTX
Semantic analysis
PPT
Process management in os
PPTX
Neural Networks
PPTX
Context switching
PPTX
Data Structure and Algorithms Merge Sort
PPTX
SEQUENTIAL CIRCUITS [Flip-flops and Latches]
PPTX
Computer architecture page replacement algorithms
PDF
Operating System-Process Scheduling
DOC
algorithm Unit 3
PPTX
deadlock handling
PDF
The Back Propagation Learning Algorithm
PPTX
Instruction level parallelism
PDF
Trees, Binary Search Tree, AVL Tree in Data Structures
PPT
Lecture 11 Informed Search
PPTX
AI - Local Search - Hill Climbing
PPTX
Chapter 9 introduction to transaction processing
PPTX
Adbms 42 deadlocks and starvation
PPTX
Evolutionary Computing - Genetic Algorithms - An Introduction
PPT
Loader
Magnitude Comparator and types of MC
Semantic analysis
Process management in os
Neural Networks
Context switching
Data Structure and Algorithms Merge Sort
SEQUENTIAL CIRCUITS [Flip-flops and Latches]
Computer architecture page replacement algorithms
Operating System-Process Scheduling
algorithm Unit 3
deadlock handling
The Back Propagation Learning Algorithm
Instruction level parallelism
Trees, Binary Search Tree, AVL Tree in Data Structures
Lecture 11 Informed Search
AI - Local Search - Hill Climbing
Chapter 9 introduction to transaction processing
Adbms 42 deadlocks and starvation
Evolutionary Computing - Genetic Algorithms - An Introduction
Loader
Ad

Similar to 3. Basic Pentesting 1 Walkthrough.pdf (20)

PDF
Writing & Sharing Great Modules - Puppet Camp Boston
PDF
26.1.7 lab snort and firewall rules
PDF
OSCP Preparation Guide @ Infosectrain
PDF
Null bhopal Sep 2016: What it Takes to Secure a Web Application
PPTX
AppSec California 2016 - Making Security Agile
PDF
Digital Forensics and Incident Response in The Cloud Part 3
PPTX
01 - Velociraptor Installation and Overview.pptx
PPTX
01 - Velociraptor Installation and Overview.pptx
PDF
CloudOps CloudStack Days, Austin April 2015
DOCX
Network and Internet Security.docx
ODP
50 tips50minutes
PPTX
DevFest | Presentation | Final - Imran Roshan
PDF
Aeon mike guide transparent ssl filtering
PDF
Aeon mike guide transparent ssl filtering (1)
PDF
Building a Gateway Server
PDF
One-Man Ops
ODP
Ubuntu And Parental Controls
PDF
CloudStack - Top 5 Technical Issues and Troubleshooting
PPTX
REMOTE TRIGGERED SOFTWARE DEFINED RADIO
PPTX
Managing and Scaling Puppet - PuppetConf 2014
Writing & Sharing Great Modules - Puppet Camp Boston
26.1.7 lab snort and firewall rules
OSCP Preparation Guide @ Infosectrain
Null bhopal Sep 2016: What it Takes to Secure a Web Application
AppSec California 2016 - Making Security Agile
Digital Forensics and Incident Response in The Cloud Part 3
01 - Velociraptor Installation and Overview.pptx
01 - Velociraptor Installation and Overview.pptx
CloudOps CloudStack Days, Austin April 2015
Network and Internet Security.docx
50 tips50minutes
DevFest | Presentation | Final - Imran Roshan
Aeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filtering (1)
Building a Gateway Server
One-Man Ops
Ubuntu And Parental Controls
CloudStack - Top 5 Technical Issues and Troubleshooting
REMOTE TRIGGERED SOFTWARE DEFINED RADIO
Managing and Scaling Puppet - PuppetConf 2014
Ad

More from Setiya Nugroho (15)

PDF
Network Security riset Network Automation + artikel.pdf
PDF
Modul 02 CRUD CI 3.pdf
PDF
Modul 02 CRUD CI 3.pdf
PDF
Web-based culinary tourism recommendation system
PDF
Network Automation.pdf
PDF
RPS 2022-Pemrograman Web 2.pdf
PDF
10. Data Security.pdf
PDF
Basic Cryptography.pdf
PDF
Web Programming Form
PDF
Access Control Fundamentals
PDF
case study1 web defacement answer.pdf
PDF
WEEK5 Mobile Device Security 31032022.pdf
PDF
Modul 05 Framework CodeIgniter.pdf
PDF
PDF
Modul 4 Web Programming HTML Form & Hyperlink.pdf
Network Security riset Network Automation + artikel.pdf
Modul 02 CRUD CI 3.pdf
Modul 02 CRUD CI 3.pdf
Web-based culinary tourism recommendation system
Network Automation.pdf
RPS 2022-Pemrograman Web 2.pdf
10. Data Security.pdf
Basic Cryptography.pdf
Web Programming Form
Access Control Fundamentals
case study1 web defacement answer.pdf
WEEK5 Mobile Device Security 31032022.pdf
Modul 05 Framework CodeIgniter.pdf
Modul 4 Web Programming HTML Form & Hyperlink.pdf

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Empathic Computing: Creating Shared Understanding
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Approach and Philosophy of On baking technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Machine Learning_overview_presentation.pptx
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Getting Started with Data Integration: FME Form 101
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
A Presentation on Artificial Intelligence
Programs and apps: productivity, graphics, security and other tools
Diabetes mellitus diagnosis method based random forest with bat algorithm
Empathic Computing: Creating Shared Understanding
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation_ Review paper, used for researhc scholars
Group 1 Presentation -Planning and Decision Making .pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Heart disease approach using modified random forest and particle swarm optimi...
Approach and Philosophy of On baking technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine Learning_overview_presentation.pptx
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Getting Started with Data Integration: FME Form 101

3. Basic Pentesting 1 Walkthrough.pdf

  • 1. Modul Praktikum Keamanan Jaringan ============================== 1 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang Lab - Basic Pentesting: 1 CTF Walkthrough This small boot2root VM contains multiple remote vulnerabilities and multiple privilege escalation vectors. The validation for this walkthrough used VirtualBox, which is the recommended platform. It may also work with VMware. Hardware Requirements • Installation of VirtualBox • One virtual install of Kali Linux • One virtual install of the Basic Pentesting OVA file, which can be downloaded from here. Ensure the network adapter for both machines to set to either bridged or NAT. This VM will not boot until you go into the settings and disable the USB controller. This CTF is specifically intended for those new to penetration testing. If you’re a beginner, you should hopefully find the difficulty of the VM to be just right. Your goal is to attack this VM and gain root privileges remotely. Organization Create a folder on the desktop of your Kali machine. Name the folder, pentest. When using a terminal, change the directory to the pentest folder and run all your commands from this location. Save any downloads or captured files to this location.
  • 2. Modul Praktikum Keamanan Jaringan ============================== 2 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang Enumeration We begin with the basics (always) by enumerating the machine for its IP address and any open ports and running services. There’s no harm in getting the network ranges by doing an IFCONFIG from your Kali terminal. Once we have our network range, we can discover the target machine’s IP address using netdiscover, Nmap, or ARP. Using netdiscover netdiscover -r 192.168.0.0/24
  • 3. Modul Praktikum Keamanan Jaringan ============================== 3 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang Using ARP arp-scan -l We’re now ready to do a Nmap scan. This is my IP address for my target! Your target IP address will differ! nmap -sS -AT4 192.168.0.30 The -sS switch looks for open ports and services, while the -AT4 switch looks for OS information. From the results, we look for the low-hanging fruit first.
  • 4. Modul Praktikum Keamanan Jaringan ============================== 4 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang Port: 21 There is an ftp server listening on port 21. Nmap informs us that the ftp service is likely ProFTPD 1.3.3c. Port: 22 There is an ssh service listening on port 22. Nmap informs us that it is likely OpenSSH 7.2p2 Ubuntu 4ubuntu 2.2. Port: 80 There is an HTTP server listening on port 80. It is likely Apache httpd 2.4.18. Since we have HTTP running on port 80, let’s conduct a web server scan using Nikto and dirb. This is my IP address for my target! Your target IP address will differ! nikto -host 192.168.0.30
  • 5. Modul Praktikum Keamanan Jaringan ============================== 5 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang dirb http://192.168.0.30 This is my IP address for my target! Your target IP address will differ! DIRB is a Web Content Scanner. It looks for existing or hidden Web Objects. It works by launching a dictionary-based attack against a web server and analyzing the response. Nikto and dirb both indicate the existence of a secret directory at /secret/. Furthermore, the files and directories discovered by dirb suggest that /secret/ is a WordPress site. Visiting the page confirms this, so we will run a scan to enumerate the site.
  • 6. Modul Praktikum Keamanan Jaringan ============================== 6 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang Using our browser and the IP address of the target, we get the default page for the site. Appending/secret to the front of the IP address gives up the hidden page. The website is distorted, but we now know this is a WordPress site. Let’s add the domain name to our Kali host file to see if we can get the theme page. This is my IP address for my target! Your target IP address will differ! echo "192.168.0.30 vtcsec" >> /etc/hosts
  • 7. Modul Praktikum Keamanan Jaringan ============================== 7 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang Using the same IP and URL for the /secret/ page, we now get the WordPress theme page properly rendered. Scroll down the page until you come to the link for the login. Nearly all well know applications and networking devices come preconfigured with a default username and password. We should always try the well-known default username password when attempting to guess the login information. For example, for a Cisco appliance out of the box, the default username and password are cisco: cisco, and for a WordPress site, admin: admin.
  • 8. Modul Praktikum Keamanan Jaringan ============================== 8 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang We attempt to login into the word press site using the default username and password of admin: admin. And we are in! We now have complete administrative access to the WordPress site. This is more common than you might think. As a pentester or hacker, you will find plenty of default usernames and passwords being used. We need not waste our time trying to guess login credentials. These can be discovered using any number of vulnerability scanners with a signature file that will attempt to log in using the default credentials. For WordPress, we can use wpscan scan to brute-force the login credentials for a WordPress site. wpscan --url http://192.168.0.30/secret/ This is my IP address for my target! Your target IP address will differ!
  • 9. Modul Praktikum Keamanan Jaringan ============================== 9 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang We can now use wpscan with a wordlist to try and brute force the password. wpscan --url 192.168.0.30/secret --passwords /usr/share/wordlists/dirb/big.txt --threads 2 Reading the scan results, it seems we did not recover a password, but there is an error message “We received an unknown response for login: admin and password: admin.” So we did brute- force the site and recovered admin: admin as the username and password. We type in admin as the username and admin as the password back to our WordPress login page. Success! We have logged onto the WordPress site with full administrative access; this will allow us to upload and run files on the server.
  • 10. Modul Praktikum Keamanan Jaringan ============================== 10 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang Vulnerability Analysis We have two additional ports to examine. Using searchsploit, we can look for any known exploit that might be used against the FTP service and version running on the server, ProFTPD 1.3.3c FTP Searchsploit indicates that this version of ProFTPD can be backdoored, and there is a Metasploit module for the exploit. We will return to this opportunity later. SSH searchsploit OpenSSH 7.2p2 We find a vulnerability in this version of OpenSSH that allows username enumeration. Still, since we are likely to get a shell through either FTP or HTTP, we can mark this as the last chance for romance-type possibility.
  • 11. Modul Praktikum Keamanan Jaringan ============================== 11 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang Exploitation We can search Metasploit for the FTP exploit we found earlier using searchsploit. We found our exploit, and it is rated as excellent. We next need to load the exploit. Use the show options command to see what setting to configure.
  • 12. Modul Praktikum Keamanan Jaringan ============================== 12 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang For this exploit, all we need to set is the remote host’s IP address, which is our target IP address. Next, set the payload. To see what payloads are available, use the show payload command. We can use the number associated with the payload. For this lab, we can use payload 0. set payload 0
  • 13. Modul Praktikum Keamanan Jaringan ============================== 13 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang At the prompt, type in the exploit command. We’re not going to see a prompt, but it’s there. We next need to use a bit of Python coding to improve our situation. python -c 'import pty; pty.spawn("/bin/bash")' We have root access to the machine! Summary – This was an easy CTF to complete. There are plenty of walkthroughs for this CTF on the Internet. I tried many of them and ended up taking bits and pieces for two or three of the best to get one that would work with the latest version of Kali and the software. We exploited FTP, HTTP, and WordPress. You were shown how to use wpscan to brute-force a username and password on the WordPress site. You were introduced to a bit of Python code to take a limited shell to full root access. This lab had something for everyone and used the hacking methodology to gain root access. Get used to building and organizing your attack. You don’t want files scattered all over your desktop. For every step shown in the walkthrough, there are 3 or 4 others that will get you the same result.
  • 14. Modul Praktikum Keamanan Jaringan ============================== 14 © 2022 Teknik Informatika S1 Universitas Muhammaadiyah Magelang Everything shown is reusable and, over time, and with enough practice, you will start to recall some of your favorite exploits. End of the Walkthrough!