From d7c7395683f908afc489cb2686ba11ce0e33870c Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+A2hari@users.noreply.github.com> Date: Thu, 3 Sep 2020 08:25:34 +0530 Subject: [PATCH 01/20] Update requirements.txt --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index dbd1295..b3d030c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -requests==2.20.1 -BeautifulSoup==3.2.1 +requests +BeautifulSoup From aad9f4c80feed2370be110a323dbe02e932c0b50 Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+A2hari@users.noreply.github.com> Date: Thu, 3 Sep 2020 08:28:38 +0530 Subject: [PATCH 02/20] Update README.md Python3 Compactable --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d92ae7..c506c8b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Version 3.0 introduces the automation of domain and email retrieval in addition ## Installation ----- -Run `pip install -r requirements.txt` within the cloned InSpy directory. +Run `pip3 install -r requirements.txt` within the cloned InSpy directory. Obtain an API key from [HunterIO](https://hunter.io/) and insert it into the hunterio variable within InSpy.py (line 29). From 252b03e60c24b736f39fa4dcdeae4471332efa4f Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Thu, 3 Sep 2020 18:36:59 +0530 Subject: [PATCH 03/20] Update InSpy.py As Python 2 came to end Updating tool to Python 3 --- InSpy.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/InSpy.py b/InSpy.py index 2f6dda0..4070aab 100755 --- a/InSpy.py +++ b/InSpy.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Copyright (c) 2018 Jonathan Broche (@LeapSecurity) import argparse, sys, os @@ -32,7 +32,7 @@ domain = args.domain -print "\nInSpy {}".format(parser.version) +print("\nInSpy {}").format(parser.version) try: if domain and not email: #search hunterio for email format @@ -48,7 +48,7 @@ email = email.replace("{", "").replace("}","") - print "\nDomain: {}, Email Format: {}\n".format(domain, email) + print (\nDomain: {}, Email Format: {}\n").format(domain, email) employees = {} @@ -58,15 +58,15 @@ if args.company.lower() in title.lower(): if not name in employees: employees[name] = title - print "\n{} Employees identified".format(len(employees.keys())) + print("\n{} Employees identified").format(len(employees.keys())) else: - print os.path.abspath(args.titles) - print "No such file or directory: '{}'".format(args.titles) + print(os.path.abspath(args.titles)) + print("No such file or directory: '{}'").format(args.titles) if employees: #output employees for name, title in employees.iteritems(): - print "{} {}".format(name, title[:50].replace('&', '&')) + print("{} {}").format(name, title[:50].replace('&', '&')) #craft emails emails = create_emails(employees, domain, email) @@ -74,9 +74,9 @@ if emails: #output emails - print "\nEmails crafted\n".format(len(emails.keys())) + print("\nEmails crafted\n").format(len(emails.keys())) for name, email in emails.items(): - print email + print(email) #export results if args.html: @@ -88,4 +88,4 @@ if args.csv: output("csv", args.csv, args.company, domain, employees, emails) except (KeyboardInterrupt, SystemExit): - print "\nTerminated script.\n" \ No newline at end of file + print("\nTerminated script.\n") From bb054fdae9aed7313a93d317c5913ff00bb085fb Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Thu, 3 Sep 2020 19:03:20 +0530 Subject: [PATCH 04/20] Update http.py --- lib/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http.py b/lib/http.py index b949f0a..575eb88 100644 --- a/lib/http.py +++ b/lib/http.py @@ -27,7 +27,7 @@ def http_request(url): return {"status": r.status_code, "response": ""} except requests.exceptions.Timeout as e: - print "Error: Timed out." + print("Error: Timed out.") logging.error(e) except Exception as e: - logging.error(e) \ No newline at end of file + logging.error(e) From deca6054eddbdf65ee4df9e59963e65b7e134f4a Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Thu, 3 Sep 2020 19:07:42 +0530 Subject: [PATCH 05/20] Update soup.py Added python 3 support --- lib/soup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/soup.py b/lib/soup.py index 1351719..61cb04e 100644 --- a/lib/soup.py +++ b/lib/soup.py @@ -1,4 +1,5 @@ -import BeautifulSoup, json +import json +from bs4 import BeautifulSoup def soupify(response): try: @@ -7,7 +8,7 @@ def soupify(response): except (AttributeError, TypeError) as e: pass except Exception as e: - print "Error: {}".format(e) + print("Error: {}".format(e)) def get_employees(soup): try: @@ -21,5 +22,5 @@ def get_employees(soup): except (AttributeError, TypeError) as e: pass except Exception as e: - print "Error: {}".format(e) + print("Error: {}".format(e)) From fcdaaf12c6882c1e21b8fe4b91426bf19313e903 Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Thu, 3 Sep 2020 19:11:24 +0530 Subject: [PATCH 06/20] Update workbench.py Added Python 3 support --- lib/workbench.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/workbench.py b/lib/workbench.py index 850c017..fe9a919 100644 --- a/lib/workbench.py +++ b/lib/workbench.py @@ -19,9 +19,9 @@ def get_domain(company): #Clearbit API - clearbit.com if len(clearbit_results) == 1: #return domain if one result domain = clearbit_results[0]["domain"] elif len(clearbit_results) > 1: #prompt user if multiple domains identified - print "Multiple domains identified for company. Which one is the target?" + print("Multiple domains identified for company. Which one is the target?") for index, result in enumerate(clearbit_results): - print "{}) Name: {}, Domain: {}".format(index, result["name"], result["domain"]) + print("{}) Name: {}, Domain: {}").format(index, result["name"], result["domain"]) choice = input() domain = clearbit_results[choice]["domain"] @@ -29,7 +29,7 @@ def get_domain(company): #Clearbit API - clearbit.com return domain else: logging.error("Clearbit API - HTTP {} Error".format(r["status"])) - print "InSpy could not identify the domain name. Use --domain." + print("InSpy could not identify the domain name. Use --domain.") def get_email_format(domain, apikey): #HunterIO API - hunter.io @@ -50,7 +50,7 @@ def get_email_format(domain, apikey): #HunterIO API - hunter.io if emailformat: return emailformat else: - print "InSpy could not identify the email format. Use --email." + print("InSpy could not identify the email format. Use --email.") def search_linkedin(company, file): titles = [] @@ -113,4 +113,4 @@ def format_email(eformat, first, last): } return formats[eformat] except Exception as e: - print e \ No newline at end of file + print(e) From 40651c81cd5db74531fdb25cafc5821a18e8dcfa Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Thu, 3 Sep 2020 19:17:32 +0530 Subject: [PATCH 07/20] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b3d030c..1190bd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ requests -BeautifulSoup +beautifulsoup4 From fa80bb155c31a605733f694b49916e797671a4a2 Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Fri, 4 Sep 2020 00:05:53 +0530 Subject: [PATCH 08/20] Update InSpy.py Code Updated to Python 3 as python 2 is dead in many os environment --- InSpy.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/InSpy.py b/InSpy.py index 4070aab..ba13e16 100755 --- a/InSpy.py +++ b/InSpy.py @@ -8,8 +8,13 @@ from lib.export import * from lib.logger import * - -parser = argparse.ArgumentParser(description='InSpy - A LinkedIn enumeration tool by Jonathan Broche (@LeapSecurity)', version="3.0.1") +hunterapi = "" #insert hunterio api key here +if not hunterapi: + print("[+] Your hunter api key is Empty") + print("[+] Hunter Api Key is required please fill the hunter api key opening the InSpy.py File") + exit() +Version ="4.0" +parser = argparse.ArgumentParser(description='InSpy - A LinkedIn enumeration tool by Jonathan Broche (@LeapSecurity)') parser.add_argument('company', help="Company name to use for tasks.") parser.add_argument('--domain', help="Company domain to use for searching.") parser.add_argument('--email', help="Email format to create email addresses with. [Accepted Formats: 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]") @@ -26,13 +31,13 @@ args = parser.parse_args() start_logger(args.company) -hunterapi = "" #insert hunterio api key here + email = args.email domain = args.domain -print("\nInSpy {}").format(parser.version) +print("\nInSpy {}".format(Version)) try: if domain and not email: #search hunterio for email format @@ -48,7 +53,7 @@ email = email.replace("{", "").replace("}","") - print (\nDomain: {}, Email Format: {}\n").format(domain, email) + print("Domain: {}, Email Format: {}".format(domain, email)) employees = {} @@ -58,15 +63,15 @@ if args.company.lower() in title.lower(): if not name in employees: employees[name] = title - print("\n{} Employees identified").format(len(employees.keys())) + print("{} Employees identified".format(len(employees.keys()))) else: print(os.path.abspath(args.titles)) - print("No such file or directory: '{}'").format(args.titles) - + print("No such file or directory: '{}'".format(args.titles)) + emails=[] if employees: #output employees - for name, title in employees.iteritems(): - print("{} {}").format(name, title[:50].replace('&', '&')) + for name, title in employees.items(): + print("{} {}".format(name, title[:50].replace('&', '&'))) #craft emails emails = create_emails(employees, domain, email) @@ -74,7 +79,7 @@ if emails: #output emails - print("\nEmails crafted\n").format(len(emails.keys())) + print("Emails crafted".format(len(emails.keys()))) for name, email in emails.items(): print(email) @@ -88,4 +93,4 @@ if args.csv: output("csv", args.csv, args.company, domain, employees, emails) except (KeyboardInterrupt, SystemExit): - print("\nTerminated script.\n") + print("Terminated script.") From 2183425318da814b3c4615cad4f8db97a4010bbf Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Fri, 4 Sep 2020 00:06:27 +0530 Subject: [PATCH 09/20] Delete __init__.pyc --- lib/__init__.pyc | Bin 119 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/__init__.pyc diff --git a/lib/__init__.pyc b/lib/__init__.pyc deleted file mode 100644 index 2b69e10f8840612a7b1ba1f6bbfb6dba1b5e0a6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 119 zcmZSn%*(Y{RW~}B0SXv_v;z Date: Fri, 4 Sep 2020 00:06:36 +0530 Subject: [PATCH 10/20] Delete export.pyc --- lib/export.pyc | Bin 3592 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/export.pyc diff --git a/lib/export.pyc b/lib/export.pyc deleted file mode 100644 index f62f85e2d0f13500492de7f0a954086d760952a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3592 zcmbVP+j87Q5N&C_SKHYH62M%-7T|av;;a*bN!gBzA_=zwQ^=tV1}ddpX>BdiN|DBi zO?Drs@SYbQ_yG!jfG^_%;GC8e8!D+H*w(0Lre~(7`}AqK^5=YO`uWvw22%Xkc)y1y zo1*dXXGtis`&hPQ*DA+t*{ziFjO@;+Y)e>`s3yBLiR!Xjm#87T4Y9n6{Dh5~;?1bg z60fSltavpQ=ESS3FwaxByA4@JMcyCZc zr+jWe&VE5N(W`uKOS&iqT}vjmOe!*&kx5k^R>d0UO14nx6EVr%l&xu9CUqG>#(9UIGN_|EJ2$`E zly7aBHe}jVm4*a3p}{RzCrudvi#1{nXW@udLZKlGIBFF(Sa-jcogGi)i?7h+XxxIG zB5pR1_EzDr&Xybb8iw0}fsc8`TXdgdbQt)dH-<)*apHm-CF{D$g)V)du8I>Nnt2BR zGp>ni_BB*)Kcnn$P;3YFp>5 z7GUxi9L#eC#~%>(gdixw3UC~UwI+;wRYsPE6_KxJv(>)2u4k4!6CQee{m?IRr zE^*>K6~uaIoTxnm)}2jZTh35ShwB}k&w?NPwa(?M$>Dk@a?`zFjNVFe*jd5v z6$tA~YT%XJE}V3Q{bch-o{VcJ?MyZ?anm)}@qr1{K?${u+YkLtKTc84uPS^&YLSM@4VZ;w%#fG!{Ja3;ky0JGPU&!1@77BhB|Ybp8Chg ztz~|)ltXx@RDM9uPw6?ejYjs<9$!7WP=z8mT4Qovz?HHy2;bt@y~U`v=yeu9T3h^V zZE@RScIJFSgy-bJ3~>k@=Y2H#<$~|{AszEnmUx!ZM*EI&r4}acp8r4cnN{&aJjIs_ zi`w$JCFE^aKc7f5TAK|^IVj^2*zZ!of)1G~zac-UIP06#_b(Oy!Q6&?%&$2|(uexF pfT(7WVy=pgS0f~0A^Ea$y!h8S# From 4645d5d3b96627f1cdf4d7f7e46802888c28e7ba Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Fri, 4 Sep 2020 00:06:45 +0530 Subject: [PATCH 11/20] Delete http.pyc --- lib/http.pyc | Bin 1687 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/http.pyc diff --git a/lib/http.pyc b/lib/http.pyc deleted file mode 100644 index 9e537f3693f9d96677d1b494781e6ecf11a4cb64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1687 zcmbVM&2HO95T2zhJ5m!QJp^!pAlM`Axcrf1T8`7AMv$K-v0cbYZKMZ*A~(`X6shd4 z5;=%Z>7g&uN9a5B0eb0k^a0wLm1;qD(V(Ts(d_*0%+9x^KWy_#CLw$hspm;B{EcUm(fV(F$ zPm6b&AGUeqg?k*=QDcu!iKw^tYiP8=pNM2w__ZJm@D2H6sl@AI>XTAWFGoCx6PcSr z_xJd>xe*yh0Y5tCr#uWgVc3Z_`2KjDi4)O%E{(rk-|^}Zcb`9PAH3M&nH-8)z777c zuZofIw;NvI)tZgK+imjW_;sx0+)HD%%jNuQ@~G3inmerD`^V(p3#Da|W0yj2XOXty zZSQzB{r+;|(-52YLgtexpEjdT)VP}I6IF&(!XR4Yv&}jBuI1O8q_5QiuMujT zt>wC}9OKc+|JcH!(Ywn#&{a(MQVaFveoy2^Kf|RFQ{(r|DBFthIAszWYS)w`_okPn zqipZZS9pM1auoN3|4wwrTbur-6*kQ(hTBgPF*Ys%$*xt5gE_Kn(l2BpW{@CLjDUM^ zkpoNg9pwBz%}TfH%UqAo-q!t0c5!=V?2XUN4K$bq?DR#P3PoY`btK@F*z8wv5<*!C zKhj#H{f^ApPYY08pw2k(kuc_*BiI-WEDnbbC`D*Q_zhPfSo(Q(h59zYOcYc0v~W!3|P+5vTAL9o7pU@ z8Jyx3b?nli9-1|zMvg==F_Mb6f?1ce{1pYZPnpbzB9*z9%nwDI*i1AA#?A^oE^;jh zji5hA@<^#d-REr#n{o{7xu2nQZv18L_7r zxP@!Ij)aEju5*)JXY0;g=L_dHE3;edCbJiMi)w3K%r$LPC|h-ld>0$A+^1)mI{si( Tq?1g1O;I&X>pH8JD%HOLMyZ7z From d7714912ef300c47e5cf08353fca692aa8603a64 Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Fri, 4 Sep 2020 00:06:53 +0530 Subject: [PATCH 12/20] Delete logger.pyc --- lib/logger.pyc | Bin 836 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/logger.pyc diff --git a/lib/logger.pyc b/lib/logger.pyc deleted file mode 100644 index e0ec5c54ff6933e0afbeb6130181034a29397d35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 836 zcma)3O>fgc5S`s5ZIdQYB*YQrfQ30EK2++VLZ~Vbid2G>hy&qZZS1Y<$X|H3m7*r6 z@FV!2`~Y~fO`*ME?T+W;&CJ`G#;;zdJ3IOo(e{)0pWqr6F^-^&X!chZG!u7zNi#`W z(xO4Jqzyt%iW~F;_!cKl{U(Z}zwwRD6R6(TftL@wxbK}Ed!LTIX(Zrn;O^kQ#Wg=6 zEYSi@1T7@3pu6%Yypd#^4@`K_b}eWHaLXm`P~2oEj^IMOv>{p}bB|V%!ZyoAhZ7jV z#=gtz-phzvY-|HP7r-c{KC>K~1IS^Jm5B*%*5S>12-WgK`c8)CC3MeMCbDU+Uzxt= zXZl)ag>u#acCL+431VPHRO|0o+F0X1f?;^v0nezaE-RHNt8E9CisQT1Oca=N zehIcf^l?1;?2_NTKmGE-=Pf!?QJGh&SUUak9&dh=u6@AB3G*CUa9QR$n9qZ>FxB$< zFv!w5j~2*bwY2UbR@FAV^)Xk&QzCIFp2@Cgi=H?TZZQ+bfQ4Ba$B;+j25fA7!N!DV eJ9!H6kH&v<*+bgvyo|3h{f4(~cnB}#WBCU&W3i6_ From 21109c90503d88c3569f9d1392b7459b6e26c8c6 Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Fri, 4 Sep 2020 00:07:09 +0530 Subject: [PATCH 13/20] Delete soup.pyc --- lib/soup.pyc | Bin 1094 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/soup.pyc diff --git a/lib/soup.pyc b/lib/soup.pyc deleted file mode 100644 index 305db4dff7f2a437831864230742f9b1a9741d1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1094 zcmb7D&2G~`5T3R3TeTpNfCzDbn@5e?N_4RD z1sw>AJ$eVwqu6(j&td(bh7|P;Pj4jP`q&NZ``BgxQ(huVln_-!CxYgJDx?kcZK_#8 z)}ygUFW0EJL1ONa(AR+b4ha_ssw6e4JkEafSPOcJ4*LQ3+%s+1y`sp9J6GS%gF3$K z2F$LErdExoX+N9h_6(36YYR1;TIr%K=k1sIPhWepk<6{iwB`24Suu%hz_+n2m_nL7 z(?(h@VQ^@S=80qgL(Z5h@Vdv@M0SV6uF@tiU*GJeYS`uQ&AhZt1hB8hC7)}!EfT&s zD_Y`$dpia>jJIR(3!L%;DPrPg@0m*Qm_Q9d%4q^MZk>2P(3(T*tP!JF4_-W>=N^IE zxz8*nKyd=pYf#+eh&kBx|AyD8s!_2`Refop9FVP7+k`bZ)v-q4WvSywsMc8O*l;?2 zULbLck|tG+-*jXpdXCJ>OYzYYn@i3uZmqjIOoSm}5tO`U%v?Y^8@mo4=ui)F|vwd>Tnkku8evZ)L?^?#;@#~EE6t_rMk*$xcPPDAX94u0$6+-i#4 pUozwXS3fbC4*AmIWth{_&inV&a^}_~i>Il)%TyS?cE@YCzXMCs+7 Date: Fri, 4 Sep 2020 00:07:38 +0530 Subject: [PATCH 14/20] Delete workbench.pyc --- lib/workbench.pyc | Bin 4095 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/workbench.pyc diff --git a/lib/workbench.pyc b/lib/workbench.pyc deleted file mode 100644 index c8fb15d502c18badf2c3f0e3e737db1534e2e252..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4095 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 From 806343cdf58c9aa32a60b2c1924ddb80ff1383f6 Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Fri, 4 Sep 2020 00:08:47 +0530 Subject: [PATCH 15/20] Update export.py Code Updated to python 3 As support for python 2 came to end --- lib/export.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/export.py b/lib/export.py index 3b4093a..22eeae8 100644 --- a/lib/export.py +++ b/lib/export.py @@ -1,4 +1,5 @@ -import json, os, xml.dom.minidom, time, csv +import json, os, time, csv +import xml.dom.minidom from xml.etree.ElementTree import Element, SubElement, tostring def output(format, file, company, domain, employees, emails): @@ -17,14 +18,14 @@ def ocsv(filename, company, domain, employees, emails): fieldnames = ["Employee Name", "Title", "Email"] writer = csv.DictWriter(csvfile, fieldnames=fieldnames) writer.writeheader() - for name, title in employees.iteritems(): + for name, title in employees.items(): writer.writerow({"Employee Name": name, "Title": title.replace('&', '&'), "Email": emails[name]}) #JSON def ojson(file, company, domain, employees, emails): employee_json = [] - for name, title in employees.iteritems(): + for name, title in employees.items(): employee_json.append({"name": name, "title": title.replace('&', '&'), "email": emails[name]}) full_json = { @@ -49,7 +50,7 @@ def oxml(file, company, domain, employees, emails): echild = SubElement(top, 'Employees') - for name, title in employees.iteritems(): + for name, title in employees.items(): employee = SubElement(echild, "Employee") #name @@ -71,7 +72,7 @@ def oxml(file, company, domain, employees, emails): def ohtml(file, company, domain, employees, emails): employee_html = [] - for name, title in employees.iteritems(): + for name, title in employees.items(): employee_html.append("{name}{title}{email}".format(name=name, title=title, email=emails[name])) page = """ @@ -96,4 +97,4 @@ def ohtml(file, company, domain, employees, emails): """.format(company=company, time=time.strftime("%Y/%m/%d %H:%M:%S"), html=employee_html) with open(os.path.abspath(file), 'w') as f: - f.write(page) \ No newline at end of file + f.write(page) From 61ecfe132c533ca40b689c2ec9d2c348b61eb2b2 Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Fri, 4 Sep 2020 00:10:03 +0530 Subject: [PATCH 16/20] Update http.py --- lib/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http.py b/lib/http.py index 575eb88..faeffbf 100644 --- a/lib/http.py +++ b/lib/http.py @@ -1,6 +1,6 @@ import requests, random -from logger import * +import logging #requests.packages.urllib3.disable_warnings() def random_header(): From 745f68dc7e46d44450e295ad632585a210145c95 Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+TheCyberMonster@users.noreply.github.com> Date: Fri, 4 Sep 2020 00:12:44 +0530 Subject: [PATCH 17/20] Update workbench.py --- lib/workbench.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/workbench.py b/lib/workbench.py index fe9a919..e4ece19 100644 --- a/lib/workbench.py +++ b/lib/workbench.py @@ -1,6 +1,7 @@ -import re, json, HTMLParser, unicodedata -from http import * -from logger import * +import re, json, unicodedata +from html.parser import HTMLParser +import logging +from lib.http import http_request def get_domain(company): #Clearbit API - clearbit.com From 828123261770a97783b3e831d237c87e0c05babc Mon Sep 17 00:00:00 2001 From: A2hari Date: Wed, 18 Nov 2020 21:46:35 +0530 Subject: [PATCH 18/20] [+] Improved code & fix bugs --- InSpy.py | 14 +++++++------- lib/http.py | 7 +------ lib/logger.py | 3 ++- lib/soup.py | 2 +- lib/workbench.py | 23 +++++++++++------------ 5 files changed, 22 insertions(+), 27 deletions(-) diff --git a/InSpy.py b/InSpy.py index ba13e16..b14a9a9 100755 --- a/InSpy.py +++ b/InSpy.py @@ -2,19 +2,21 @@ # Copyright (c) 2018 Jonathan Broche (@LeapSecurity) import argparse, sys, os -from lib.http import * from lib.workbench import * from lib.soup import * from lib.export import * from lib.logger import * -hunterapi = "" #insert hunterio api key here +hunterapi = "305d56f8420e160b5fb20dc09dc87c00fddbccc5" #insert hunterio api key here + if not hunterapi: print("[+] Your hunter api key is Empty") print("[+] Hunter Api Key is required please fill the hunter api key opening the InSpy.py File") - exit() + sys.exit(404) + Version ="4.0" -parser = argparse.ArgumentParser(description='InSpy - A LinkedIn enumeration tool by Jonathan Broche (@LeapSecurity)') + +parser = argparse.ArgumentParser(description='InSpy - A LinkedIn enumeration tool by Hari Kiran(TheCyberMonster)\n A forked project of InSpy 3.0') parser.add_argument('company', help="Company name to use for tasks.") parser.add_argument('--domain', help="Company domain to use for searching.") parser.add_argument('--email', help="Email format to create email addresses with. [Accepted Formats: 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]") @@ -32,15 +34,13 @@ args = parser.parse_args() start_logger(args.company) - email = args.email domain = args.domain - print("\nInSpy {}".format(Version)) try: - if domain and not email: #search hunterio for email format + if domain and not email: #search hunter.io for email format email = get_email_format(args.domain, hunterapi) if email and not domain: #search clearbit for domain domain = get_domain(args.company) diff --git a/lib/http.py b/lib/http.py index faeffbf..7ad8123 100644 --- a/lib/http.py +++ b/lib/http.py @@ -1,15 +1,10 @@ import requests, random import logging -#requests.packages.urllib3.disable_warnings() def random_header(): - agents = ['Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0', - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36', - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2', - 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41', - 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36'] + agents = ['Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3'] return {'User-Agent': random.choice(agents),'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'} diff --git a/lib/logger.py b/lib/logger.py index aa8714e..20bbfd9 100644 --- a/lib/logger.py +++ b/lib/logger.py @@ -1,4 +1,5 @@ -import logging, sys, time + +import logging,time time_format = time.strftime("%Y-%m-%d %H:%M:%S") diff --git a/lib/soup.py b/lib/soup.py index 61cb04e..0320336 100644 --- a/lib/soup.py +++ b/lib/soup.py @@ -1,4 +1,4 @@ -import json + from bs4 import BeautifulSoup def soupify(response): diff --git a/lib/workbench.py b/lib/workbench.py index e4ece19..8f7d363 100644 --- a/lib/workbench.py +++ b/lib/workbench.py @@ -1,29 +1,27 @@ -import re, json, unicodedata + from html.parser import HTMLParser import logging from lib.http import http_request - -def get_domain(company): #Clearbit API - clearbit.com +def get_domain(company): #Clearbit API - clearbit.com clearbit_request = "https://autocomplete.clearbit.com/v1/companies/suggest?query={}".format(company) clearbit_results = [] domain = "" r = http_request(clearbit_request) - if len(r["response"]) >=1: - for element in r["response"]: - if company.lower() == element['name'].lower(): - clearbit_results.append({"name" : element['name'], "domain":element['domain']}) + if len(r["response"]) >= 1: + for element in r["response"]: + clearbit_results.append({"name": element['name'], "domain": element['domain']}) - if len(clearbit_results) == 1: #return domain if one result + if len(clearbit_results) == 1: #return domain if one result domain = clearbit_results[0]["domain"] - elif len(clearbit_results) > 1: #prompt user if multiple domains identified + elif len(clearbit_results) > 1: #prompt user if multiple domains identified print("Multiple domains identified for company. Which one is the target?") for index, result in enumerate(clearbit_results): - print("{}) Name: {}, Domain: {}").format(index, result["name"], result["domain"]) - choice = input() + print("{}) Name: {}, Domain: {}".format(index, result["name"], result["domain"])) + choice = int(input("Select using S.No \n (Ex: select-> 1 )\n select-> ")) domain = clearbit_results[choice]["domain"] if domain: @@ -40,7 +38,7 @@ def get_email_format(domain, apikey): #HunterIO API - hunter.io r = http_request(hunter_request) if r["status"] == 200: - for k,v in r["response"].iteritems(): + for k,v in r["response"].items(): if k == 'data': if v['pattern']: emailformat = v['pattern'] @@ -75,6 +73,7 @@ def search_linkedin(company, file): #craft emails + def create_emails(employees, domain, eformat): hparser=HTMLParser.HTMLParser() emails = {} From 9cb39557dd43e1058d1b15d64523abb41d9d4bf9 Mon Sep 17 00:00:00 2001 From: A2hari Date: Wed, 18 Nov 2020 21:46:35 +0530 Subject: [PATCH 19/20] [+] added additional headers --- lib/http.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/http.py b/lib/http.py index 7ad8123..90869e1 100644 --- a/lib/http.py +++ b/lib/http.py @@ -3,8 +3,11 @@ import logging def random_header(): - - agents = ['Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3'] + agents = ['Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0', + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36', + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2', + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41', + 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36'] return {'User-Agent': random.choice(agents),'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'} From f431943550d84b9b564b987045fd170fef767e9f Mon Sep 17 00:00:00 2001 From: Hari kiran <40531762+A2hari@users.noreply.github.com> Date: Thu, 19 Nov 2020 10:43:44 +0530 Subject: [PATCH 20/20] Update InSpy.py removed accidentally added api key --- InSpy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InSpy.py b/InSpy.py index b14a9a9..18a9097 100755 --- a/InSpy.py +++ b/InSpy.py @@ -7,7 +7,7 @@ from lib.export import * from lib.logger import * -hunterapi = "305d56f8420e160b5fb20dc09dc87c00fddbccc5" #insert hunterio api key here +hunterapi = "" #insert hunterio api key here if not hunterapi: print("[+] Your hunter api key is Empty")