CURL로 터미널에서 IP, ASN 및 VPN/프록시 유출 확인 (가입 및 키 없음)

작성자

카테고리:

← 피드로
DEV Community · CodeLong888 · 2026-06-30 개발(SW)

CodeLong888

Every “what’s my IP” site is a bloated page covered in ads, cookie banners, and “sign up for a VPN” popups. Half the time I just want the number, and often I want it inside a shell script or over SSH, where a browser is not even an option.

So here is the no-nonsense version: hackmyip.com serves clean text and JSON when you hit it with curl. No signup, no API key, no HTML.

The basics

# IP + location + network, human-readable
curl hackmyip.com

# just the raw IP (pipe-friendly)
curl hackmyip.com/ip
# 203.0.113.45

Enter fullscreen mode Exit fullscreen mode

Because /ip returns nothing but the address, it drops straight into scripts:

IP=$(curl -s hackmyip.com/ip)
echo "running from $IP"

Enter fullscreen mode Exit fullscreen mode

JSON when you need to parse it

curl hackmyip.com/json

Enter fullscreen mode Exit fullscreen mode

{
  "ip": "203.0.113.45",
  "city": "Amsterdam",
  "country": "NL",
  "asn": "AS64500",
  "org": "Example Telecom B.V."
}

Enter fullscreen mode Exit fullscreen mode

Pipe it into jq like anything else:

curl -s hackmyip.com/json | jq -r .asn

Enter fullscreen mode Exit fullscreen mode

The useful one: is my VPN actually working?

This is the endpoint I reach for most. It tells you whether your current IP looks like a normal residential connection or a datacenter / VPN / proxy:

curl hackmyip.com/proxy

Enter fullscreen mode Exit fullscreen mode

proxy: yes
type:  datacenter/hosting
network: AS212238  Datacamp Limited
signal: IP is on a known datacenter/hosting ASN

Enter fullscreen mode Exit fullscreen mode

Why this is handy: turn your VPN on, then run curl hackmyip.com/proxy. If it still shows your real residential ISP and ASN, your VPN is not actually routing that traffic (a leak). If it shows a datacenter ASN like above, the VPN is doing its job. It is a one-second sanity check you can even drop into a script before doing anything sensitive.

The rest of the toolkit

curl hackmyip.com/asn       # your ASN + ISP
curl hackmyip.com/headers   # the request headers the server sees
curl hackmyip.com/ua        # your User-Agent
curl hackmyip.com/rdns      # reverse DNS (PTR) of your IP
curl hackmyip.com/help      # the full menu

Enter fullscreen mode Exit fullscreen mode

All of it is free, keyless, and runs on Cloudflare’s edge, so it is fast from anywhere. If you would rather hit a full JSON API (DNS, WHOIS, blacklist, breach checks, and more), the no-key API is documented at https://hackmyip.com/api-docs.

What do you use for this in your scripts? Curious whether people are still hardcoding ifconfig.me or have a sharper trick.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다