Network Security-Penetration Testing Using Kali Linux
Network Security-Penetration Testing Using Kali Linux
CISCO LMC
CCNA, CCAI NC-II / NC-IV Comptia NCP+ Fluke CTTA Apple and Android Developer
TRAINING DESCRIPTION
This training is targeted toward Information Technology (IT) professional who has networking and administrative skills in TCP/IP networks and familiarity with Windows and basic Linux commands, and who wants to learn foundational knowledge in network security topics by means of using penetration testing methodology using KALI Linux in a controlled laboratory environment
Security Facts
Two fundamental security facts:
1. 2. All complex software programs have flaw/bugs The extraordinarily difficult to build hardware/software not vulnerable to attack
Who is vulnerable?
Financial institutions and banks Internet service providers Pharmaceutical companies Government and defense agencies Contractors to various government agencies Multinational corporations ANYONE ON THE NETWORK
Virus writers and releasers Script kiddies: limited but numerous Criminals are growing rapidly Employees, Consultants, and Contractors
5 Categories of Hackers
White-Hat Gray-Hat Black-Hat Script-Kiddie Hacktivist
Hacking Group
Philker Hackers, responsible for the attacks on the PNRI, FDA and OVP websites.
Types Attacks
Classify as passive or active
Passive attacks are eavesdropping
Release of message contents Traffic analysis Are hard to detect so aim to prevent
Goals of Security
Prevention
Prevent attackers from violating security policy
Detection
Detect attackers violation of security policy
Recovery
Stop attack, assess and repair damage Continue to function correctly even if attack succeeds
Penetration Testing
Takes and identified port, associated service which contains vulnerabilities Uses an exploit to gain unauthorized access to the target system Tools include Metasploit, CANVAS, & Core IMPACT
Ethical Hacking
Information Gathering Social Engineering Password Cracking (remote & local) War Dialing Wireless (WifI, Bluetooth) VoIP, Blackberry, Smartphones, etc...
the quieter you become, the more you are able to hear
PC 1
User: Victim1 Password: 12345 DNS sub-domain name : victim1.petshop.com IP Address : 192.168.1.3 /24 Intranet Service:
Web Server - Apache Web Server Email Server Kerio Mail Server Telnet FTP Server
PC 2
User: Victim2 Password: 12345 DNS sub-domain name : victim2.petshop.com IP Address : 192.168.1.3 /24 Intranet Service:
DNS Server Simple DNS Telnet FTP Server Hardware: Web Cam
Note: Use Quick Records to configure web, ftp, MX domain and add new A-Record for the rest of the sub-domains
Email Configuration
Install Kerio Mail Server trial copy Create the following emails (POP3) for web mail accounts, with defaults password of 12345
[email protected] [email protected] Note : Test email by sending emails from each accounts
PC2
Username : victim2 Password:1234
Telnet Configurations
Activate TELNET service on each victim PC Test Telnet connections
Procedures :
1. Go to command prompt 2. Type services.msc 3. Search for Telnet services and activate
Phase 1: Reconnaissance
This phase deals with information gathering about the target. the more information you collect on your target, the more likely you are to succeed
If I had six hours to chop down a tree, Id spend the first four of them sharpening my axe.
Google Directives
Directives are keywords that enable a user to accurately extract information from the Google Index.
Google Directives
To properly use a Google directive, you need three things: 1. The name of the directive you want to use 2. A colon 3. The term you want to use in the directive
theharvester
Program use to gather emails, subdomains, hosts, employee names, open ports and banners from different public sources like search engines, PGP key servers and SHODAN computer database.
msfconsole
The msfconsole is probably the most popular interface to the MSF. It provides an "all-in-one" centralized console and allows you efficient access to virtually all of the options available in the Metasploit Framework.
Usage: 1. Go to root console 2. Type msfconsole 3. Type use gather/search_email_collector 4. Type set domain hau.edu.ph 5. Type exploit
NSLookup
Network administration command-line tool available for many computer operating systems use for querying the Domain Name System (DNS) to obtain domain name or IP address mapping or for any other specific DNS record.
Usage:
nslookup target_domain
WHOIS
A query and response protocol that is widely used for querying databases that store the registered users or assignees of an Internet resource, such as a domain name, an IP address block, or an autonomous system, but is also used for a wider range of other information. For Philippines .ph extension whois domain registrant is PH.NET Usage:
whois target_domain
Netcraft
Netcraft is an Internet services company based in Bath, England. Netcraft provides web server and web hosting market-share analysis, including web server and operating system detection.
Usage: 1. Open web browser and go to http://news.netcraft.com 2. Type the domain on the
Dig
Replacement for nslookup for domain information search Usage: dig @target_ip dig @target_ip example.com t AXFR
Phase 2: Scanning
Is the process of examining the activity on a network, which can include monitoring data flow as well as monitoring the functioning of network devices. Network Scanning serves to promote both the security and performance of a network. Network Scanning may also be employed from outside a network in order to identify potential network vulnerabilities.
Ping Sweep
A ping sweep is a series of pings that are automatically sent to a range of IP addresses, rather than manually entering the individual targets address.
fping
A program that sends ICMP echo probes to network hosts, similar to ping, but much better performing when pinging multiple hosts. Usage: fping fping Example: fping fping -a target_ip -a target_ip_beginning target_ip_end >file -a 172.16.41.172 -a -g 172.16.41.1 172.16.41.190 >host.txt
Port Scanning
The act of systematically scanning a computer's ports. Since a port is a place where information goes into and out of a computer, port scanning identifies open doors to a computer. Port scanning has legitimate uses in managing networks, but port scanning also can be malicious in nature if someone is looking for a weakened access point to break into your computer.
Three-Way Handshake
When two machines on any given network want to communicate using TCP, they do so by completing the threeway handshake. When two computers want to talk, they go through a similar process. The first computer connects to the second computer by sending a SYN packet to a specified port number. If the second computer is listening, it will respond with a SYN/ACK . When the first computer receives the SYN/ACK , it replies with an ACK packet. At this point, the two machines can communicate normally.
Nmap
Is a security scanner used to discover Host and services on a computer network, thus creating a "map" of the network. To accomplish its goal, Nmap sends specially crafted packets to the target host and then analyses the responses.
NMAP Basics
Nmap has 6 stats: open, closed, filtered, unfiltered, open|filtered, or closed|filtered. Open This means that the port actively accepted a connection that we tried to establish with it. Closed Means the host is up and responding but no services are running on that port, also indicates the need of a firewall Filtered NMAP couldnt get to the port because there was some sort of firewall or routing rules in the way. Unfiltered port is accessible but couldnt tell if it was open or closed.
Vulnerability Scanning
A vulnerability is a weakness in the software or system configuration that can be exploited. Vulnerabilities can come in many forms but most often they are associated with missing patches.
Nessus
Nessus is a proprietary comprehensive vulnerability scanner which is developed by Tenable Network Security. It is free of charge for personal use in a non-enterprise environment. Its goal is to detect potential vulnerabilities on the tested systems.
Installing Nessus
1. To install Nessus, you need to complete the following steps: 2. Download the installer from www.nessus.org. 3. Register for a key on the Nessus website by submitting your e-mail address. 4. The Nessus crew will e-mail you a unique product key that can be used to register the product. 5. Install the program. 6. Create a Nessus user to access the system. 7. Update the plug-ins.
Using Nessus
To run Nessus 1. Open browser type https://kali:8834 2. Username: admin Password: adminkali 3. Create new scans and scan 4. After finishing scan click results
Troubleshooting Nessus
Nessus not running on browser , start nessus service by typing the command service nessusd start or /etc/init.d/nessud start
Phase 3: Exploitation
Exploitation is the process of gaining control over a system. This process can take many different forms but the end goal always remains the same: administrative-level access to the computer. Exploitation is the attempt to turn the target machine into a puppet that will execute your commands and do your bidding. Just to be clear, exploitation is the process of launching an exploit. Exploits are issues or bugs in the software code that allow a hacker or attacker to alter the original functionality of the software.
Using Metasploit
To run Metasploit 1. Go to root console 2. Type msfconsole Note: Starting the Msfconsole takes between 10 and 30 seconds, so do not panic if nothing happens for a few moments. To update (You can update metasploit in two ways) 1. On the root console type msfupdate or 2. Inside msfconsole afte the msf> prompt type msfupdate
Metasploit Terminology
Exploit - is a pre-packaged collection of code that gets sent to a remote system, Exploits are the weaknesses that allow the attacker to execute remote code (payloads) on the target system.
Payload - is also a small snippet of code that is used to perform some task like installing new software, creating new users, or opening backdoors to the system. These are software or functionality that installs on the target system once the exploit has been successfully executed.
Exploiting Vulnerabilities
Inside msfconsole look for exploits pertaining to the vulnerabilities msf > search ms08-067
Note: If you are encountering [!] Database not connected or cache not built, using slow search , exit msfconsole by typing exit. On the root console type service postgresql start , the return to msfconsole and do the search again
Hands-On: Metasploit
1. Attack the using msfconsole 2. Select windows/adduser for the payload 3. Use telnet to connect to the victim using the new user account
Hands-On: Meterpreter
Use meterpreter to capture and save keystroke. Use to execute mspaint and notepad on the target machine
Using Armitage
1. At the root console type armitage 2. On the Connect dialog box click connect
Using Armitage
4. To scan host, on the Host menu select MSF scan. Enter specific IP address or network range (ex: 192.168.1.0/24) 5. Target Machine will appear with corresponding IP address and OS information 6. To attack specific machine. Click or select machine and on the Attacks menu select Find Attacks. All possible exploit will be queried against the target machine 7. To implement exploit, right-click target machine and select exploit to deploy