Example 3-3. Script for searching using theHarvester
#!/usr/bin/python
import sys
import os
if
len
(
sys.argv
)
< 2:
sys.exit
(
-1
)
providers
=
[
'google'
,
'bing'
,
'linkedin'
,
'pgp'
,
'google-profiles'
]
for
a in providers:
cmd
=
'theharvester -d {0} -b {1} -f {2}.html'
.format
(
sys.argv
[
1
]
, a, a
)
os.system
(
cmd
)
The
for
loop is a way to keep calling theHarvester with different providers each time.
Because theHarvester can generate output, we don’t have to collect the output from
this script. Instead, we just name each output file based on the provider. If you want
to add providers
or just change providers out, you can modify the list. You may not
want to check with google-profiles, for instance. You may want to add Twitter. Just
modifying the providers line will get you additional results, depending on your needs.
Because it can be such
a useful source of information, we’re going to take a look at
another program that mines LinkedIn. This program uses word lists to help identify
matches on LinkedIn. We are essentially doing two levels of data searching. First, we
are focusing on companies,
but additionally, we can look for specific data. In
Example 3-4
, we are searching LinkedIn for people who have titles that are included
in the word list provided using the program InSpy.
Example 3-4. Using InSpy to search LinkedIn
root@rosebud:~# inspy --empspy
/usr/share/inspy/wordlists/title-list-large.txt oreilly
InSpy 2.0.3
2017-12-18 17:51:25
24
Employees
identified
2017-12-18 17:51:25 Shannon Sisk QA Developer OReilly Automotive, HP Tuners Enthusi
2017-12-18 17:51:25 gerry costello financial controller at oreilly transport
2017-12-18 17:51:25 Amber
Evans HR Assistant LOA
for
Oreilly Corporate Office
2017-12-18 17:51:25 Mary Treseler Vice President, Content Strategy,
OReilly Media
2017-12-18 17:51:25 Donna O
'Reilly President of Eurow &
OReilly Corporation
2017-12-18 17:51:25 Ruben Garcia District Manager at Oreilly Auto Parts
2017-12-18 17:51:25 Lexus Johnson Program Coordinator
at OReilly Auto Parts
2017-12-18 17:51:25 John O'
Reilly Chairman at Oreilly Birtwistle SL
2017-12-18 17:51:25 Destiny Wallace HR Social Media Specialist at OReilly Auto Parts