|
72 | 72 | from theHarvester.discovery.constants import MissingKey |
73 | 73 | from theHarvester.lib import hostchecker, stash |
74 | 74 | from theHarvester.lib.core import DATA_DIR, Core, show_default_error_message |
| 75 | +from theHarvester.lib.output import print_linkedin_sections, print_section, sorted_unique |
75 | 76 | from theHarvester.screenshot.screenshot import ScreenShotter |
76 | 77 |
|
77 | 78 | if TYPE_CHECKING: |
@@ -1330,55 +1331,35 @@ async def handler(lst): |
1330 | 1331 |
|
1331 | 1332 | # Results |
1332 | 1333 | if len(total_asns) > 0: |
1333 | | - print(f'\n[*] ASNS found: {len(total_asns)}') |
1334 | | - print('--------------------') |
1335 | | - total_asns = list(sorted(set(total_asns))) |
1336 | | - for asn in total_asns: |
1337 | | - print(asn) |
| 1334 | + print_section(f'\n[*] ASNS found: {len(total_asns)}', total_asns, '--------------------') |
| 1335 | + total_asns = sorted_unique(total_asns) |
1338 | 1336 |
|
1339 | 1337 | if len(interesting_urls) > 0: |
1340 | | - print(f'\n[*] Interesting Urls found: {len(interesting_urls)}') |
1341 | | - print('--------------------') |
1342 | | - interesting_urls = list(sorted(set(interesting_urls))) |
1343 | | - for iurl in interesting_urls: |
1344 | | - print(iurl) |
| 1338 | + print_section(f'\n[*] Interesting Urls found: {len(interesting_urls)}', interesting_urls, '--------------------') |
| 1339 | + interesting_urls = sorted_unique(interesting_urls) |
1345 | 1340 |
|
1346 | 1341 | if len(twitter_people_list_tracker) == 0 and 'twitter' in engines: |
1347 | 1342 | print('\n[*] No Twitter users found.\n\n') |
1348 | 1343 | elif len(twitter_people_list_tracker) >= 1: |
1349 | | - print('\n[*] Twitter Users found: ' + str(len(twitter_people_list_tracker))) |
1350 | | - print('---------------------') |
1351 | | - twitter_people_list_tracker = list(sorted(set(twitter_people_list_tracker))) |
1352 | | - for usr in twitter_people_list_tracker: |
1353 | | - print(usr) |
1354 | | - |
1355 | | - if len(linkedin_people_list_tracker) == 0 and 'linkedin' in engines: |
1356 | | - print('\n[*] No LinkedIn users found.\n\n') |
1357 | | - elif len(linkedin_people_list_tracker) >= 1: |
1358 | | - print('\n[*] LinkedIn Users found: ' + str(len(linkedin_people_list_tracker))) |
1359 | | - print('---------------------') |
1360 | | - linkedin_people_list_tracker = list(sorted(set(linkedin_people_list_tracker))) |
1361 | | - for usr in linkedin_people_list_tracker: |
1362 | | - print(usr) |
1363 | | - |
1364 | | - if len(linkedin_links_tracker) == 0 and ('linkedin' in engines or 'rocketreach' in engines): |
1365 | | - print(f'\n[*] LinkedIn Links found: {len(linkedin_links_tracker)}') |
1366 | | - linkedin_links_tracker = list(sorted(set(linkedin_links_tracker))) |
1367 | | - print('---------------------') |
1368 | | - for link in linkedin_people_list_tracker: |
1369 | | - print(link) |
| 1344 | + print_section( |
| 1345 | + '\n[*] Twitter Users found: ' + str(len(twitter_people_list_tracker)), |
| 1346 | + twitter_people_list_tracker, |
| 1347 | + '---------------------', |
| 1348 | + ) |
| 1349 | + twitter_people_list_tracker = sorted_unique(twitter_people_list_tracker) |
| 1350 | + |
| 1351 | + print_linkedin_sections(engines, linkedin_people_list_tracker, linkedin_links_tracker) |
| 1352 | + linkedin_people_list_tracker = sorted_unique(linkedin_people_list_tracker) |
| 1353 | + linkedin_links_tracker = sorted_unique(linkedin_links_tracker) |
1370 | 1354 |
|
1371 | 1355 | length_urls = len(all_urls) |
1372 | 1356 | if length_urls == 0: |
1373 | 1357 | if len(engines) >= 1 and 'trello' in engines: |
1374 | 1358 | print('\n[*] No Trello URLs found.') |
1375 | 1359 | else: |
1376 | 1360 | total = length_urls |
1377 | | - print('\n[*] Trello URLs found: ' + str(total)) |
1378 | | - print('--------------------') |
1379 | | - all_urls = list(sorted(set(all_urls))) |
1380 | | - for url in sorted(all_urls): |
1381 | | - print(url) |
| 1361 | + print_section('\n[*] Trello URLs found: ' + str(total), all_urls, '--------------------') |
| 1362 | + all_urls = sorted_unique(all_urls) |
1382 | 1363 |
|
1383 | 1364 | if len(all_ip) == 0: |
1384 | 1365 | print('\n[*] No IPs found.') |
@@ -1847,7 +1828,6 @@ async def handler(lst): |
1847 | 1828 | try: |
1848 | 1829 | print('\n[*] Performing BuiltWith scan...') |
1849 | 1830 | builtwith_scanner = builtwith.SearchBuiltWith(word) |
1850 | | - # Use the process method according to the original structure of this module |
1851 | 1831 | await builtwith_scanner.process(use_proxy) |
1852 | 1832 |
|
1853 | 1833 | hosts = await builtwith_scanner.get_hostnames() |
|
0 commit comments