Responsive Ads Here

Saturday, May 12, 2018

Last week I’ve come across an awesome tool named ‘Inspy’ that was written by gojhonny in early 2016. Unfortunately I haven’t heard about this tool earlier despite it being almost 2 years old, fortunately it was referenced by Offensive Security in the Kali 2017.3 release post as being part of the repo. Inspy is a LinkedIn enumeration tool written in Python that can be used for passive information gathering using information that is publicly available on LinkedIn. Inspy uses job titles and department names on LinkedIn profiles to find out who’s employed by a specific organization and in what role. Additionally this tool can also discover technologies that are being used by this organization by crawling job listing for specific keywords. Let’s have a look at the two different operation modes for this tool: EmSpy and TechSpy.
In EmSpy mode this tool searches for LinkedIn users that are employed by the organization using a wordlist. The wordlist that is included with this tool contains little over 300 job titles and department names that are being used to match the job title and/or department together with the company name on the LinkedIn profile. The second mode is called TechSpy. In TechSpy mode it crawls LinkedIn for technologies that are mentioned in a companies job listings, especially in the job description. This will give us an indication of what technologies are in use by the company such as Windows technology, applications, firewall brands and network equipment. At the time of writing this tutorial the TechSpy function unfortunately doesn’t work (anymore). This is probably caused by LinkedIn changing their schemes or, maybe even more likely, LinkedIn is blocking the queries that are generated from our network after a couple test runs. For this reason we will just focus on the EmSpy functionality for now and update this hacking tutorial when the TechSpy function is working properly again.

Running InSpy with EmSpy

Before we can run InSpy we have to install the tool on our system. You can install it by simply running the following command:
apt update && apt -y install inspy
Next we can print the usage instructions by running the following command:
inspy -h
InSpy - A LinkedIn enumeration tool by Jonathan Broche (@jonathanbroche)

positional arguments:
  company               Company name to use for tasks.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

Technology Search:
  --techspy [file]Crawl LinkedIn job listings for technologies used by
                        the company. Technologies imported from a new line
                        delimited file. [Default: tech-list-small.txt]
  --limit int           Limit the number of job listings to crawl. [Default:
                        50]

Employee Harvesting:
  --empspy [file]Discover employees by title and/or department. Titles
                        and departments are imported from a new line delimited
                        file. [Default: title-list-small.txt]
  --emailformat string  Create email addresses for discovered employees using
                        a known format. [Accepted Formats: first.last@xyz.com,
                        last.first@xyz.com, first_last@xyz.com, last_first@xyz.com, 
                        firstl@xyz.com, lfirst@xyz.com,
                        flast@xyz.com, lastf@xyz.com, first@xyz.com,
                        last@xyz.com]
This will print an overview of all options that are available to us with a description. To successfully run this tool there’s a few required parameters that we need to populate which are: --techspy[file]or --emspy[file]mode and the company name that we want to locate employees for. Since techspy is currently not working we will only look at emspy. The EmSpy mode takes only one argument which is the wordlist that contains the titles. The default wordlists are located in the following directory:
/usr/share/inspy/wordlists/
The wordlist directory contains 4 different wordlists from which 2 contain the titles and are meant to be used in EmSpy mode. The other 2 lists are meant to be used in the TechSpy mode.
Inspy wordlists
Now that we know where the wordlists are located we can use them in the following command to search for Google employees with a LinkedIn profile:
inspy --empspy /usr/share/inspy/wordlists/title-list-large.txt google
Inspy Results Google
737 employees found in 63.7 seconds, that’s incredible!
InSpy found a total of 737 LinkedIn profiles that have Google mentioned in the job title. This is roughly 1% of the total staff (70k+ in 2017) employed by Google if all results were valid results. Personally I am amazed by the time it took to find these employees, only 63.7 seconds, which is incredibly fast. Expanding the number of entries might yield even better results though I must say that the included list is pretty effective already. Finally Inspy also has options to export the results in different formats; HTML, CSV & JSON. While these formats may come in handy in some cases I haven’t tested them.

Email format

