What is an IP list cleaner and refanger?
Logs, tickets, emails and threat reports are full of IP addresses, but they come mixed with timestamps, ports, usernames and other text. This tool reads all of it and gives you back only the addresses: one clean list with the IPv4 and IPv6 addresses together, and no duplicates. The addresses that appeared more than once are shown in a separate box.
It also refangs addresses. Analysts write them in a safe, "defanged" form like 185.220.101[.]34 so that they cannot be clicked by mistake. Before you can block or search for such an address, it has to be turned back into 185.220.101.34. The tool does that for you.
How to use the IP List Cleaner
Paste anything into the box: firewall logs, web server logs, a threat report, an email or a plain list. Not sure how it works? Click Load Example Logs to fill the box with sample logs that include defanged IPs, IPv6 addresses and duplicates, and see the result straight away.
Extract IPv4 and Extract IPv6 choose which kinds of address you get. Refang IPs fixes defanged addresses. Remove Duplicates keeps one copy of each address. Sort Numerically orders the lists by value. All five are on by default.
The clean list appears below, IPv4 addresses first and then IPv6, with the number of addresses found, duplicates removed and defanged addresses fixed. A second box under it shows which addresses appeared more than once, and how many times. After the first click, both boxes follow your changes, so you can tick or untick an option and watch them update.
Both boxes have their own Copy and Download buttons. You get one address per line, in a plain text file. Clear All empties the input and puts the options back to their defaults.
What gets refanged
These defanged forms are turned back into normal addresses when Refang IPs is on:
| Defanged form | Refanged address |
|---|---|
| 192[.]168[.]1[.]10 | 192.168.1.10 |
| 192(.)168(.)1(.)10 | 192.168.1.10 |
| 192{.}168{.}1{.}10 | 192.168.1.10 |
| 192[dot]168[dot]1[dot]10 | 192.168.1.10 |
| 192\.168\.1\.10 | 192.168.1.10 |
| 2001[:]db8[::]1 | 2001:db8::1 |
| 2001(:)db8(::)1 | 2001:db8::1 |
| 2001[colon]db8[::]1 | 2001:db8::1 |
If you turn Refang IPs off, defanged addresses are left alone and will not appear in the results.
How the tool finds addresses
IPv4
- Four numbers from 0 to 255, separated by dots.
- Leading zeros are not accepted, so
10.01.2.3is skipped. Some systems read it as octal, so the meaning is unclear. - Numbers with five parts, like
1.2.3.4.5, and versions likev1.2.3.4are not addresses and are skipped. - A port or a prefix after the address is dropped:
203.0.113.45:8080gives203.0.113.45.
IPv6
- Each candidate is checked with a strict parser. It needs 8 groups of 1 to 4 hex digits, or fewer groups with a single
::. An IPv4 ending such as::ffff:192.0.2.77is fine. - Times (
03:12:44), MAC addresses (00:1a:2b:3c:4d:5e) and code such asstd::vectordo not pass the check, so they are not listed. - Brackets, ports and zone IDs are dropped:
[2001:db8::1]:443gives2001:db8::1andfe80::1%eth0givesfe80::1. - Every address is written in the standard short form, so
2001:DB8:0:0:0:0:0:1and2001:db8::1are seen as the same address and counted once.
Example
This text:
src=203.0.113.45 dst=10.0.0.5 blocked 198[.]51[.]100[.]23 and 203.0.113.45 client [2001:DB8:0:0:0:0:0:1]:443 beacon 2001[:]db8[::]1
gives this result, with Refang, Remove Duplicates and Sort all on. IPv4 addresses come first, then IPv6:
| Clean IP Addresses (4) | Duplicate Addresses (2) |
|---|---|
| 10.0.0.5 | 203.0.113.45 (2 times) |
| 198.51.100.23 | 2001:db8::1 (2 times) |
| 203.0.113.45 | |
| 2001:db8::1 |
Two duplicates were removed (the second 203.0.113.45 and the second 2001:db8::1) and listed in the second box, and two defanged addresses were fixed.
When it helps
Use it to build a blocklist from a threat report, to list the sources that appear in a firewall or web log, to see which addresses show up more than once, to clean an IOC list before you load it into a SIEM, or to merge several lists into one. Because it runs in your browser, internal logs never leave your computer.
To check what network an address belongs to, use the IPv4 Subnet Calculator.