This post will list a summary of various tools and examples on how to pen-test a network. Note that this post is ONLY intended for ethical/white-hat hacking and is absolutely not intended to be a source for malicious intent. The tools and methods used within this post are based on a source system using the Kali operating system.
Technology Ecosystem
The steps in this post are executed on a desktop running the Kali operating system (specifically, Kali Linux version 2017.3, 64-bit). Details related to the host machine are as follows:
Kali Host
- Hostname: kali.localhost
- OS: Kali 2017.3
- CPU: 2
- RAM: 4096MB
- Disk 1 (OS): 500GB
- Network: Private Network
- IP: 192.168.1.233
In addition, the Kali instance is connected to a home network with many other various devices attached. Again, the testing and examples performed in this post are devices owned by the author and the testing is performed within full legal compliance on the author’s own devices.
Discover Devices on Network
Let’s assume you’re already connected to a network (home network, for instance). To inspect the devices that are present on the network you can perform any of the following:
Aside from command-line tools, there are other tools such as Autoscan and Zenmap that can offer more detailed information as well.
Now that you know the devices connected to the same network your Kali instance is connected to, you can start to pick targets for penetration testing.
Man in the Middle
Performing a man in the middle attack places your penetration test instance between the target and the router, allowing all network traffic to pass through your instance. The following steps include how to perform a man in the middle attack using ARP spoofing/poisoning and corresponding abilities for further penetration efforts once you have become the man in the middle.
Address Resolution Protocol (ARP) Spoofing
As a means for attempting a man-in-the-middle (MITM) attack, you can use what is known as ARP spoofing/poisoning. There are several tools that can achieve this which will cause your Kali instance to sit between the router and the target device, passing all network traffic through your penetration testing instance.
Session Hijacking
Now that we can become the man in the middle, we can also session hijack, which is useful if the user utilizes things such as “remember me” features in websites. This functionality saves the user credential information in cookies/session data within their browser, which can be sniffed and hijacked/executed using the following tools:
When used in conjunction with a man-in-the-middle attack, the above tools can be used to hijack and replicate the stolen session information, allowing the hacker to log into the suspect’s accounts. Examples won’t be given here as they are difficult to enumerate via text and the websites have very good and detailed examples already.
DNS Spoofing
DNS spoofing allows for directing a user attempting to access some website to a completely different target endpoint and can be used in conjunction with a man-in-the-middle attack.
In conjunction with the Browser Exploitation Framework
BeEF you can perform cross-site scripting
attacks in-line with a man-in-the-middle mitmf
attack using the --dns
switch. Once you
have set up BeEF, your users can automatically be re-directed to the target IP/location
you have configured rather than the site they were intending to visit.
Screen Capture
Upon becoming the man in the middle using the mitmf
command, you can also configure screen
capture to monitor what the user is viewing using the --screen
switch for the mitmf
command:
Key Logger
Similar to screen capture, you can also use the mitmf
command to key log the target user
using the --jskeylogger
switch:
Injection
Since traffic passes through your Kali instance prior to being sent from or to the target,
you can inject any kind of data into the network stream prior to it reaching the target
or outbound target using the mitmf
command with the --inject
and --js-payload
switches:
Credit
The above tutorial was pieced together with some information from the following sites/resources: