Last active
March 5, 2021 21:32
-
-
Save wille-io/04b7c1805f967bcdff2f2b1099c86b34 to your computer and use it in GitHub Desktop.
Find your Bitsquatting domain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| int main(int argc, char **argv) | |
| { | |
| char *d = argv[1]; | |
| size_t l = strlen(d); | |
| for (int i = 0; (size_t)i < l; i++) | |
| for (int k = 0; k < 8; k++) | |
| { | |
| char c = d[i] ^ (1 << k); | |
| if ((c >= 48 && c <= 57) || (c >= 97 && c <= 122)) | |
| { | |
| char *s = malloc(l + 1); | |
| strcpy(s, d); | |
| s[i] = c; | |
| printf("> %s\n", s); | |
| free(s); | |
| } | |
| } | |
| puts("done"); | |
| return 0; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compile with
gcc bitsquatting.c -o bitsquattingThen run with
./bitsquatting yourdomain