-
Notifications
You must be signed in to change notification settings - Fork 12
/
linky.py
executable file
·73 lines (59 loc) · 2.08 KB
/
linky.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/python3
from lib import logger,user_enum, banner
import argparse, os.path, json
from time import sleep
'''
Linky is a LinkedIn Enumerator.
Inspired by @vysecurity.
'''
# The most important part...
banner.banner()
parser = argparse.ArgumentParser(description="Yet another LinkedIn scraper.")
parser.add_argument("-c", "--cookie", required=True, metavar="", help="Cookie to authenticate to LinkedIn with [li_at]")
parser.add_argument("-i", "--company-id", metavar="", help="Company ID number")
parser.add_argument("-k", "--keyword", metavar="", help="Keyword for searches")
parser.add_argument("-d", "--domain", metavar="", help="Company domain name")
parser.add_argument("-o", "--output", metavar="", help="File to output to: Writes CSV, JSON and HTML.")
parser.add_argument("-f", "--format", metavar="", help="Format for email addresses")
args = parser.parse_args()
try:
with open(args.cookie,'r') as f:
cookie=f.readline()
logger.blue('Got cookie: [%s]' % logger.BLUE(cookie))
except:
logger.blue('Got cookie: [%s]' % logger.BLUE(cookie))
cookie=args.cookie
company_id=args.company_id
domain=args.domain
if args.output:
filename = args.output
else:
filename=None
if args.keyword == None:
keyword = None
else:
keyword = args.keyword
if args.format:
email_schemes=['firstname.surname','firstnamesurname','f.surname','fsurname','surname.firstname','surnamefirstname','s.firstname','sfirstname']
email_format=args.format.lower()
if email_format not in email_schemes:
logger.red('Unknown email scheme specified, please see the available below:')
for i in email_schemes:
logger.blue(i)
quit()
else:
email_format='firstname.surname'
if args.company_id == None:
logger.red('Please specify a company id with the %s flag' % logger.RED('-id'))
quit()
if args.domain == None:
logger.red('Please specify a domain with the %s flag' % logger.RED('-d'))
quit()
connection_data=[cookie,company_id,email_format]
try:
sleep(2)
users=user_enum.run(connection_data,domain,filename,keyword)
except KeyboardInterrupt:
logger.yellow('Keyboard interrupt detected!')
quit()
logger.green('Done!')