Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Programma: iHack.c
- Autore: Marini Samuele
- Data: -
- */
- #include<stdio.h>
- #include<string.h>
- #define COL(x) "\033[" #x ";1m"
- #define dark COL(30)
- #define red COL(31)
- #define green COL(32)
- #define yellow COL(33)
- #define blue COL(34)
- #define pink COL(35)
- #define lblue COL(36)
- #define white COL(37)
- #define rosso COL(41)
- #define verde COL(42)
- #define giallo COL(43)
- #define blu COL(44)
- #define viola COL(45)
- #define azzurro COL(46)
- #define grigio COL(47)
- #define normal "\033[0m"
- #define dim 100
- int Livello_1(int* max_ten);
- int Livello_2();
- int Livello_3();
- int Livello_4();
- int Livello_5();
- int Livello_6();
- int Livello_7();
- int Livello_8();
- int Livello_9();
- int Livello_10();
- int main()
- {
- char sino;
- int max_ten,liv=1,ver,inizio=0,a=0;
- do
- {
- do
- {
- if(inizio==0)
- {
- system("clear");
- printf(green);
- printf("***************************\n");
- printf("********** **********\n");
- printf("********* ");
- printf(red);
- printf("iHack");
- printf(green);
- printf(" *********\n");
- printf("********** **********\n");
- printf("***************************\n");
- printf(normal);
- printf("Premi invio per iniziare ");
- getchar();
- if(a==1)
- {
- getchar();
- }
- }
- switch(liv)
- {
- case 1:
- max_ten=0;
- inizio=1;
- do
- {
- ver=Livello_1(&max_ten);
- if(ver==0)
- {
- liv++;
- }
- }
- while(max_ten<3 && ver==1);
- if(max_ten==3)
- {
- system("clear");
- printf(red);
- printf(blu);
- printf(" WARNING \n");
- printf("INVALID USERNAME AND/OR\nPASSWORD! ATTEMPTED \nACCESS TOO MANY TIMES! \n");
- printf(normal);
- printf("Premi invio per continuare ");
- inizio=0;
- a=1;
- }
- break;
- case 2:
- printf("LIVELLO 2");
- getchar();
- getchar();
- break;
- case 3:
- break;
- case 4:
- break;
- case 5:
- break;
- case 6:
- break;
- case 7:
- break;
- case 8:
- break;
- case 9:
- break;
- case 10:
- break;
- }
- }
- while(max_ten<3);
- getchar();
- printf("Vuoi riavviare il gioco(s/n)?: ");
- scanf("%c", &sino);
- }
- while(sino=='s' || sino=='S');
- return 0;
- }
- // LIVELLI
- int Livello_1(int* max_ten)
- {
- int scelta;
- char Username[dim],Password[dim],Ver1[dim]={'j','a','c','k'},Ver2[dim]={'j','1','9','8','7'};
- do
- {
- system("clear");
- printf(red);
- printf(" LIVELLO 1\n");
- printf(blue);
- printf("Menù\n");
- printf("1| Inserisci Username/Password\n");
- printf("2| View Source\n");
- printf("3| Hint\n");
- printf(normal);
- printf("Scelta: ");
- scanf("%d", &scelta);
- if(scelta<1 || scelta>3)
- {
- printf(rosso);
- printf("Devi inserire una scelta valida\n");
- printf("Premi invio per continuare ");
- printf(normal);
- getchar();
- getchar();
- }
- }
- while(scelta<1 || scelta>3);
- switch(scelta)
- {
- case 1:
- system("clear");
- getchar();
- printf("Username: ");
- gets(Username);
- printf("Password: ");
- gets(Password);
- if(strcmp(Username,Ver1)==0)
- {
- if(strcmp(Password,Ver2)==0)
- {
- printf("Esatto\n");
- getchar();
- return 0;
- }
- }
- else
- {
- printf(red);
- printf("\n");
- printf(" WARNING\n\n");
- printf("INVALID USERNAME AND/OR\n PASSWORD\n");
- printf(normal);
- printf("Premi invio per continuare ");
- getchar();
- (*max_ten)++;
- return 1;
- }
- break;
- case 2:
- system("clear");
- printf(yellow);
- printf(" Source Code\n\n");
- printf("<html>\n<head>\n<a ret='style.css'/>\n</head>\n<body>\n<div id='wrapper'>\n");
- printf("<div id='container'>\nTHE DEPARTMENT OF\nHACKING\n<br />\n<br />\n");
- printf("form action=login.php\nmethod=put>\nUername\n<input type=text size=20\n class='form'/>\n");
- printf("<input type=hidden\nname=username value=jack />\n<br />\nPassword\n");
- printf("<input type=password size=20\nclass='form' />\n<input type=hidden\nname=password value=j1987 />\n");
- printf("<br />\n</form>\n**Unauthorized access to this site\nis strictly prohibited.**\n");
- printf("</div>\n</div>\n</body>\n</html>\n");
- printf(blue);
- printf("Premi invio per continuare ");
- printf(normal);
- getchar();
- getchar();
- break;
- case 3:
- system("clear");
- printf(yellow);
- printf(" HINT\n\n");
- printf("Honestly, its the first level. Well i\n");
- printf("think that you can come up with\n");
- printf("some sort of reSOURCE to help you\n");
- printf("break in.\n");
- printf(blue);
- printf("Premi invio per continuare ");
- printf(normal);
- getchar();
- getchar();
- break;
- }
- return 3;
- }
Add Comment
Please, Sign In to add comment