pyBEscanner

Running it a console will do the same, no need to run it in an IDLE.

Apparently in one of my commits i uploaded an old version servers-example.ini twice without noticing.
Was missing options for the setting to tell app u have your ban files symlinked together.
That way it knows it only needs to monitor 1 file for changes..


@Everyone else,

Anyway couldnt get some sleep.
So when debugging an error k4n30 encountered.
Anyway there is a new fix commited for both versions of pyBEscanner for spam detection.
The spam code was using max_count instead of max_time :(
Also noticed a small typo in-regards to logging the spam correctly aswell

U should update to be on safe side
 
Well, unsure what the problem is here, possibly an issue with my filters?

Code:
E:\Server Tools\pyBEscanner>pyBEscanner.py
 
 
---------------------------------------------------------
      pyBEscanner-v3
---------------------------------------------------------
 
Server Name = Server 1
 
Scanning .Traceback (most recent call last):
  File "E:\Server Tools\pyBEscanner\pyBEscanner.py", line 321, in <module>
    main.start()
  File "E:\Server Tools\pyBEscanner\pyBEscanner.py", line 276, in start
    logs_server.ConsoleScanner(server).scan_log()
  File "E:\Server Tools\pyBEscanner\modules\logs_server.py", line 119, in scan_log
    self.entries, f_offset = scan(self.logfile, self.offset_data["Offset"], encoding='utf-8')
  File "E:\Server Tools\pyBEscanner\modules\logs_server.py", line 40, in scan
    f_log_entries = f_log.readlines()
  File "C:\Python33\lib\codecs.py", line 300, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd in position 6115: invalid continuation byte
 
E:\Server Tools\pyBEscanner>

Ok will try and replace, teamswitch.txt and see how i go.

Code:
DEBUG:Parser :Parsing E:\Server Tools\pyBEscanner\temp\Server 1\teamswitch.log
DEBUG:Parser :Checking of Offset Data File
DEBUG:Parser :Offset Data File Found
DEBUG:Parser :Loading Offset Data = {'Version': 1, 'Data': []}
DEBUG:Parser :Incorrect Pickle Version 1

Ok that made little difference, and it's where the debug (highest logging) ends.

Code:
DEBUG:Parser :Parsing E:\Server Tools\pyBEscanner\temp\Server 1\teamswitch.log
DEBUG:Parser :Checking of Offset Data File
DEBUG:Parser :No Offset Data File Found
 
Just uploaded hopefully a fix for the handling of server logs.

Basicly the issue is the app decoding the text files using the text encoding.
Been abit of try & error atm to figure out the encoding atm
I am hoping i have it sorted

Battleye Logs = system default locale
Server Logs = UTF16 with no BOM Never due code changes without coffee first
 
Cool thanks I will give it a go, i figured something like that was wrong since when I modified the file it would just error on the next one.
 
Still no luck...

Code:
DEBUG:Battleye Scanner:Filters --> ['E:\\Server Tools\\pyBEscanner\\filters\\dayz-default', 'E:\\Server Tools\\pyBEscanner\\filters\\dayz-weapons-chernarus']
DEBUG:Parser :Scan Time = 1357307975.352673
 
DEBUG:Parser :Parsing E:\Server Tools\pyBEscanner\temp\Server 1\remoteexec.log
DEBUG:Parser :Checking of Offset Data File
DEBUG:Parser :No Offset Data File Found
DEBUG:Parser :
DEBUG:Parser :Parsing E:\Server Tools\pyBEscanner\temp\Server 1\selectplayer.log
DEBUG:Parser :Checking of Offset Data File
DEBUG:Parser :No Offset Data File Found
DEBUG:Parser :

Console

Code:
E:\Server Tools\pyBEscanner>pyBEscanner.py -f
 
 
---------------------------------------------------------
      pyBEscanner-v3
---------------------------------------------------------
Server Name = Server 1
 
Scanning .Traceback (most recent call last):
  File "E:\Server Tools\pyBEscanner\pyBEscanner.py", line 321, in <module>
    main.start()
  File "E:\Server Tools\pyBEscanner\pyBEscanner.py", line 276, in start
    logs_server.ConsoleScanner(server).scan_log()
  File "E:\Server Tools\pyBEscanner\modules\logs_server.py", line 119, in scan_log
    self.entries, f_offset = scan(self.logfile, self.offset_data["Offset"], encoding='utf-8')
  File "E:\Server Tools\pyBEscanner\modules\logs_server.py", line 40, in scan
    f_log_entries = f_log.readlines()
  File "C:\Python33\lib\codecs.py", line 300, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd in position 6115: invalid continuation byte
 
Yeah starting to annoy me, i am gonna try and come up with a solution over the weekend...

As a workaround i have added a commit, that disables output in console to tell u server files are missing..
Just change the location of the server files to something that doesn't exist
This way u can continue to use the app, until i figured it out log file encoding
 
IS their anyway to install this on a managed server? I have access to add files but the python part is where you lost me
 
So pyBEscanner-v3, is gonna pretty much gonna be scrapped, no need for further testing...
People should switch back to pyBEscanner & thx

Due to Python 3 changes to handling text files and arma servers apparent use of multiple different encodings in a single log file i.e
cp-1252 / utf-8 / utf-16-le

I really only have 2 choices, either i make a custom decoder for the log files
Or i just switch back to python 2.7 & continue work off the normal pyBEscanner
 
Hi!

2 people got ban, and i I check the createvehicle-spam.txt and find this:

Player Name = XX
Action = BAN
05.01.2013 01:29:38: YY188.6.244.93:2304 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy - #0 "HelicopterExploSmall" 32:625 0:0 [-556,5122,136] [0,0,0]
05.01.2013 01:29:38: YY 188.6.244.93:2304 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy- #0 "HelicopterExploBig" 32:626 0:0 [-556,5122,137] [0,0,0]
05.01.2013 01:30:24: YY 188.6.244.93:2304 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy- #0 "SmallSecondary" 32:632 0:0 [-563,5127,140] [0,0,0]

Player Name = XY
Action = BAN
05.01.2013 12:18:31: XY 117.205.83.89:2304 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - #0 "HelicopterExploSmall" 201:181 0:0 [1703,10144,244] [0,0,0]
05.01.2013 12:18:31: XY 117.205.83.89:2304 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - #0 "HelicopterExploBig" 201:182 0:0 [1703,10144,245] [0,0,0]
05.01.2013 12:18:54: XY 117.205.83.89:2304 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - #0 "SmallSecondary" 201:187 0:0 [1702,10136,244] [0,0,0]

He told me that: "I crash with heli and after that I get banned".

Is it fals ban? How can i fix it in config?

Another people sent e-mail to me: "I accidently pressed letter G or H or something and the heli fired flares and i immediatly got banned"
I find this in createvehicle-bans.txt:
05.01.2013 10:41:31: ZZ: (85.255.54.212:2304) zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz - #0 "CMflareAmmo" 6:709 2:83 Mi17_DZ [11174,13820,249] [-6,29,0]
Is it fals ban?

Thanks for your help.
 
Yeah, they are false bans, hust remove the bans from bans.txt

Then u can either then update to the latest version

Or if u want u can just edit the rule's files yousrself
edit filters/dayz-default/createvehicle.banlist
remove the line with CMflareAmmo
edit filters/dayz-default/createvehicle.spamlist
remove the line with 3 59 BAN .*\[0,0,0\]
 
Code:
[Default]
 
# Config Version
#    Read Changes.txt for info on version changes
Version = 16
 
# Filter Location Settings
#    Custom
#        is basicly using different filters per server i.e
#            battleye/pyBEscanner/filters
#    Any other value is relative path from pyBEscanner/filters i.e
#        dayz-default = pyBEscanner/filters/default
Filters = dayz-default, dayz-weapons, dayz-weapons-chernarus
 
# Sleep time after scanning server(s)
Interval = 5
 
#------------------------------
# Default Server Scan Settings
#  off = skip file
#    standard
#        ban for only code in banlist filter
#    standard+kick
#        Ban for only code that is in blacklist filter + kick for unknown code entries
#    strict
#        Ban for everything that isnt in whitelist filter
 
Scan Addbackpackcargo = standard
Scan Addmagazinecargo = standard
Scan Addweaponcargo = standard
Scan Attachto = standard
Scan Createvehicle = standard
Scan Deletevehicle = standard
Scan Mpeventhandler = standard
Scan Publicvariable = standard
Scan Remotecontrol = standard
Scan Remoteexec = standard
Scan Scripts = standard
Scan Selectplayer = standard
Scan Setdamage = standard
Scan Setvariable = standard
Scan Setpos = standard
Scan Teamswitch = standard
 
#Expermential  off/on
Scan Server Logs = standard
 
# Ban File Settings  off/on
Bans Symlinked = off
Bans Directory = C:\server\pyBEscanner-master\bans
 
# Ban Players IP aswell
BAN IP = off
 
 
 
# This is not server time offset....
#    Don't change value basicly
#        Basicly pyBEscanner will buffer the last line for logs in a temp file
#        Until either a new line is proccessed or OffSet value (time in seconds) has passed..
#        This prevents pyBEscanner from missing multiple line entrys if battleye flushs file,
#        before it finishes writting lines 2,3 etc
OffSet = 3
 
#---------------------------------------------
# Custom Ban / Kick Messages
#    Keywords
#        PLAYER_NAME = Player Name
#        SERVER_NAME = Server Name
#        LOG_FILE = Log File
#        DATE_TIME = Date + Time
 
Ban Message = DATE_TIME: PLAYER_NAME on SERVER_NAME
Kick Message = DATE_TIME: PLAYER_NAME on SERVER_NAME
Report Message = Player Name: PLAYER_NAME, Server: SERVER_NAME, Date: DATE_TIME:, Logfile: LOG_FILE
 
 
[Server 1]
ServerName = IE10
ServerIP = 127.0.0.1
ServerPort = xxxxxx
RconPassword = xxxxxxx
BattlEye Directory = C:\Server\Arma2\dayz_10.chernarus\BattlEye
Server Console Log = C:\Server\Arma2\dayz_10.chernarus\server_console.log
Server RPT Log = C:\Server\Arma2\dayz_10.chernarus\arma2oaserver.RPT
# U can override the default scanning options per server if needed i.e
#Scan Setpos = strict
Hi,
i have the problem that ppl are not kicked off and banned if they have i.e. the AS50_TWS equipped.
Any suggestions?

Thanks!
 
http://dayzmod.com/forum/index.php?...txt-to-auto-kick-players-with-hacked-weapons/

Basicly u need to add the banned items to your battleye publicvariableval.txt filter.
Otherwise there is no battleye log entry for a player having the weapons.

Atm, pyBEscanner doesn't scan server logs (work in progress), so it doesn't pick up on database sync log entries.


--------------------------------------------------------------
From lookin @ your servers.ini

If u want pyBEscanner to use the bans directory in default section, u should select
Code:
Bans Symlinked = on
Note:- pyBEscanner will not symlink your file.
I would try & automate this, but on a windows server u would need to run pyBEscanner as admin to make a symlink. So thats why u need todo it manually

Otherwise with
Code:
Bans Symlinked = off
pyBEscanner uses the battleye folder instead for location of bans.txt file
If u want u can define this option in the server sections aswell if u like...

-------------------------------
Also u should change your
ServerName= IE10
Its is used for custom ban / report messages with the server name in it.

The section name [Server 1] is just used for the directory name for the /logs/Server 1/
Its handy to use makes like easier no need to check for duplicate directory names


Some of the config options are relatively new & need some extra explantions in the server-example.ini
 
Hi Torndeco,

I'm running this scanner under linux and starting it with:

Code:
python pyBEscanner.py

after awhile I'm getting this error:

Code:
---------------------------------------------------------
      Loading Config File
---------------------------------------------------------
 
 
---------------------------------------------------------
      Scanning SERVER1
---------------------------------------------------------
addbackpackcargo (standard)
addmagazinecargo (standard)
addweaponcargo (standard)
attachto (standard)
createvehicle (standard)
deletevehicle (standard)
mpeventhandler (standard)
publicvariable (standard)
remotecontrol (standard)
remoteexec (standard)
selectplayer (standard)
scripts (standard)
setdamage (standard)
setpos (standard)
Banning Player Rasaks[Bandit]
setvariable (off)
teamswitch (off)
['/home/user/servers/pyBEscanner-05.01.2013/filters/dayz-default', '/home/user/servers/pyBEscanner-05.01.2013/filters/dayz-weapons']
Traceback (most recent call last):
  File "pyBEscanner.py", line 254, in <module>
    pyBE.start()
  File "pyBEscanner.py", line 230, in start
    rcon.kickplayers(kicks_file)
  File "/home/user/servers/pyBEscanner-05.01.2013/rcon_modules.py", line 33, in kickplayers
    subprocess.call([temp, "--ip=" + self.ip, "--port=" + self.port, "--password=" + self.password, "--file=" + kickfile])
  File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied

at this point the scanner stops working.

Would you help me to fix it, so I can use your tool.
Thanks.
 
For starters try grab the latest version, latest tagged has afew bugs

Now while python is cross platform + most off the app is made with that in mind...
The rcon part of pyBEscanner were it issues reloadbans + kickplayer commands over rcon,
is done via C# code atm :(
Now i have no-idea if u can compile C# code into a linux executable or not.
If thats possible it would be idea why togo...

Otherwise u could try alter the rcon_modules.py to launch wine to start the .exes
Either way u will prob need to edit
pyBEscanner/modules/rcon_modules.py


While i was planning on adding code for python rcon code.

Its doubtful i get around to it, as have shutdown my dayz-servers (got annoyed @ regulars on server bitching/complaining).
Will try and finish off the code for scanning server logs for pyBEscanner anyways
 
Like the updates to version 2 ;)

Just a little error for you, I've disabled the server log file scanning after this though.

Code:
Scanning .............................................................
Scanning ...........Traceback (most recent call last):
  File "E:\Server Tools\pyBEscanner\pyBEscanner.py", line 296, in <module>
    main.start()
  File "E:\Server Tools\pyBEscanner\pyBEscanner.py", line 252, in start
    logs_battleye.Scanner(server).scan()
  File "E:\Server Tools\pyBEscanner\modules\logs_battleye.py", line 215, in scan
    self.scan_battleye_logs(log)
  File "E:\Server Tools\pyBEscanner\modules\logs_battleye.py", line 119, in scan_battleye_logs
    self.update_bans(x, self.log_scanner.banlist, update=True)
  File "E:\Server Tools\pyBEscanner\modules\logs_battleye.py", line 159, in update_bans
    self.bans.addBan(self.bans_ip_list[x], self.bans_info_list[x], logname, self.server_settings["Ban Message"], se
lf.server_settings["Report Message"])
AttributeError: Scanner instance has no attribute 'bans'
 
E:\Server Tools\pyBEscanner>
 
Back
Top