Another possibly interesting feature is the ’emailformat’ option. This options allows you to specify a format for an e-mail address and export the search results as e-mail addresses. Let’s say you know that Google uses the firstname.lastname format we can specify this format and Inspy will generate a list of e-mail addresses according to this format. The following command searches for Google employees and generates a list of e-mail address in the firstname.lastname format:
inspy --empspy /usr/share/inspy/wordlists/title-list-large.txt --emailformat first.last@google.com google
There are several other formats that you can use with the ’emailformat’ option, all available options are listed in the help function.
Note: Even though the information found by InSpy is publicly available we’ve decided to blur the names in the search results.
This concludes the tutorial for this awesome hacking tool. Are you interested to learn more about other hacking tools? Make sure you’ll have a loot at our Metasploit, Exploitation and networking sections.
Virtual Hacking Labs - Penetration testing lab
In this tutorial we will be scanning a target for the well known Heartbleed SSL Bug using the popular Nmap tool on Kali Linux. The Heartbleed Bug is a serious vulnerability in the popular OpenSSL cryptographic software library and was introduced on 31 December on 2011 and released in March 2012. This weakness allows the attacker to steal information protected by the SSL/TLS encryption which is very commonly used to secure internet connections. The official name for Heartbleed is CVE-2014-0160. A fix has been released and deployed by many OS and application vendors but when a vulnerable version of OpenSSL is used or when applications haven’t been patched by the user or vendor, the vulnerability can still be exploited. With Nmap’s SSL-Heartbleed script it takes us just a couple seconds to check for this vulnerability and should be part of any penetration test.
Many software applications, web applications and web services have SSL/TLS encryption integrated and have been affected by Heartbleed. These applications include among a lot more: multiple VMware products, Yahoo, Filemaker, Cisco Routers, HP server applications, Sourceforge and Github. Even governments have temporarily shut down online services to defend their applications and networks from attackers, like the Canada Revenue Agency (CRA). Many websites instructed their users to change passwords after a fix had been implemented to reduce the risk of attackers using passwords which were stolen by exploiting the Heartbleed SSL vulnerability.
The Heartbleed SSL bug was discovered by Neel Mehta from Google Security and announced to the public by the OpenSSL project on April 7th 2014. After companies like Yahoo, Google and Microsoft had a chance to fix Heartbleed on their applications. Researchers at AVG’s Virus Labs said they scanned Alexa’s league table of the top 800,000 sites in the world and found 12,043 sites (1.5 per cent) are still vulnerable. Let’s continue this tutorial with some hands on testing and see how we can use Nmap to scan targets for Heartbleed vulnerabilities.

Scanning for Heartbleed with Nmap

Use the following command to scan a target for the Heartbleed SSL bug:
nmap -d --script ssl-heartbleed --script-args vulns.showall -sV [host]
When using the --script-args vulns.showall flag, Nmap will show you also when the target is not vulnerable.
Heartbleed SSL bug Nmap
As you can see on the screenshot the target host we have scanned is not vulnerable to Heartbleed. The scanning took only a few seconds and since a lot of applications have been vulnerable to Heartbleed we suggest you to run this script when performing a penetration test or security scan.

Nmap Heartbleed Scanning Video Tutorial

Thanks for watching and please subscribe to my YouTube channel :)

Related Nmap Hacking Tutorials

Open Port Scanning and OS Detection with Nmap in Kali Linux
Scanning a network for live hosts with Nmap
How to enumerate webserver directories with Nmap
Scanning for SMB vulnerabilities using Nmap
Heartbleed SSL bug Scanning using Nmap on Kali Linux
Virtual Hacking Labs - Penetration testing lab

In this tutorial we will be using Nmap on Kali Linux to scan and enumerate webserver directories from popular web applications and servers. We will be using the Nmap script http-enum.nse for this purpose. The first step in web application penetration testing is scanning webserver directories for popular web applications so we can see which applications have been installed on the particular webserver and what directories are available. Many applications have known vulnerabilities and attack strategies that can be exploited in order to gain administrator access or to exploit data. Using this Nmap script we can quickly get an overview of those applications with version numbers so we can check vulnerability databases for known vulnerabilities and exploits.  The Nmap script parses a fingerprint file and scans the targeted webserver for any matches and also returns the particular version of the web application. In the nselib/data folder there is a file called ‘http-fingerprints.lua’. This file contains all the available fingerprints with a description in the header for those who are interested in what is exactly scanned by this Nmap script. The current fingerprint database is really huge and is still updated on a regular basis. If you want to use a Nikto database with fingerprints instead of the lua file, you can also parse a Nikto-formatted database using http-fingerprints.nikto-db-path.
Let’s continue this tutorial and switch to Kali Linux for some hands on testing with Nmap.

Enumerate webserver directories

Use the following command to enumerate directories used by popular web applications:
nmap --script http-enum.nse [host]
Depening on the applications which are installed on the targeted host, Nmap returns a list of those applications. In the Hacking Tutorials video the target has a WordPress installation running which is confirmed by the Nmap script.

Enumerate webserver directories video tutorial

Thanks for watching and please subscribe to my YouTube channel :)

Related Nmap Hacking Tutorials

Open Port Scanning and OS Detection with Nmap in Kali Linux
Scanning a network for live hosts with Nmap
Scanning for SMB vulnerabilities using Nmap
Heartbleed SSL bug Scanning using Nmap on Kali Linux
Virtual Hacking Labs - Penetration testing lab