Created
February 24, 2021 23:06
-
-
Save fatihsnsy/8074b79538ca7dbac5479dbdc4934858 to your computer and use it in GitHub Desktop.
This file contains 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
std::string dic_based_pseudorandom(int year, int month, int day, int hour, int minute, int second, int domain_len) { | |
std::string domain = {}; | |
std::string tlds[] = { ".com", ".net", ".org", ".biz", ".io", ".run" }; | |
std::string domain_dic[] = {"intel", "speak", "dog", "cat", "at", "criteria", "cyber", "security", "dictionary", "world", "safe", "health", "shadow", "game", "star", "enter", "into", "life", "time", "kudos", "arch", "result", "change"}; | |
for (int i = 0; i < domain_len; i++) { | |
year = ((year ^ 8 * year) >> 11) ^ ((year & 0xFFFFFFF0) << 17) ^ (hour ^ ((second ^ 0xFFFFFFF8) << 8)); | |
month = ((month ^ 4 * month) >> 25) ^ 16 * (month & 0xFFFFFFF8) ^ (minute ^ ((second ^ 0xFFFFFFFE) << 4)); | |
day = ((day ^ (day << 13)) >> 19) ^ ((day & 0xFFFFFFFE) << 12) ^ ((second ^ 0xFFFFFFF0) << 3); | |
domain += domain_dic[((1 << (year ^ month ^ day)) % (sizeof(domain_dic) / sizeof(*domain_dic)))]; | |
} | |
return domain + tlds[(1 << day) % (sizeof(tlds) / sizeof(*tlds))]; | |
} | |
int main(int argc, char *argv[]) | |
{ | |
std::string ret_domain = dic_based_pseudorandom(21, 2, 25, atoi(argv[1]), atoi(argv[2]), atoi(argv[3]), 3); | |
std::cout << ret_domain; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment