diff --git a/README.md b/README.md index bbf710fb..598af5bc 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Main contributors: ------------------ * [![Twitter Follow](https://img.shields.io/twitter/follow/NotoriousRebel1.svg?style=social&label=Follow)](https://twitter.com/NotoriousRebel1) Matthew Brown @NotoriousRebel1 * [![Twitter Follow](https://img.shields.io/twitter/follow/jay_townsend1.svg?style=social&label=Follow)](https://twitter.com/jay_townsend1) Jay "L1ghtn1ng" Townsend @jay_townsend1 -* [![Twitter Follow](https://img.shields.io/twitter/follow/Jzold.svg?style=social&label=Follow)](https://twitter.com/Jzold) Janos Zold @Jzold +* [![LinkedIn](https://static.licdn.com/scds/common/u/img/webpromo/btn_viewmy_160x25.png)](https://www.linkedin.com/in/janoszold/) Janos Zold * [![Twitter Follow](https://img.shields.io/twitter/follow/discoverscripts.svg?style=social&label=Follow)](https://twitter.com/discoverscripts) Lee Baird @discoverscripts Thanks: diff --git a/theHarvester/__main__.py b/theHarvester/__main__.py index 1758f81e..992b4f7e 100644 --- a/theHarvester/__main__.py +++ b/theHarvester/__main__.py @@ -358,7 +358,7 @@ def start(): db.store_all(word, emails, 'email', 'trello') elif engineitem == 'twitter': - print('\033[94m[*] Searching Twitter. \033[0m') + print('\033[94m[*] Searching Twitter usernames using Google. \033[0m') search = twittersearch.search_twitter(word, limit) search.process() people = search.get_people() diff --git a/theHarvester/discovery/twittersearch.py b/theHarvester/discovery/twittersearch.py index cc8747da..386434f2 100644 --- a/theHarvester/discovery/twittersearch.py +++ b/theHarvester/discovery/twittersearch.py @@ -3,6 +3,7 @@ from theHarvester.parsers import myparser import requests import time +import re class search_twitter: @@ -36,24 +37,9 @@ def get_people(self): # fix invalid handles that look like @user other_output handles = set() for handle in to_parse: - handle = str(handle).strip() - if len(handle) > 2: - if ' ' in handle: - handle = handle.split(' ')[0] - # strip off period at the end if exists - if handle[len(handle) - 1] == '.': - handle = handle[:len(handle) - 1] - # strip periods if contains three of them - if '...' in handle: - handle = handle[:handle.index('.')] - if '-' == handle[0]: - handle = handle[1:] - if '-' == handle[1]: - handle = handle[0] + handle[2:] - handles.add(handle) - if '@' in handles: - handles.remove('@') - + result = re.search(r'^@?(\w){1,15}', handle) + if result: + handles.add(result.group(0)) return handles def process(self):