### Install intelx from GitHub Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Installs the intelx Python package directly from a GitHub repository, specifying a subdirectory. ```bash pip install "intelx @ git+https://github.com/IntelligenceX/SDK#subdirectory=Python" ``` -------------------------------- ### Install intelx via pip Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Installs the intelx Python package from the Python Packaging Index. ```bash pip install intelx ``` -------------------------------- ### Install and Import ixapi Go Package Source: https://github.com/intelligencex/sdk/blob/master/Go/ixapi/README.md Instructions for downloading and importing the `ixapi` Go package into your project. ```go go get -u github.com/IntelligenceX/SDK/Go/ixapi import "github.com/IntelligenceX/SDK/Go/ixapi" ``` -------------------------------- ### Install intelx via pip with specific index Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Installs the intelx Python package from a specific PyPI index URL. ```bash pip install --index-url https://pypi.python.org/simple/ intelx ``` -------------------------------- ### Install intelx from local GitHub clone Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Installs the intelx Python package in editable mode after cloning the GitHub repository. ```bash git clone https://github.com/IntelligenceX/SDK cd Python pip3 install -e . ``` -------------------------------- ### Install intelx-maltego SDK Source: https://github.com/intelligencex/sdk/blob/master/Maltego Transform/README.md Clones the Intelligence X SDK repository and installs the Python package. ```Shell git clone https://github.com/IntelligenceX/SDK pip install ./SDK/Python ``` -------------------------------- ### Initiate Identity-Enabled Search Source: https://github.com/intelligencex/sdk/blob/master/httpie.md Initiates a live search for a given selector (e.g., a domain) with specified parameters like limit and analysis. It requires an IntelligenceX Key for authentication. The response includes a search ID and status. ```shell $ http "https://3.intelx.io/live/search/internal" selector==example.com skipinvalid==False limit==10 analyze==False datefrom== dateto== "x-key:11111111-1111-1111-1111-111111111111" ``` -------------------------------- ### Intelx.io Search and Retrieval Example Source: https://github.com/intelligencex/sdk/blob/master/HTML/search.html This JavaScript code snippet demonstrates how to interact with the Intelx.io API to perform a search, retrieve results, and display file previews. It utilizes jQuery and AJAX to make asynchronous requests to the API endpoints. ```javascript var API_KEY = '00000000-0000-0000-0000-000000000000'; var API_URL = 'https://2.intelx.io/'; $(document).on('click', '#btnSearch', function (event) { event.preventDefault(); if ($('#searchField').val() == '') { return; } $('#searchResults').html('
Searching for results...
'); $.ajax({ url: API_URL + "intelligent/search", headers: { 'x-key': API_KEY }, type: 'POST', cache: true, data: JSON.stringify({ term: $('#searchField').val(), maxresults: 10, media: 0, sort: 2, terminate: [] }), success: function (p, statusText, xhr) { $.ajax({ url: API_URL + "intelligent/search/result", headers: { 'x-key': API_KEY }, type: 'GET', cache: true, data: "id=" + p.id + "&limit=10&statistics=1&previewlines=8", success: function (data, textStatus, xhr) { $('#searchResults').html(""); if (!!data && data.records.length > 0) { $.each(data.records, function (i, record) { $.ajax({ url: API_URL + "file/preview", headers: { 'x-key': API_KEY }, type: 'GET', cache: true, data: "sid=" + record['storageid'] + "&f=" + 0 + "&l=" + 8 + "&c=" + 1 + "&m=" + 1 + "&b=" + 'pastes' + "&k=" + API_KEY, success: function (preview, textStatus, xhr) { if (record['name'] != '') { $('#searchResults').append('' + preview + '
Nothing found :(
'); } } }); } }); }); ``` -------------------------------- ### Run Maltego Transform Installation Script Source: https://github.com/intelligencex/sdk/blob/master/Maltego Transform/README.md Executes the installation script for the Maltego transforms, prompting for Python executable path and API key. ```Shell C:\intelx-maltego>python install.py Python executable: C:\Program Files (x86)\Python38-32\Python.exe Intelligence X API Key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Configuration file saved to: C:\intelx-maltego/intelx.mtz ``` -------------------------------- ### Copy and Install Maltego Transforms Source: https://github.com/intelligencex/sdk/blob/master/Maltego Transform/README.md Copies the Maltego transform files to a local directory and installs the required dependencies. ```Shell mkdir C:\intelx-maltego xcopy /E "./SDK/Maltego Transform" C:\intelx-maltego\ cd C:\intelx-maltego pip install -r requirements.txt ``` -------------------------------- ### Download Identity Accounts Data Source: https://github.com/intelligencex/sdk/blob/master/httpie.md Downloads the account data for a specific search ID. This command is used after initiating an account data retrieval and allows saving the results to a local file. An IntelligenceX Key is required for authentication. ```shell $ http "https://3.intelx.io/live/search/result" id==00000000-0000-0000-0000-000000000000 "x-key:11111111-1111-1111-1111-111111111111" --download -o pyintelx-identityenabled-accounts-example.com.json ``` -------------------------------- ### Retrieve Identity-Enabled Search Results Source: https://github.com/intelligencex/sdk/blob/master/httpie.md Retrieves the results of a previously initiated identity-enabled search using its ID. It allows specifying the output format and limit, and can download the results to a file. Requires an IntelligenceX Key. ```shell $ http "https://3.intelx.io/live/search/result" id==00000000-0000-0000-0000-000000000000 format==1 limit==10 "x-key:11111111-1111-1111-1111-111111111111" --download -o pyintelx-identityenabled-example.com.json ``` -------------------------------- ### Retrieve Identity Accounts Data Source: https://github.com/intelligencex/sdk/blob/master/httpie.md Fetches account data associated with a given selector in CSV format. This operation requires an IntelligenceX Key and allows filtering by date range and limit. The response contains a search ID and status. ```shell $ http "https://3.intelx.io/accounts/csv" selector==example.com limit==10 datefrom== dateto== "x-key:11111111-1111-1111-1111-111111111111" ``` -------------------------------- ### Initialize and Perform a Search Source: https://github.com/intelligencex/sdk/blob/master/Go/ixapi/README.md Demonstrates how to initialize the `IntelligenceXAPI` struct, optionally setting an API key and URL, and then perform a search query. ```go search := ixapi.IntelligenceXAPI{} search.Init("", "") results, selectorInvalid, err := search.Search(ctx, Selector, ixapi.SortXScoreDesc, 100, ixapi.DefaultWaitSortTime, ixapi.DefaultTimeoutGetResults) ``` -------------------------------- ### Initialize IntelX library Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Initializes the IntelX library in Python. If no API key is provided, it defaults to the public API key. ```python from intelxapi import intelx intelx = intelx() ``` -------------------------------- ### Use intelx.py with API key argument Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Executes the intelx.py command-line utility, providing the API key as an argument. ```bash intelx.py -search riseup.net -apikey 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### IntelligenceXAPI Struct Methods Source: https://github.com/intelligencex/sdk/blob/master/Go/ixapi/README.md Lists and describes the available methods for the `IntelligenceXAPI` struct, covering search management, file operations, and API key configuration. ```APIDOC IntelligenceXAPI Methods: Init(apiURL string, apiKey string) Initializes the API with optional API URL and Key. SearchStart(ctx context.Context, selector string, sort ixapi.Sort, limit int, waitTime time.Duration, timeout time.Duration) (searchID string, selectorInvalid bool, err error) Starts a search and returns the search ID. SearchStartAdvanced(ctx context.Context, selector string, sort ixapi.Sort, limit int, waitTime time.Duration, timeout time.Duration, advancedOptions ...ixapi.AdvancedOption) (searchID string, selectorInvalid bool, err error) Starts a search with optional parameters and returns the search ID. SearchGetResults(ctx context.Context, searchID string) (results []ixapi.Result, err error) Returns available results for a given search ID. SearchTerminate(ctx context.Context, searchID string) (err error) Terminates an ongoing search. FilePreview(ctx context.Context, itemID string) (preview string, err error) Returns the preview (max first 1000 characters) of an item. FileRead(ctx context.Context, itemID string) (data []byte, err error) Returns the full item data. SearchGetResultsAll(ctx context.Context, selector string, sort ixapi.Sort, limit int, waitTime time.Duration, timeout time.Duration) (results []ixapi.Result, selectorInvalid bool, err error) Returns all results within a timeout. SetAPIKey(apiKey string, apiURL string) Sets API URL and Key to use. ``` -------------------------------- ### Quick search with intelx.py Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Performs a quick search for a given domain using the intelx.py command-line utility. ```bash intelx.py -search riseup.net ``` -------------------------------- ### Perform a quick search using IntelX library Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Executes a quick search for a given domain using the intelx.search() function. An API key can be provided during initialization. ```python from intelxapi import intelx intelx = intelx('00000000-0000-0000-0000-000000000000') results = intelx.search('hackerone.com') ``` -------------------------------- ### Build and Package with Twine Source: https://github.com/intelligencex/sdk/blob/master/Python/requirements-dev.txt Twine is used to upload Python package distributions to the Python Package Index (PyPI). This command builds the source distribution and wheel, then uploads them. ```bash python -m build python -m twine upload dist/* ``` -------------------------------- ### Link to Intelx.io Search Source: https://github.com/intelligencex/sdk/blob/master/README.md Demonstrates how to link directly to the Intelligence X website for search queries. This method bypasses the SDK and uses the web interface. ```URL https://intelx.io/?s=[search term] ``` ```URL https://intelx.io/?s=test.com ``` ```URL https://intelx.io/?s=test@example.com ``` -------------------------------- ### Download item with intelx.py Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Downloads an item by its ID from a specified bucket and saves it with a given filename. Requires -bucket and optionally -name. ```bash # save item as test.pdf intelx.py -download 29a97791-1138-40b3-8cf1-de1764e9d09c -bucket leaks.private.general -name test.txt ``` -------------------------------- ### Intelx API Integration Source: https://github.com/intelligencex/sdk/blob/master/Maltego Transform/requirements.txt This section covers the integration with the Intelx API using the provided SDK. It outlines how to perform searches, retrieve data, and interact with various IntelligenceX services. ```python from intelx.api import IntelX # Initialize the IntelX API client # Ensure you have your API key set as an environment variable or pass it directly api_key = "YOUR_API_KEY" # Or os.environ.get("INTELX_API_KEY") intelx = IntelX(api_key=api_key) # Example: Search for a domain search_results = intelx.search("example.com", "domain") # Process search results for result in search_results['events']: print(f"ID: {result['id']}, Date: {result['date']}") # Example: Get details for a specific search search_id = "some_search_id" search_details = intelx.search_details(search_id) print(search_details) ``` -------------------------------- ### Enable Virtual Terminal Level for Color Support on Windows Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Creates a .reg file to enable virtual terminal level for color support in Windows command prompt. ```bash Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Console] "VirtualTerminalLevel"=dword:00000001 ``` -------------------------------- ### Quick search in specific buckets with intelx.py Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Performs a search for a domain within specified buckets (e.g., pastes, darknet.tor). ```bash intelx.py -search riseup.net -buckets "pastes, darknet.tor" ``` -------------------------------- ### Search with a limit of 100 results using intelx.py Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Performs a search for a domain and limits the results to 100. ```bash intelx.py -search riseup.net -limit 100 ``` -------------------------------- ### View File Contents Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Demonstrates how to view the contents of a file from search results. This is suitable for text-based content. Requires the intelxapi library. ```python from intelxapi import intelx intelx = intelx() results = intelx.search('riseup.net') # use the first result result = results['records'][0] # grab file contents of first search result contents = intelx.FILE_VIEW(result['type'], result['media'], result['storageid'], result['bucket']) print(contents) ``` -------------------------------- ### Export accounts from Identity Portal with intelx.py Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Exports accounts associated with a given identity using the intelx.py command-line utility. ```bash intelx.py -identity riseup.net --exportaccounts ``` -------------------------------- ### Read/Download File Data Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Shows how to download the raw data of a file from search results. This is suitable for any file type, including binary. Requires the intelxapi library. ```python from intelxapi import intelx intelx = intelx() results = intelx.search('riseup.net') # save the first search result file as "file.txt" intelx.FILE_READ(results['records'][0]['systemid'], 0, results['records'][0]['bucket'], "file.txt") ``` -------------------------------- ### Collect Search Statistics Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Shows how to perform a search and then collect statistics on the results. Requires the intelxapi library. ```python from intelxapi import intelx intelx = intelx('00000000-0000-0000-0000-000000000000') results = intelx.search( 'riseup.net', maxresults=1000, ) stats = intelx.stats(results) print(stats) ``` -------------------------------- ### Pre-commit Hooks for Code Quality Source: https://github.com/intelligencex/sdk/blob/master/Python/requirements-dev.txt Pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. It helps ensure code quality and consistency before commits are made. ```bash pre-commit install pre-commit run --all-files ``` -------------------------------- ### High-Level Search Functions Source: https://github.com/intelligencex/sdk/blob/master/Go/ixapi/README.md Provides descriptions for high-level functions that simplify the search process by immediately returning results. ```APIDOC High-Level Search Functions: Search(ctx context.Context, selector string, sort ixapi.Sort, limit int, waitTime time.Duration, timeout time.Duration) (results []ixapi.Result, selectorInvalid bool, err error) Starts a search and queries all results. SearchWithDates(ctx context.Context, selector string, startDate time.Time, endDate time.Time, sort ixapi.Sort, limit int, waitTime time.Duration, timeout time.Duration) (results []ixapi.Result, selectorInvalid bool, err error) Starts a search with dates and queries all results. ``` -------------------------------- ### View item details with intelx.py Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Views the full data of a specific search result using its ID and the --view parameter. ```bash intelx.py -search 3a4d5699-737c-4d22-8dbd-c5391ce805df --view ``` -------------------------------- ### Set INTELX_KEY environment variable Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Sets the INTELX_KEY environment variable to store your API key. ```bash # create an INTELX_KEY env var with your API key. export INTELX_KEY=00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Automated Changelog Generation with Git-Cliff Source: https://github.com/intelligencex/sdk/blob/master/Python/requirements-dev.txt Git-cliff is a command-line tool that generates changelogs from git history. It can be configured to follow specific conventions for commit messages. ```bash git cliff --output CHANGELOG.md ``` -------------------------------- ### Intelligence X Supported Search Selectors Source: https://github.com/intelligencex/sdk/blob/master/README.md Lists the supported selector types for searching within the Intelligence X engine. Any other types will be rejected. ```Text Email address Domain, including wildcards like *.example.com URL IPv4 and IPv6 CIDRv4 and CIDRv6 Phone Number Bitcoin address MAC address IPFS Hash UUID Simhash Credit Card Number Social Security Number IBAN ``` -------------------------------- ### Search in specific buckets with IntelX library Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Searches for a term within specified buckets (e.g., 'darknet', 'leaks.public', 'leaks.private'). Requires access to all specified buckets. ```python from intelxapi import intelx b = ['darknet', 'leaks.public', 'leaks.private'] intelx = intelx('00000000-0000-0000-0000-000000000000') results = intelx.search('hackerone.com', maxresults=200, buckets=b) ``` -------------------------------- ### Filter Search by Media Type Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Demonstrates how to filter search results by a specific media type and date range. Requires the intelxapi library. ```python from intelxapi import intelx media_type = 1 # Paste document startdate = "2014-01-01 00:00:00" enddate = "2014-02-02 23:59:59" intelx = intelx('00000000-0000-0000-0000-000000000000') results = intelx.search( 'riseup.net', maxresults=200, media=media_type, datefrom=startdate, dateto=enddate ) ``` -------------------------------- ### Retrieve data leaks from Identity Portal with intelx.py Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Retrieves data leaks associated with a given identity using the intelx.py command-line utility. ```bash intelx.py -identity riseup.net --dataleaks ``` -------------------------------- ### Maltego Transforms Source: https://github.com/intelligencex/sdk/blob/master/Maltego Transform/requirements.txt This section details the Maltego Transforms available within the IntelligenceX SDK. These transforms allow users to integrate IntelligenceX data and functionality into Maltego for advanced threat intelligence analysis. ```python from intelx.maltego import IxMaltego # Example of a Maltego Transform class SearchIntelx(IxMaltego): @classmethod def create_entities(cls, request): # Implement search logic here pass # To run this transform: # python -m intelx.maltego.transforms.search_intelx ``` -------------------------------- ### Extract emails from phonebook search with intelx.py Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Performs a phonebook search for a domain and extracts associated emails. ```bash intelx.py -search cia.gov --phonebook emails ``` -------------------------------- ### Perform an advanced search with custom maxresults Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Performs a search with a custom maximum number of results. Server-side limitations may still apply. ```python from intelxapi import intelx intelx = intelx('00000000-0000-0000-0000-000000000000') results = intelx.search('hackerone.com', maxresults=200) ``` -------------------------------- ### Filter search results by date range Source: https://github.com/intelligencex/sdk/blob/master/Python/README.md Filters search results by a specified date range. Both 'datefrom' and 'dateto' must be provided with time included. ```python from intelxapi import intelx startdate = "2014-01-01 00:00:00" enddate = "2014-02-02 23:59:59" intelx = intelx('00000000-0000-0000-0000-000000000000') results = intelx.search( 'riseup.net', maxresults=200, datefrom=startdate, dateto=enddate ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.