Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. void messageLog(string ip)
  2. {
  3. logMessage(printf("%s | Scanned you @ %s :: %s", ip, getTime(), getDate()));
  4. }
  5.  
  6. void doMessage(string ip, string data)
  7. {
  8. message(getSourceIP(), printf(data, ip));
  9. }
  10.  
  11. void writeToFile(string file, string data)
  12. {
  13.  
  14. writeLine(file, data);
  15. }
  16.  
  17. void doIPCheck(string ip)
  18. {
  19. string f_ips[];
  20. string file[];
  21. string data[];
  22.  
  23. data[0] = printf("%s :: %s || Scan Detected - IP: %s", getDate(), getTime(), ip);
  24. data[1] = printf("%s", ip);
  25.  
  26. file[0] = "scan.local.log";
  27. file[1] = "ips.total.log";
  28.  
  29. if (fileExists(file[1])) {
  30. int lines = countLines(file[1]);
  31. int x = 0;
  32.  
  33. while (x < lines)
  34. {
  35. f_ips[x] = readLine(file[1], x);
  36. x++;
  37. }
  38.  
  39. for (x = 0; x < length(f_ips); x++)
  40. {
  41. if (equal(ip, f_ips[x])) {
  42. writeToFile(file[0], ip);
  43. } else {
  44. for (int y = 0; y < 2; y++)
  45. {
  46. writeToFile(file[y], data[y]);
  47. }
  48. }
  49. }
  50. } else {
  51. doMessage(ip, "Please Create File: 'ips.total.log'");
  52. }
  53. }
  54.  
  55.  
  56. int main()
  57. {
  58. string ip = getTargetIP();
  59.  
  60. messageLog(ip);
  61. doMessage(ip, "%s | Scanned you");
  62. doIPCheck(ip);
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement