HACKING WORDPRESS

OBJECTIVE: perform an external penetration test against the company inlanefreight that is hosting one of their main public-facing websites on WordPress. Enumerate the target thoroughly to find a variety of flags. Obtain shell access to the webserver to find the final flag.

Identify the WordPress version number.
#walk the application
root@htb:~$ BROWSER > http://10.129.2.37/ > blog
 * Hmm. We’re having trouble finding that site.
 
root@htb:~$ sudo nano /etc/hosts
 10.129.2.37 blog.inlanefreight.local

root@htb:~$ sudo nmap -sC -sV -T4 10.129.2.37 -p-

 PORT    STATE SERVICE VERSION
 22/tcp  open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0)
 | ssh-hostkey: 
 |   2048 c4:31:c0:f2:74:ba:29:32:5d:15:ae:43:c5:3a:2c:ab (RSA)
 |   256 b5:64:dc:0a:bc:2d:d9:aa:1e:42:b2:50:34:73:0f:40 (ECDSA)
 |_  256 5e:7e:8a:b9:e7:73:5c:be:00:f2:5f:19:d6:d3:23:e3 (ED25519)
 80/tcp  open  http    Apache httpd 2.4.29 ((Ubuntu))
 |_http-title: Inlane Freight
 |_http-server-header: Apache/2.4.29 (Ubuntu)
 443/tcp open  http    Apache httpd 2.4.29
 |_http-server-header: Apache/2.4.29 (Ubuntu)
 |_http-title: Inlane Freight
root@htb:~$ sudo nmap --script=vuln 10.129.2.37 -p 22,80,443

 PORT    STATE SERVICE
 22/tcp  open  ssh
 80/tcp  open  http
 |_http-stored-xss: Couldn't find any stored XSS vulnerabilities.
 |_http-dombased-xss: Couldn't find any DOM based XSS.
 | http-csrf: 
 | Spidering limited to: maxdepth=3; maxpagecount=20; withinhost=inlanefreight.htb
 |   Found the following possible CSRF vulnerabilities: 
 |     
 |     Path: http://inlanefreight.local:80/
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:80/contact.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:80/contact.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:80/index.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:80/gallery.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:80/error.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:80/services.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:80/about.html
 |     Form id: 
 |_    Form action: #
 | http-enum: 
 |   /css/: Potentially interesting directory w/ listing on 'apache/2.4.29 (ubuntu)'
 |   /error.html: Potentially interesting folder
 |_  /images/: Potentially interesting directory w/ listing on 'apache/2.4.29 (ubuntu)'
 443/tcp open  https
 |_ssl-ccs-injection: No reply from server (TIMEOUT)
 |_http-dombased-xss: Couldn't find any DOM based XSS.
 | http-internal-ip-disclosure: 
 |_  Internal IP Leaked: 127.0.1.1
 | http-enum: 
 |   /css/: Potentially interesting directory w/ listing on 'apache/2.4.29 (ubuntu)'
 |   /error.html: Potentially interesting folder
 |_  /images/: Potentially interesting directory w/ listing on 'apache/2.4.29 (ubuntu)'
 | http-csrf: 
 | Spidering limited to: maxdepth=3; maxpagecount=20; withinhost=inlanefreight.htb
 |   Found the following possible CSRF vulnerabilities: 
 |     
 |     Path: http://inlanefreight.local:443/
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:443/contact.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:443/contact.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:443/about.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:443/index.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:443/gallery.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:443/services.html
 |     Form id: 
 |     Form action: #
 |     
 |     Path: http://inlanefreight.local:443/error.html
 |     Form id: 
 |_    Form action: #
 |_http-stored-xss: Couldn't find any stored XSS vulnerabilities.
root@htb:~$ curl -s -X GET blog.inlanefreight.local | grep '<meta name="generator"'
 <meta name="generator" content="WordPress 5.1.6" />

Identify the WordPress theme in use.

Submit the contents of the flag file in the directory with directory listing enabled.

Identify the only non-admin WordPress user. (Format:<first-name><last-name>)

Use a vulnerable plugin to download a file containing a flag value via an unauthenticated file download.

What is the version number of the plugin vulnerable to an LFI?

Use the LFI to identify a system user whose name starts with the letter "f".


Obtain a shell on the system and submit the contents of the flag in the /home/erika directory.

Last updated