Skip to main content

Takes a webpage and outputs all ip addresses it finds

Project description

ipfromwebpage

PyPi CircleCI codecov

Summary:

Takes a webpage or text string and extracts IPv4 and IPv6 addresses. Then prints the IPs (aggregated where possible).

Quickstart:

Run using uvx ipfromwebpage

Usage Options:

  1. Extract IPs from a URL: ipfromwebpage <url> where <url> is the fully qualified URL you wish to scrape for IPs.
  2. Extract IPs from text: ipfromwebpage --input-string "<text>" where <text> is any plain text containing IP addresses (e.g., copy-pasted from a website).
  3. Include reserved IPs: Add --no-exclusions flag to include addresses in reserved ranges (0.0.0.0/8, 224.0.0.0/3) that are normally filtered out.

Code Examples:

Example 1: Scraping from a URL

ipfromwebpage https://www.cloudflare.com/ips
================
IPv4 addresses:
103.21.244.0/22
103.22.200.0/22
103.31.4.0/22
104.16.0.0/12
108.162.192.0/18
131.0.72.0/22
141.101.64.0/18
162.158.0.0/15
172.64.0.0/13
173.245.48.0/20
188.114.96.0/20
190.93.240.0/20
197.234.240.0/22
198.41.128.0/17
================
IPv6 addresses:
2400:cb00::/32
2405:8100::/32
2405:b500::/32
2606:4700::/32
2803:f800::/32
2a06:98c0::/29
2c0f:f248::/32

Example 2: Extracting from text string (e.g., copy-pasted content)

ipfromwebpage --input-string "Server IPs: 10.0.0.1, 192.168.1.1
Network range: 172.16.0.0/24
IPv6: 2001:db8::1"
================
IPv4 addresses:
10.0.0.1
172.16.0.0/24
192.168.1.1
================
IPv6 addresses:
2001:db8::1

Example 3: Including reserved/multicast IPs (e.g., from terraform output)

ipfromwebpage --input-string "242.143.224.100/32, 242.143.224.101/32" --no-exclusions
================
IPv4 addresses:
242.143.224.100/31
================
IPv6 addresses:
No addresses found when scraping input string

Note: By default, addresses in the ranges 0.0.0.0/8 and 224.0.0.0/3 are excluded as they are typically reserved or multicast addresses. Use --no-exclusions to include them.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipfromwebpage-1.3.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipfromwebpage-1.3.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file ipfromwebpage-1.3.0.tar.gz.

File metadata

  • Download URL: ipfromwebpage-1.3.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.1

File hashes

Hashes for ipfromwebpage-1.3.0.tar.gz
Algorithm Hash digest
SHA256 98b8ca79c6e557e2de8d20f55c5539cf86524fd9b30f851a8c241806cbd93bb0
MD5 e9abcfd380656f7ee371d24647006feb
BLAKE2b-256 3a95056924098828b54b09bb6c0803d3e4b5bfc98a140d7019f40c6360d3e4c7

See more details on using hashes here.

File details

Details for the file ipfromwebpage-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ipfromwebpage-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c206380fe23bef011d9e6ddc78406b7dd984e8b46820be2cb3676dc1a6c5502
MD5 4f084c189bbac0484d7f6e7c06c63742
BLAKE2b-256 3aab70ae1f241ae78b02199a00903034af746dae42a4dd43fdc1d2b8af854432

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page