Three

Task 1

How many TCP ports are open?

Answer:

  • Ran command nmap [IP]

  • The answer is 2 TCP ports are open. Port 22 and 80

Task 2

What is the domain of the email address provided in the "Contact" section of the website?

Answer:

  • Go to the URL from the IP given.

  • Go to the contact link.

  • The answer is the domain listed in the email address.

  • thetoppers.htb

Task 3

In the absence of a DNS server, which Linux file can we use to resolve hostnames to IP addresses in order to be able to access the websites that point to those hostnames?

Answer:

  • The answer to this on a Linux machine is /etc/hosts

Task 4

Which sub-domain is discovered during further enumeration?

Answer:

  • Run the following command to discover another subdomain:

  • This will give you the answer of s3.thetoppers.htb

Task 5

Which service is running on the discovered sub-domain?

Answer:

  • Run a quick google search on "s3 subdomain status running"

  • The first search result should show amazon s3 as the active service.

Task 6

Which command line utility can be used to interact with the service running on the discovered sub-domain?

Answer:

  • Quick google search for "cli utility to utilize s3".

  • Result points towards awscli

Task 7

Which command is used to set up the AWS CLI installation?

Answer:

Task 8

What is the command used by the above utility to list all of the S3 buckets?

Answer:

  • Checking on the same documentation page is found the command to list the buckets: aws s3 ls

Task 9

This server is configured to run files written in what web scripting language?

Answer:

  • Check wappalyzer and it will tell you php

Submit Flag:

  • First was to add s3.thetoppers.htb to /etc/hosts

  • Configure aws: aws configure

    • Set all values to "temp"

  • I have a reverse shell php script:

  • I changed the IP and PORT in the lines above to match what I wanted it to connect back to.

  • Next is to upload the reverse shell to the s3 bucket

  • Open a netcat listener

  • Navigate to the URL: http://thetoppers.htb/reverse_shell.php

  • It should hold up while it connects back to your netcat listener

  • Go back to your netcat listener and you should have a reverse shell into the bucket.

  • Navigate to /var/www/flag.txt

    • You may have to wait a while as the flag file did not pop up immediately for me.

  • The flag is a980d99281a28d638ac68b9bf9453c2b

Last updated