Tryhackme:CC: Pen Testing(PART-1)

A crash course on various topics in penetration testing

[Section 1 — Network Utilities] — nmap:

1.What does nmap stand for?

A:network mapper

2.How do you specify which port(s) to scan?

A:-p

A:-sn

A:-sU

A:-sC

A:-A

A:-O

A:-sV

A:no answer need

10.How many ports are open on the machine?

A:1

A:Apache

12.What is the version of the service?

A:2.4.18

13.What is the output of the http-title script(included in default scripts)

A:Apache2 Ubuntu Default Page: It works

[Section 1 — Network Utilities] — Netcat:

After you connect to a port with nc you will be able to send data, this also has the consequence of the user being able to pipe data through nc. For example one can doecho hello | nc <ip> 1234 to send the string hello to the service running on port 1234

Note: There are multiple versions of nc, so if you are unable to find an answer in your specific man page, try reading the man page for others!

1.How do you listen for connections?

A:-l

A:-v

A:-p

A:-e

A:-u

[Section 2 — Web Enumeration] — gobuster:

The beginning questions of this task use the gobuster man page, while the latter questions will use a virtual machine.

In the event your operating system does not provide the gobuster man page, please use gobuster — help

1.How do you specify directory/file brute forcing mode?

A:dir

2.How do you specify dns bruteforcing mode?

A:dns

3.What flag sets extensions to be used?

Example: if the php extension is set, and the word is “admin” then gobuster will test admin.php against the webserver

A:-e

4.What flag sets a wordlist to be used?

A:-w

5.How do you set the Username for basic authentication(If the directory requires a username/password)?

A:-u

6.How do you set the password for basic authentication?

A:-p

7.How do you set which status codes gobuster will interpret as valid?

Example: 200,400,404,204

A:-s

8.How do you skip ssl certificate verification?

A:-k

9.How do you specify a User-Agent?

A:-a

10.How do you specify a HTTP header?

A:-h

11.What flag sets the URL to bruteforce?

A:-u

12.Deploy the machine

A:no answer need

13.What is the name of the hidden directory

A:secret

14.What is the name of the hidden file with the extension xxa

A:password

[Section 2 — Web Enumeration] — nikto:

1.How do you specify which host to use?

A:-h

2.What flag disables ssl?

A:-nossl

3.How do you force ssl?

A:-ssl

4.How do you specify authentication(username + pass)?

A:-id

5.How do you select which plugin to use?

A:-plugins

6.Which plugin checks if you can enumerate apache users?

A:apacheusers

7.How do you update the plugin list

A:-update

8.How do you list all possible plugins to use

A:-list-plugins

[Section 3 — Metasploit]: Intro:

Metasploit is one of the most popular penetration testing frameworks around. It contains a large database of almost every major CVE, which you can easily use against a machine. The aim of this section is to go through some of the major features of metasploit, and at the end there will be a machine that you will need to exploit.

[Section 3 Metasploit]: Setting Up:

Running that command will present you with an “msf5” prompt which will allow you to enter commands. All tasks can be answered with use of the “help” command.

1.What command allows you to search modules?

A:search

2.How do you select a module?

A:use

3.How do you display information about a specific module?

A:info

4.How do you list options that you can set?

A:options

5.What command lets you view advanced options for a specific module?

A:advanced

6.How do you show options in a specific category

A:show

[Section 3 — Metasploit]: — Selecting a module:

1.How do you select the eternalblue module?

A:set exploit/windows/smb/ms17_010_eternalblue

2.What option allows you to select the target host(s)?

A:RHOSTS

3.How do you set the target port?

A:RPORT

4.What command allows you to set options?

A:set

5.How would you set SMBPass to “username”?

A:set SMBPass username

6.How would you set the SMBUser to “password”?

A:set SMBUser password

7.What option sets the architecture to be exploited?

A:arch

8.What option sets the payload to be sent to the target machine?

A:payload

9.Once you’ve finished setting all the required options, how do you run the exploit?

A:exploit

10.What flag do you set if you want the exploit to run in the background?

A:-j

11.How do you list all current sessions?

A:sessions

12.What flag allows you to go into interactive mode with a session(“drops you either into a meterpreter or regular shell”)

A:-i

[Section 3 — Metasploit]: meterpreter:

Once you’ve run the exploit, ideally it will give you one of two things, a regular command shell or a meterpreter shell. Meterpreter is metasploits own “control center” where you can do various things to interact with the machine. A list of commonmeterpreter commands and their uses can be found here

Note: Regular shells can usually be upgraded to meterpreter shells by using the module post/multi/manage/shell_to_meterpreter

1.What command allows you to download files from the machine?

A:download

2.What command allows you to upload files to the machine?

A:upload

3.How do you list all running processes?

A:ps

4.How do you change processes on the victim host(Ideally it will allow you to change users and gain the perms associated with that user)

A:migrate

5.What command lists files in the current directory on the remote machine?

A:ls

6.How do you execute a command on the remote host?

A:execute

7.What command starts an interactive shell on the remote host?

A:shell

8.How do you find files on the target host(Similar function to the linux command “find”)

A:search

9.How do you get the output of a file on the remote host?

A:cat

10.How do you put a meterpreter shell into “background mode”(allows you to run other msf modules while also keeping the meterpreter shell as a session)?

A:background

[Section 3 — Metasploit]: Final Walkthrough:

1.Select the module that needs to be exploited

A:exploit/multi/http/nostromo_code_exec

2.What variable do you need to set, to select the remote host

A:RHOSTS

3.How do you set the port to 80

A:RPORT

4.How do you set listening address(Your machine)

A:LHOST

5.Exploit the machine!

A:no answer need

6.What is the name of the secret directory in the /var/nostromo/htdocs directory?

A:s3cretd1r

7.What are the contents of the file inside of the directory?

A:Woohoo!

Section 4 — Hash Cracking]: Intro:

[Section 4 — Hash Cracking]: Salting and Formatting:

Example:

<hash 1>

<hash 2>

<hash 3>

Salts are typically appended onto the hash with a colon and the salt. Files with salted hashes still follow the same convention with each hash being separated by a newline.

Example:

<hash1>:<salt>

<hash2>:<salt>

<hash3>:<salt>

Note: Different hashing algorithms treat salts differently. Some prepend them and some append them. Research what it is you’re trying to crack, and make the distinction.

please everyone join my telegram channel :https://t.me/hackerwheel

please everyone join my youtube channel :https://www.youtube.com/channel/UCl10XUIb7Ka6fsq1Pl7m0Hg

Hackerwheel
Change the world
https://t.me/hackerwheel

happy hacking……….

CTF-PLAYER, security analyst, Pentesting, vapt, digital forensics