22018, 1/1101 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   ÇØÅ·ÀßÇϰí½Í´Ù
   http://¾øÀ½
   lob ¿¬½ÀÇÒ ¶§ µµ¿òµÇ´Â ÀÚ·á (Á÷Á¢ ¸¸µé¾úÀ½)

http://www.hackerschool.org/HS_Boards/zboard.php?id=Free_Board&no=37877 [º¹»ç]


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define MAX_LEN 256

// Convert input string like "\\x31\\xc0..." into actual byte array
int decode_shellcode(const char *input, unsigned char *output) {
    int len = strlen(input);
    int out_idx = 0;
    
    for (int i = 0; i < len;) {
        // Check for "\xNN" pattern
        if (input[i] == '\\' && input[i+1] == 'x' &&
            isxdigit(input[i+2]) && isxdigit(input[i+3])) {
            char hex[3] = { input[i+2], input[i+3], '\0' };
            output[out_idx++] = (unsigned char)strtol(hex, NULL, 16);
            i += 4;
        } else {
            return -1; // Invalid format
        }
    }
    return out_idx; // Number of bytes converted
}

int main(void)
{
    char your_answer[MAX_LEN];
    char *shellcode_25bytes = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e"
                               "\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80";

    unsigned char decoded_input[MAX_LEN];

    while (1) {
        // Prompt user for shellcode input
        printf("Enter the shellcode('q' to exit) : ");
        fgets(your_answer, MAX_LEN, stdin);
        your_answer[strcspn(your_answer, "\n")] = '\0';  // Remove newline character

        // Exit if input is "q"
        if (strcmp(your_answer, "q") == 0) {
            exit(0);
        }

        // Decode input into raw bytes
        int decoded_len = decode_shellcode(your_answer, decoded_input);

        if (decoded_len < 0) {
            printf("Invalid format. Use \\xNN format.\n");
            continue;
        }

        // Compare decoded input with actual shellcode
        if (decoded_len == strlen(shellcode_25bytes) &&
            memcmp(decoded_input, shellcode_25bytes, decoded_len) == 0) {
            printf("correct!!!\n");
            break;
        } else {
            printf("fail...\n");
        }
    }

    return 0;
}

  Hit : 980     Date : 2025/05/07 06:30



    
     [°øÁö]ÇØÄ¿½ºÄð ÀÌ¿ë¼öÄ¢ 2021/04/11 ¼öÁ¤ÆÇ [54] ÇѽÂÀç 01/05 11507
22017   A¤¿...     ÇØÅ·ÀßÇϰí½Í´Ù
01/27 14
22016   ¿À·£¸¸~     DarkSlayer
12/11 230
22015   ÇØÄ¿½ºÄð ¿¾³¯ BGM[1]     wkfhddl4041
11/07 387
22014   È÷À×...     ÇØÅ·ÀßÇϰí½Í´Ù
11/02 312
22013   ¹ÙµÏ°ú Àå±â     ÇØÅ·ÀßÇϰí½Í´Ù
10/30 340
22012   ³ª´Â ¾ðÁ¦ ¾ÖÀÎÀÌ »ý±â³ª¿è...     ÇØÅ·ÀßÇϰí½Í´Ù
10/27 394
22011   Àü±¹ 1À§     ÇØÅ·ÀßÇϰí½Í´Ù
10/27 351
22010   ´ã¹è ¤»¤»[1]     ÇØÅ·ÀßÇϰí½Í´Ù
10/27 351
22009   ¸ÅÆ®¸¯½ºÀÇ ÆÄ¶õ¾àÀ» ¾Æ½Ê´Ï±î..?     ÇØÅ·ÀßÇϰí½Í´Ù
10/27 335
22008   ¤·¤·[1]     ÇØÅ·ÀßÇϰí½Í´Ù
10/20 331
22007   ¿ÉÄ¡ ÇÙ°¨Áö ÇÁ·Î±×·¥Á» ¸¸µé¾îÁÖ¼¼¿ä[1]     powerima
10/15 334
22006   ÇØÅ·ÆÀ¿ø ¸ðÁý[1]     koromoon
08/27 843
22005   °°ÀÌ ÇØÅ· ÆÀ ÀÌ·ç½ÇºÐ??     hacs98
08/26 539
22004   ¾Æ........ ¤Ð¤Ð     ÇØÅ·ÀßÇϰí½Í´Ù
08/04 690
22003   ±Í¼ö(Сâ¢) µû¶óÇϱâ(?)     ÇØÅ·ÀßÇϰí½Í´Ù
07/28 685
22002   ½º½º·Î ¸ñ¼ûÀ» Á®¹ö¸°´Ù´Â °ÍÀº     ÇØÅ·ÀßÇϰí½Í´Ù
07/27 710
22001   ¹ÌÄ£µí     ÇØÅ·ÀßÇϰí½Í´Ù
07/02 781
22000   »ç¹«½Ç     ÇØÅ·ÀßÇϰí½Í´Ù
07/02 714
21999   ¾Æ¹« °Íµµ ¸ô¶ó¿ä     ÇØÅ·ÀßÇϰí½Í´Ù
05/20 953
1 [2][3][4][5][6][7][8][9][10]..[1101]

Copyright 1999-2026 Zeroboard / skin by Hackerschool.org / Secure Patch by Hackerschool.org