205 points · by boramalper · 5y ago · 123 comments
https://lucb1e.com/randomprojects/php/funnip.php?ip=8.8.8.8
The variant found by OP is apparently the very last option that my tool generates. These days, Firefox is a bit boring (okay, okay, I'll admit it's a good choice for security) and translates these at the first opportunity. Even hyperlinks are translated on hover in the 'status bar' (if we can still call it that). For mobile users, this is what it shows when you paste one of those addresses in Firefox: https://snipboard.io/kbLTso.jpg
Only thing I can think of personally is UNIX file permissions.
0644|0755: a=rX,u+w
0600: u=rw
Etc.
<?php
if (isset($_GET['source'])) {
highlight_file(__FILE__);
exit;
}
This is such a useful and nice snippet I add to many of my PHP files. Open Source at its finest, literally "in place" :-)So basically it allows the reader to read the source directly without hunting it down on github of something.
Name borrowed from https://github.com/ian-hamlin/ipdec
Note the trietool "list" command prints data as decimal not unsigned integer.
sed -n 's/ //;wip4dec.l' << eof
/*
not a domain name or ip address validator
input file format:
(left-justified, no leading spaces)
example.com 93.184.216.34
example.net 93.184.216.34 comment
*/
int fileno(FILE *);
int setenv(const char*,const char*,int);
int unsetenv(const char*);
#define echo do{if(fwrite(yytext,(size_t)yyleng,1,yyout)){}}while(0)
#define jmp (yy_start) = 1 + 2 *
int x=0,y=0,o=0;
xa [0-9]{1,3}\x2e
xb [0-9]{1,3}
xc [0-9]{4,5}
xd ^[A-Za-z0-9\.-]+
xe ^[^A-Za-z0-9]
%s xa
%option noyywrap nounput noinput
%%
{xd} if(yytext[0]=='-'||yytext[0]=='.')jmp 0;else{o=0;y=0;x=0;setenv("x",yytext,1);jmp xa;}
{xe} jmp 0;
<xa>{xc} jmp 0;
<xa>{xa}|{xb} {
switch(o){
case 0: y=atoi(yytext);if(y<1)break;x=y*16777216;y=0;o++;break;
case 1: y=atoi(yytext);if(y>255)break;x=x+y*65536;y=0;o++;break;
case 2: y=atoi(yytext);if(y>255)break;x=x+y*256;y=0;o++;break;
case 3: y=atoi(yytext);if(y>255)break;x=x+y;printf("%s\t%u\n",getenv("x"),x);unsetenv("x");break;
default: break;
}
}
.|\n
%%
int main(){ yylex();exit(0) ;}
eof
flex -8iCrf ip4dec.l
cc -std=c89 -Wall -pedantic -I. -pipe lex.yy.c -static -o ip4dec
usage: ip4dec < input-fileName borrowed from https://github.com/ian-hamlin/ipdec
Note the trietool "list" command prints data as %d not %u. To fix, edit list_enum_func() in trietool.c
sed -n 's/ //;wip4dec.l' << eof
/*
not a domain name or ip address validator
input file format:
(left-justified, no leading spaces)
example.com 93.184.216.34
example.net 93.184.216.34 comment
*/
int fileno(FILE *);
int setenv(const char*,const char*,int);
int unsetenv(const char*);
#define echo do{if(fwrite(yytext,(size_t)yyleng,1,yyout)){}}while(0)
#define jmp (yy_start) = 1 + 2 *
int x=0,y=0,o=0;
xa [0-9]{1,3}\x2e
xb [0-9]{1,3}
xc [0-9]{4,5}
xd ^[A-Za-z0-9\.-]*
xe ^[^A-Za-z0-9]
%s xa
%option noyywrap nounput noinput
%%
{xd} if(yytext[0]=='-'||yytext[0]=='.')jmp 0;else{o=0;y=0;x=0;setenv("x",yytext,1);jmp xa;}
{xe} jmp 0;
<xa>{xc} jmp 0;
<xa>{xa}|{xb} {
switch(o){
case 0: y=atoi(yytext);if(y<1)break;x=y*16777216;y=0;o++;break;
case 1: y=atoi(yytext);if(y>255)break;x=x+y*65536;y=0;o++;break;
case 2: y=atoi(yytext);if(y>255)break;x=x+y*256;y=0;o++;break;
case 3: y=atoi(yytext);if(y>255)break;x=x+y;printf("%s\t%u\n",getenv("x"),x);unsetenv("x");break;
default: break;
}
}
.|\n
%%
int main(){ yylex();exit(0) ;}
eof
flex -8iCrf ip4dec.l
cc -std=c89 -Wall -pedantic -I. -pipe lex.yy.c -static -o ip4dec
usage: ip4dec < input-fileexample:
echo example.com 93.184.216.34 icann|ip4dec
output: example.com 1572395042Credit: IPv4 addresses are silly, inet_aton(3) doubly so. https://www.netmeister.org/blog/inet_aton.html
I think you probably know that already, but there are at least a couple of ways to interpret what you wrote.
There's also always dns.adguard.com to block Ads (which is what I use on my phone).
What are we looking at here that’s new?
Try this:
curl -v -H "Host: 010.010.010.010" https://8.8.8.8
Trying to do the same with other websites doesn't seem to work. curl -v -H "Host: 010.010.010.010" https://8.8.8.8
curl -v -H "Host: 222.222.222.222" https://8.8.8.8
curl -v -H "Host: example.com" https://8.8.8.8 curl -kiH Host:1348764566 https://1348764566
(-k flag needed because I didn't get a valid cert for this variant of the IP. One could also specify the fingerprint but let's keep the demo simple.)It'll give you a 404 because of the unknown vhost, but it would also do that if you access it using the 'normal' dotted decimal notation: http://80.100.131.150
I used to detect this number actually and it would give you a small easter egg, but nobody triggered it and nowadays Firefox doesn't send it as a host header anymore when you specify the IP as such so I didn't check how to port that over to my new web server stack.
You can check it by hovering over the link
Just be careful, because TWNIC/Quad101 was subjected to a BGP hijack in 2019[0]
101.101.101.101 [TWNIC]
80.80.80.80 [FREENOM][1]
4.2.2.2 [Level 3]
[0] https://www.manrs.org/2019/05/public-dns-in-taiwan-the-lates...Short and easy to remember thanks to the classic 2600 zine (named after the Captain Crunch cereal whistle which emitted the 2600hz tone for payphones). I wonder if someone at Sprint is a fan.
X509v3 Subject Alternative Name:
DNS:dns.google, DNS:dns.google.com,
DNS:*.dns.google.com, DNS:8888.google,
DNS:dns64.dns.google,
IP Address:8.8.8.8, IP Address:8.8.4.4,
IP Address:2001:4860:4860:0:0:0:0:8888,
IP Address:2001:4860:4860:0:0:0:0:8844,
IP Address:2001:4860:4860:0:0:0:0:6464,
IP Address:2001:4860:4860:0:0:0:0:64
I'm guessing this is in part for network device auth? DNS over HTTPS?In some ways the actual rules for IP addresses are less strict than for DNS names. Perhaps this will get tightened up. Google Trust Services (the part of Google which issues certificates, as distinct from say, Chrome, which on behalf of Relying Parties has to decide if the certificates are trustworthy) expressed interest in issuing IP address certificates via ACME, ie automatically to anyone who asks. The pushback (including from people in other parts of Google) was considerable, even though what GTS proposed to do was actually more robust than what's technically required for issuance today. But it's nice that they asked (and indeed one argument to allow what they requested is, hey, there was no requirement for them to ask, if somebody had just done this without asking would we have been even more unhappy about that or would we let it slide?)
In practical terms, you likely don't get and don't want certificates with ipAddress SANs in them. You probably don't get them because (unless GTS went ahead subsequently) this is a Special Request item not something your Certbot or acme.sh or whatever can get for you, and you probably don't want them because unless you're a DNS server people expect to type in a name, not a sequence of arcane numbers.
This is most commonly seen with large clouds like AWS buying millions of IPs from owners that weren't using them.
You can use "whowas" to track the ownership shifts, but I don't know of a global index-- each NIC has their own implementation and restrictions.
Almost all of IPv4 is allocated by IANA to Regional Internet Registries that in turn allocate them to customers like Google and Verizon. You pay yearly maintenance fees to keep the addresses assigned to you.
Sounds like a good unit of measurement for Javascript
The reason Google provides DNS should be obvious: when people experience a better web, Google makes more money. ISP DNS fuckery is bad for users. Since Google already needs to cache the DNS for its internal purposes, presenting it to the public as a service is close to free for them.
The practical benefit is that some ISPs run bad DNS servers that e.g. automatically redirect nxdomains to their spam pages. If you use Google or Cloudflare you can bypass this particular anti-feature.
I've changed the URL above back to https://010.010.010.010/ now. Thanks!
Whether your URL parser considers that octal IPv4 addresses are a reasonable thing is up to each individual parser. On the whole I'd suggest user-facing software should not permit this because it's pointlessly confusing.
Rust took a patch that says if you try to convert (for example) 010.010.010.010 to an IPv4 address that's an error, which again I think is reasonable for the same reason.
In the patch feedback several people want it to mean 10.10.10.10 and others think it should mean 8.8.8.8 and eventually it seems to become clear to both groups that this is itself a terrible sign for their positions, since if you expected one but got the other now your software has unexpected behaviour, whereas if you got an error you can fix your program to do whatever it was you intended. So hence the error behaviour won.
[Edited to add: It has been pointed out to me that maybe the poster meant .google. Yes, that's a TLD owned by Google. They applied for, and received a number of "new gTLDs" from ICANN, some like .dev are open for you to register 2LDs in, others like .google are only for their own use. Running TLDs likely costs Google somewhere in the region of a million dollars per year to maintain, but that's a drop in the ocean for a large tech company.]
See also: https://01.01.01.01/
(btw: .google and .goog are valid TLDs)
This leaves no room for the ambiguity of the text rendering something like 010.010.010.010 in the certificate itself.
Likewise the dnsName SAN type is defined in an alphabet for X.509 that literally can't represent fancy Unicode, so you can't mistakenly write certificates with dnsName SANs that give the Unicode name instead of the unambiguous punycode name stored in DNS.
These two choices mean your browser can mechanically with 100% reliability check certificates in the Web PKI match the IP address or DNS name from the URL you believed you were visiting, whereas historically the abuse of "Common Name" features to write a human representation had nasty edge cases for both IP addresses and some DNS names.
[0] https://en.m.wikipedia.org/wiki/.google [1] https://en.m.wikipedia.org/wiki/Sponsored_top-level_domain
I think what I meant was mostly
> will all or most DNS servers other than Google's resolve .google addresses
I didn't realize Google had bought their own TLD.
I'm not sure how I feel about the sponsored TLDs. I think I like them, mostly. I think I don't love how .google is centered on a single corporation in the same way that I don't like how .gov and .mil have always been so US-centric.
In a way it feels like an intrusion, or somehow misplaced
Using your ISP's DNS decreases privacy. I assume you mean that because UDP/53 DNS is unencrypted, if you switch to another DNS provider, then both the ISP and the new DNS can see your requests? In which case I present to you DNS over HTTPS
[1]: See SNI: https://www.cloudflare.com/learning/ssl/what-is-sni/
https://www.icsi.berkeley.edu/pubs/networking/redirectingdns...