<s> import re <EOL> from ztag . annotation import Annotation <EOL> from ztag . annotation import OperatingSystem <EOL> from ztag import protocols <EOL> import ztag . test <EOL> class FtpWarFtpd ( Annotation ) : <EOL> protocol = protocols . FTP <EOL> subprotocol = protocols . FTP . BANNER <EOL> port = None <EOL> impl_re = re . compile ( "<STR_LIT>" , re . IGNORECASE ) <EOL> version_re = re . compile ( "<STR_LIT>" , re . IGNORECASE ) <EOL> tests = { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:version>" : "<STR_LIT>" , <EOL> } <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:version>" : "<STR_LIT>" , <EOL> } <EOL> } <EOL> } <EOL> def process ( self , obj , meta ) : <EOL> banner = obj [ "<STR_LIT>" ] <EOL> if self . impl_re . search ( banner ) : <EOL> meta . local_metadata . product = "<STR_LIT>" <EOL> version = self . version_re . search ( banner ) . group ( <NUM_LIT:1> ) <EOL> meta . local_metadata . version = version <EOL> return meta <EOL> """<STR_LIT>""" </s>
