lexi

i like breaking computers

  • it/its, #[deprecated] she/her
  • ./a.out

i like rust, nix, linux, infosec, webdev and i shitpost a lot. ctf player and so-called "security researcher". aroace, agender, nb, nd, disabled, &, ΘΔ :3 🏳️‍⚧️ 🟨⬜️🟪⬛️

picrew: #1322863


TL;DR curl -L v4v6.ml will give you your IPv4 and IPv6 address with a single cURL command.

There are a couple services that give you your IP address with one cURL. The problem with all of those is that they either give you your IPv4 or IPv6. And getting both at the same time seems impossible at first, because you either connect over v4 or v6, but there is a simple trick I use to avoid this.

I have two domains, v4v6.ml, I'll call it A, and v4.v4v6.ml, and call it B. Domain A has an A and AAAA record to my server, and domain B only an A record.

The code looks roughly like this:

app.get('/', (req, res) => {
if (connected via ipv6) {
res.redirect(`https://B/r/${ip}/`)
} else {
res.redirect(`https://A/results/${ip}/null/`)
}
})
app.get('/r/:v6/', (req, res) => {
res.redirect(`https://A/results/${ipv4}/${ipv6}`)
})
app.get('/results/:v4/:v6/', (req, res) => {
res.send(v4, v6)
})

If you make a request to A/, it will check if you are connected over IPv6 or IPv4. If you are connected over v6, it will redirect to B/r/[your IPv6]. That will initiate an IPv4 connection, and I can get your v4 address that way, and redirect you to A/result/[IPv4]/[IPv6]! If you are connected to A over IPv4, it will redirect you to A/result/[IPv4]/null immediately. This way, I can show your v4 and v6 at the same time! You can try it out with curl -L v4v6.ml or by visiting v4v6.ml :) (i forgor 💀 to renew the domain)

Full source code in Node.js: http://ix.io/4bjp


You must log in to comment.

in reply to @lexi's post:

how on EARTH did you manage to get v6.v4v6.ml???? i do not even have a record for that lol

but yep i have a FSM instance on the same nginx running and forgot to set a default https server. v4.v4v6.ml is supposed to be the v4 version, and v4v6.ml is v4 and v6 to support v4-only connection, but acts as the v6 ip grabber if you're connected via v6

i just remembered that that thing was on a domain that i may or may not have forgotten about oopsie

i did want to change a thing or two about it and rewrite the code so that may be a good excuse to do that too

alt account of @lexi here, i have my posts as logged-in only to avoid scrapers and unwanted guests, but ftr here's the post:

[note: this service has been down for a while (both the domain and the server), but you can use hax.gay, a rewrite in go now!]

thing i made today: v4v6

TL;DR curl -L v4v6.expired will give you your IPv4 and IPv6 address with a single cURL command.

There are a couple services that give you your IP address with one cURL. The problem with all of those is that they either give you your IPv4 or IPv6. And getting both at the same time seems impossible at first, because you either connect over v4 or v6, but there is a simple trick I use to avoid this.

I have two domains, v4v6.expired, I'll call it A, and v4.v4v6.expired, and call it B. Domain A has an A and AAAA record to my server, and domain B only an A record.

The code looks roughly like this:

app.get('/', (req, res) => {
  if (connected via ipv6) {
    res.redirect(`https://B/r/${ip}/`)
  } else {
    res.redirect(`https://A/results/${ip}/null/`)
  }
})
app.get('/r/:v6/', (req, res) => {
  res.redirect(`https://A/results/${ipv4}/${ipv6}`)
})
app.get('/results/:v4/:v6/', (req, res) => {
  res.send(v4, v6)
})

If you make a request to A/, it will check if you are connected over IPv6 or IPv4. If you are connected over v6, it will redirect to B/r/[your IPv6]. That will initiate an IPv4 connection, and I can get your v4 address that way, and redirect you to A/result/[IPv4]/[IPv6]! If you are connected to A over IPv4, it will redirect you to A/result/[IPv4]/null immediately. This way, I can show your v4 and v6 at the same time! You can try it out with curl -L v4v6.expired or by visiting v4v6.expired :) (i forgor 💀 to renew the domain)

Full source code in Node.js: https://web.archive.org/web/20220926131233/https://ix.io/4bjp