Codebase list osrframework / 99727bc
Import upstream version 0.20.2 Kali Janitor 3 years ago
61 changed file(s) with 767 addition(s) and 2585 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 2.1
11 Name: osrframework
2 Version: 0.20.1
2 Version: 0.20.2
33 Summary: OSRFramework - A set of AGPLv3+ OSINT tools developed by i3visio analysts for online research.
44 Home-page: http://github.com/i3visio/osrframework
55 Author: Felix Brezo and Yaiza Rubio
66 Author-email: [email protected]
77 License: COPYING
8 Description: OSRFramework
9 ============
10
11 OSRFramework: Open Sources Research Framework
12
13 Copyright (C) 2014-2020 F. Brezo and Y. Rubio, i3visio
14
15 [![Version in PyPI](https://img.shields.io/pypi/v/osrframework.svg)]()
16 [![License](https://img.shields.io/badge/license-GNU%20Affero%20General%20Public%20License%20Version%203%20or%20Later-blue.svg)]()
17
18 1 - Description
19 ---------------
20
21 OSRFramework is a GNU AGPLv3+ set of libraries developed by i3visio to perform Open Source Intelligence collection tasks.
22 They include references to a bunch of different applications related to username checking, DNS lookups, information leaks research, deep web search, regular expressions extraction and many others.
23 At the same time, by means of ad-hoc Maltego transforms, OSRFramework provides a way of making these queries graphically as well as several interfaces to interact with like OSRFConsole or a Web interface.
24
25 2 - License: GNU AGPLv3+
26 ------------------------
27
28 This is free software, and you are welcome to redistribute it under certain conditions.
29
30 This program is free software: you can redistribute it and/or modify
31 it under the terms of the GNU Affero General Public License as published by
32 the Free Software Foundation, either version 3 of the License, or
33 (at your option) any later version.
34
35 This program is distributed in the hope that it will be useful,
36 but WITHOUT ANY WARRANTY; without even the implied warranty of
37 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 GNU Affero General Public License for more details.
39
40 You should have received a copy of the GNU Affero General Public License
41 along with this program. If not, see <http://www.gnu.org/licenses/>.
42
43
44 For more details on this issue, check the [COPYING](COPYING) file.
45
46 3 - Installation
47 ----------------
48
49 Fast way to do it on any system for a user with administration privileges:
50 ```
51 pip3 install osrframework
52 ```
53 You can upgrade to the latest release of the framework with:
54 ```
55 pip3 install osrframework --upgrade
56 ```
57 This will manage all the dependencies for you and install the latest version of the framework.
58
59 If you needed further information on how to install OSRFramework on certain systems, note that you may need to add `export PATH=$PATH:$HOME/.local/bin` to your `~/.bashrc_profile`). This has been confirmed in some distributions, including MacOS.
60 In any case, we recommend you yo have a look at the [INSTALL.md](doc/INSTALL.md) file where we provide additional details for these cases.
61
62 4 - Basic usage
63 ---------------
64
65 If everything went correctly (we hope so!), it's time for trying usufy., mailfy and so on.
66 But we are they
67 ? They are installed in your path meaning that you can open a terminal anywhere and typing the name of the program (seems to be an improvement from previous installations...). Examples:
68 ```
69 osrf --help
70 usufy -n i3visio febrezo yrubiosec -p twitter facebook
71 searchfy -q "i3visio"
72 mailfy -n i3visio
73 ```
74
75 Type -h or --help to get more information about which are the parameters of each application.
76
77 The tools installed in this package include:
78
79 - `alais_generator`. Generates candidate nicknames based on known info about the target. **Input**: information about the target. **Output**: list of possible nicknames.
80 - `checkfy`. Guesses possible emails based on a list of candidate nicknames and a pattern. **Input**: list of nicknames and an email pattern. **Output**. list of emails matching the pattern..
81 - `domainfy`. Finds domains that currently resolve using a given word or nickname. **Input**: liat of words. **Output**: domains using that word that currently resolve.
82 - `mailfy`. Find more information about emails taken as a reference either a nickname (to generate a list of possible emails) or the email list. **Input**: list of nicknames or emails. **Output**: found information about the email.
83 - `osrf`. Shared wrapper for the rest of the applications. All commands can also be used as `osrf usufy…`, `osrf mailfy…`, etc.
84 - `phonefy`. Recovers information about mobile phones linked to known spam practices. **Inputs**: list of phones. **Outputs**: Phones linked to spam.
85 - `searchfy`. Finds profiles linked to a fullname. **Inputs**: list of phones. **Outputs**: Known profiles linked to the query.
86 - `usufy`. Identifies socialmedia profiles using a given nickname. **Inputs**: list of nicknames. **Outputs**: Known profiles in socialmedia using those nicknames.
87
88 You can find the configuration files in a folder created in your user home to define the default behaviour of the applications:
89 ```
90 # Configuration files for Linux and MacOS
91 ~/.config/OSRFramework/
92 # Configuration files for Windows
93 C:\Users\<User>\OSRFramework\
94 ```
95
96 OSRFramework will look for the configuration settings for each application stored there.
97 You can add new credentials there and if something goes wrong, you can always restore the files stored in the `defaults` subfolder.
98
99 If you are experiencing problems, you might fight relevant information in the (FAQ Section)[doc/FAQ.md].
100
101 5 - HACKING
102 -----------
103
104 If you want to extend the functionalities of OSRFramework and you do not know where to start from, check the [HACKING.md](doc/HACKING.md) file.
105
106 6 - AUTHORS
107 -----------
108
109 More details about the authors in the [AUTHORS.md](AUTHORS.md) file.
110
8 Description: UNKNOWN
1119 Keywords: python osint harvesting profiling username socialmedia forums
11210 Platform: UNKNOWN
11311 Classifier: Development Status :: 4 - Beta
4040
4141 Fast way to do it on any system for a user with administration privileges:
4242 ```
43 pip3 install osrframework
43 sudo pip3 install osrframework
4444 ```
4545 You can upgrade to the latest release of the framework with:
4646 ```
47 pip3 install osrframework --upgrade
47 sudo pip3 install osrframework --upgrade
4848 ```
4949 This will manage all the dependencies for you and install the latest version of the framework.
5050
5555 ---------------
5656
5757 If everything went correctly (we hope so!), it's time for trying usufy., mailfy and so on.
58 But we are they
59 ? They are installed in your path meaning that you can open a terminal anywhere and typing the name of the program (seems to be an improvement from previous installations...). Examples:
58 But where are they locally? They are installed in your path meaning that you can open a terminal anywhere and typing the name of the program (seems to be an improvement from previous installations...). Examples:
59
6060 ```
6161 osrf --help
6262 usufy -n i3visio febrezo yrubiosec -p twitter facebook
0 ################################################################################
0 # !/usr/bin/python
1 # -*- coding: utf-8 -*-
12 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 ##################################################################################
4 #
5 # Copyright 2016-2017 Félix Brezo and Yaiza Rubio (i3visio, [email protected])
36 #
47 # This program is part of OSRFramework. You can redistribute it and/or modify
58 # it under the terms of the GNU Affero General Public License as published by
1417 # You should have received a copy of the GNU Affero General Public License
1518 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1619 #
17 ################################################################################
20 ##################################################################################
1821
1922 __author__ = "John Doe <[email protected]>"
2023 __version__ = "1.0"
2326 import json
2427 import re
2528 import sys
29 import urllib2
2630
2731 import osrframework.utils.browser as browser
2832 from osrframework.utils.platforms import Platform
0 # -*- coding: utf-8 -*-
1 #
02 ################################################################################
13 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
4 # Copyright 2018 Félix Brezo and Yaiza Rubio (i3visio, [email protected])
35 #
46 # This program is part of OSRFramework. You can redistribute it and/or modify
57 # it under the terms of the GNU Affero General Public License as published by
2022 __version__ = "2.0"
2123
2224 from osrframework.utils.platforms import Platform
23
25 import urllib2
2426
2527 class Demo(Platform):
2628 """
7577 -------
7678 Returns the collected data if exists or None if not.
7779 """
78 return query if query urllib3.open("https://demo.demo/{}".format(query)) else None
80 return query if query urllib2.open("https://demo.demo/{}".format(query)) else None
99 ```
1010 python --version
1111 ```
12
1312 If you get errors at this point or the Python version is not appeating, your system is not yet prepared. You will need to install Python 3.6 from the official website:
14
1513 ```
1614 https://www.python.org/downloads/
1715 ```
18
1916 Follow the installation steps for your system. Note that in one step of the Windows installation process you WILL NEED to manually add c:\Python36 and C:\Python36\scripts to the system. Try again after completing this task.
20
21 If using OSRFramework < 0.20.0 (Python 2) only, it is recommemded to uninstall the Python 2 package.
22
23 ```
24 pip2 uninstall osrframework
25 ```
2617
2718 Now it's the turn of the package manager. Check that you have the pip version installed. `pip` SHOULD mostly work, but just in case and for legacy compatibilities with systems also using `pip` for Python 2, `pip3` is preferred:
2819
1616 #
1717 ################################################################################
1818
19 __version__ = "0.20.1"
19 __version__ = "0.20.2"
0 ################################################################################
0 #!/usr/bin/env python
1 # encoding: utf-8
12 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 ##################################################################################
34 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
5 # Copyright 2015 Félix Brezo and Yaiza Rubio (i3visio, [email protected])
6 #
7 # This file is part of OSRFramework. You can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
69 # the Free Software Foundation, either version 3 of the License, or
710 # (at your option) any later version.
811 #
912 # This program is distributed in the hope that it will be useful,
1013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1114 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
15 # GNU General Public License for more details.
1316 #
14 # You should have received a copy of the GNU Affero General Public License
17 # You should have received a copy of the GNU General Public License
1518 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1619 #
17 ################################################################################
20 ##################################################################################
1821
1922 import argparse
2023 import json
480483 except:
481484 # Error... We will have to wait
482485 waiting = True
483 print("No more queries remaining, sleeping for " + str(waitTime) +" seconds...")
486 print "No more queries remaining, sleeping for " + str(waitTime) +" seconds..."
484487 time.sleep(waitTime) """
485488
486489 new_tweets = _getNewTweets(api, screen_name, oldest=oldest)
737740
738741 page = 0
739742
743 # print "Getting page %s of new users..." % page+1
740744 # Making the call to the API
741745 try:
742746 newUsers = api.search_users(query, n, page)
445445
446446 # Configuring the processing options
447447 group_processing = parser.add_argument_group('Processing arguments', 'Configuring the way in which mailfy will process the identified profiles.')
448 group_processing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.')
449 group_processing.add_argument('-o', '--output-folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.')
450 group_processing.add_argument('-t', '--tlds', metavar='<tld_type>', nargs='+', choices=["all", "none"] + list(TLD.keys()), action='store', help='list of TLD types where the nick will be looked for.', required=False, default=DEFAULT_VALUES["tlds"])
451 group_processing.add_argument('-u', '--user-defined', metavar='<new_tld>', nargs='+', action='store', help='additional TLD that will be searched.', required=False, default=DEFAULT_VALUES["user_defined"])
448 group_processing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES.get("extension", ["csv"]), action='store', help='output extension for the summary files. Default: xls.')
449 group_processing.add_argument('-o', '--output-folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES.get("output_folder", "."), action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.')
450 group_processing.add_argument('-t', '--tlds', metavar='<tld_type>', nargs='+', choices=["all", "none"] + list(TLD.keys()), action='store', help='list of TLD types where the nick will be looked for.', required=False, default=DEFAULT_VALUE.get("tlds", [])
451 group_processing.add_argument('-u', '--user-defined', metavar='<new_tld>', nargs='+', action='store', help='additional TLD that will be searched.', required=False, default=DEFAULT_VALUES.get("user_defined", []))
452452 group_processing.add_argument('-x', '--exclude', metavar='<domain>', nargs='+', required=False, default=exclude_list, action='store', help="select the domains to be avoided. The format should include the initial '.'.")
453453 group_processing.add_argument('-F', '--file-header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES["file_header"], action='store', help='header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' )
454454 group_processing.add_argument('-T', '--threads', metavar='<num_threads>', required=False, action='store', default=int(DEFAULT_VALUES["threads"]), type=int, help='write down the number of threads to be used (default 16). If 0, the maximum number possible will be used, which may make the system feel unstable.')
345345 print(f"\n\t[*] {i+1}/{len(emails)} Checking '{general.title(e)}'...")
346346 for pla in platforms:
347347 # This returns a json.txt!
348 entities = pla.get_info(query=e, mode="mailfy")
349 data = json.loads(entities)
350 if data:
351 results += data
348 entities = pla.do_mailfy(query=e)
349 if entities:
350 results += entities
352351 return results
353352
354353
377376
378377 # Configuring the processing options
379378 group_processing = parser.add_argument_group('Processing arguments', 'Configuring the way in which mailfy will process the identified profiles.')
380 group_processing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.')
381 group_processing.add_argument('-d', '--domains', metavar='<candidate_domains>', nargs='+', choices=['all'] + EMAIL_DOMAINS, action='store', help='list of domains where the nick will be looked for.', required=False, default=DEFAULT_VALUES["domains"])
382 group_processing.add_argument('-o', '--output-folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.')
379 group_processing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx'], required=False, default=DEFAULT_VALUES.get("extension", ["csv"]), action='store', help='output extension for the summary files. Default: csv.')
380 group_processing.add_argument('-d', '--domains', metavar='<candidate_domains>', nargs='+', choices=['all'] + EMAIL_DOMAINS, action='store', help='list of domains where the nick will be looked for.', required=False, default=DEFAULT_VALUES.get("domains", []))
381 group_processing.add_argument('-o', '--output-folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES.get("output_folder"), action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.')
383382 group_processing.add_argument('-p', '--platforms', metavar='<platform>', choices=plat_options, nargs='+', required=False, default=["all"], action='store', help='select the platforms where you want to perform the search amongst the following: {}. More than one option can be selected.'.format(str(plat_options)))
384383 group_processing.add_argument('-x', '--exclude', metavar='<domain>', choices=EMAIL_DOMAINS, nargs='+', required=False, default=exclude_list, action='store', help="select the domains to be excluded from the search.")
385 group_processing.add_argument('-F', '--file-header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES["file_header"], action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' )
386 group_processing.add_argument('-T', '--threads', metavar='<num_threads>', required=False, action='store', default = int(DEFAULT_VALUES["threads"]), type=int, help='write down the number of threads to be used (default 16). If 0, the maximum number possible will be used, which may make the system feel unstable.')
384 group_processing.add_argument('-F', '--file-header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES.get("file_header", "profiles"), action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' )
385 group_processing.add_argument('-T', '--threads', metavar='<num_threads>', required=False, action='store', default = int(DEFAULT_VALUES.get("threads", 0)), type=int, help='write down the number of threads to be used (default 16). If 0, the maximum number possible will be used, which may make the system feel unstable.')
387386 group_processing.add_argument('--quiet', required=False, action='store_true', default=False, help='tells the program not to show anything.')
388387
389388 # About options
534533 except KeyError:
535534 # API_Key not found
536535 config_path = os.path.join(configuration.get_config_path()["appPath"], "api_keys.cfg")
537 print(general.warning(f"No API found for HaveIBeenPwned. Request one at <https://haveibeenpwned.com/API/Key> and add it to '{config_path}'."))
536 print("\t[*] " + general.warning("No API found for HaveIBeenPwned") + f". Request one at <https://haveibeenpwned.com/API/Key> and add it to '{config_path}'.")
538537 except KeyboardInterrupt:
539538 print(general.warning("\tStep 3 manually skipped by the user...\n"))
540539
604603 print(general.success(general.osrf_to_text_export(results)))
605604
606605 now = dt.datetime.now()
606 """#TODO fix
607607 print(f"\n{now}\tYou can find all the information collected in the following files:")
608 fileHeader = os.path.join(args.output_folder, args.file_header)
608609 for ext in args.extension:
609610 # Showing the output files
610 print(general.emphasis("\t" + fileHeader + "." + ext))
611 print(general.emphasis("\t" + fileHeader + "." + ext))"""
611612
612613 # Showing the execution time...
613614 if not args.quiet:
614615 end_time = dt.datetime.now()
615 print("\n{end_time}\tFinishing execution...\n")
616 print(f"\n{end_time}\tFinishing execution...\n")
616617 print("Total time used:\t" + general.emphasis(str(end_time - start_time)))
617618
618619 if not args.quiet:
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
0 # !/usr/bin/python
1 # -*- coding: cp1252 -*-
2 #
3 ##################################################################################
34 #
45 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # it under the terms of the GNU General Public License as published by
67 # the Free Software Foundation, either version 3 of the License, or
78 # (at your option) any later version.
89 #
910 # This program is distributed in the hope that it will be useful,
1011 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1112 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
1516 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1617 #
17 ################################################################################
18 ##################################################################################
1819
1920 __all__ = ['search']
2021
3132 else:
3233 from cookielib import LWPCookieJar
3334 from urllib import quote_plus
34 from urllib3 import Request, urlopen
35 from urllib2 import Request, urlopen
3536 from urlparse import urlparse, parse_qs
3637
3738 # Lazy import of BeautifulSoup.
6869 @return: Web page retrieved for the given URL.
6970
7071 @raise IOError: An exception is raised on error.
71 @raise urllib3.URLError: An exception is raised on error.
72 @raise urllib3.HTTPError: An exception is raised on error.
72 @raise urllib2.URLError: An exception is raised on error.
73 @raise urllib2.HTTPError: An exception is raised on error.
7374 """
7475 request = Request(url)
7576 request.add_header('User-Agent',
233234
234235 # Returns a generator that yields URLs.
235236 def processSearch(query, tld='com', lang='en', num=10, start=0, stop=50, pause=2.0, only_standard=False):
236 """Method that recovers the URI for a search returning an i3visio-compliant json object.
237
238 Returns:
239 dict.json-like object."""
240
241 uriList = search(query, tld=tld, lang=lang, num=int(num), start=int(start), stop=int(stop), pause=float(pause),only_standard=only_standard)
242
237 '''
238 Method that recovers the URI for a search returning an i3visio-compliant json object.
239
240 :return: A json-like object.
241
242 '''
243 uriList = search(query, tld=tld, lang=lang, num=int(num), start=int(start), stop=int(stop), pause=float(pause),only_standard=only_standard)
244
243245 # Dictionary containing the URI objects
244246 results = []
245
247
246248 # Building the objects
247249 for uri in uriList:
248250 aux = {}
249 aux["type"] = "com.i3visio.URI"
250 aux["value"] = uri
251 aux["type"] = "i3visio.uri"
252 aux["value"] = uri
251253 aux["attributes"] = []
252254 results.append(aux)
253255
254256 return results
255
257
256258 # When run as a script...
257259 if __name__ == "__main__":
258260 parser = argparse.ArgumentParser(description='A package that allows the execution of searches in Google.', prog='google.py', add_help=False)
270272 groupAbout.add_argument('--version', action='version', version='%(prog)s 0.1.0', help='shows the version of the program and exists.')
271273 args = parser.parse_args()
272274
273 print("Searching..." )
274
275 print "Searching..."
276
275277 results = processSearch(args.query, tld=args.tld, lang=args.lang, num=int(args.num), start=int(args.start), stop=int(args.stop), pause=float(args.pause),only_standard=args.only_standard)
276278
277 print(json.dumps(results, indent=2))
279 print json.dumps(results, indent=2)
280
7676
7777 # Configuring the processing options
7878 group_processing = parser.add_argument_group('Processing arguments', 'Configuring the way in which searchfy will process the identified profiles.')
79 group_processing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.')
80 group_processing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES["file_header"], action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>' )
81 group_processing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.')
82 group_processing.add_argument('-p', '--platforms', metavar='<platform>', choices=listAll, nargs='+', required=False, default=DEFAULT_VALUES["platforms"] ,action='store', help='select the platforms where you want to perform the search amongst the following: ' + str(listAll) + '. More than one option can be selected.')
79 group_processing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES.get("extension", ["csv"]), action='store', help='output extension for the summary files. Default: xls.')
80 group_processing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES.get("file_header", "profiles"), action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>' )
81 group_processing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES.get("output_folder", "."), action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.')
82 group_processing.add_argument('-p', '--platforms', metavar='<platform>', choices=listAll, nargs='+', required=False, default=DEFAULT_VALUES.get("platforms", []) ,action='store', help='select the platforms where you want to perform the search amongst the following: ' + str(listAll) + '. More than one option can be selected.')
8383 group_processing.add_argument('-w', '--web_browser', required=False, action='store_true', help='opening the URIs returned in the default web browser.')
8484 group_processing.add_argument('-x', '--exclude', metavar='<platform>', choices=listAll, nargs='+', required=False, default=exclude_list, action='store', help='select the platforms that you want to exclude from the processing.')
8585
171171 end_time = dt.datetime.now()
172172 print(f"\n{end_time}\tFinishing execution...\n")
173173 print("Total time used:\t" + general.emphasis(str(end_time-start_time)))
174 print("Average seconds/query:\t" + general.emphasis(str((end_time-start_time).total_seconds()/len(args.platforms))) +" seconds\n")
174 try:
175 print("Average seconds/query:\t" + general.emphasis(str((end_time-start_time).total_seconds()/len(args.platforms))) +" seconds\n")
176 except:
177 pass
175178
176179 # Urging users to place an issue on Github...
177180 print(banner.footer)
1616 #
1717 ################################################################################
1818
19
1920 import argparse
2021 import json
2122 import sys
22 import urllib3
23 import urllib2
2324
2425
2526 def getBitcoinAddressDetails(address=None):
4243 apiURL = "https://blockchain.info/rawaddr/" + str(address)
4344
4445 # Accessing the HIBP API
45 data = urllib3.urlopen(apiURL).read()
46 data = urllib2.urlopen(apiURL).read()
4647
4748 # Reading the text data onto python structures
4849 jsonData = json.loads(data)
2020
2121 import osrframework.thirdparties.md5crack_com.checkIfHashIsCracked as md5crack_com
2222
23
2423 if __name__ == "__main__":
2524 parser = argparse.ArgumentParser(description='A library that wraps a search onto md5crack.com.', prog='checkIfHashIsCracked.py', epilog="NOTE: if not provided, the API key will be searched in the config_api_keys.py file.", add_help=False)
2625 # Adding the main options
2121
2222 import osrframework.thirdparties.resolvethem_com.processing as resolvethem_com
2323
24
2524 if __name__ == "__main__":
2625 parser = argparse.ArgumentParser(description='A library that wraps a search onto resolvethem.com.', prog='checkIPFromAlias.py', epilog="", add_help=False)
2726 # Adding the main options
1818
1919 import argparse
2020 import json
21 import sys
22 import urllib2
2123
2224 import osrframework.thirdparties.infobel_com.checkPhoneDetails as infobel_com
23
2425
2526 if __name__ == "__main__":
2627 parser = argparse.ArgumentParser(description='A library that wraps a search onto infobel.com via Google.', prog='checkPhoneDetails.py', add_help=False)
1616 #
1717 ################################################################################
1818
19
1920 import argparse
2021 import json
2122
2223 import osframework.thirdparties.blockchain_info as blockchain_info
23
2424
2525 if __name__ == "__main__":
2626 parser = argparse.ArgumentParser(description='A library that wraps the search about a Bitcoin address in blockchain.info.', prog='getBitcoinAddressDetails.py', epilog="", add_help=False)
1919 import argparse
2020 import json
2121 import sys
22 import urllib2
2223
2324 import osrframework.searchengines.google as google
2425 import osrframework.thirdparties.infobel_com.processing as processing
8990
9091 args = parser.parse_args()
9192
92 print(json.dumps(checkPhoneDetails(query=args.query), indent=2))
93 print json.dumps(checkPhoneDetails(query=args.query), indent=2)
2323 import sys
2424
2525 import osrframework.utils.browser as browser
26
2726
2827 def extractFieldsFromResult(data):
2928 '''
2020 import argparse
2121 import json
2222 import sys
23 import urllib3
23 import urllib2
2424
2525
2626 def checkIpDetails(query=None):
27 """Method that checks if the given hash is stored in the md5crack.com website. An example of the json received:
27 '''
28 Method that checks if the given hash is stored in the md5crack.com website. An example of the json received:
2829 {
2930 "as": "AS8560 1\u00261 Internet AG",
3031 "city": "",
4243 "zip": ""
4344 }
4445
45 Args:
46 query (str): Query to verify. It can be either a domain or an IPv4 address.
46 :param query: Query to verify. It can be either a domain or an IPv4 address.
4747
48 Returns:
49 list. Python structure for the json received. If nothing was found, it will return an empty dictionary.
48 :return: Python structure for the json received. If nothing was found, it will return an empty dictionary.
5049 [
5150 {
5251 "attributes": [
7574 "value": "51, 9"
7675 }
7776 ]
78 """
77 '''
7978 try:
8079 apiURL = "http://ip-api.com/json/" + query
8180
8281
8382 # Accessing the ip-api.com RESTful API
84 data = urllib3.urlopen(apiURL).read()
83 data = urllib2.urlopen(apiURL).read()
8584
8685 # Reading the text data onto python structures
8786 apiData = json.loads(data)
153152 # Appending to the list of results
154153 jsonData.append(aux)
155154
155 #print json.dumps(jsonData, indent = 2)
156156 return jsonData
157157 except:
158158 # No information was found, then we return a null entity
159159 return {}
160
161160
162161 if __name__ == "__main__":
163162 parser = argparse.ArgumentParser(description='A library that wraps a search onto ip-api.com.', prog='checkIPDetails.py', epilog="", add_help=False)
172171
173172 args = parser.parse_args()
174173
175 print(json.dumps(checkIpDetails(query=args.query), indent=2))
174 print json.dumps(checkIpDetails(query=args.query), indent=2)
1818
1919 import argparse
2020 import json
21 import osrframework.utils.config_api_keys as config_api_keys
2122 import sys
22 import urllib3
23
24 import osrframework.utils.config_api_keys as config_api_keys
23 import urllib2
2524
2625
2726 def checkIfHashIsCracked(hash=None, api_key=None):
28 """Method that checks if the given hash is stored in the md5crack.com website.
27 '''
28 Method that checks if the given hash is stored in the md5crack.com website.
2929
3030 :param hash: hash to verify.
3131 :param api_key: api_key to be used in md5crack.com. If not provided, the API key will be searched in the config_api_keys.py file.
3737 "parsed": "hola",
3838 "response": "The MD5 hash was cracked."
3939 }
40 """
40 '''
4141 # This is for i3visio
4242 if api_key is None:
4343 #api_key = raw_input("Insert the API KEY here:\t")
5252 apiURL = "http://api.md5crack.com/crack/"+ api_key +"/" + hash
5353
5454 # Accessing the HIBP API
55 data = urllib3.urlopen(apiURL).read()
55 data = urllib2.urlopen(apiURL).read()
5656 if "\"parsed\":null" in data:
5757 data = data.replace("\"parsed\":null", "\"parsed\":\"\"")
5858
5959 # Reading the text data onto python structures
6060 jsonData = json.loads(data)
61 #print json.dumps(jsonData, indent = 2)
6162 return jsonData
62
6363
6464 if __name__ == "__main__":
6565 parser = argparse.ArgumentParser(description='A library that wraps a search onto md5crack.com.', prog='checkIfHashIsCracked.py', epilog="NOTE: if not provided, the API key will be searched in the config_api_keys.py file.", add_help=False)
1919 import argparse
2020 import json
2121 import sys
22 import urllib3
22 import urllib2
2323
2424
2525 def checkIfHashIsCracked(hash=None):
3737 try:
3838
3939 # Getting the result of the query from MD5db.net
40 data = urllib3.urlopen(apiURL).read()
40 data = urllib2.urlopen(apiURL).read()
4141 return data
4242
4343 except:
2121 import json
2222 import osrframework.utils.config_api_keys as config_api_keys
2323 import sys
24 import urllib2
2425
2526 from osrframework.thirdparties.pipl_com.lib.search import SearchAPIRequest, SearchAPIError
2627 from osrframework.thirdparties.pipl_com.lib import Person, Name, Address, Job
27
2828
2929 def checkInfo(email=None, username=None, api_key=None):
3030 '''
00 """Python wrapper for easily making calls to Pipl's Search API.
11
22 Pipl's Search API allows you to query with the information you have about
3 a person (his name, address, email, phone, username and more) and in response
3 a person (his name, address, email, phone, username and more) and in response
44 get all the data available on him on the web.
55
66 The classes contained in this module are:
1313
1414 """
1515 import urllib
16 import urllib3
16 import urllib2
1717 import itertools
1818 import threading
1919
2323 from osrframework.thirdparties.pipl_com.lib.utils import Serializable
2424
2525
26 # Default API key value, you can set your key globally in this variable instead
26 # Default API key value, you can set your key globally in this variable instead
2727 # of passing it to each request object.
2828 # >>> import osrframework.thirdparties.pipl_com.lib.search
2929 # >>> osrframework.thirdparties.pipl_com.lib.search.default_api_key = '<your_key>'
3131
3232
3333 class SearchAPIRequest(object):
34
34
3535 """A request to Pipl's Search API.
36
36
3737 Building the request from the query parameters can be done in two ways:
38
39 Option 1 - directly and quickly (for simple requests with only few
38
39 Option 1 - directly and quickly (for simple requests with only few
4040 parameters):
41
41
4242 >>> from osrframework.thirdparties.pipl_com.lib.search import SearchAPIRequest
43 >>> request = SearchAPIRequest(api_key='samplekey',
43 >>> request = SearchAPIRequest(api_key='samplekey',
4444 email='[email protected]')
4545 >>> response = request.send()
46
47 Option 2 - using the data-model (useful for more complex queries; for
48 example, when there are multiple parameters of the same type
49 such as few phones or a few addresses or when you'd like to use
50 information beyond the usual identifiers such as name or email,
46
47 Option 2 - using the data-model (useful for more complex queries; for
48 example, when there are multiple parameters of the same type
49 such as few phones or a few addresses or when you'd like to use
50 information beyond the usual identifiers such as name or email,
5151 information like education, job, relationships etc):
52
52
5353 >>> from osrframework.thirdparties.pipl_com.lib.search import SearchAPIRequest
5454 >>> from osrframework.thirdparties.pipl_com.lib import Person, Name, Address, Job
5555 >>> fields = [Name(first='Eric', last='Cartman'),
5656 Address(country='US', state='CO', city='South Park'),
5757 Address(country='US', state='NY'),
5858 Job(title='Actor')]
59 >>> request = SearchAPIRequest(api_key='samplekey',
59 >>> request = SearchAPIRequest(api_key='samplekey',
6060 person=Person(fields=fields))
6161 >>> response = request.send()
6262
6363 The request also supports prioritizing/filtering the type of records you
64 prefer to get in the response (see the append_priority_rule and
64 prefer to get in the response (see the append_priority_rule and
6565 add_records_filter methods).
66
66
6767 Sending the request and getting the response is very simple and can be done
68 by either making a blocking call to request.send() or by making
69 a non-blocking call to request.send_async(callback) which sends the request
68 by either making a blocking call to request.send() or by making
69 a non-blocking call to request.send_async(callback) which sends the request
7070 asynchronously.
71
71
7272 """
73
73
7474 HEADERS = {'User-Agent': 'osrframework.thirdparties.pipl_com/python/%s' % osrframework.thirdparties.pipl_com.lib.__version__}
7575 BASE_URL = 'http://api.pipl.com/search/v3/json/?'
7676 # HTTPS is also supported:
7777 #BASE_URL = 'https://api.pipl.com/search/v3/json/?'
78
79 def __init__(self, api_key=None, first_name=None, middle_name=None,
80 last_name=None, raw_name=None, email=None, phone=None,
81 username=None, country=None, state=None, city=None,
78
79 def __init__(self, api_key=None, first_name=None, middle_name=None,
80 last_name=None, raw_name=None, email=None, phone=None,
81 username=None, country=None, state=None, city=None,
8282 raw_address=None, from_age=None, to_age=None, person=None,
8383 query_params_mode='and', exact_name=False):
8484 """Initiate a new request object with given query params.
85
86 Each request must have at least one searchable parameter, meaning
87 a name (at least first and last name), email, phone or username.
88 Multiple query params are possible (for example querying by both email
85
86 Each request must have at least one searchable parameter, meaning
87 a name (at least first and last name), email, phone or username.
88 Multiple query params are possible (for example querying by both email
8989 and phone of the person).
90
90
9191 Args:
92
92
9393 api_key -- str, a valid API key (use "samplekey" for experimenting).
94 Note that you can set a default API key
95 (osrframework.thirdparties.pipl_com.lib.search.default_api_key = '<your_key>') instead of
96 passing it to each request object.
94 Note that you can set a default API key
95 (osrframework.thirdparties.pipl_com.lib.search.default_api_key = '<your_key>') instead of
96 passing it to each request object.
9797 first_name -- unicode, minimum 2 chars.
98 middle_name -- unicode.
98 middle_name -- unicode.
9999 last_name -- unicode, minimum 2 chars.
100 raw_name -- unicode, an unparsed name containing at least a first name
100 raw_name -- unicode, an unparsed name containing at least a first name
101101 and a last name.
102102 email -- unicode.
103 phone -- int/long. If a unicode/str is passed instead then it'll be
103 phone -- int/long. If a unicode/str is passed instead then it'll be
104104 striped from all non-digit characters and converted to int.
105105 IMPORTANT: Currently only US/Canada phones can be searched by
106 so country code is assumed to be 1, phones with different
106 so country code is assumed to be 1, phones with different
107107 country codes are considered invalid and will be ignored.
108108 username -- unicode, minimum 4 chars.
109109 country -- unicode, a 2 letter country code from:
117117 to_age -- int.
118118 person -- A Person object (available at osrframework.thirdparties.pipl_com.lib.Person).
119119 The person can contain every field allowed by the data-model
120 (see osrframework.thirdparties.pipl_com.lib.fields) and can hold multiple fields of
120 (see osrframework.thirdparties.pipl_com.lib.fields) and can hold multiple fields of
121121 the same type (for example: two emails, three addresses etc.)
122122 query_params_mode -- str, one of "and"/"or" (default "and").
123 Advanced parameter, use only if you care about the
124 value of record.query_params_match in the response
123 Advanced parameter, use only if you care about the
124 value of record.query_params_match in the response
125125 records.
126 Each record in the response has an attribute
127 "query_params_match" which indicates whether the
126 Each record in the response has an attribute
127 "query_params_match" which indicates whether the
128128 record has the all fields from the query or not.
129 When set to "and" all query params are required in
130 order to get query_params_match=True, when set to
129 When set to "and" all query params are required in
130 order to get query_params_match=True, when set to
131131 "or" it's enough that the record has at least one
132 of each field type (so if you search with a name
133 and two addresses, a record with the name and one
132 of each field type (so if you search with a name
133 and two addresses, a record with the name and one
134134 of the addresses will have query_params_match=True)
135135 exact_name -- bool (default False).
136 If set to True the names in the query will be matched
136 If set to True the names in the query will be matched
137137 "as is" without compensating for nicknames or multiple
138 family names. For example "Jane Brown-Smith" won't return
138 family names. For example "Jane Brown-Smith" won't return
139139 results for "Jane Brown" in the same way "Alexandra Pitt"
140140 won't return results for "Alex Pitt".
141
142 Each of the arguments that should have a unicode value accepts both
141
142 Each of the arguments that should have a unicode value accepts both
143143 unicode objects and utf8 encoded str (will be decoded automatically).
144
144
145145 """
146146 if person is None:
147147 person = Person()
167167 if from_age is not None or to_age is not None:
168168 dob = DOB.from_age_range(from_age or 0, to_age or 1000)
169169 person.add_fields([dob])
170
170
171171 self.api_key = api_key
172172 self.person = person
173173 self.query_params_mode = query_params_mode
174174 self.exact_name = exact_name
175175 self._filter_records_by = []
176176 self._prioritize_records_by = []
177
177
178178 @staticmethod
179 def _prepare_filtering_params(domain=None, category=None,
179 def _prepare_filtering_params(domain=None, category=None,
180180 sponsored_source=None, has_field=None,
181 has_fields=None, query_params_match=None,
181 has_fields=None, query_params_match=None,
182182 query_person_match=None, **kwargs):
183183 """Transform the params to the API format, return a list of params."""
184184 if query_params_match not in (None, True):
185185 raise ValueError('query_params_match can only be `True`')
186186 if query_person_match not in (None, True):
187187 raise ValueError('query_person_match can only be `True`')
188
188
189189 params = []
190190 if domain is not None:
191191 params.append('domain:%s' % domain)
204204 for has_field in has_fields:
205205 params.append('has_field:%s' % has_field.__name__)
206206 return params
207
208 def add_records_filter(self, domain=None, category=None,
209 sponsored_source=None, has_fields=None,
207
208 def add_records_filter(self, domain=None, category=None,
209 sponsored_source=None, has_fields=None,
210210 query_params_match=None, query_person_match=None):
211211 """Add a new "and" filter for the records returned in the response.
212
213 IMPORTANT: This method can be called multiple times per request for
214 adding multiple "and" filters, each of these "and" filters is
212
213 IMPORTANT: This method can be called multiple times per request for
214 adding multiple "and" filters, each of these "and" filters is
215215 interpreted as "or" with the other filters.
216216 For example:
217
217
218218 >>> from osrframework.thirdparties.pipl_com.lib.search import SearchAPIRequest
219219 >>> from osrframework.thirdparties.pipl_com.lib import Phone, Job
220220 >>> request = SearchAPIRequest('samplekey', username='eric123')
221221 >>> request.add_records_filter(domain='linkedin', has_fields=[Phone])
222222 >>> request.add_records_filter(has_fields=[Phone, Job])
223
223
224224 The above request is only for records that are:
225225 (from LinkedIn AND has a phone) OR (has a phone AND has a job).
226226 Records that don't match this rule will not come back in the response.
227
228 Please note that in case there are too many results for the query,
227
228 Please note that in case there are too many results for the query,
229229 adding filters to the request can significantly improve the number of
230230 useful results; when you define which records interest you, you'll
231231 get records that would have otherwise be cut-off by the limit on the
232232 number of records per query.
233
233
234234 Args:
235
235
236236 domain -- str, for example "linkedin.com", you may also use "linkedin"
237 but note that it'll match "linkedin.*" and "*.linkedin.*"
237 but note that it'll match "linkedin.*" and "*.linkedin.*"
238238 (any sub-domain and any TLD).
239239 category -- str, any one of the categories defined in
240240 osrframework.thirdparties.pipl_com.lib.source.Source.categories.
241 sponsored_source -- bool, True means you want just the records that
242 come from a sponsored source and False means you
241 sponsored_source -- bool, True means you want just the records that
242 come from a sponsored source and False means you
243243 don't want these records.
244 has_fields -- A list of fields classes from osrframework.thirdparties.pipl_com.lib.fields,
244 has_fields -- A list of fields classes from osrframework.thirdparties.pipl_com.lib.fields,
245245 records must have content in all these fields.
246 For example: [Name, Phone] means you only want records
246 For example: [Name, Phone] means you only want records
247247 that has at least one name and at least one phone.
248 query_params_match -- True is the only possible value and it means you
249 want records that match all the params you passed
248 query_params_match -- True is the only possible value and it means you
249 want records that match all the params you passed
250250 in the query.
251251 query_person_match -- True is the only possible value and it means you
252 want records that are the same person you
253 queried by (only records with
254 query_person_match == 1.0, see the documentation
252 want records that are the same person you
253 queried by (only records with
254 query_person_match == 1.0, see the documentation
255255 of record.query_person_match for more details).
256
256
257257 ValueError is raised in any case of an invalid parameter.
258
258
259259 """
260260 params = SearchAPIRequest._prepare_filtering_params(**locals())
261261 if params:
262262 self._filter_records_by.append(' AND '.join(params))
263
264 def append_priority_rule(self, domain=None, category=None,
265 sponsored_source=None, has_field=None,
263
264 def append_priority_rule(self, domain=None, category=None,
265 sponsored_source=None, has_field=None,
266266 query_params_match=None, query_person_match=None):
267267 """Append a new priority rule for the records returned in the response.
268
269 IMPORTANT: This method can be called multiple times per request for
268
269 IMPORTANT: This method can be called multiple times per request for
270270 adding multiple priority rules, each call can be with only one argument
271 and the order of the calls matter (the first rule added is the highest
271 and the order of the calls matter (the first rule added is the highest
272272 priority, the second is second priority etc).
273273 For example:
274
274
275275 >>> from osrframework.thirdparties.pipl_com.lib.search import SearchAPIRequest
276276 >>> from osrframework.thirdparties.pipl_com.lib import Phone
277277 >>> request = SearchAPIRequest('samplekey', username='eric123')
278278 >>> request.append_priority_rule(domain='linkedin')
279279 >>> request.append_priority_rule(has_field=Phone)
280
281 In the response to the above request records from LinkedIn will be
282 returned before records that aren't from LinkedIn and records with
283 phone will be returned before records without phone.
284
280
281 In the response to the above request records from LinkedIn will be
282 returned before records that aren't from LinkedIn and records with
283 phone will be returned before records without phone.
284
285285 Please note that in case there are too many results for the query,
286 adding priority rules to the request does not only affect the order
287 of the records but can significantly improve the number of useful
286 adding priority rules to the request does not only affect the order
287 of the records but can significantly improve the number of useful
288288 results; when you define which records interest you, you'll get records
289289 that would have otherwise be cut-off by the limit on the number
290 of records per query.
290 of records per query.
291291
292292 Args:
293
294 domain -- str, for example "linkedin.com", "linkedin" is also possible
293
294 domain -- str, for example "linkedin.com", "linkedin" is also possible
295295 and it'll match "linkedin.*".
296296 category -- str, any one of the categories defined in
297297 osrframework.thirdparties.pipl_com.lib.source.Source.categories.
298 sponsored_source -- bool, True will bring the records that
299 come from a sponsored source first and False
298 sponsored_source -- bool, True will bring the records that
299 come from a sponsored source first and False
300300 will bring the non-sponsored records first.
301301 has_fields -- A field class from osrframework.thirdparties.pipl_com.lib.fields.
302 For example: has_field=Phone means you want to give
302 For example: has_field=Phone means you want to give
303303 a priority to records that has at least one phone.
304 query_params_match -- True is the only possible value and it means you
305 want to give a priority to records that match all
304 query_params_match -- True is the only possible value and it means you
305 want to give a priority to records that match all
306306 the params you passed in the query.
307307 query_person_match -- True is the only possible value and it means you
308308 want to give a priority to records with higher
309 query_person_match (see the documentation of
309 query_person_match (see the documentation of
310310 record.query_person_match for more details).
311
311
312312 ValueError is raised in any case of an invalid parameter.
313
313
314314 """
315315 params = SearchAPIRequest._prepare_filtering_params(**locals())
316316 if len(params) > 1:
317317 raise ValueError('The function should be called with one argument')
318318 if params:
319319 self._prioritize_records_by.append(params[0])
320
320
321321 def validate_query_params(self, strict=True):
322 """Check if the request is valid and can be sent, raise ValueError if
322 """Check if the request is valid and can be sent, raise ValueError if
323323 not.
324
325 `strict` is a boolean argument that defaults to True which means an
324
325 `strict` is a boolean argument that defaults to True which means an
326326 exception is raised on every invalid query parameter, if set to False
327327 an exception is raised only when the search request cannot be performed
328328 because required query params are missing.
329
329
330330 """
331331 if not (self.api_key or default_api_key):
332332 raise ValueError('API key is missing')
335335 if not self.person.is_searchable:
336336 raise ValueError('No valid name/username/phone/email in request')
337337 if strict and self.person.unsearchable_fields:
338 raise ValueError('Some fields are unsearchable: %s'
338 raise ValueError('Some fields are unsearchable: %s'
339339 % self.person.unsearchable_fields)
340
340
341341 @property
342342 def url(self):
343343 """The URL of the request (str)."""
350350 'filter_records_by': self._filter_records_by,
351351 }
352352 return SearchAPIRequest.BASE_URL + urllib.urlencode(query, doseq=True)
353
353
354354 def send(self, strict_validation=True):
355355 """Send the request and return the response or raise SearchAPIError.
356
356
357357 Calling this method blocks the program until the response is returned,
358 if you want the request to be sent asynchronously please refer to the
359 send_async method.
360
358 if you want the request to be sent asynchronously please refer to the
359 send_async method.
360
361361 The response is returned as a SearchAPIResponse object.
362
363 `strict_vailidation` is a bool argument that's passed to the
362
363 `strict_vailidation` is a bool argument that's passed to the
364364 validate_query_params method.
365
366 Raises ValueError (raised from validate_query_params),
367 HttpError/URLError and SearchAPIError (when the response is returned
365
366 Raises ValueError (raised from validate_query_params),
367 HttpError/URLError and SearchAPIError (when the response is returned
368368 but contains an error).
369
369
370370 Example:
371
371
372372 >>> from osrframework.thirdparties.pipl_com.lib.search import SearchAPIRequest, SearchAPIError
373373 >>> request = SearchAPIRequest('samplekey', email='[email protected]')
374374 >>> try:
375375 ... response = request.send()
376376 ... except SearchAPIError as e:
377 ... print(e.http_status_code, e)
378
377 ... print e.http_status_code, e
378
379379 """
380380 self.validate_query_params(strict=strict_validation)
381381 query = {
386386 'prioritize_records_by': ','.join(self._prioritize_records_by),
387387 'filter_records_by': self._filter_records_by,
388388 }
389 request = urllib3.Request(url=SearchAPIRequest.BASE_URL, data=urllib.urlencode(query, True), headers=SearchAPIRequest.HEADERS)
389 request = urllib2.Request(url=SearchAPIRequest.BASE_URL, data=urllib.urlencode(query, True), headers=SearchAPIRequest.HEADERS)
390390 try:
391 json_response = urllib3.urlopen(request).read()
392 except urllib3.HTTPError as e:
391 json_response = urllib2.urlopen(request).read()
392 except urllib2.HTTPError as e:
393393 json_error = e.read()
394394 if not json_error:
395395 raise e
398398 except ValueError:
399399 raise e
400400 return SearchAPIResponse.from_json(json_response)
401
401
402402 def send_async(self, callback, strict_validation=True):
403403 """Same as send() but in a non-blocking way.
404
405 Use this method if you want to send the request asynchronously so your
404
405 Use this method if you want to send the request asynchronously so your
406406 program can do other things while waiting for the response.
407
408 `callback` is a function (or other callable) with the following
407
408 `callback` is a function (or other callable) with the following
409409 signature:
410410 callback(response=None, error=None)
411
411
412412 Example:
413
413
414414 >>> from osrframework.thirdparties.pipl_com.lib.search import SearchAPIRequest
415415 >>>
416416 >>> def my_callback(response=None, error=None):
417 ... print(response or error)
417 ... print response or error
418418 ...
419419 >>> request = SearchAPIRequest('samplekey', email='[email protected]')
420420 >>> request.send_async(my_callback)
421421 >>> do_other_things()
422
422
423423 """
424424 def target():
425425 try:
431431
432432
433433 class SearchAPIResponse(Serializable):
434
434
435435 """A response from Pipl's Search API.
436
436
437437 A response comprises the two things returned as a result to your query:
438
439 - A person (osrframework.thirdparties.pipl_com.lib.containers.Person) that is the deta object
440 representing all the information available for the person you were
438
439 - A person (osrframework.thirdparties.pipl_com.lib.containers.Person) that is the deta object
440 representing all the information available for the person you were
441441 looking for.
442442 This object will only be returned when our identity-resolution engine is
443443 convinced that the information is of the person represented by your query.
447447 that the response will not contain a person object.
448448 On the other hand, if you search by a unique identifier such as email or
449449 a combination of identifiers that only lead to one person, such as
450 "Eric Cartman, Age 22, From South Park, CO, US", you can expect to get
450 "Eric Cartman, Age 22, From South Park, CO, US", you can expect to get
451451 a response containing a single person object.
452
453 - A list of records (osrframework.thirdparties.pipl_com.lib.containers.Record) that fully/partially
454 match the person from your query, if the query was for "Eric Cartman from
455 Colorado US" the response might also contain records of "Eric Cartman
456 from US" (without Colorado), if you need to differentiate between records
452
453 - A list of records (osrframework.thirdparties.pipl_com.lib.containers.Record) that fully/partially
454 match the person from your query, if the query was for "Eric Cartman from
455 Colorado US" the response might also contain records of "Eric Cartman
456 from US" (without Colorado), if you need to differentiate between records
457457 with full match to the query and partial match or if you want to get a
458458 score on how likely is that record to be related to the person you are
459 searching please refer to the record's attributes
459 searching please refer to the record's attributes
460460 record.query_params_match and record.query_person_match.
461
462 The response also contains the query as it was interpreted by Pipl. This
463 part is useful for verification and debugging, if some query parameters
464 were invalid you can see in response.query that they were ignored, you can
465 also see how the name/address from your query were parsed in case you
461
462 The response also contains the query as it was interpreted by Pipl. This
463 part is useful for verification and debugging, if some query parameters
464 were invalid you can see in response.query that they were ignored, you can
465 also see how the name/address from your query were parsed in case you
466466 passed raw_name/raw_address in the query.
467
468 In some cases when the query isn't focused enough and can't be matched to
469 a specific person, such as "John Smith from US", the response also contains
470 a list of suggested searches. This is a list of Record objects, each of
471 these is an expansion of the original query, giving additional query
467
468 In some cases when the query isn't focused enough and can't be matched to
469 a specific person, such as "John Smith from US", the response also contains
470 a list of suggested searches. This is a list of Record objects, each of
471 these is an expansion of the original query, giving additional query
472472 parameters so the you can zoom in on the right person.
473
473
474474 """
475
476 def __init__(self, query=None, person=None, records=None,
475
476 def __init__(self, query=None, person=None, records=None,
477477 suggested_searches=None, warnings_=None):
478478 """Args:
479
479
480480 query -- A Person object with the query as interpreted by Pipl.
481481 person -- A Person object with data about the person in the query.
482 records -- A list of Record objects with full/partial match to the
482 records -- A list of Record objects with full/partial match to the
483483 query.
484 suggested_searches -- A list of Record objects, each of these is an
484 suggested_searches -- A list of Record objects, each of these is an
485485 expansion of the original query, giving additional
486486 query parameters to zoom in on the right person.
487 warnings_ -- A list of unicodes. A warning is returned when the query
487 warnings_ -- A list of unicodes. A warning is returned when the query
488488 contains a non-critical error and the search can still run.
489
489
490490 """
491491 self.query = query
492492 self.person = person
493493 self.records = records or []
494494 self.suggested_searches = suggested_searches or []
495495 self.warnings = warnings_ or []
496
496
497497 @property
498498 def query_params_matched_records(self):
499499 """Records that match all the params in the query."""
500500 return [rec for rec in self.records if rec.query_params_match]
501
501
502502 @property
503503 def query_person_matched_records(self):
504504 """Records that match the person from the query.
505
506 Note that the meaning of "match the person from the query" means "Pipl
507 is convinced that these records hold data about the person you're
508 looking for".
509 Remember that when Pipl is convinced about which person you're looking
510 for, the response also contains a Person object. This person is
511 created by merging all the fields and sources of these records.
512
505
506 Note that the meaning of "match the person from the query" means "Pipl
507 is convinced that these records hold data about the person you're
508 looking for".
509 Remember that when Pipl is convinced about which person you're looking
510 for, the response also contains a Person object. This person is
511 created by merging all the fields and sources of these records.
512
513513 """
514514 return [rec for rec in self.records if rec.query_person_match == 1.]
515
515
516516 def group_records(self, key_function):
517 """Return a dict with the records grouped by the key returned by
517 """Return a dict with the records grouped by the key returned by
518518 `key_function`.
519
519
520520 `key_function` takes a record and returns the value from the record to
521521 group by (see examples in the group_records_by_* methods below).
522
522
523523 The return value is a dict, a key in this dict is a key returned by
524524 `key_function` and the value is a list of all the records with this key.
525
525
526526 """
527527 sorted_records = sorted(self.records, key=key_function)
528528 grouped_records = itertools.groupby(sorted_records, key=key_function)
529529 return dict([(key, list(group)) for key, group in grouped_records])
530
530
531531 def group_records_by_domain(self):
532532 """Return the records grouped by the domain they came from.
533
533
534534 The return value is a dict, a key in this dict is a domain
535535 and the value is a list of all the records with this domain.
536
536
537537 """
538538 key_function = lambda record: record.source.domain
539539 return self.group_records(key_function)
540
540
541541 def group_records_by_category(self):
542542 """Return the records grouped by the category of their source.
543
543
544544 The return value is a dict, a key in this dict is a category
545545 and the value is a list of all the records with this category.
546
546
547547 """
548548 Source.validate_categories(categories)
549549 key_function = lambda record: record.source.category
550550 return self.group_records(key_function)
551
551
552552 def group_records_by_query_params_match(self):
553553 """Return the records grouped by their query_params_match attribute.
554
554
555555 The return value is a dict, a key in this dict is a query_params_match
556 bool (so the keys can be just True or False) and the value is a list
556 bool (so the keys can be just True or False) and the value is a list
557557 of all the records with this query_params_match value.
558
558
559559 """
560560 key_function = lambda record: record.query_params_match
561561 return self.group_records(key_function)
562
562
563563 def group_records_by_query_person_match(self):
564564 """Return the records grouped by their query_person_match attribute.
565
565
566566 The return value is a dict, a key in this dict is a query_person_match
567 float and the value is a list of all the records with this
567 float and the value is a list of all the records with this
568568 query_person_match value.
569
569
570570 """
571571 key_function = lambda record: record.query_person_match
572572 return self.group_records(key_function)
573
573
574574 @staticmethod
575575 def from_dict(d):
576576 """Transform the dict to a response object and return the response."""
586586 records = [Record.from_dict(record) for record in records]
587587 suggested_searches = d.get('suggested_searches')
588588 if suggested_searches:
589 suggested_searches = [Record.from_dict(record)
589 suggested_searches = [Record.from_dict(record)
590590 for record in suggested_searches]
591 return SearchAPIResponse(query=query, person=person, records=records,
591 return SearchAPIResponse(query=query, person=person, records=records,
592592 suggested_searches=suggested_searches,
593593 warnings_=warnings_)
594
594
595595 def to_dict(self):
596596 """Return a dict representation of the response."""
597597 d = {}
604604 if self.records:
605605 d['records'] = [record.to_dict() for record in self.records]
606606 if self.suggested_searches:
607 d['suggested_searches'] = [record.to_dict()
607 d['suggested_searches'] = [record.to_dict()
608608 for record in self.suggested_searches]
609609 return d
610
610
611611
612612 class SearchAPIError(APIError):
613
614 """An exception raised when the response from the search API contains an
613
614 """An exception raised when the response from the search API contains an
615615 error."""
616
616
617617 pass
2020 import argparse
2121 import re
2222 import requests
23
23 import urllib
2424
2525 def checkIPFromAlias(alias=None):
26 """Method that checks if the given alias is currently connected to Skype and returns its IP address.
26 """
27 Method that checks if the given alias is currently connected to Skype and returns its IP address.
2728
28 Args:
29 alias (str): Alias to be searched.
29 :param alias: Alias to be searched.
3030
31 Returns:
32 dict. Python structure for the Json received. It has the following structure:
31 :return: Python structure for the Json received. It has the following structure:
3332 {
3433 "type": "i3visio.ip",
3534 "value": "1.1.1.1",
334334
335335 # Selecting the platforms where performing the search
336336 groupPlatforms = parser.add_argument_group('Platform selection arguments', 'Criteria for selecting the platforms where performing the search.')
337 groupPlatforms.add_argument('-p', '--platforms', metavar='<platform>', choices=platOptions, nargs='+', required=False, default=DEFAULT_VALUES["platforms"], action='store', help='select the platforms where you want to perform the search amongst the following: ' + str(platOptions) + '. More than one option can be selected.')
337 groupPlatforms.add_argument('-p', '--platforms', metavar='<platform>', choices=platOptions, nargs='+', required=False, default=DEFAULT_VALUES.get("platforms", []), action='store', help='select the platforms where you want to perform the search amongst the following: ' + str(platOptions) + '. More than one option can be selected.')
338338 groupPlatforms.add_argument('-t', '--tags', metavar='<tag>', default = [], nargs='+', required=False, action='store', help='select the list of tags that fit the platforms in which you want to perform the search. More than one option can be selected.')
339339 groupPlatforms.add_argument('-x', '--exclude', metavar='<platform>', choices=platOptions, nargs='+', required=False, default=excludeList, action='store', help='select the platforms that you want to exclude from the processing.')
340340
344344 group_processing.add_argument('--avoid_processing', required=False, action='store_true', default=False, help='argument to force usufy NOT to perform any processing task with the valid profiles.')
345345 group_processing.add_argument('--fuzz_config', metavar='<path_to_fuzz_list>', action='store', type=argparse.FileType('r'), help='path to the fuzzing config details. Wildcards such as the domains or the nicknames should come as: <DOMAIN>, <USERNAME>.')
346346 group_processing.add_argument('--nonvalid', metavar='<not_valid_characters>', required=False, default = '\\|<>=', action='store', help="string containing the characters considered as not valid for nicknames." )
347 group_processing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.')
347 group_processing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES.get("extension", ["csv"]), action='store', help='output extension for the summary files. Default: csv.')
348348 group_processing.add_argument('-L', '--logfolder', metavar='<path_to_log_folder', required=False, default = './logs', action='store', help='path to the log folder. If none was provided, ./logs is assumed.')
349 group_processing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.')
349 group_processing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES.get("output_folder", "."), action='store', help='output folder for the generated documents. While if the paths does not exist, usufy will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.')
350350 group_processing.add_argument('-w', '--web_browser', required=False, action='store_true', help='opening the uris returned in the default web browser.')
351 group_processing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES["file_header"], action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' )
352 group_processing.add_argument('-T', '--threads', metavar='<num_threads>', required=False, action='store', default=int(DEFAULT_VALUES["threads"]), type=int, help='write down the number of threads to be used (default 32). If 0, the maximum number possible will be used, which may make the system feel unstable.')
351 group_processing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES.get("file_header", "profiles"), action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' )
352 group_processing.add_argument('-T', '--threads', metavar='<num_threads>', required=False, action='store', default=int(DEFAULT_VALUES.get("threads", 0)), type=int, help='write down the number of threads to be used (default 32). If 0, the maximum number possible will be used, which may make the system feel unstable.')
353353
354354 # About options
355355 group_about = parser.add_argument_group('About arguments', 'Showing additional information about this program.')
426426 # performing the test
427427 elif args.benchmark:
428428 platforms = platform_selection.get_all_platform_names("usufy")
429 res = benchmark.doBenchmark(platforms)
429 res = benchmark.do_benchmark(platforms)
430430 str_times = ""
431431 for e in sorted(res.keys()):
432432 str_times += str(e) + "\t" + str(res[e]) + "\n"
434434
435435 # showing the tags of the usufy platforms
436436 elif args.show_tags:
437 tags = platform_selection.get_all_platform_namesByTag("usufy")
437 tags = platform_selection.get_all_platform_names_by_tag("usufy")
438438 print(general.info("This is the list of platforms grouped by tag.\n"))
439439 print(json.dumps(tags, indent=2, sort_keys=True))
440440 print(general.info("[Tip] Remember that you can always launch the platform using the -t option followed by any of the aforementioned.\n"))
441 return tags
442441
443442 # Executing the corresponding process...
444443 else:
2626
2727
2828 def testFunctionWeb():
29 """Benchmarcking function...
2930 """
30 Benchmarcking function...
31 """
31 #print p
3232 resp = urllib3.urlopen('http://www.i3visio.com')
3333 html = resp.read()
3434 return
3535
36
3736 def testFunction2():
38 """
39 Benchmarcking function...
37 """Benchmarcking function...
4038 """
4139 a = 1
4240 for i in range(1000):
4341 a+=1
4442 return
4543
44 def multi_run_wrapper(args):
45 """ Wrapper for being able to launch all the threads of getPageWrapper.
4646
47 def multi_run_wrapper(args):
48 """
49 Wrapper for being able to launch all the threads of getPageWrapper.
50 Parameters:
47 Args:
5148 We receive the parameters for getPageWrapper as a tuple.
5249 """
50 #print args
5351 return testFunctionWeb(*args)
5452
55
56 def doBenchmark(plats):
57 """
58 Perform the benchmark...
53 def do_benchmark(plats):
54 """Perform the benchmark...
5955 """
6056 logger = logging.getLogger("osrframework.utils")
6157 # defining the results dict
9797 # Configuring the proxy as it will be used by br.set_proxies
9898 for p in proxy.keys():
9999 # p ~= ProxyHTTP --> Protocol = p.lower()[5:]
100 #print p, p.lower()[5:], proxy[p]
100101 try:
101102 # Adding credentials if they exist
102103 self.proxies[ p.lower()[5:] ] = proxy[p]["username"] + ":" + proxy[p]["password"] + "@" + proxy[p]["host"] + ":" + proxy[p]["port"]
4747 with open(config_path, "w") as output_file:
4848 output_file.write(cont)
4949 except Exception as e:
50 raise errors.ConfigurationFileNotFoundError(config_path, default_config_path);
50 #raise errors.ConfigurationFileNotFoundError(config_path, default_config_path);
5151 return dict_api_keys
5252
5353 # Reading the configuration file
5656 creds[plat] = [c]
5757 else:
5858 creds[plat] = creds[plat].append(c)
59
60 if len(creds) > 0:
61 print(f"\n\t[*] {general.info(str(len(creds)))} credentials have been loaded.")
59 print(f"\t[*] {general.info(str(len(creds_tuples)))} credentials have been loaded.")
6260 return creds
113113 return platform_list
114114
115115
116 def get_all_platform_names_by_tag (mode = None):
116 def get_all_platform_names_by_tag(mode=None):
117117 """Returns the platforms in the framework grouped by tags
118118
119119 Args:
2020 import random
2121 import re
2222 import urllib
23 import tempfile
2324
2425 import osrframework.utils.browser as browser
2526 import osrframework.utils.general as general
6869 def create_url(self, word, mode="phonefy"):
6970 """Method to create the URL replacing the word in the appropriate URL
7071
72 Depending on the module it returns the corresponding URL. However,
73 a special keyword can be provided as mode ("base") to use a different
74 URL instead. This is useful when the check is performed towards a
75 different platform (e. g., tweettunnel.com) but the URI to be shown is
76 expected to be the original one (e. g., twitter.com).
77
7178 Args:
7279 word (str): Word to be searched.
7380 mode (str): Mode to be executed.
7481
7582 Returns:
76 The URL to be queried.
77 """
78 try:
79 return self.modes[mode]["url"].replace("{placeholder}", word)
80 except:
83 The URL to be queried. It returns None if no base has been provided.
84 """
85 try:
8186 if mode == "base":
8287 if word[0] == "/":
83 return self.baseURL + word[1:], word
88 return self.baseURL + word[1:]
8489 else:
8590 return self.baseURL + word
8691 else:
8792 try:
93 return self.modes[mode]["url"].replace("{placeholder}", word)
94 except:
8895 return self.url[mode].replace("<"+mode+">", word)
89 except:
90 pass
91 return None
96 except:
97 return None
9298
9399 def launch_query_for_mode(self, query=None, mode=None):
94100 """Method that launches an i3Browser to collect data
119125 else:
120126 # Accessing the resources
121127 data = i3Browser.recover_url(qURL)
128
129 try:
130 if self.modes[mode]["debug"]:
131 with open(os.path.join(tempfile.gettempdir(), self.platformName) + ".html", "w") as file:
132 print(f"DEBUG mode is active for '{general.emphasis(self.platformName)}'. Data grabbed saved to: '{general.warning(file.name)}'")
133 file.write(data)
134 except:
135 pass
136
122137 return data
123138 except KeyError:
124 print(general.error("[*] '{}' is not a valid mode for this wrapper ({}).".format(mode, self.__class__.__name__)))
139 print(general.error("\t[*] '{}' is not a valid mode for this wrapper ({}).".format(mode, self.__class__.__name__)))
125140
126141 return None
127142
349364 ]
350365 """
351366 if self.check_mailfy(query, **kwargs):
352 expandedEntities = general.expand_entities_from_email(query)
367 expanded_entities = general.expand_entities_from_email(query)
353368 r = {
354369 "type": "com.i3visio.Profile",
355370 "value": self.platformName + " - " + query,
356 "attributes": expandedEntities + [
371 "attributes": expanded_entities + [
357372 {
358373 "type": "com.i3visio.Platform",
359374 "value": self.platformName,
400415 A list of elements to be appended.
401416 """
402417 results = []
403 print(f"[*] Launching search using the {self.__class__.__name__} module...")
418 print(f"\t[*] Launching search using the {self.__class__.__name__} module...")
404419 test = self.check_searchfy(query, **kwargs)
405420
406421 if test:
643658 # Appending platform URI
644659 aux = {}
645660 aux["type"] = "com.i3visio.URI"
646 aux["value"] = self.create_url(word=query, mode="usufy")
661
662 uri = self.create_url(word=query, mode="base")
663 if uri:
664 aux["value"] = uri
665 else:
666 aux["value"] = self.create_url(word=query, mode="usufy")
667
647668 aux["attributes"] = []
648669 r["attributes"].append(aux)
649670 # Appending the alias
+0
-100
osrframework/wrappers/bitbacker.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Bitbacker(Platform):
27 """A <Platform> object for Bitbacker"""
28 def __init__(self):
29 self.platformName = "bitbacker"
30 self.tags = ["cryptocurrencies", "payments"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://bitbacker.io/user/<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["<h1>Not Found</h1>"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
+0
-101
osrframework/wrappers/bucketlistly.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Bucketlistly(Platform):
27 """A <Platform> object for Bucketlistly"""
28 def __init__(self):
29 self.platformName = "Bucketlistly"
30 self.tags = ["trips"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "http://www.bucketlistly.com/users/" + "<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query.
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = "[^0-9][^\.]+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["Sorry, the page you are looking for doesn't exist. (404) - Bucketlistly"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90
91 # Definition of regular expressions to be searched in searchfy mode
92 #self.fieldsRegExp["searchfy"] = {}
93 # Example of fields:
94 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
95
96 ################
97 # Fields found #
98 ################
99 # This attribute will be feeded when running the program.
100 self.foundFields = {}
+0
-100
osrframework/wrappers/canva.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Canva(Platform):
27 """A <Platform> object for Canva"""
28 def __init__(self):
29 self.platformName = "Canva"
30 self.tags = ["imagery"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://www.canva.com/" + "<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["(404)</h1>"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
+0
-100
osrframework/wrappers/colourlovers.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Colourlovers(Platform):
27 """A <Platform> object for Colourlovers"""
28 def __init__(self):
29 self.platformName = "Colourlovers"
30 self.tags = ["art"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "http://www.colourlovers.com/lover/" + "<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["<h4>No one's home</h4>"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
1717 ################################################################################
1818
1919 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
20 __version__ = "3.0"
2121
2222
2323 from osrframework.utils.platforms import Platform
2424
2525
2626 class Douban(Platform):
27 """A <Platform> object for Douban"""
27 """<Platform> class"""
2828 def __init__(self):
29 """Constructor with parameters
30
31 This method permits the developer to instantiate dinamically Platform
32 objects."""
2933 self.platformName = "Douban"
30 self.tags = ["social", "opinions"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://site.douban.com/" + "<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query.
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["https://img3.doubanio.com/pics/douban_error.gif"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90
91 # Definition of regular expressions to be searched in searchfy mode
92 #self.fieldsRegExp["searchfy"] = {}
93 # Example of fields:
94 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
95
96 ################
97 # Fields found #
98 ################
99 # This attribute will be feeded when running the program.
100 self.foundFields = {}
34 self.tags = ["social"]
35 self.modes = {
36 "usufy": {
37 "debug": False,
38 "extra_fields": {},
39 "needs_credentials": False,
40 "not_found_text": 'https://img9.doubanio.com/pics/douban_error.gif"/>',
41 "query_validator": "[a-z0-9A-Z_]+",
42 "url": "https://site.douban.com/{placeholder}",
43 }
44 }
+0
-100
osrframework/wrappers/dreamstime.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Dreamstime(Platform):
27 """A <Platform> object for Dreamstime"""
28 def __init__(self):
29 self.platformName = "Dreamstime"
30 self.tags = ["social"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://es.dreamstime.com/" + "<usufy>" + "_info"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ['error404']
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
3232 # Base URL
3333 self.baseURL = "https://facebook.com/"
3434
35 ########################
36 # Defining valid modes #
37 ########################
38 self.isValidMode = {}
39 self.isValidMode["phonefy"] = False
40 self.isValidMode["usufy"] = True
41 self.isValidMode["searchfy"] = True
42
43 ######################################
44 # Search URL for the different modes #
45 ######################################
46 # Strings with the URL for each and every mode
47 self.url = {}
48 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
49 self.url["usufy"] = "https://www.facebook.com/" + "<usufy>"
50 self.url["searchfy"] = "https://www.facebook.com/public?query=" + "<searchfy>"
51
52 ######################################
53 # Whether the user needs credentials #
54 ######################################
55 self.needsCredentials = {}
56 #self.needsCredentials["phonefy"] = False
57 self.needsCredentials["usufy"] = False
58 self.needsCredentials["searchfy"] = False
59
60 #################
61 # Valid queries #
62 #################
63 # Strings that will imply that the query number is not appearing
64 self.validQuery = {}
65 # The regular expression '.+' will match any query.
66 #self.validQuery["phonefy"] = ".*"
67 self.validQuery["usufy"] = ".+"
68 self.validQuery["searchfy"] = ".+"
69
70 ###################
71 # Not_found clues #
72 ###################
73 # Strings that will imply that the query number is not appearing
74 self.notFoundText = {}
75 #self.notFoundText["phonefy"] = []
76 self.notFoundText["usufy"] = ["https://static.xx.fbcdn.net/rsrc.php/v3/yp/r/U4B06nLMGQt.png"]
77 self.notFoundText["searchfy"] = []
78
79 #########################
80 # Fields to be searched #
81 #########################
82 self.fieldsRegExp = {}
83
84 # Definition of regular expressions to be searched in phonefy mode
85 #self.fieldsRegExp["phonefy"] = {}
86 # Example of fields:
87 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
88
89 # Definition of regular expressions to be searched in usufy mode
90 self.fieldsRegExp["usufy"] = {}
91 # Example of fields:
92 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
93 # Definition of regular expressions to be searched in searchfy mode
94 self.fieldsRegExp["searchfy"] = {}
95 self.searchfyAliasRegexp = "<a title=\"[^\"]+\" class=\"_2ial\" aria-label=\"[^\"]+\" href=\"https://www.facebook.com/([^\"]+)"
96 # Example of fields:
97 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
98
99 ################
100 # Fields found #
101 ################
102 # This attribute will be feeded when running the program.
103 self.foundFields = {}
35 self.modes = {
36 "usufy": {
37 "debug": False,
38 "extra_fields": {
39 "com.i3visio.FullName": '<title id="pageTitle">(.+) \| Facebook</title>', # Regular expresion to extract the alias
40 },
41 "needs_credentials": False,
42 "not_found_text": "https://static.xx.fbcdn.net/rsrc.php/v3/yp/r/U4B06nLMGQt.png", # Text that indicates a missing profile
43 "query_validator": "[a-zA-Z\.0-9_\-]+", # Regular expression that the alias SHOULD match
44 "url": "https://www.facebook.com/{placeholder}", # Target URL where {placeholder} would be modified by the alias
45 },
46 "searchfy": {
47 "debug": False,
48 "extra_fields": {},
49 "needs_credentials": False,
50 "not_found_text": "We couldn&#039;t find anything for",
51 "query_validator": ".+",
52 "url": "https://www.facebook.com/public?query={placeholder}",
53 # Needed function to extract aliases from the website
54 "alias_regexp": '<a title="[^\"]+" class="_32mo" href="https://www.facebook.com/([^\"]+)"><span>'
55 },
56 # Reimplementation needed of check_mailfy
57 "mailfy": {},
58 }
1717 ################################################################################
1818
1919 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
20 __version__ = "3.0"
2121
2222
2323 from osrframework.utils.platforms import Platform
2424
2525
2626 class Freelancer(Platform):
27 """A <Platform> object for Freelancer"""
27 """A <Platform> object for Facebook"""
2828 def __init__(self):
2929 self.platformName = "Freelancer"
3030 self.tags = ["jobs"]
3131
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://www.freelancer.com/u/<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["404 - Page not found</h3>"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
32 self.modes = {
33 "usufy": {
34 "debug": False,
35 "extra_fields": {},
36 "needs_credentials": False,
37 "not_found_text": " Looks like the page you are looking for doesn't exist", # Text that indicates a missing profile
38 "query_validator": "[a-zA-Z\.0-9_\-]+", # Regular expression that the alias SHOULD match
39 "url": "https://www.freelancer.com/u/{placeholder}", # Target URL where {placeholder} would be modified by the alias
40 "test": {
41 "valid": "james",
42 "invalid": "7ddf32e17a6ac5"
43 }
44 }
45 }
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 import re
24
25 import osrframework.utils.general as general
26 from osrframework.utils.platforms import Platform
27
28
29 class GnuPGKeys(Platform):
30 """A <Platform> object for the MIT PGP public keys repository"""
31 def __init__(self):
32 self.platformName = "GnuPGKeys"
33 self.tags = ["mails", "cryptography"]
34
35 # Base URL
36 self.baseURL = "http://keys.gnupg.net/pks/lookup?search="
37 ########################
38 # Defining valid modes #
39 ########################
40 self.isValidMode = {}
41 self.isValidMode["mailfy"] = True
42 self.isValidMode["phonefy"] = False
43 self.isValidMode["usufy"] = False
44 self.isValidMode["searchfy"] = True
45
46 ######################################
47 # Search URL for the different modes #
48 ######################################
49 # Strings with the URL for each and every mode
50 self.url = {}
51 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
52 #self.url["usufy"] = "https://github.com/" + "<usufy>"
53 self.url["searchfy"] = "http://keys.gnupg.net/pks/lookup?search=<searchfy>"
54
55 ######################################
56 # Whether the user needs credentials #
57 ######################################
58 self.needsCredentials = {}
59 #self.needsCredentials["phonefy"] = False
60 #self.needsCredentials["usufy"] = False
61 self.needsCredentials["searchfy"] = False
62
63 #################
64 # Valid queries #
65 #################
66 # Strings that will imply that the query number is not appearing
67 self.validQuery = {}
68 # The regular expression '.+' will match any query.
69 #self.validQuery["phonefy"] = ".*"
70 #self.validQuery["usufy"] = ".*"
71 self.validQuery["searchfy"] = ".+"
72 self.validQuery["mailfy"] = ".+"
73
74 ###################
75 # Not_found clues #
76 ###################
77 # Strings that will imply that the query number is not appearing
78 self.notFoundText = {}
79 #self.notFoundText["phonefy"] = []
80 self.notFoundText["usufy"] = [
81 "This is not the web page you are looking for"
82 ]
83 self.notFoundText["searchfy"] = []
84
85 #########################
86 # Fields to be searched #
87 #########################
88 self.fieldsRegExp = {}
89
90 # Definition of regular expressions to be searched in phonefy mode
91 #self.fieldsRegExp["phonefy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
94
95 # Definition of regular expressions to be searched in usufy mode
96 #self.fieldsRegExp["usufy"] = {}
97 # Example of fields:
98 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
99 # Definition of regular expressions to be searched in searchfy mode
100 self.fieldsRegExp["searchfy"] = {}
101 #self.searchfyAliasRegexp = '&lt;([^\&]+)&gt;'
102 self.searchfyEmailRegexp = ' &lt;([^\&]+)&gt;'
103
104 # Example of fields:
105 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
106
107 ################
108 # Fields found #
109 ################
110 # This attribute will be feeded when running the program.
111 self.foundFields = {}
112
113 def check_mailfy(self, query, **kwargs):
114 """Verifying a mailfy query in this platform
115
116 This might be redefined in any class inheriting from Platform. The only
117 condition is that any of this should return a dictionary as defined.
118
119 Args:
120 query (str): The element to be searched.
121
122 Returns:
123 String. Returns the collected data if exists or None if not.
124 """
125 import re
126 import requests
127
128 s = requests.Session()
129
130 # Getting the first response to grab the csrf_token
131 resp = s.get(f"http://keys.gnupg.net/pks/lookup?search={query}")
132
133 if resp.status_code == 200 or resp.status_code == 404:
134 if ' 0 keys found..' in resp.text:
135 return None
136 else:
137 return resp.text
138 else:
139 print(general.warning(f"\t[*] Something happened. keyserver.io returned status '{resp.status_code}' for '{query}'."))
140 return None
141
142 def do_mailfy(self, query, **kwargs):
143 """Verifying a mailfy query in this platform
144
145 This might be redefined in any class inheriting from Platform. The only
146 condition is that any of this should return an equivalent array.
147
148 Args:
149 query: The element to be searched.
150
151 Returns:
152 A list of elements to be appended. A sample output format is as follows:
153 [
154 {
155 "attributes": [
156 {
157 "attributes": [],
158 "type": "com.i3visio.Email",
159 "value": "[email protected]"
160 },
161 {
162 "attributes": [],
163 "type": "com.i3visio.Alias",
164 "value": "contacto"
165 },
166 {
167 "attributes": [],
168 "type": "com.i3visio.Domain",
169 "value": "i3visio.com"
170 },
171 {
172 "attributes": [],
173 "type": "com.i3visio.Platform",
174 "value": "Twitter"
175 }
176 ],
177 "type": "com.i3visio.Profile",
178 "value": "Twitter - [email protected]"
179 }
180 ]
181 """
182 info = self.check_mailfy(query, **kwargs)
183
184 results = []
185 if info:
186 emails = set(re.findall(' &lt;([^\&]+)&gt;', info))
187
188 for i, email in enumerate(emails):
189 try:
190 expandedEntities = general.expand_entities_from_email(email)
191 r = {
192 "type": "com.i3visio.Profile",
193 "value": self.platformName + " - " + email,
194 "attributes": expandedEntities + [
195 {
196 "type": "com.i3visio.Platform",
197 "value": self.platformName,
198 "attributes": []
199 }
200 ]
201 }
202 results.append(r)
203 except IndexError:
204 # A result does not contain a @.
205 pass
206
207 return results
5959 # This attribute will be feeded when running the program.
6060 self.foundFields = {}
6161
62
6362 def check_mailfy(self, query, kwargs={}):
6463 """Verifying a mailfy query in this platform
6564
1717 ################################################################################
1818
1919 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
20 __version__ = "3.0"
2121
2222
2323 from osrframework.utils.platforms import Platform
2424
2525
2626 class Jamiiforums(Platform):
27 """A <Platform> object for Jamiiforums"""
27 """<Platform> class"""
2828 def __init__(self):
29 """Constructor with parameters
30
31 This method permits the developer to instantiate dinamically Platform
32 objects."""
2933 self.platformName = "Jamiiforums"
30 self.tags = ["opinions", "contact"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "http://jamiiforums.com/members/?username=<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query.
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = [
74 (
75 "The specified member cannot be found. Please enter a member's"
76 " entire name."
77 )
78 ]
79 #self.notFoundText["searchfy"] = []
80
81 #########################
82 # Fields to be searched #
83 #########################
84 self.fieldsRegExp = {}
85
86 # Definition of regular expressions to be searched in phonefy mode
87 #self.fieldsRegExp["phonefy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
90
91 # Definition of regular expressions to be searched in usufy mode
92 self.fieldsRegExp["usufy"] = {}
93 # Example of fields:
94 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
95 # Definition of regular expressions to be searched in searchfy mode
96 #self.fieldsRegExp["searchfy"] = {}
97 # Example of fields:
98 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
99
100 ################
101 # Fields found #
102 ################
103 # This attribute will be feeded when running the program.
104 self.foundFields = {}
34 self.tags = ["opinions"]
35 self.modes = {
36 "usufy": {
37 "debug": False,
38 "extra_fields": {
39 "com.i3visio.Name": '>([^<]+)</span></h1>',
40 },
41 "needs_credentials": False,
42 "not_found_text": "The specified member cannot be found. Please enter a member's entire name.",
43 "query_validator": "[a-z0-9A-Z_]+",
44 "url": "https://www.jamiiforums.com/members/?username={placeholder}",
45 }
46 }
+0
-208
osrframework/wrappers/key_server.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 import re
24
25 import osrframework.utils.general as general
26 from osrframework.utils.platforms import Platform
27
28
29 class KeyServerIO(Platform):
30 """A <Platform> object for the MIT PGP public keys repository"""
31 def __init__(self):
32 self.platformName = "KeyServerIO"
33 self.tags = ["mails", "cryptography"]
34
35 # Base URL
36 self.baseURL = "https://pgp.key-server.io/pks/lookup?search="
37 ########################
38 # Defining valid modes #
39 ########################
40 self.isValidMode = {}
41 self.isValidMode["mailfy"] = True
42 self.isValidMode["phonefy"] = False
43 self.isValidMode["usufy"] = False
44 self.isValidMode["searchfy"] = True
45
46 ######################################
47 # Search URL for the different modes #
48 ######################################
49 # Strings with the URL for each and every mode
50 self.url = {}
51 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
52 #self.url["usufy"] = "https://github.com/" + "<usufy>"
53 self.url["searchfy"] = "https://pgp.key-server.io/pks/lookup?search=<searchfy>"
54
55 ######################################
56 # Whether the user needs credentials #
57 ######################################
58 self.needsCredentials = {}
59 #self.needsCredentials["phonefy"] = False
60 #self.needsCredentials["usufy"] = False
61 self.needsCredentials["searchfy"] = False
62
63 #################
64 # Valid queries #
65 #################
66 # Strings that will imply that the query number is not appearing
67 self.validQuery = {}
68 # The regular expression '.+' will match any query.
69 #self.validQuery["phonefy"] = ".*"
70 #self.validQuery["usufy"] = ".*"
71 self.validQuery["searchfy"] = ".+"
72 self.validQuery["mailfy"] = ".+"
73
74 ###################
75 # Not_found clues #
76 ###################
77 # Strings that will imply that the query number is not appearing
78 self.notFoundText = {}
79 #self.notFoundText["phonefy"] = []
80 self.notFoundText["usufy"] = [
81 "This is not the web page you are looking for"
82 ]
83 self.notFoundText["searchfy"] = []
84
85 #########################
86 # Fields to be searched #
87 #########################
88 self.fieldsRegExp = {}
89
90 # Definition of regular expressions to be searched in phonefy mode
91 #self.fieldsRegExp["phonefy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
94
95 # Definition of regular expressions to be searched in usufy mode
96 #self.fieldsRegExp["usufy"] = {}
97 # Example of fields:
98 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
99 # Definition of regular expressions to be searched in searchfy mode
100 self.fieldsRegExp["searchfy"] = {}
101 #self.searchfyAliasRegexp = '&lt;([^\&]+)&gt;'
102 self.searchfyEmailRegexp = ' &lt;([^\&]+)&gt;'
103
104 # Example of fields:
105 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
106
107 ################
108 # Fields found #
109 ################
110 # This attribute will be feeded when running the program.
111 self.foundFields = {}
112
113 def check_mailfy(self, query, **kwargs):
114 """Verifying a mailfy query in this platform
115
116 This might be redefined in any class inheriting from Platform. The only
117 condition is that any of this should return a dictionary as defined.
118
119 Args:
120 query (str): The element to be searched.
121
122 Returns:
123 String. Returns the collected data if exists or None if not.
124 """
125 import re
126 import requests
127
128 s = requests.Session()
129
130 # Getting the first response to grab the csrf_token
131 resp = s.get(f"https://pgp.key-server.io/pks/lookup?search={query}")
132
133 if resp.status_code == 200 or resp.status_code == 404:
134 if ' 0 keys found..' in resp.text:
135 return None
136 else:
137 return resp.text
138 else:
139 print(general.warning(f"Something happened. keyserver.io returned status '{resp.status_code}' for '{query}'."))
140 return None
141
142 def do_mailfy(self, query, **kwargs):
143 """Verifying a mailfy query in this platform
144
145 This might be redefined in any class inheriting from Platform. The only
146 condition is that any of this should return an equivalent array.
147
148 Args:
149 query: The element to be searched.
150
151 Returns:
152 A list of elements to be appended. A sample output format is as follows:
153 [
154 {
155 "attributes": [
156 {
157 "attributes": [],
158 "type": "com.i3visio.Email",
159 "value": "[email protected]"
160 },
161 {
162 "attributes": [],
163 "type": "com.i3visio.Alias",
164 "value": "contacto"
165 },
166 {
167 "attributes": [],
168 "type": "com.i3visio.Domain",
169 "value": "i3visio.com"
170 },
171 {
172 "attributes": [],
173 "type": "com.i3visio.Platform",
174 "value": "Twitter"
175 }
176 ],
177 "type": "com.i3visio.Profile",
178 "value": "Twitter - [email protected]"
179 }
180 ]
181 """
182 info = self.check_mailfy(query, **kwargs)
183
184 results = []
185 if info:
186 emails = set(re.findall(' &lt;([^\&]+)&gt;', info))
187
188 for i, email in enumerate(emails):
189 try:
190 expandedEntities = general.expand_entities_from_email(email)
191 r = {
192 "type": "com.i3visio.Profile",
193 "value": self.platformName + " - " + email,
194 "attributes": expandedEntities + [
195 {
196 "type": "com.i3visio.Platform",
197 "value": self.platformName,
198 "attributes": []
199 }
200 ]
201 }
202 results.append(r)
203 except IndexError:
204 # A result does not contain a @.
205 pass
206
207 return results
1717 ################################################################################
1818
1919 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
20 __version__ = "3.0"
2121
2222
2323 from osrframework.utils.platforms import Platform
2929 self.platformName = "Listaspam"
3030 self.tags = ["phone"]
3131
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = True
37 self.isValidMode["usufy"] = False
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 self.url = {}
44 self.url["phonefy"] = "http://www.listaspam.com/busca.php?Telefono=<phonefy>"
45 #self.url["usufy"] = "http://anyurl.com/user/" + "<phonefy>"
46 #self.url["searchfy"] = "http://anyurl.com/search/" + "<phonefy>"
47
48 ######################################
49 # Whether the user needs credentials #
50 ######################################
51 self.needsCredentials = {}
52 self.needsCredentials["phonefy"] = False
53 self.needsCredentials["usufy"] = False
54 self.needsCredentials["searchfy"] = False
55
56 #################
57 # Valid queries #
58 #################
59 # Strings that will imply that the query number is not appearing
60 self.validQuery = {}
61 # The regular expression '.+' will match any query.
62 self.validQuery["phonefy"] = ".+"
63 self.validQuery["usufy"] = ".+"
64 self.validQuery["searchfy"] = ".+"
65
66 ###################
67 # Not_found clues #
68 ###################
69 # Strings that will imply that the phone number is not appearing
70 self.notFoundText = {}
71 self.notFoundText["phonefy"] = [
72 "No te quedes sin saber quien te llama por teléfono."
73 ]
74 #self.notFoundText["usufy"] = []
75 #self.notFoundText["searchfy"] = []
76
77 #########################
78 # Fields to be searched #
79 #########################
80 self.fieldsRegExp = {}
81 # Definition of regular expressions to be searched in phonefy mode
82 self.fieldsRegExp["phonefy"] = {}
83 self.fieldsRegExp["phonefy"]["i3visio.location.province"] = "<strong class='located_label'>(.*),"
84 self.fieldsRegExp["phonefy"]["i3visio.location.country"] = "class='country_located' alt='([a-zA-Zñ]*)'"
85 self.fieldsRegExp["phonefy"]["i3visio.text"] = '<h4 class="media-heading">(.*)</p>'
86
87 # Definition of regular expressions to be searched in usufy mode
88 #self.fieldsRegExp["usufy"] = {}
89 # Example of fields:
90 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
91
92 # Definition of regular expressions to be searched in searchfy mode
93 #self.fieldsRegExp["searchfy"] = {}
94 # Example of fields:
95 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
96
97 ################
98 # Fields found #
99 ################
100 # This attribute will be feeded when running the program.
101 self.foundFields = {}
32 self.modes = {
33 "phonefy": {
34 "debug": False,
35 "extra_fields": {
36 "com.i3visio.Location": "<div>📍([^<]+)</div>",
37 "com.i3visio.Labels": 'Nube de tags: (.+)</div>'
38 },
39 "needs_credentials": False,
40 "not_found_text": "No te quedes sin saber quién te llama por teléfono.", # Text that indicates a missing profile
41 "query_validator": "[0-9+\-\.]{6-16}", # Regular expression that the alias SHOULD match
42 "url": "http://www.listaspam.com/busca.php?Telefono={placeholder}", # Target URL where {placeholder} would be modified by the alias
43 }
44 }
1717 ################################################################################
1818
1919 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
20 __version__ = "3.0"
2121
2222
2323 from osrframework.utils.platforms import Platform
3636 "usufy": {
3737 "debug": False,
3838 "extra_fields": {
39 "com.i3visio.Name": '<h2>([^<]+)</h2>', # Regular expresion to extract the alias
39 "com.i3visio.Name": '<h2>([^<]+)</h2>',
4040 },
4141 "needs_credentials": False,
42 "not_found_text": "<title>Minds</title>", # Text that indicates a missing profile
43 "query_validator": "[a-z0-9A-Z_]+", # Regular expression that the alias SHOULD match
44 "url": "https://www.minds.com/{placeholder}", # Target URL where {placeholder} would be modified by the alias
42 "not_found_text": "Sorry, the channel couldn't be found",
43 "query_validator": "[a-z0-9A-Z_]+",
44 "url": "https://www.minds.com/{placeholder}",
4545 }
4646 }
1717 ################################################################################
1818
1919 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
20 __version__ = "3.0"
2121
2222
2323 from osrframework.utils.platforms import Platform
2424
2525
26 class Okcupid(Platform):
27 """A <Platform> object for Okcupid"""
26 class OkCupid(Platform):
27 """<Platform> class"""
2828 def __init__(self):
29 self.platformName = "Okcupid"
29 """Constructor with parameters
30
31 This method permits the developer to instantiate dinamically Platform
32 objects."""
33 self.platformName = "OkCupid"
3034 self.tags = ["contact"]
35 self.modes = {
36 "mailfy": {
37 "debug": False,
38 }
39 }
3140
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
41 def check_mailfy(self, query, kwargs={}):
42 """Verifying a mailfy query in this platform
3943
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://www.okcupid.com/profile/" + "<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
44 This might be redefined in any class inheriting from Platform. The only
45 condition is that any of this should return a dictionary as defined.
4846
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
47 Args:
48 query (str): The element to be searched.
5649
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
50 Returns:
51 String. The collected data if exists or None if not.
52 """
53 import requests
6654
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["<title>Account not found"]
74 #self.notFoundText["searchfy"] = []
55 s = requests.Session()
7556
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
57 # Getting the first response to grab the csrf_token
58 r1 = s.get('https://www.okcupid.com')
8059
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
60 # Launching the query to Instagram
61 r2 = s.post(
62 'https://www.okcupid.com/1/apitun/signup/check_email',
63 json={"email": query},
64 )
8565
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
66 if self.modes["mailfy"]["debug"]:
67 print(f"Response: {[r2.text]}")
9468
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
69 if '"is_valid" : false' in r2.text:
70 return r2.text
71 return None
1717 ################################################################################
1818
1919 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
20 __version__ = "3.0"
2121
2222
2323 from osrframework.utils.platforms import Platform
2424
2525
2626 class Onename(Platform):
27 """A <Platform> object for Onename"""
27 """<Platform> class"""
2828 def __init__(self):
2929 self.platformName = "Onename"
3030 self.tags = ["cryptocurrencies", "identity"]
3131
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://onename.com/" + "<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["User data not properly formatted"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
32 self.modes = {
33 "usufy": {
34 "debug": False,
35 "extra_fields": {},
36 "needs_credentials": False,
37 "not_found_text": "<title>Page Not Found</title>", # Text that indicates a missing profile
38 "query_validator": "[a-zA-Z\.0-9_\-]+", # Regular expression that the alias SHOULD match
39 "url": "https://onename.com//{placeholder}", # Target URL where {placeholder} would be modified by the alias
40 "test": {
41 "valid": "james",
42 "invalid": "7ddf32e17a6ac5"
43 }
44 }
45 }
+0
-102
osrframework/wrappers/pixinsight.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Pixinsight(Platform):
27 """A <Platform> object for Pixinsight"""
28 def __init__(self):
29 self.platformName = "Pixinsight"
30 self.tags = ["imagery"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "http://pixinsight.com/forum/index.php?action=profile;user=<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query.
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = [
74 "The user whose profile you are trying to view does not exist."
75 ]
76 #self.notFoundText["searchfy"] = []
77
78 #########################
79 # Fields to be searched #
80 #########################
81 self.fieldsRegExp = {}
82
83 # Definition of regular expressions to be searched in phonefy mode
84 #self.fieldsRegExp["phonefy"] = {}
85 # Example of fields:
86 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
87
88 # Definition of regular expressions to be searched in usufy mode
89 self.fieldsRegExp["usufy"] = {}
90 # Example of fields:
91 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
92 # Definition of regular expressions to be searched in searchfy mode
93 #self.fieldsRegExp["searchfy"] = {}
94 # Example of fields:
95 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
96
97 ################
98 # Fields found #
99 ################
100 # This attribute will be feeded when running the program.
101 self.foundFields = {}
+0
-100
osrframework/wrappers/sarahah.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Sarahah(Platform):
27 """A <Platform> object for Sarahah"""
28 def __init__(self):
29 self.platformName = "Sarahah"
30 self.tags = ["social", "teenagers"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://<usufy>.sarahah.com"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ['<title>Sarahah </title>']
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = {"start": 'Location: "', "end": '"'}
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
+0
-100
osrframework/wrappers/sidereel.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Sidereel(Platform):
27 """A <Platform> object for Sidereel"""
28 def __init__(self):
29 self.platformName = "Sidereel"
30 self.tags = ["social"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "http://www.sidereel.com/profile/" + "<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query.
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["Page Not Found"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
+0
-100
osrframework/wrappers/soup.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Soup(Platform):
27 """A <Platform> object for Soup"""
28 def __init__(self):
29 self.platformName = "Soup"
30 self.tags = ["social"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://" + "<usufy>" + ".soup.io"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["<h2>Happy happy joy joy! A new user!</h2>"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
+0
-100
osrframework/wrappers/taringa.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Taringa(Platform):
27 """A <Platform> object for Taringa"""
28 def __init__(self):
29 self.platformName = "Taringa"
30 self.tags = ["social"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "https://www.taringa.net/" + "<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query.
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ['/dist/404Retina.png', '>Taringa! - Inteligencia Colectiva en Taringa!</title>', '>Taringa! - Inteligencia Colectiva en Taringa!</title>' ]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
+0
-100
osrframework/wrappers/thesims.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 from osrframework.utils.platforms import Platform
24
25
26 class Thesims(Platform):
27 """A <Platform> object for Thesims"""
28 def __init__(self):
29 self.platformName = "Thesims"
30 self.tags = ["gaming"]
31
32 ########################
33 # Defining valid modes #
34 ########################
35 self.isValidMode = {}
36 self.isValidMode["phonefy"] = False
37 self.isValidMode["usufy"] = True
38 self.isValidMode["searchfy"] = False
39
40 ######################################
41 # Search URL for the different modes #
42 ######################################
43 # Strings with the URL for each and every mode
44 self.url = {}
45 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
46 self.url["usufy"] = "http://mypage.thesims3.com/mypage/" + "<usufy>"
47 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
48
49 ######################################
50 # Whether the user needs credentials #
51 ######################################
52 self.needsCredentials = {}
53 #self.needsCredentials["phonefy"] = False
54 self.needsCredentials["usufy"] = False
55 #self.needsCredentials["searchfy"] = False
56
57 #################
58 # Valid queries #
59 #################
60 # Strings that will imply that the query number is not appearing
61 self.validQuery = {}
62 # The regular expression '.+' will match any query.
63 #self.validQuery["phonefy"] = ".*"
64 self.validQuery["usufy"] = ".+"
65 #self.validQuery["searchfy"] = ".*"
66
67 ###################
68 # Not_found clues #
69 ###################
70 # Strings that will imply that the query number is not appearing
71 self.notFoundText = {}
72 #self.notFoundText["phonefy"] = []
73 self.notFoundText["usufy"] = ["<title>&nbsp;-&nbsp;Community&nbsp;-&nbsp;The Sims 3</title>"]
74 #self.notFoundText["searchfy"] = []
75
76 #########################
77 # Fields to be searched #
78 #########################
79 self.fieldsRegExp = {}
80
81 # Definition of regular expressions to be searched in phonefy mode
82 #self.fieldsRegExp["phonefy"] = {}
83 # Example of fields:
84 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
85
86 # Definition of regular expressions to be searched in usufy mode
87 self.fieldsRegExp["usufy"] = {}
88 # Example of fields:
89 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
90 # Definition of regular expressions to be searched in searchfy mode
91 #self.fieldsRegExp["searchfy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
94
95 ################
96 # Fields found #
97 ################
98 # This attribute will be feeded when running the program.
99 self.foundFields = {}
3131 self.tags = ["contact", "microblogging", "social"]
3232
3333 # Base URL
34 self.baseURL = "http://twitter.com/"
34 self.baseURL = "https://twitter.com/"
3535
36 ########################
37 # Defining valid modes #
38 ########################
39 self.isValidMode = {}
40 self.isValidMode["mailfy"] = True
41 self.isValidMode["phonefy"] = False
42 self.isValidMode["searchfy"] = True
43 self.isValidMode["usufy"] = True
44
45 ######################################
46 # Search URL for the different modes #
47 ######################################
48 # Strings with the URL for each and every mode
49 self.url = {}
50 self.url["mailfy"] = "https://api.twitter.com/i/users/email_available.json?email=<mailfy>"
51 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
52 self.url["searchfy"] = "https://twitter.com/search?f=users&vertical=default&q=\"" + "<searchfy>" + "\""
53 self.url["usufy"] = "http://twitter.com/" + "<usufy>"
54
55 ######################################
56 # Whether the user needs credentials #
57 ######################################
58 self.needsCredentials = {}
59 self.needsCredentials["mailfy"] = False
60 #self.needsCredentials["phonefy"] = False
61 self.needsCredentials["usufy"] = False
62 self.needsCredentials["searchfy"] = False
63
64 #################
65 # Valid queries #
66 #################
67 # Strings that will imply that the query number is not appearing
68 self.validQuery = {}
69 # The regular expression '.+' will match any query.
70 #self.validQuery["phonefy"] = ".*"
71 self.validQuery["usufy"] = "[a-zA-Z0-9_]+"
72 self.validQuery["searchfy"] = ".+"
73 self.validQuery["mailfy"] = ".+"
74
75 ###################
76 # Not_found clues #
77 ###################
78 # Strings that will imply that the query number is not appearing
79 self.notFoundText = {}
80 self.notFoundText["mailfy"] = ['"valid":true']
81 #self.notFoundText["phonefy"] = []
82 self.notFoundText["usufy"] = ["<form class=\"search-404\""]
83 self.notFoundText["searchfy"] = []
84
85 #########################
86 # Fields to be searched #
87 #########################
88 self.fieldsRegExp = {}
89
90 # Definition of regular expressions to be searched in phonefy mode
91 #self.fieldsRegExp["phonefy"] = {}
92 # Example of fields:
93 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
94
95 # Definition of regular expressions to be searched in usufy mode
96 self.fieldsRegExp["usufy"] = {}
97 # Examples (do NOT forget to escape the quoting marks inside any string: \"):
98 self.fieldsRegExp["usufy"]["@protected"] = {"start": "data-protected=\"", "end": "\">\n <span class=\"UserActions"}
99 self.fieldsRegExp["usufy"]["i3visio.fullname"] = {"start": "class=\"ProfileHeaderCard-nameLink u-textInheritColor js-nav\n\">", "end": "</a>\n </h1>"}
100 #self.fieldsRegExp["usufy"]["ProfileHeaderCard-bio"] = {"start": "<p class=\"ProfileHeaderCard-bio u-dir\"\n \n dir=\"ltr\">", "end": "</p>"}
101 self.fieldsRegExp["usufy"]["i3visio.location"] = {"start": "<span class=\"ProfileHeaderCard-locationText u-dir\" dir=\"ltr\">\n ", "end": "\n </span>\n </div>\n\n <div class=\"ProfileHeaderCard-url"}
102 self.fieldsRegExp["usufy"]["@created_at"] = {"start": "<span class=\"ProfileHeaderCard-joinDateText js-tooltip u-dir\" dir=\"ltr\" title=\"", "end": "\">Se uni"}
103 self.fieldsRegExp["usufy"]["i3visio.uri.homepage"] = {"start": "<span class=\"ProfileHeaderCard-urlText u-dir\" dir=\"ltr\"><a class=\"u-textUserColor\" target=\"_blank\" rel=\"me nofollow\" href=\"[^\"]*\" title=\"", "end": "\">"}
104 #self.fieldsRegExp["usufy"]["PhotoRail-headingText"] = {"start": "class=\"js-nav\">\n \n ", "end": " </a>"}
105
106 # Definition of regular expressions to be searched in searchfy mode
107 self.fieldsRegExp["searchfy"] = {}
108 self.searchfyAliasRegexp = "data-screen-name=\"([^\"]+)\""
109 # Example of fields:
110 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
111
112 ################
113 # Fields found #
114 ################
115 # This attribute will be feeded when running the program.
116 self.foundFields = {}
117
36 self.modes = {
37 "usufy": {
38 "debug": False,
39 "extra_fields": {
40 "com.i3visio.FullName": ' \((.+)\)</title>', # Regular expresion to extract the alias
41 },
42 "needs_credentials": False,
43 "not_found_text": "Sorry, that page does not exist. ", # Text that indicates a missing profile
44 "query_validator": "[a-zA-Z0-9_]{3,15}", # Regular expression that the alias SHOULD match
45 "url": "https://tweettunnel.com/{placeholder}", # Target URL where {placeholder} would be modified by the alias
46 },
47 # Reimplementation needed of check_mailfy
48 "mailfy": {
49 "debug": False,
50 "extra_fields": {},
51 "needs_credentials": False,
52 "not_found_text": '"valid":true',
53 "query_validator": ".+",
54 "url": "https://api.twitter.com/i/users/email_available.json?email=",
55 },
56 }
11857
11958 def do_usufy(self, query, **kwargs):
120 """
121 Verifying a usufy query in this platform.
59 """Verifying a usufy query in this platform using the API
12260
123 This might be redefined in any class inheriting from Platform.
61 If no credentials are provided, the standard verifier will be raised.
12462
12563 Args:
126 -----
12764 query: The element to be searched.
12865
12966 Return:
130 -------
13167 A list of elements to be appended.
13268 """
13369 # Trying to interact with the API Wrapper
15086 return super(Twitter, self).do_usufy(query, **kwargs)
15187
15288 def do_searchfy(self, query, **kwargs):
153 """Verifying a usufy query in this platform
89 """Verifying a searchfy query in this platform using the API
15490
155 This might be redefined in any class inheriting from Platform.
91 If no credentials are provided, the standard verifier will be raised.
15692
15793 Args:
15894 query (str): The element to be searched.
+0
-101
osrframework/wrappers/v7n.py less more
0 ################################################################################
1 #
2 # Copyright 2015-2020 Félix Brezo and Yaiza Rubio
3 #
4 # This program is part of OSRFramework. You can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 ################################################################################
18
19 __author__ = "Felix Brezo, Yaiza Rubio <[email protected]>"
20 __version__ = "2.0"
21
22
23 import osrframework.utils.browser as browser
24 from osrframework.utils.platforms import Platform
25
26
27 class V7n(Platform):
28 """A <Platform> object for V7n"""
29 def __init__(self):
30 self.platformName = "V7n"
31 self.tags = ["development"]
32
33 ########################
34 # Defining valid modes #
35 ########################
36 self.isValidMode = {}
37 self.isValidMode["phonefy"] = False
38 self.isValidMode["usufy"] = True
39 self.isValidMode["searchfy"] = False
40
41 ######################################
42 # Search URL for the different modes #
43 ######################################
44 # Strings with the URL for each and every mode
45 self.url = {}
46 #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
47 self.url["usufy"] = "http://www.v7n.com/forums/members/" + "<usufy>" + ".html"
48 #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"
49
50 ######################################
51 # Whether the user needs credentials #
52 ######################################
53 self.needsCredentials = {}
54 #self.needsCredentials["phonefy"] = False
55 self.needsCredentials["usufy"] = False
56 #self.needsCredentials["searchfy"] = False
57
58 #################
59 # Valid queries #
60 #################
61 # Strings that will imply that the query number is not appearing
62 self.validQuery = {}
63 # The regular expression '.+' will match any query
64 #self.validQuery["phonefy"] = ".*"
65 self.validQuery["usufy"] = ".+"
66 #self.validQuery["searchfy"] = ".*"
67
68 ###################
69 # Not_found clues #
70 ###################
71 # Strings that will imply that the query number is not appearing
72 self.notFoundText = {}
73 #self.notFoundText["phonefy"] = []
74 self.notFoundText["usufy"] = ["This user has not registered and therefore does not have a profile to view."]
75 #self.notFoundText["searchfy"] = []
76
77 #########################
78 # Fields to be searched #
79 #########################
80 self.fieldsRegExp = {}
81
82 # Definition of regular expressions to be searched in phonefy mode
83 #self.fieldsRegExp["phonefy"] = {}
84 # Example of fields:
85 #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
86
87 # Definition of regular expressions to be searched in usufy mode
88 self.fieldsRegExp["usufy"] = {}
89 # Example of fields:
90 #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
91 # Definition of regular expressions to be searched in searchfy mode
92 #self.fieldsRegExp["searchfy"] = {}
93 # Example of fields:
94 #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
95
96 ################
97 # Fields found #
98 ################
99 # This attribute will be feeded when running the program.
100 self.foundFields = {}
3939 "com.i3visio.Date.Create": '{"start": "<li class=\"about-stat joined-date\">", "end": "</li>"}', # Regular expresion to extract the alias
4040 },
4141 "needs_credentials": False,
42 "not_found_text": "channel-empty-message banner-message", # Text that indicates a missing profile
42 "not_found_text": "error-page", # Text that indicates a missing profile
4343 "query_validator": "[^@, ]+", # Regular expression that the alias SHOULD match
4444 "url": "https://www.youtube.com/user/{placeholder}/about", # Target URL where {placeholder} would be modified by the alias
4545 },
00 Metadata-Version: 2.1
11 Name: osrframework
2 Version: 0.20.1
2 Version: 0.20.2
33 Summary: OSRFramework - A set of AGPLv3+ OSINT tools developed by i3visio analysts for online research.
44 Home-page: http://github.com/i3visio/osrframework
55 Author: Felix Brezo and Yaiza Rubio
66 Author-email: [email protected]
77 License: COPYING
8 Description: OSRFramework
9 ============
10
11 OSRFramework: Open Sources Research Framework
12
13 Copyright (C) 2014-2020 F. Brezo and Y. Rubio, i3visio
14
15 [![Version in PyPI](https://img.shields.io/pypi/v/osrframework.svg)]()
16 [![License](https://img.shields.io/badge/license-GNU%20Affero%20General%20Public%20License%20Version%203%20or%20Later-blue.svg)]()
17
18 1 - Description
19 ---------------
20
21 OSRFramework is a GNU AGPLv3+ set of libraries developed by i3visio to perform Open Source Intelligence collection tasks.
22 They include references to a bunch of different applications related to username checking, DNS lookups, information leaks research, deep web search, regular expressions extraction and many others.
23 At the same time, by means of ad-hoc Maltego transforms, OSRFramework provides a way of making these queries graphically as well as several interfaces to interact with like OSRFConsole or a Web interface.
24
25 2 - License: GNU AGPLv3+
26 ------------------------
27
28 This is free software, and you are welcome to redistribute it under certain conditions.
29
30 This program is free software: you can redistribute it and/or modify
31 it under the terms of the GNU Affero General Public License as published by
32 the Free Software Foundation, either version 3 of the License, or
33 (at your option) any later version.
34
35 This program is distributed in the hope that it will be useful,
36 but WITHOUT ANY WARRANTY; without even the implied warranty of
37 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 GNU Affero General Public License for more details.
39
40 You should have received a copy of the GNU Affero General Public License
41 along with this program. If not, see <http://www.gnu.org/licenses/>.
42
43
44 For more details on this issue, check the [COPYING](COPYING) file.
45
46 3 - Installation
47 ----------------
48
49 Fast way to do it on any system for a user with administration privileges:
50 ```
51 pip3 install osrframework
52 ```
53 You can upgrade to the latest release of the framework with:
54 ```
55 pip3 install osrframework --upgrade
56 ```
57 This will manage all the dependencies for you and install the latest version of the framework.
58
59 If you needed further information on how to install OSRFramework on certain systems, note that you may need to add `export PATH=$PATH:$HOME/.local/bin` to your `~/.bashrc_profile`). This has been confirmed in some distributions, including MacOS.
60 In any case, we recommend you yo have a look at the [INSTALL.md](doc/INSTALL.md) file where we provide additional details for these cases.
61
62 4 - Basic usage
63 ---------------
64
65 If everything went correctly (we hope so!), it's time for trying usufy., mailfy and so on.
66 But we are they
67 ? They are installed in your path meaning that you can open a terminal anywhere and typing the name of the program (seems to be an improvement from previous installations...). Examples:
68 ```
69 osrf --help
70 usufy -n i3visio febrezo yrubiosec -p twitter facebook
71 searchfy -q "i3visio"
72 mailfy -n i3visio
73 ```
74
75 Type -h or --help to get more information about which are the parameters of each application.
76
77 The tools installed in this package include:
78
79 - `alais_generator`. Generates candidate nicknames based on known info about the target. **Input**: information about the target. **Output**: list of possible nicknames.
80 - `checkfy`. Guesses possible emails based on a list of candidate nicknames and a pattern. **Input**: list of nicknames and an email pattern. **Output**. list of emails matching the pattern..
81 - `domainfy`. Finds domains that currently resolve using a given word or nickname. **Input**: liat of words. **Output**: domains using that word that currently resolve.
82 - `mailfy`. Find more information about emails taken as a reference either a nickname (to generate a list of possible emails) or the email list. **Input**: list of nicknames or emails. **Output**: found information about the email.
83 - `osrf`. Shared wrapper for the rest of the applications. All commands can also be used as `osrf usufy…`, `osrf mailfy…`, etc.
84 - `phonefy`. Recovers information about mobile phones linked to known spam practices. **Inputs**: list of phones. **Outputs**: Phones linked to spam.
85 - `searchfy`. Finds profiles linked to a fullname. **Inputs**: list of phones. **Outputs**: Known profiles linked to the query.
86 - `usufy`. Identifies socialmedia profiles using a given nickname. **Inputs**: list of nicknames. **Outputs**: Known profiles in socialmedia using those nicknames.
87
88 You can find the configuration files in a folder created in your user home to define the default behaviour of the applications:
89 ```
90 # Configuration files for Linux and MacOS
91 ~/.config/OSRFramework/
92 # Configuration files for Windows
93 C:\Users\<User>\OSRFramework\
94 ```
95
96 OSRFramework will look for the configuration settings for each application stored there.
97 You can add new credentials there and if something goes wrong, you can always restore the files stored in the `defaults` subfolder.
98
99 If you are experiencing problems, you might fight relevant information in the (FAQ Section)[doc/FAQ.md].
100
101 5 - HACKING
102 -----------
103
104 If you want to extend the functionalities of OSRFramework and you do not know where to start from, check the [HACKING.md](doc/HACKING.md) file.
105
106 6 - AUTHORS
107 -----------
108
109 More details about the authors in the [AUTHORS.md](AUTHORS.md) file.
110
8 Description: UNKNOWN
1119 Keywords: python osint harvesting profiling username socialmedia forums
11210 Platform: UNKNOWN
11311 Classifier: Development Status :: 4 - Beta
106106 osrframework/wrappers/bandcamp.py
107107 osrframework/wrappers/bennugd.py
108108 osrframework/wrappers/betblog.py
109 osrframework/wrappers/bitbacker.py
110109 osrframework/wrappers/bitbucket.py
111110 osrframework/wrappers/bitcointalk.py
112111 osrframework/wrappers/bitrated.py
115114 osrframework/wrappers/blogspot.py
116115 osrframework/wrappers/boonex.py
117116 osrframework/wrappers/bubok.py
118 osrframework/wrappers/bucketlistly.py
119117 osrframework/wrappers/buddypic.py
120118 osrframework/wrappers/burbuja.py
121 osrframework/wrappers/canva.py
122119 osrframework/wrappers/carbonmade.py
123120 osrframework/wrappers/cartodb.py
124121 osrframework/wrappers/causes.py
129126 osrframework/wrappers/codecademy.py
130127 osrframework/wrappers/codementor.py
131128 osrframework/wrappers/coderwall.py
132 osrframework/wrappers/colourlovers.py
133129 osrframework/wrappers/connectingsingles.py
134130 osrframework/wrappers/couchsurfing.py
135131 osrframework/wrappers/crokes.py
143139 osrframework/wrappers/disqus.py
144140 osrframework/wrappers/doodle.py
145141 osrframework/wrappers/douban.py
146 osrframework/wrappers/dreamstime.py
147142 osrframework/wrappers/dribbble.py
148143 osrframework/wrappers/drupal.py
149144 osrframework/wrappers/dzone.py
170165 osrframework/wrappers/freerepublic.py
171166 osrframework/wrappers/getsatisfaction.py
172167 osrframework/wrappers/github.py
168 osrframework/wrappers/gnupgkeys.py
173169 osrframework/wrappers/goblinrefuge.py
174170 osrframework/wrappers/goodreads.py
175171 osrframework/wrappers/gravatar.py
188184 osrframework/wrappers/jamiiforums.py
189185 osrframework/wrappers/kali.py
190186 osrframework/wrappers/kanogames.py
191 osrframework/wrappers/key_server.py
192187 osrframework/wrappers/keybase.py
193188 osrframework/wrappers/kickstarter.py
194189 osrframework/wrappers/kinja.py
234229 osrframework/wrappers/periscope.py
235230 osrframework/wrappers/phishtank.py
236231 osrframework/wrappers/photobucket.py
237 osrframework/wrappers/pixinsight.py
238232 osrframework/wrappers/pixls.py
239233 osrframework/wrappers/pjrc.py
240234 osrframework/wrappers/pokerred.py
249243 osrframework/wrappers/ripenear.py
250244 osrframework/wrappers/rojadirecta.py
251245 osrframework/wrappers/ruby.py
252 osrframework/wrappers/sarahah.py
253246 osrframework/wrappers/scribd.py
254247 osrframework/wrappers/seatwish.py
255248 osrframework/wrappers/sencha.py
256 osrframework/wrappers/sidereel.py
257249 osrframework/wrappers/singletrackworld.py
258250 osrframework/wrappers/slashdot.py
259251 osrframework/wrappers/slideshare.py
260252 osrframework/wrappers/smartcitizen.py
261253 osrframework/wrappers/smugmug.py
262254 osrframework/wrappers/soundcloud.py
263 osrframework/wrappers/soup.py
264255 osrframework/wrappers/spaniards.py
265256 osrframework/wrappers/spoj.py
266257 osrframework/wrappers/spotify.py
268259 osrframework/wrappers/steamcommunity.py
269260 osrframework/wrappers/steemit.py
270261 osrframework/wrappers/steinberg.py
271 osrframework/wrappers/taringa.py
272262 osrframework/wrappers/teamtreehouse.py
273263 osrframework/wrappers/telegram.py
274 osrframework/wrappers/thesims.py
275264 osrframework/wrappers/thestudentroom.py
276265 osrframework/wrappers/theverge.py
277266 osrframework/wrappers/thiscrush.py
281270 osrframework/wrappers/twoplustwo.py
282271 osrframework/wrappers/typepad.py
283272 osrframework/wrappers/unsplash.py
284 osrframework/wrappers/v7n.py
285273 osrframework/wrappers/venmo.py
286274 osrframework/wrappers/verbling.py
287275 osrframework/wrappers/vexforum.py
1818 colorama
1919 configparser
2020 cfscrape
21 pip>=19.0.0
1818 colorama
1919 configparser
2020 cfscrape
21 pip>=19.0.0
4949 requirements = file.read().splitlines()
5050
5151 # Depending on the place in which the project is going to be upgraded
52 def read(fname):
53 return open(os.path.join(os.path.dirname(__file__), fname)).read()
52 """def read(fname):
53 return open(os.path.join(os.path.dirname(__file__), fname)).read()"""
5454
5555 # Creating the application paths
5656 paths = configuration.get_config_path()
104104 'Topic :: Text Processing :: Markup :: HTML'
105105 ],
106106 packages=find_packages(),
107 long_description=read('README.md'),
107 #long_description=read('README.md'),
108108 long_description_content_type="text/markdown",
109109 install_requires=requirements,
110110 )