Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. // Settings to change
  2. string IPList = "Log/IPDP"; // This is your list of IPs
  3. string logs = "Logs/attack.log.text";
  4. //End of settings
  5.  
  6.  
  7. //DO NOT EDIT
  8. string newcontent(string file, string text) {
  9. string a = readFile(file);
  10.  
  11. int b = strlen(a);
  12. int c = strlen(text);
  13.  
  14. if (c+b >= 60000) {
  15. string e = ""+text+""+a+"";
  16. string f = substr(e, 0, 60000);
  17. writeFile(file, f);
  18. string q = strlen(readFile(logs));
  19. message(getSourceIP(), q);
  20. } else {
  21. string content = ""+text+"<br>"+a+"";
  22. writeFile(file, content);
  23. }
  24.  
  25.  
  26. }
  27.  
  28.  
  29. int main()
  30. {
  31. string vIP = getTargetIP();
  32. string b = getTargetPort();
  33. string c = getPort();
  34.  
  35.  
  36.  
  37.  
  38. int size = countLines(IPList);
  39. int i = 0;
  40.  
  41. string Player[];
  42.  
  43. Player[0] = vIP;
  44. Player[1] = "Unknown name";
  45. Player[2] = "Unknown type";
  46.  
  47. while(i < size)
  48. {
  49. if(indexOf(readLine(IPList, i), vIP, 0) >= 0)
  50. {
  51. spl(Player, readLine(IPList, i), " <-- ");
  52. i = size;
  53. }
  54.  
  55.  
  56. i++;
  57. }
  58. //END OF DO NOT EDIT
  59.  
  60.  
  61. logMessage("Your were attacked by "+Player[1]+"(" + vIP + ") they hit port "+c+" using port "+b+" ");
  62.  
  63.  
  64. string sub=substr(vIP, 0, 7);
  65.  
  66. //Writing to logs
  67. newcontent(logs, "("+getDate()+" "+getTime()+") Your were attacked by "+Player[1]+"(" + vIP + ") they hit port "+c+" using port "+b+char(10));
  68.  
  69. }
  70.  
  71.  
  72. //AGAIN DO NOT EDIT BELOW
  73. void spl(string arr[], string inString, string charSplit)
  74. {
  75. string tString = inString;
  76. int delimLen = strlen(charSplit);
  77. int i = 0;
  78. int x = 0;
  79.  
  80. while(indexOf(tString, charSplit, 0) > 0)
  81. {
  82. i = indexOf(tString, charSplit, 0);
  83. arr[x] = substr(tString, 0, i);
  84. tString = substr(tString, i + delimLen, strlen(tString));
  85. x++;
  86. }
  87.  
  88. arr[x] = tString;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement