-
Notifications
You must be signed in to change notification settings - Fork 18
/
Email-Rapportive.py
42 lines (34 loc) · 1.79 KB
/
Email-Rapportive.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python
#Email-Rapportive.py
#Author: Sudhanshu Chauhan - @Sudhanshu_C
#Based upon the service Rapportive: http://www.rapportive.com/
#Credits: This code is based upon the research and code of Jordan Wright.
#Blog Link: http://jordan-wright.github.io/blog/2013/10/14/automated-social-engineering-recon-using-rapportive/
#Code Link: https://github.com/jordan-wright/rapportive
#This code requires the Requests library: https://pypi.python.org/pypi/requests/
#Rapportive Code: https://github.com/SudhanshuC/Rapportive/blob/master/rapportive.py
#For MaltegoTransform library and Installation guidelines go to http://www.paterva.com/web6/documentation/developer-local.php
from MaltegoTransform import *
import sys
import urllib2
import requests
mt = MaltegoTransform()
mt.parseArguments(sys.argv)
target_email=mt.getValue()
mt = MaltegoTransform()
random_email="[email protected]"
response = requests.get('https://rapportive.com/login_status?user_email=' + random_email).json()
profile = requests.get('https://profiles.rapportive.com/contacts/email/' + target_email, headers = {'X-Session-Token' : response['session_token']}).json()
if profile['contact']['name']:
mt.addEntity("maltego.Person", profile['contact']['name'])
if profile['contact']['location']:
mt.addEntity("maltego.Location", profile['contact']['location'])
if profile['contact']['occupations']:
for occupation in profile['contact']['occupations']:
mt.addEntity("maltego.Phrase", "Job Title: " + occupation['job_title'] + " at " + occupation['company'])
if profile['contact']['memberships']:
for membership in profile['contact']['memberships']:
purl=membership['profile_url']
url=mt.addEntity("maltego.URL", membership['site_name'] + " profile: " + purl)
url.addAdditionalFields("theurl","URL",True,purl)
mt.returnOutput()