Anyone got some C code that loops over all used IP addresses? Can you come up with any special optimizations? (I need to handle them in the "%u.%u.%u.%u"-form; computations are independant and can be run in parallel)
[foldr1 ((++).(++".")) $ map show [a,b,c,d] | a <- [0..255], b <- [0..255], c <- [0..255], d <- [0..255]]
Name:
Anonymous2009-03-02 20:23
for(i = 0; i < 256; i++)
for(h = 0; h < 256; h++)
for(j = 0; b < 256; j++)
for(k = 0; t < 256; k++)
printf("%d.%d.%d.%d",i,h,b,t);
Name:
Anonymous2009-03-02 20:26
Have you read your poignant guide today? 256.times{|i|256.times{|j|256.times{|k|256.times{|l|puts "#{i}.#{j}.#{k}.#{l}"}}}}
THIS IS SO ELEGANT FUCK I NEED TO MASTURBATE. I've run it for an hour, currently at 1.12.90.201
Name:
Anonymous2009-03-02 20:52
[foldr1 ((++).(++".")) $ map show [a,b,c,d] | a <- [0..255], b <- [0..255], c <- [0..255], d <- [0..255]][/code
[code]map (intercalate "." . map show) . sequence . replicate 4 $ [0..255]
for (a = 58; a < 223; ++a) {
if (a == 100) { a = 107; continue; }
if (a == 127) continue;
if (a == 175) { a = 177; continue; }
if (a == 179) { a = 183; continue; }
if (a == 185) continue;
for (b = 0; b < 256; ++b) {
for (c = 0; c < 256; ++c) {
for (d = 1; d < 255; ++d) {
SHA1_Init(&ctx);
sprintf(prefix1, "%u.%u.%u.%u", a, b, c, d);
SHA1_Update(&ctx, prefix1, strlen(prefix1));
SHA1_Update(&ctx, prefix2, 12);
SHA1_Update(&ctx, salt, 448);
SHA1_Final(md, &ctx);
if (memcmp(search, md, sizeof(search)) == 0)
goto done;
}
}
}
printf("%u/8 done.\n", a);
}
All right, I made some changes (most importantly I removed the overflow so it didn't loop forever on the inner loops, and I split the sprintf into four calls). But I'm not really sure about what IP addresses I should check. What are those LEGACY blocks?[1] My research has shown that they might indeed be in use.