Skip to content

Instantly share code, notes, and snippets.

@CyberFlameGO
Last active October 20, 2021 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyberFlameGO/d09998f5f70d912a6b69f00c8ae99457 to your computer and use it in GitHub Desktop.
Save CyberFlameGO/d09998f5f70d912a6b69f00c8ae99457 to your computer and use it in GitHub Desktop.
Loop thing
/*
Loops over every IP in the world
*/
public class LoopAllnetAddr {
public static void main(String[] args) {
for (int x = 1; x < 256; x++) {
if (x == 10) continue;
for (int f = 0; f < 256; f++) {
if ((x == 172 && (f >= 16 && f <= 31)) ||
(x == 192 && f == 168)) continue;
for (int d = 0; d < 256; d++) {
for (int g = 0; g < 256; g++) {
final String ip_address = x + "." + f + "." + d + "." + g;
//do something
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment