root💀bl4ck4non-sec:~#

Hack. Eat. Sleep. Repeat!!!

View on GitHub

Recon 00


image

Our task here is to retrive the robots.txt file from the main website for hackycorp.com.

Navigate to the webpage

image

We can try to view the robots.txt file by adding /robots.txt to the url

image

cool, we’ve successfully completed this task


Recon 01


image

Our task is to generate a 404/”Not Found” error on the main website for hackycorp.com.

Navigate to the webpage

image

To trigger a 404 error we’ll try to access a directory that doesn’t exist on the webserver. Lets try to access the directory /bankai

image

We have successfully completed this exercise


Recon 02


image

Our task is to retrieve the security.txt file from the main website for hackycorp.com

Navigate to the webpage

image

To view the security.txt file, just navigate to /.well-known/security.txt

image

We have successfully completed this exercise.


Recon 03


image

Our task is to find a directory with directory listing in the main website for hackycorp.com.

Navigate to the webpage

image

Lets fuzz for directories using ffuf

command:ffuf -u "http://hackycorp.com/FUZZ" -w /usr/share/wordlists/dirb/common.txt -e .zip,.sql,.php,.phtml,.bak,.backup

┌──(bl4ck4non㉿bl4ck4non)-[~/Downloads/pentesterlab]
└─$ ffuf -u "http://hackycorp.com/FUZZ" -w /usr/share/wordlists/dirb/common.txt -e .zip,.sql,.php,.phtml,.bak,.backup

        /'___\  /'___\           /'___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v1.5.0 Kali Exclusive <3
________________________________________________

 :: Method           : GET
 :: URL              : http://hackycorp.com/FUZZ
 :: Wordlist         : FUZZ: /usr/share/wordlists/dirb/common.txt
 :: Extensions       : .zip .sql .php .phtml .bak .backup 
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200,204,301,302,307,401,403,405,500
________________________________________________

admin                   [Status: 301, Size: 178, Words: 6, Lines: 8, Duration: 141ms]
images                  [Status: 301, Size: 178, Words: 6, Lines: 8, Duration: 200ms]
index.html              [Status: 200, Size: 16011, Words: 5888, Lines: 278, Duration: 317ms]
robots.txt              [Status: 200, Size: 121, Words: 14, Lines: 7, Duration: 142ms]
startpage               [Status: 301, Size: 178, Words: 6, Lines: 8, Duration: 136ms]
:: Progress: [32305/32305] :: Job [1/1] :: 256 req/sec :: Duration: [0:02:45] :: Errors: 0 ::

nice nice,

Navigate to the /images directory

image

We have 2 files in this directory, lets try to access the key.txt file

image

We have successfully completed this task


Recon 04

image

Our task is to find a directory that is commonly used to manage applications.

Navigate to the webpage

image

Now, lets fuzz for directories using ffuf

command:ffuf -u "http://hackycorp.com/FUZZ" -w /usr/share/wordlists/dirb/common.txt -e .zip,.sql,.php,.phtml,.bak,.backup

┌──(bl4ck4non㉿bl4ck4non)-[~/Downloads/pentesterlab]
└─$ ffuf -u "http://hackycorp.com/FUZZ" -w /usr/share/wordlists/dirb/common.txt -e .zip,.sql,.php,.phtml,.bak,.backup

        /'___\  /'___\           /'___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v1.5.0 Kali Exclusive <3
________________________________________________

 :: Method           : GET
 :: URL              : http://hackycorp.com/FUZZ
 :: Wordlist         : FUZZ: /usr/share/wordlists/dirb/common.txt
 :: Extensions       : .zip .sql .php .phtml .bak .backup 
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200,204,301,302,307,401,403,405,500
________________________________________________

admin                   [Status: 301, Size: 178, Words: 6, Lines: 8, Duration: 141ms]
images                  [Status: 301, Size: 178, Words: 6, Lines: 8, Duration: 200ms]
index.html              [Status: 200, Size: 16011, Words: 5888, Lines: 278, Duration: 317ms]
robots.txt              [Status: 200, Size: 121, Words: 14, Lines: 7, Duration: 142ms]
startpage               [Status: 301, Size: 178, Words: 6, Lines: 8, Duration: 136ms]
:: Progress: [32305/32305] :: Job [1/1] :: 256 req/sec :: Duration: [0:02:45] :: Errors: 0 ::                                                                                         

Lets start with the /admin directory.

Navigating to that directory

image

We have successfully solved this task


Recon 05


image

Our task is to look for a directory that is not directly accessible.

Lets fuzz for directories using ffuf

command:ffuf -u "http://hackycorp.com/FUZZ" -w /usr/share/wordlists/dirb/common.txt -e .zip,.sql,.php,.phtml,.bak,.backup

