8000 GitHub - loglux-lab/ip-extractor: ip-extractor.sh uses nano to extract IP addresses. Results are stored in 'hosts', with duplicates removed. Ideal for sifting through logs and data-rich files.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ip-extractor.sh uses nano to extract IP addresses. Results are stored in 'hosts', with duplicates removed. Ideal for sifting through logs and data-rich files.

Notifications You must be signed in to change notification settings

loglux-lab/ip-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

IP-Extractor

ip-extractor.sh is a Bash script designed to extract IP addresses from any text input via the nano editor. It processes the input, saves clean IP lists into several formats, and provides immediate feedback in the console.


📦 Prerequisites

  • Bash-compatible environment (Linux, macOS, WSL, etc.)
  • nano editor installed
  • Standard Unix tools: grep, sort, tr, cat, rm, sed, etc.

🚀 Usage

  1. Run the script:

    ./ip-extractor.sh
  2. On first run, a file called load will be opened in nano. Paste your raw text (e.g., log files, traceroutes, firewall logs).

  3. Save and exit (Ctrl + O, Enter, Ctrl + X).

  4. The script will:

    • Extract all non-localhost IPv4 addresses
    • Save them to a file called hosts
    • Remove duplicates
    • Create two additional files:
      • hostcom: IPs in a comma-separated format
      • chost: IPs in a space-separated format
    • Display the final list of IPs in console
    • Inform how many IPs were found

📁 Output Files

File Description
hosts Unique extracted IP addresses, one per line
hostcom Same IPs as in hosts, comma-separated
chost Same IPs as in hosts, space-separated
load Temporary input file (deleted after run)
loadlast Copy of last processed input

🛠 Features

  • Clean parsing: skips 127.*.*.* and non-IP lines
  • Visual feedback (, Done!) during processing
  • Duplicate removal via sort -u
  • Auto-relaunches itself if load file is empty or missing
  • Multi-format output: plain, comma, and space-separated

🔁 Notes

  • The script only works with IPv4 addresses.
  • Edit the regex in grep if you want to support other formats or behaviours.
  • You can comment or customise the JobFin messages for quieter output.

🙋 Contributing

This is a lightweight utility meant for quick daily tasks. Feel free to submit enhancements, especially:

  • IPv6 support
  • GUI-based input (e.g. with zenity)
  • Output to JSON or CSV

About

ip-extractor.sh uses nano to extract IP addresses. Results are stored in 'hosts', with duplicates removed. Ideal for sifting through logs and data-rich files.

Topics

Resources

Stars

Watchers

Forks

Languages

0