Giter VIP home page Giter VIP logo

pybescanner's Introduction

README

pyBEscanner

A simple python application with goal of scanning arma2 + battlelog files.
This this not protect against people using a battleye bypass


Features:

	* Multiple Servers ( No multi-threading support, it scans 1 server at a time )
	* Scans battlelogs
	* Whitelist + Blanlist + Kicklist rules with regrex features
		http://docs.python.org/2/library/re.html
	* Auto-purges logs as it scans, reduces need to re-scan
	* Makes backup logs files & splits them up into folders based on date
	* Makes actions logs i.e
		scripts-bans.txt /
		scripts-kicks.txt /
		scripts-unknown.txt.
	* Ability to pick per file different scan settings
		Standard       - Ban only for blanlisted code...
		Standard+Kick  - Ban only for blacklisted code
					   + kick for unknown code entries...
		Strict         - Ban for everything not in
						whitelist filter
	* Ability to detect multiple attempts i.e user spamming an logfile
		i.e
			If u could ban a player than appears in setpos.log
			10 times in 5 seconds if u wanted to...
		Or
			U can also add in different triggers i.e different triggers for
			pipebombs / grenades etc...

			
Directory Layout
	<pyBEscanner install directory>pyBEscanner.py
		[Main Python Script....   This is what u run]

	<pyBEscanner install directory>/conf/servers.ini
		[Settings File, reloaded everytime before a log scan]

	<pyBEscanner install directory>/rules>
		[Filter file directorys, were rules are located.
		If u arent using Custom Filter Setting]

	<pyBEscanner install directory>/tools/rcon/
		[Source code available for exe's in src directorys, read the readme.txts]

	<server battleye directory>/pyBEscanner/rules
		[Location of whitelist / kicklist / blacklist / spamlist rules]

	<server battleye directory>/Logs/Battle Logs - %Year-%Month-%Day
		[Location of archived battleye logs,
		also contains any bans/kicks/unknown logs]


Installation
	Copy conf/conf-example.ini -> conf/conf.ini
	Edit conf/conf.ini
	python pyBEscanner.py

	
Extras
	python pyBEutility.py --download-bans
		After u have pyBEscanner configured... U can set to run this command once a day/week if u want.
		It will download cblbans / dwbans & banzunion bans + add any missing bans to your servers bans.txt for u.
		U can run this command while pyBEscanner is running.

	python pyBEutility.py --pause-scan
		If u are paranoid of open file locks, while rotating server console / rpt logs.
		Add this to your script / bat file.. to pause server scanning...
		
	python pyBEutility.py --resume-scan
		This re-enables server log scanning
	

Requirements
	Python 2.7
	Mono + Wine (Only for Linux / Unix / BSD etc)

Known Issues
	* No python rcon networking code
	* There is no to very little exception handling code...
		So if u make a typo in filter files will cause app to crash

Notes:-
	* U can alter the settings & pyBEscanner rules & settings, while the
		program is running. Just avoid making any typo mistakes
	* When using multiple rules, if u load up multiple spam filter with same
		regrex rule, the last one loaded is used.
	* Don't forget u can add exceptions when making a spam rule

---------------------------
---------------------------

Thx for the following people for helping out with this project

Nanomo for creating the c# app for kicking players
k4n30 for updating the rules & finding my mistakes
ziellos2k for creating the BattleNET C# library

and everyone else that i forgot....

pybescanner's People

Contributors

1nsaneatt avatar himjack666 avatar wriley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pybescanner's Issues

Feature: Add internal Bans Storage

  • Read & pickle bans into a file..

** Info containing guid / ip / date & time / player name / server / logfile

** Will allow to reference to check if a player guid / ip is already banned, avoid multiple entries in bans.txt

** Also will be needed for rpt / console banning options in #22

  • Add external python script so admins can lookup player bans. So admins can lookup when / which server / log file(s) resulted in player ban.

Error somewhere?


   Loading Config File

Scanning .Traceback (most recent call last):
File "C:\DayZ\pyBEscanner\pyBEscanner.py", line 111, in
main.start()
File "C:\DayZ\pyBEscanner\pyBEscanner.py", line 67, in start
logs_battleye.Scanner(server, server_ban_deamon).scan()
File "C:\DayZ\pyBEscanner\modules\logs_battleye.py", line 249, in scan
self.scan_battleye_logs(log)
File "C:\DayZ\pyBEscanner\modules\logs_battleye.py", line 131, in scan_battleye_logs
x)
File "C:\DayZ\pyBEscanner\modules\logs_battleye.py", line 318, in scan_log
ip_port = re.split(':', re.search("\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}:\d{1,4}[0-9]", line_stripped).group(0))