┌──(bl4ck4non㉿bl4ck4non)-[~/Downloads/pentesterlab]
└─$ ffuf -u "http://hackycorp.com/FUZZ" -w /usr/share/wordlists/dirb/common.txt -e .zip,.sql,.php,.phtml,.bak,.backup

        /'___\  /'___\           /'___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v1.5.0 Kali Exclusive <3
________________________________________________

 :: Method           : GET
 :: URL              : http://hackycorp.com/FUZZ
 :: Wordlist         : FUZZ: /usr/share/wordlists/dirb/common.txt
 :: Extensions       : .zip .sql .php .phtml .bak .backup 
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200,204,301,302,307,401,403,405,500
________________________________________________

admin                   [Status: 301, Size: 178, Words: 6, Lines: 8, Duration: 141ms]
images                  [Status: 301, Size: 178, Words: 6, Lines: 8, Duration: 200ms]
index.html              [Status: 200, Size: 16011, Words: 5888, Lines: 278, Duration: 317ms]
robots.txt              [Status: 200, Size: 121, Words: 14, Lines: 7, Duration: 142ms]
startpage               [Status: 301, Size: 178, Words: 6, Lines: 8, Duration: 136ms]
:: Progress: [32305/32305] :: Job [1/1] :: 256 req/sec :: Duration: [0:02:45] :: Errors: 0 ::

Navigate to the /startpage directory

image

We have successfully completed the task


Recon 06


image

Our task is to access the default virtual host (“vhost”)

Navigate to the webpage

image

Refresh this webpage, capture the request on burpsuite and send it over to burp repeater

image

So, to view the default vhost, we have to get the ip address of the domain. To do that run ping hackycorp.com -c 5 on your terminal

┌──(bl4ck4non㉿bl4ck4non)-[~/Downloads/pentesterlab]
└─$ ping hackycorp.com -c 5
PING hackycorp.com (51.158.147.132) 56(84) bytes of data.
64 bytes from 51-158-147-132.rev.poneytelecom.eu (51.158.147.132): icmp_seq=1 ttl=48 time=205 ms
64 bytes from 51-158-147-132.rev.poneytelecom.eu (51.158.147.132): icmp_seq=2 ttl=48 time=286 ms
64 bytes from 51-158-147-132.rev.poneytelecom.eu (51.158.147.132): icmp_seq=3 ttl=48 time=143 ms
64 bytes from 51-158-147-132.rev.poneytelecom.eu (51.158.147.132): icmp_seq=4 ttl=48 time=277 ms
64 bytes from 51-158-147-132.rev.poneytelecom.eu (51.158.147.132): icmp_seq=5 ttl=48 time=153 ms

--- hackycorp.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 142.555/212.707/286.497/60.195 ms

We got the ip address to be 51.158.147.132.

Lets head back to burpsuite. We’ll be changing the value for the Host parameter from hackycorp.com to 51.158.147.132

image

We have successfully completed this task.


Recon 07


image

Our task is to access the default virtual host (“vhost”) over TLS

This challenge has to do with TLS. Https service uses TLS.

So to solve this challenge we just need to add https:// to the back of the ip address. We know the ip address of the domain to be 51.158.147.132 when we run the ping commnad

┌──(bl4ck4non㉿bl4ck4non)-[~/Downloads/pentesterlab]
└─$ ping hackycorp.com -c 3   
PING hackycorp.com (51.158.147.132) 56(84) bytes of data.
64 bytes from 51-158-147-132.rev.poneytelecom.eu (51.158.147.132): icmp_seq=1 ttl=48 time=233 ms
64 bytes from 51-158-147-132.rev.poneytelecom.eu (51.158.147.132): icmp_seq=2 ttl=48 time=256 ms
64 bytes from 51-158-147-132.rev.poneytelecom.eu (51.158.147.132): icmp_seq=3 ttl=48 time=279 ms

--- hackycorp.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 233.149/256.028/279.038/18.734 ms

Now, navigate to the webpage https://51.158.147.132

image

We have completed the task


Recon 08


image

Our task is to access the alternative names in the certificate.

To solve this, we can use the openssl command

command:openssl s_client -connect hackycorp.com:443 </dev/null 2>/dev/null | openssl x509 -noout -text | grep DNS:

┌──(bl4ck4non㉿bl4ck4non)-[~/Downloads/pentesterlab]
└─$ openssl s_client -connect hackycorp.com:443 </dev/null 2>/dev/null | openssl x509 -noout -text | grep DNS:
                DNS:66177e3f25e3ea0713807b1dc5f0b9df.hackycorp.com, DNS:hackycorp.com, DNS:www.hackycorp.com

We got a dns 66177e3f25e3ea0713807b1dc5f0b9df.hackycorp.com

Now, lets navigate to https://66177e3f25e3ea0713807b1dc5f0b9df.hackycorp.com

image

We have successfully completed this task.


Recon 09


image

Our task is to access the headers from the responses

Navigate to the webpage

image

We can use curl to view HTTP headers

command:curl -I http://hackycorp.com/

