<s> from common . dbconnect import db_connect <EOL> from common . entities import KippoHoneypot , KippoDatabase <EOL> from canari . maltego . message import Field , UIMessage <EOL> from canari . framework import configure <EOL> __author__ = '<STR_LIT>' <EOL> __copyright__ = '<STR_LIT>' <EOL> __credits__ = [ ] <EOL> __license__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> __maintainer__ = '<STR_LIT>' <EOL> __email__ = '<STR_LIT>' <EOL> __status__ = '<STR_LIT>' <EOL> __all__ = [ <EOL> '<STR_LIT>' <EOL> ] <EOL> @ configure ( <EOL> label = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> uuids = [ '<STR_LIT>' ] , <EOL> inputs = [ ( '<STR_LIT>' , KippoDatabase ) ] , <EOL> debug = True <EOL> ) <EOL> def dotransform ( request , response ) : <EOL> host = request . value <EOL> x = db_connect ( host ) <EOL> try : <EOL> cursor = x . cursor ( ) <EOL> query = "<STR_LIT>" <EOL> cursor . execute ( query ) <EOL> for ( id , ip ) in cursor : <EOL> e = KippoHoneypot ( '<STR_LIT:%s>' % ip ) <EOL> e += Field ( '<STR_LIT>' , host , displayname = '<STR_LIT>' ) <EOL> e += Field ( '<STR_LIT>' , ( '<STR_LIT:%s>' % id ) , displayname = '<STR_LIT>' ) <EOL> response += e <EOL> return response <EOL> except Exception as e : <EOL> return response + UIMessage ( str ( e ) ) </s>