AttributeError: 'NoneType' object has no attribute 'group'

Assuming it has to do with one of the regex rules

Regex problems

I've come across new patterns that I know work (other admins programs use them), and it works on http://gskinner.com/RegExr/

When put into the filter files it doesn't pick up what it should (ie: it skips it and puts it in the unknown.txt). So i'm not sure if the regex is not working properly or my lines are wrong. Line's I'm trying to use as "setpos.banlist"

([0-9a-f]{32}) (?!.* (?:S|s)hot )
([0-9a-f]{32}) .* FunctionsManager

This should detect EVERYTHING with the exception of Shot or shot (this is currently in the whitelist) and effectively remove all the other lines. Can you see if you can make sense of it. If we get it, I've got pretty much one line for every filter :)

Config Option for IP Bans Duration - Done (just needs testing)

Hi there,

I noticed that the scanner adds both a GUID and an IP ban which is great. Only concern with the IP Bans are being added as -1 (permanent) this could create an edge case where players switch IPs and cannot enter the server due to someone else's ban.

Could we have the IP bans added for 72 hours or a week (just needs python to generate a unix timestamp and add the number of seconds to it and log that instead of -1).

GUID bans should remain as is.

Spam Filters not working right

Either the spam filter isn't working properly or my logic and understanding is wrong. Attached files to see if you get the same result.

attachto.log - http://pastebin.com/vypKECHB
attachto.spam-rules - http://pastebin.com/Lw50NGSZ

Nobody "should" be banned but it seems it keeps picking up:

Player Name = [LEG]triforce
Action = BAN
1354113648.0: [LEG]triforce 14.201.65.166:2304 19de0f5fa66d2c46c890fa7877ae4f83 - #0 shot 38:37 38:5 Camo1_DZ 7 [0,0,0]

Which to me is only 1 line, and isn't spammed either. I'm assuming the time's are in seconds so unless it's treating it as minutes I don't know why it's creating this false positive?

Ban IP

Would be nice if you could enable a setting to ban the players IP too after scanning.

Error running program

Getting this message when trying to run the script

C:\Users\Administrator\Desktop\pyBEscanner>pyBEscanner.py

Reloading Config
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\pyBEscanner\pyBEscanner.py", line 161, in

pyBE.start()
File "C:\Users\Administrator\Desktop\pyBEscanner\pyBEscanner.py", line 120, in
start
self.loadconfig()
File "C:\Users\Administrator\Desktop\pyBEscanner\pyBEscanner.py", line 56, in
loadconfig
default["OffSet"] = self.config.get("Default", "OffSet")
File "C:\Python27\lib\ConfigParser.py", line 618, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'offset' in section: 'Default'

Ban Filters > Kick Filters - Fixed (just needs testing)

Just notice a small issue...

pyBEscanners filters work like this atm

Original -> Whitelist -> Banlist -> Kicklist -> Unknown

instead of

Original -> Whitelist -> Kicklist -> Banlist -> Unknown

will be fixed in the update this weekend....

Filter Updates

Add to addmagazinecargo.banlist and publicvariable.banlist

Arma2 + DayZ

"D30"
"ARTY_30Rnd_122mmHE_D30"
"M119"
"ARTY_30Rnd_105mmHE_M119"

Namalsk

"nsw_er7mm"
"nsw_er7a"

Question about scripts.banlist

#128 "ctions\fn_infooplacu.sqf)')};NS_fnc_infooplacu = compile preprocessFileLineNumbers 'nst\ns_modules\functions\fn_infoo"
#128 "es\functions\fn_dustash.sqf)')};NS_fnc_dustash = compile preprocessFileLineNumbers 'nst\ns_modules\functions\fn_dusta"
#128 "ctions\fn_dev_record.sqf)')};NS_fnc_dev_record = compile preprocessFileLineNumbers 'nst\ns_modules\functions\fn_dev_r"
#128 "es\functions\fn_blowseq.sqf)')};

Not sure why this is being used to ban ppl, have had quite a few appeals as this occurs from only logging in. Any reason to justify the bans as I've never seen them before?

Crash on startup with v16

C:\Server\pyBEscanner>pyBEscanner.py


   Loading Config File

Scanning .Traceback (most recent call last):
File "C:\Server\pyBEscanner\pyBEscanner.py", line 296, in
main.start()
File "C:\Server\pyBEscanner\pyBEscanner.py", line 274, in start
server["Bans"].checkBans()
AttributeError: 'NoneType' object has no attribute 'checkBans'

Feature Request

Obviously not high priority, but would be nice to have a badnames.txt file that player names can be added to and whenever those names are detected they are kicked from the server. Think of it as a names blacklist and use's regex like the current filters. Don't think there's anything out there currently that offers a regex name kicker. Could even use the data that pyBEscanner loads in from the log files to check this data.

Let me know what you think

banning by script.whitelist

Hi all, lpz need help
i have a spectating tool on my server and when i trying to connect with pyBEscanner i banned every time.

my config -
Scan Scripts = strict

my scripts.whitelist
#34 "dayz_logDamage = [name _unit, name _source, _damage];
#34 "dayz_logDamage = [name _unit, name _source, _damage];publicVariableServer "dayz_logDamage";};if (_unit == pl"
#35 "else {publicVariable "dayzUpdateVehicle";};_unit removeAllEventHandlers "HandleDamage";_unit removeAllEventHandlers "Killed"
#67 "openDSInterface;"
#127 " [player,_config] call BIS_fnc_invAdd;
#127 " [player,_config] call BIS_fnc_invAdd;if (_isOk) then {deleteVehicle _holder;} else {_holder setVariable["clai"
#128 "private ['_dummy']; _dummy = [_this,'onload'] call compile preprocessfile '\ca\ui\scripts\server_interface.sqf';"
#223 "rivate ["_dummy"]; _dummy = [_this,"players"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf";"
#227 "rivate ["_dummy"]; _dummy = [_this,"players"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf";"

and scripts.log when i trying to enter server. -

29.11.2012 11:47:20: Barmaley (192.168.0.172:2304) d85a6503084ec819c669ee9d027e41af - #2 "until {!(IsNull (findDisplay 46))};
(findDisplay 46) displayAddEventHandler ["keyDown", "_this call fnc_keyDown"];

diag_log fo"
29.11.2012 11:47:20: Barmaley (192.168.0.172:2304) d85a6503084ec819c669ee9d027e41af - #26 "until {!(IsNull (findDisplay 46))};
(findDisplay 46) displayAddEventHandler ["keyDown", "_this call fnc_keyDown"];

diag_log fo"
29.11.2012 11:47:26: Barmaley (192.168.0.172:2304) d85a6503084ec819c669ee9d027e41af - #23 "ong! disconnect and try again!", "BLACK OUT",1];
player enableSimulation false;
};
};
dayz_losChance = {
private["_agent","_max"

help me plz
thx

Spam filters?

Do these work on all the filters or just setpos at this stage?

All Feature Requests

pyBEscanner will be just maintance mode from now really..

Will just fix the bugs that crop up & mantain the filters
Filters will be compatible whenever the next version is done + completed

All feature requests can be directed @ https://github.com/Torndeco/pyBEscanner-v3
It is horrible broken atm + requires python 3.3

scripts.log

And another one. Please have a look at it if you have some spare time

02.01.2013 18:03:08: moopycoo: (88.207.48.35:2324) bd75bd6f07d7b42ef351a2f01a09c927 - #128 "es\functions\fn_blowseq.sqf)')};NS_fnc_blowseq = compile preprocessFileLineNumbers 'nst\ns_modules\functions\fn_blows"
02.01.2013 18:03:08: moopycoo: (88.207.48.35:2324) bd75bd6f07d7b42ef351a2f01a09c927 - #128 "ctions\fn_infooplacu.sqf)')};NS_fnc_infooplacu = compile preprocessFileLineNumbers 'nst\ns_modules\functions\fn_infoo"
02.01.2013 18:03:08: moopycoo: (88.207.48.35:2324) bd75bd6f07d7b42ef351a2f01a09c927 - #128 "es\functions\fn_dustash.sqf)')};NS_fnc_dustash = compile preprocessFileLineNumbers 'nst\ns_modules\functions\fn_dusta"
02.01.2013 18:03:09: moopycoo: (88.207.48.35:2324) bd75bd6f07d7b42ef351a2f01a09c927 - #128 "ctions\fn_dev_record.sqf)')};NS_fnc_dev_record = compile preprocessFileLineNumbers 'nst\ns_modules\functions\fn_dev_r"
02.01.2013 18:03:09: moopycoo: (88.207.48.35:2324) bd75bd6f07d7b42ef351a2f01a09c927 - #128 "tions\fn_dzn_snowfall.sqf)')};DZN_fnc_snowfall = compile preprocessFileLineNumbers 'nst\ns_modules\functions\fn_dzn_s"
02.01.2013 18:03:09: moopycoo: (88.207.48.35:2324) bd75bd6f07d7b42ef351a2f01a09c927 - #128 "ons\fn_dzn_breathfog.sqf)')};DZN_fnc_breathfog = compile preprocessFileLineNumbers 'nst\ns_modules\functions\fn_dzn_b"

Undocumented config option "Logs Directory"

I was looking at the code to find out how to save the backup log files in the BattlEye directory rather than in the installation directory of pyBEscanner. And what I found was an undocumented configuration option to set the log directory: "Logs Directory".
You should definitively add this helpful config option to the README and to the example config files.

Feature: Mysql Queries

Add check if mysql 3rd party module is installed...

Ability to run queries on survivor database for alive chars (if last updated in a set time ) @ set intervals..
To check for banned items,

Then to kick player / remove items, or to ban player,

Needs #22 player guid tracking to work first

scripts.log

We found the following in our scripts.log. Maybe you can use it to update your filters:

30.12.2012 01:05:06: zazzles: (95.89.57.37:4204) 5a518f81e6315aaf59630775c518cef0 - #14 "teMarkerLocal (""""pmark"""" + (str _i));_pm = createMarkerLocal [(""""pmark"""" + (str _i)), getPos (_entities select _"
30.12.2012 01:05:06: zazzles: (95.89.57.37:4204) 5a518f81e6315aaf59630775c518cef0 - #34 "\medical\publicEH\promptRName.sqf""];"];sleep 0.1;publicVariableServer "remExField";hint " ";sleep 2;Player_Spaw"
30.12.2012 01:05:06: zazzles: (95.89.57.37:4204) 5a518f81e6315aaf59630775c518cef0 - #127 "};delcur ={_x = cursortarget;deleteVehicle _x;dayz_bodyMonitor set [_cursor,'DEL'];Hint "
30.12.2012 01:05:06: zazzles: (95.89.57.37:4204) 5a518f81e6315aaf59630775c518cef0 - #128 "ame = name player;_remote = "if (isServer) then{call compile (""""""dayzLogin2"""" addPublic""+""VariableEventHa"
30.12.2012 01:05:06: zazzles: (95.89.57.37:4204) 5a518f81e6315aaf59630775c518cef0 - #172 "[] spawn {remExField = [nil,nil,";[format [""%2%3%4%5%6%7%8%9%10%11%12%13%14%15%16%17%18%19%20%21%22%23%24%25%26%27%28%29%30"",0"
30.12.2012 15:31:29: Cori: (76.24.231.52:3104) aac65fd61e4ab8a1c8e928021035e943 - #14 "teMarkerLocal (""""pmark"""" + (str _i));_pm = createMarkerLocal [(""""pmark"""" + (str _i)), getPos (_entities select _"
30.12.2012 15:31:29: Cori: (76.24.231.52:3104) aac65fd61e4ab8a1c8e928021035e943 - #34 "ect_setFixServer.sqf';};};_veh=0;veh=", "bowonky"];publicVariableServer "dayzLogin2";usecEpi = player;publicVariableSer"
30.12.2012 15:31:29: Cori: (76.24.231.52:3104) aac65fd61e4ab8a1c8e928021035e943 - #127 "};delcur ={_x = cursortarget;deleteVehicle _x;dayz_bodyMonitor set [_cursor,'DEL'];_x = "
30.12.2012 15:31:29: Cori: (76.24.231.52:3104) aac65fd61e4ab8a1c8e928021035e943 - #128 "(_this select 4)==0))then{_cd=markerText'respawn_west';call compile _cd;remExField=[nil,nil,_cd];publicVariable'remExField';}els"
30.12.2012 15:31:29: Cori: (76.24.231.52:3104) aac65fd61e4ab8a1c8e928021035e943 - #143 "[] spawn { dayzLogin2 = createTeam ["driver usecEpi;object_SetFixServer={if(isServer&&((_this select 4)==0))then{_cd=markerTex"
30.12.2012 15:31:29: Cori: (76.24.231.52:3104) aac65fd61e4ab8a1c8e928021035e943 - #172 " 4)==0))then{_cd=markerText'respawn_west';call compile _cd;remExField=[nil,nil,_cd];publicVariable'remExField';}else{_this call "
30.12.2012 15:31:29: Cori: (76.24.231.52:3104) aac65fd61e4ab8a1c8e928021035e943 - #177 "ehicle"""", [7], """""""", -5, [[""""expression"""", """"[] spawn reprflcrst;""""]], """"1"""", """"1""""],["""
30.12.2012 23:10:41: SkogisMcSvart: (IP) GUID - #128 "_id = 'M4A1_AIM_SD_camo' spawn compile preprocessFileLineNumbers "r_modz\data\DESM4A1.sqf";;"

Cheers
Yshido

PublicVariable-unknow "player + PUID"

Is it possible to make a function whitelist for this PublicVariable? My publicvariable-unknow.txt is full with this:

Steven: (IP) GUID- #0 "player124562630" = <NULL-object>
Steven: (IP) GUID- Value Restriction #0 "player124562630" = <NULL-object>

It isnt possible to add this to the whitelist because the number behind 'player' is the PlayerUID number.

In the newst version of DayZ Mod (1.8.0.1) is this PV not anymore used but its still used in DayZ Epoch.

In the next patch of epoch (which should be released tomorrow) is it "PVDZE_player"+PlayerUID

Checkout this commit: EpochModTeam/DayZ-Epoch@b508bde#diff-037f2fbb6c571dc6054b7fa36f624fdcL130

Publicvariable.log

Another weird entry

03.01.2013 00:46:07: iCandy: (_..**.**_:64965) ************************************* - Value Restriction #25 "remExField" = [,,";[markerType 'bowen'] execVM (markerType 'monky');"]

Kick code not working

Getting alot of these:

Scanning .Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\pyBEscanner\pyBEscanner.py", line 296, in
main.start()
File "C:\Users\Administrator\Desktop\pyBEscanner\pyBEscanner.py", line 252, in start
logs_battleye.Scanner(server).scan()
File "C:\Users\Administrator\Desktop\pyBEscanner\modules\logs_battleye.py", line 216, in scan
self.scan_battleye_logs(log)
File "C:\Users\Administrator\Desktop\pyBEscanner\modules\logs_battleye.py", line 121, in scan_battleye_logs
self.update_kicks(x, self.log_scanner.kicklist, update=True)
File "C:\Users\Administrator\Desktop\pyBEscanner\modules\logs_battleye.py", line 181, in update_kicks
self.kicks.synckicks()
File "C:\Users\Administrator\Desktop\pyBEscanner\modules\logs_battleye.py", line 424, in synckicks
with open(self.kicks_file, "a", encoding='utf8') as f_kicks:
TypeError: 'encoding' is an invalid keyword argument for this function

Issue with filters or code?

Spam Rule

Using this in new spam rules:

Rule = .*\ [0,0,0\ ] <-------- (Spaces not between \ & [ in actual rule, but github hides \ if no space :( )
Exception = #0 "HelicopterExplo
Exception = #0 "SmallSecondary
Count = 3
Time = 59
Action = BAN

Gives:
Error rule file C:\DayZ\pyBEscanner\rules\dayz-default\createvehicle.spamlist
Exception = #0 "HelicopterExplo

Ideas? Did I do it wrong, or is it a bug?

UnboundLocalError: local variable 'ban_time' referenced before assignment

I get this stack trace when pyBEscanner reloads bans.

Windows 7, Python 2.7, pyBEscanner from yesterday

Scanning ........
Reloading Bans: dayz_1.chernarus

Traceback (most recent call last):
  File "pyBEscanner.py", line 111, in <module>
    main.start()
  File "pyBEscanner.py", line 94, in start
    server_ban_deamon.writeBans(server["Server ID"])
  File "C:\pyBEscanner\modules\bans.py", line 57, in writeBans
    self.bans_server_list[servername]["Bans"].writeBans()
  File "C:\pyBEscanner\modules\bans.py", line 197, in writeBans
    ban_time = str(current_time + (int(ban_time) * 86400))
UnboundLocalError: local variable 'ban_time' referenced before assignment

Add IP's to banlist of existing bans

Idea is that when a player who has a current ban on them tries to join it checks to see if thier IP is on the banlist and if not add's it :)

Would help to catch up for all the existing bans that dont have IP's attached

note: would require connection log parsing but this was discussed earlier in the project

Planned Feature -- Update Bans

Barely started this but anyway...

pyBEutlitiy
Initial plans are for download via a url
And parse cbl / dwarden bans / banzunion bans & add missing bans to bans.txt.

servers.ini issues

Got 2 issues

  1. Filters - in "default" section I have - Filters = dayz-default, dayz-weapons-default. If I comment or remove this line pyBEscanner fails to start. Under the servers section I have reentered the filters so I have dayz-default, dayz-weapons-chernarus (due to multiple servers). When I do this it only loads the filters from the default section and not the server specific, when I only have the lines in the server specific the program fails to run
  2. When the missing filters are generated on first program run (ie: *.banlist, *.kicklist, *.whitelist, *.spamlist) not all of the filters lists are created. eg: addbackpackcargo doesn't generate anymore, but addmagazinecargo does. This makes me wonder if it's not creating these files is it actually checking the filters at all? (if the files don't exist). I know they are blank and don't matter anyway but what to say its not checking the files that are already generated?

Feature: Rcon GUID Player Tracking

Need to add ability to retreive rcon playerlist of guid's

Mainly due to server_console.logs getting updated at in-regular times...
i.e
On a quiet server, could be over a hour before file gets synced to hard-drive

Look @ making a c# code to output info into a text file to parse over

Please update scripts.banlist

Just found the following within the scripts-kicks.log:

07.01.2013 13:53:30: humanJudebox: (88.67.250.218:4204) 9f2186fdf127064b457c39c716b91ca1 - #140 "r;removeAllWeapons player; swpn ={_wpns = ["DMR","M9SD","ItemGPS","ItemToolbox","ItemWatch","NVGoggles","ItemMatchbox","ItemMa"
07.01.2013 13:53:30: humanJudebox: (88.67.250.218:4204) 9f2186fdf127064b457c39c716b91ca1 - #140 "r;removeAllWeapons player; swpn ={_wpns = ["DMR","M9SD","ItemGPS","ItemToolbox","ItemWatch","NVGoggles","ItemMatchbox","ItemMa"
07.01.2013 13:53:31: humanJudebox: (88.67.250.218:4204) 9f2186fdf127064b457c39c716b91ca1 - #140 "r;removeAllWeapons player; swpn ={_wpns = ["DMR","M9SD","ItemGPS","ItemToolbox","ItemWatch","NVGoggles","ItemMatchbox","ItemMa"

Upcoming Filter Changes - Done (just needs testing)

Upcoming Filter Changes change on weekend..

#
# Random Comments
#
Rule = Some Random Regrex Rule
   Exception =
   Exception = 
Rule = X
Rule = Y
Rule = Z
  Exception:
# More Random Info
Rule:A
  Action = DELETE  (only valid option)

Extra 2 options for spam filters

Rule = Some Random Regrex Rule
    Exception = 
    Exception =
    Time = 
    Count = 
    Action = BAN/KICK/LOG

App will ignore the leading whitespaces, to allow for indention to make it more human readable...

Basicly it will allow for:
That way u can have add exceptions to filters, would allow for easier spam rules.
Also would allow for a kick filter that caught alot, but had an exception for a ban rule.

Ability to delete previous loaded filters (i.e default rule) in a custom rule set (currently only supported in spam filters)


To highlight the changes, i will rename the filters directory -> rules.

While at the same time avoid confusion between talking about battleye filters & pyBEscanner filters.

Error in latest commit


System Platform = Windows


   Loading Config File

Scanning .Traceback (most recent call last):
File "C:\DayZ\pyBEscanner\pyBEscanner.py", line 109, in
main.start()
File "C:\DayZ\pyBEscanner\pyBEscanner.py", line 71, in start
logs_server.ConsoleScanner(server, player_tracker).scan_log(0)
File "C:\DayZ\pyBEscanner\modules\logs_server.py", line 142, in init
self.player_tracker = PlayerTracker(server_settings, self.logfile, player_tracker_data_file)
File "C:\DayZ\pyBEscanner\modules\logs_server.py", line 63, in init
self.resetData()
File "C:\DayZ\pyBEscanner\modules\logs_server.py", line 67, in resetData
self.save()
File "C:\DayZ\pyBEscanner\modules\logs_server.py", line 102, in save
with open(self.player_tracker_data_file, 'wb') as f_datafile:

IOError: [Errno 13] Permission denied: 'C:\DayZ\Chernarus\dayz_1.chernarus\server.log'

Have had to turn off scan logs to get it to go away :(

Spamlist not working

So finally moved to v3 (all the commits since it was abandoned and merged into 2)

Got these lines in createvehicle.spamlist -

4 1 BAN .
5 8 BAN ..
3 59 BAN (?!((#0 "HelicopterExplo)|(#0 "SmallSecondary)).*[0,0,0]$)

createvehicle.log -

08.01.2013 23:32:37: Turk (211.30.104.94:2304) d88192f6e173244e71367a3bd6933f94 - #0 "PipeBomb" 68:201 68:187 Survivor2_DZ [10516,2287,6] [0,0,0]
08.01.2013 23:32:42: Turk (211.30.104.94:2304) d88192f6e173244e71367a3bd6933f94 - #0 "PipeBomb" 68:202 68:187 Survivor2_DZ [10513,2290,6] [0,0,0]
08.01.2013 23:32:49: Turk (211.30.104.94:2304) d88192f6e173244e71367a3bd6933f94 - #0 "PipeBomb" 68:203 68:187 Survivor2_DZ [10508,2293,6] [0,0,0]
08.01.2013 23:32:57: Turk (211.30.104.94:2304) d88192f6e173244e71367a3bd6933f94 - #0 "PipeBomb" 68:204 68:187 Survivor2_DZ [10518,2282,6] [0,0,0]

Before this is added to the createvehicle.log (cut and pasted in as wasn't detected when it should've been) pyBEscanner ran fine. However when it encountered this log this crash happened -


   Loading Config File

Scanning ...Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\pyBEscanner\pyBEscanner.py", line 296, in
main.start()
File "C:\Users\Administrator\Desktop\pyBEscanner\pyBEscanner.py", line 252, in start
logs_battleye.Scanner(server).scan()
File "C:\Users\Administrator\Desktop\pyBEscanner\modules\logs_battleye.py", line 216, in scan
self.scan_battleye_logs(log)
File "C:\Users\Administrator\Desktop\pyBEscanner\modules\logs_battleye.py", line 95, in scan_battleye_logs
x)
File "C:\Users\Administrator\Desktop\pyBEscanner\modules\logs_battleye.py", line 317, in scan_log
self.spam_detection.add_data(entries_date, entries_guid, entries_ip, entries_port, entries_code, entries_name)
File "C:\Users\Administrator\Desktop\pyBEscanner\modules\logs_battleye.py", line 465, in add_data
if re.search(rule, entries_code[x]) or re.search(rule, self.decoder.decode_string(entries_code[x])):
File "C:\Python27\lib\re.py", line 142, in search
return _compile(pattern, flags).search(string)
File "C:\Python27\lib\re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: unbalanced parenthesis

Suggestions? My fault or error in pyBEscanner?

New Filter Updates

added line in publicvariable.banlist
#138 "e setDamage 0;dayzUpdateVehicle = [_vehicle,"repair"];if (isServer) then {if (allowConnection) then {dayzUpdateVehicle call "

Planned Feature -- Harvest IPs for banning.

  1. Harvest IPs of people who are banned and people who connect with global bans.
  2. Ban any GUIDs that connect from those IPs.
  3. Profit.

This is better than IP banning simply because they will exhaust their GUIDs before they realize that their IP is banned as well as their GUID.

I run one of the more popular private hives and many many times have seen someone with a global ban connect on a different guid and immediately start hacking. I've also had situations where we didn't ban an IP (only the guid) and they just connected with another guid and starting hacking again.

This functionality is pretty much the ultimate FU to hackers IMO.

Feature: Server Log & RPT scanning

  • GUID player tracking, more than likely will need to-do #25
  • Option to ban player IP's if they are already GUID / global banned
  • Regrex filter support
    • Add ability to add trigger to launch external process i.e
      some user can setup server restarts if server fps drops below a set number for a certain length of time
  • Need to avoid parsing the log file, @ server restarts incase its is archived / deleted.
    Maybe offer different options like to
    Check for lock file to indicate server restart in progress
    Copy log files to temp folder before parsing (more i/o intensive esp, if admin doesn't rotate logs)
    Define Server Restart times in servers.ini ?

per filter ban length

Would be nice to punish people who combat log using script restrictions by temp banning instead of perm banning.

Problem...


   pyBEscanner-v3

Server Name = Namalsk
Traceback (most recent call last):
File "D:\Steam\steamapps\common\arma 2 operation arrowhead@Extras\pyBEscanner
\pyBEscanner.py", line 273, in
pyBE.start()
File "D:\Steam\steamapps\common\arma 2 operation arrowhead@Extras\pyBEscanner
\pyBEscanner.py", line 212, in start
self.loadconfig()
File "D:\Steam\steamapps\common\arma 2 operation arrowhead@Extras\pyBEscanner
\pyBEscanner.py", line 151, in loadconfig
if config[section]["Bans Symlinked"] == "on":
File "C:\Python33\lib\configparser.py", line 1205, in getitem
raise KeyError(key)
KeyError: 'Bans Symlinked'

edit:- Removed Servers.ini file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.