Get FTP/SSH/SFTP

How the FTP credential extraction works

This function extracts FTP credentials (host:port:login:password) from text log files, filtering out invalid or local IPs.

Workflow

  • Checks if the host is a valid domain or public IP (ignores local, loopback,
  • and private IP ranges).
  • Parses each line to detect possible FTP entries:
  • - Lines containing ftp:// are processed with full URL parsing. - Lines with plain IPs or the word ftp are handled in a general format.
  • Valid entries must include a host, login, and password — each less than 100
  • characters and without UNKNOWN.
  • Invalid or malformed lines (too long, missing parts, invalid host, or local
  • IPs) are skipped.

    After processing

  • The user can choose to upload or save results locally.
  • Duplicates are removed, and a final file with unique entries is saved in a
  • timestamped folder Result_YYYY_MM_DD_HH_MM_SS.

    Bad (ignored) lines

  • Lines longer than 200 characters.
  • Lines without enough fields (host, login, password).
  • Lines containing UNKNOWN.
  • Lines with invalid hostnames or private/local IPs.

..