Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Settings to change
- string IPList = "Log/IPDP"; // This is your list of IPs
- string logs = "Logs/attack.log.text";
- //End of settings
- //DO NOT EDIT
- string newcontent(string file, string text) {
- string a = readFile(file);
- int b = strlen(a);
- int c = strlen(text);
- if (c+b >= 60000) {
- string e = ""+text+""+a+"";
- string f = substr(e, 0, 60000);
- writeFile(file, f);
- string q = strlen(readFile(logs));
- message(getSourceIP(), q);
- } else {
- string content = ""+text+"<br>"+a+"";
- writeFile(file, content);
- }
- }
- int main()
- {
- string vIP = getTargetIP();
- string b = getTargetPort();
- string c = getPort();
- int size = countLines(IPList);
- int i = 0;
- string Player[];
- Player[0] = vIP;
- Player[1] = "Unknown name";
- Player[2] = "Unknown type";
- while(i < size)
- {
- if(indexOf(readLine(IPList, i), vIP, 0) >= 0)
- {
- spl(Player, readLine(IPList, i), " <-- ");
- i = size;
- }
- i++;
- }
- //END OF DO NOT EDIT
- logMessage("Your were attacked by "+Player[1]+"(" + vIP + ") they hit port "+c+" using port "+b+" ");
- string sub=substr(vIP, 0, 7);
- //Writing to logs
- newcontent(logs, "("+getDate()+" "+getTime()+") Your were attacked by "+Player[1]+"(" + vIP + ") they hit port "+c+" using port "+b+char(10));
- }
- //AGAIN DO NOT EDIT BELOW
- void spl(string arr[], string inString, string charSplit)
- {
- string tString = inString;
- int delimLen = strlen(charSplit);
- int i = 0;
- int x = 0;
- while(indexOf(tString, charSplit, 0) > 0)
- {
- i = indexOf(tString, charSplit, 0);
- arr[x] = substr(tString, 0, i);
- tString = substr(tString, i + delimLen, strlen(tString));
- x++;
- }
- arr[x] = tString;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement