Skip to content

Instantly share code, notes, and snippets.

@LeoAdamek
Last active September 25, 2015 00:37
Show Gist options
  • Save LeoAdamek/834378 to your computer and use it in GitHub Desktop.
Save LeoAdamek/834378 to your computer and use it in GitHub Desktop.
List All IPv6 Addresses in teh world using Inseption for loops.
#include <cstdlib>
#include <cstdio>
int main(int argc, char* argv[])
{
int a,b,c,d,e,f,g,h;
FILE* fp;
fp = fopen("ipv6.txt","w");
for(a=0;a<65536;a++)
for(b=0;b<65536;b++)
for(c=0;c<65536;c++)
for(d=0;d<65536;d++)
for(e=0;e<65536;e++)
for(f=0;f<65536;f++)
for(g=0;g<65536;g++)
for(h=0;h<65536;h++)
{
printf("%X::%X:%X:%X:%X:%X:%X:%X\n",a,b,c,d,e,f,g,h);
fprintf(fp,"%X::%X:%X:%X:%X:%X:%X:%X\n",a,b,c,d,e,f,g,h);
}
fclose(fp);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment