Skip to main content

httpfind

The MIT License

Search network for HTTP servers using a regular expression filter.

Use httpfind to obtain the IP addresses of specified devices on a network. HTTP requests for a user specified page are sent in parallel. Responses are compared against a user specified regular expression pattern. Qualified results are returned as a list. The module is readily imported for use in other projects, and it also includes a convenient command line interface.

Installation

pip install httpfind

Examples

Basic import example

import httpfind

result = httpfind.survey(
    network='192.168.0.0/24',
    pattern='(A|a)ccess (P|p)oint',
    path='login.php',
    log=False)

# Results printed as full URLs
print(result)
# Results printed as IP addresses
print([x.hostname for x in result])

Yields

['http://192.168.0.190/login.php', 'http://192.168.0.191/login.php', 'http://192.168.0.192/login.php']
['192.168.0.190', '192.168.0.191', '192.168.0.192']

Command line example

$> httpfind -h
usage: httpfind [-h] [-p PATH] [-f PATTERN] [-l] network

Search 'network' for hosts with a response to 'path' that matches 'filter'

positional arguments:
  network               IP address with optional mask, e.g. 192.168.0.0/24

optional arguments:
  -h, --help            show this help message and exit
  -p PATH, --path PATH  URL path at host, e.g. index.html
  -f PATTERN, --filter PATTERN
                        Regular expression pattern for filter
  -l, --log             Enable logging

$> httpfind 192.168.0.0/24 -f "Access Point" -p login.php
Scanning, please wait ...
Found 3 matches for Access Point on 192.168.0.0/24
192.168.0.190
192.168.0.191
192.168.0.192

Parameters

def survey(network=None, path='', pattern='', log=False):

  • network - IP address and subnet mask compatible with ipaddress library

  • path - Path portion of a URL as defined by url(un)split

  • pattern - A regular expression pattern compatible with re.compile

  • log - boolean to control logging level

Consequently, the network can be defined in either subnet mask (x.x.x.x/255.255.255.0) or CIDR notation (x.x.x.x/24). Presently, httpfind only scans networks of upto 256 addresses as shown in most of the examples. Of course, a single IP address may be specified either by x.x.x.x or x.x.x.x/32.

There are numerous resources for regular expressions, such as the introduction provided by the Python Software Foundation. For the simple cases, using the default or ‘’ will match any pages while a word such as ‘Access’ will match if it’s found in the returned HTML provided it’s the same case.

Performance

As discoverhue utilizes the excellent aiohttp package, requests are sent simultaneously rather than iteratively. More accurately, the requests are sent randomly over a 2.5s interval so as to not spike traffic. The timeout is set for 5.0s, so typical execution time is about 8.0s.

Contributions

Welcome at https://github.com/Overboard/httpfind

Status

Released.

Metadata

Release files for httpfind 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for httpfind 1.0.1
File Size Uploaded Provenance Actions
httpfind-1.0.1.tar.gz 5.5 kB Without provenance Details for httpfind-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for httpfind 1.0.1
File Interpreter ABI Platform Actions
httpfind-1.0.1-py3-none-any.whl Python 3 none any Details for httpfind-1.0.1-py3-none-any.whl

Total release size: 14.4 kB

Release files / httpfind-1.0.1.tar.gz

Download URL httpfind-1.0.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ff8162acfbdb5c7639c93756451b4df8a5ef9f7f8638c2e3f2fa0245316fd17a
BLAKE2b-256 checksum
How to use checksums
616692ee2ad624c022cbb54e7c8952ec890e083f91da90d6f25756ba6b99c496
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / httpfind-1.0.1-py3-none-any.whl

Download URL httpfind-1.0.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bab7c624ac3683493e42860750595b5828340e72bbc859e430f1fc42742501a
BLAKE2b-256 checksum
How to use checksums
1c6b03ba3b2ed148523c2cd4a879b056b258c946fa771dc24129add5fd964c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for httpfind 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page