image

We have successfully completed the task.


Recon 10


image

The task is to find the website with the key in red


Recon 11


image

Our task is to brute a virtual host.

To do this, we’ll be using ffuf

command:ffuf -u https://hackycorp.com/ -H "Host: FUZZ.hackycorp.com" -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -fw 5 -fs 107

┌──(bl4ck4non㉿bl4ck4non)-[~/Downloads/pentesterlab]
└─$ ffuf -u https://hackycorp.com/ -H "Host: FUZZ.hackycorp.com" -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -fw 5 -fs 107

        /'___\  /'___\           /'___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v1.5.0 Kali Exclusive <3
________________________________________________

 :: Method           : GET
 :: URL              : https://hackycorp.com/
 :: Wordlist         : FUZZ: /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt
 :: Header           : Host: FUZZ.hackycorp.com
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200,204,301,302,307,401,403,405,500
 :: Filter           : Response size: 107
 :: Filter           : Response words: 5
________________________________________________

admin                   [Status: 200, Size: 108, Words: 12, Lines: 4, Duration: 146ms]
www                     [Status: 200, Size: 16011, Words: 5888, Lines: 278, Duration: 130ms]
:: Progress: [4989/4989] :: Job [1/1] :: 147 req/sec :: Duration: [0:00:27] :: Errors: 0 ::

From our scan we got 2 outputs admin and www.

So there’s a subdomain admin.hackycorp.com

Lets navigate to the webpage https://hackycorp.com again, but this time we’ll capture the request on burpsuite and send it over to burp repeater

image

Lets change the Host from www.hackycorp.com to admin.hackycorp.com

image

We have successfully completed this task


Recon 12


image

our task is to access a load-balanced application hosted at the address balancer.hackycorp.com.

Lets navigate to the webpage https://balancer.hackycorp.com

image

Refreshing the page multiple times helps us solve this challenge

image

We have successfully completed this lab


Recon 13


image

Our task is to retrieve the TXT record for key.z.hackycorp.com

We’ll be using a tool called dig for this

command:dig TXT key.z.hackycorp.com

image

We have successfully completed this exercise


Recon 14


image

Our task is to perform a zone transfer on z.hackycorp.com

We can use dig to perform a zone transfer

command:dig axfr @51.158.147.132 z.hackycorp.com

image

We have successfully completed this task.


Recon 15


image

Our task is to perform a zone transfer on the internal zone named: “int” using the nameserver of z.hackycorp.com

Using the tool dig

command:dig @51.158.147.132 -t axfr int

image

We have successfully completed this task


Recon 16


image

Our task is to get the version of bind used by z.hackycorp.com

To do this we can use dig


Recon 17


image

Our task is to look for the name of the developer used in the repository test1

First, lets locate the github repo

image

We got their github repo,

Now, kets look for the name of the developer used in the repository test1

image

We have successfully completed this task


Recon 18


image

Our task is to is to look at the public repository of the developers of the organisation.

The github repo is located here https://github.com/hackycorp

image image image image image

We have successfully completed this task


Recon 19


image

Our task is to look at the repository repo7 and find an email address that is not like the other one.


Recon 20


image

Our task is to look at the repository repo3 and check different branches

Navigate to the github page

image image image

We have successfully completed this task


Recon 21


image

Our task is to look at the repository repo4 and check different branches.

Navigate to the github repo

image image image image

We have completed this task


Recon 22


image

Our task is to find a file that has been deleted in repo9.

Navigate to the github page

image image

checking the commits

image

Clicking on “Older”

image

Click on that commit

image

We can see from the above screenshot that the file KEY.txt was deleted. Click on “Load diff”, you should get the deleted file when you do that

image

We have successfully completed this task


Recon 23


image

Our task is to look for at the repository repo0a and find sensitive information in the commit message.

Navigate to the github page

image image

We’ll be checking the commits with more comments

image

clicking on that commit

image

This is not hit, go back to the previous webpage and scroll down

image

Click on “Older”

image

Click on that commit

image

We have successfully completed this task


Recon 24


image

Our task is to look at the server used to load assets (JavaScript, CSS) and find a file named key.txt.

Navigate to the webpage

image

Lets view the source page

image

From the above screenshot, you can see the domain assets.hackycorp.com constantly used. Lets navigate to that domain name using our browser

image

We get the access denied message. Lets try to see if we can access the key.txt file

image

We have successfully completed this task


Recon 25


image

Our task is to look at the server used to load assets (JavaScript, CSS) and find a file named key2.txt.


Recon 26


image

Our task is to look at the server used to load assets (JavaScript, CSS) and find a hardcoded key in one of the JavaScript files.

Navigate to the webpage

image

Doing my research I found this

image

Lets navigate to the webpage http://assets.hackycorp.com/js/script.js

image

Scrolling down,

image

We have successfully completed this lab

We have come to the end of the recon challenge😎

Back To Home