<s> import sys <EOL> from argparse import ArgumentParser <EOL> import requests <EOL> from . MaltegoTransform import MaltegoTransform <EOL> __version__ = '<STR_LIT>' <EOL> class ThreatButt ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , maltegofy = False ) : <EOL> self . _maltegofy = maltegofy <EOL> def clown_strike_ioc ( self , ioc ) : <EOL> """<STR_LIT>""" <EOL> r = requests . get ( '<STR_LIT>' , data = '<STR_LIT>' . format ( ioc ) ) <EOL> self . _output ( r . text ) <EOL> def bespoke_md5 ( self , md5 ) : <EOL> """<STR_LIT>""" <EOL> r = requests . post ( '<STR_LIT>' . format ( md5 ) ) <EOL> self . _output ( r . text ) <EOL> def _output ( self , text ) : <EOL> if self . _maltegofy : <EOL> xform = MaltegoTransform ( ) <EOL> xform . addEntity ( '<STR_LIT>' , text ) <EOL> xform . returnOutput ( ) <EOL> else : <EOL> sys . stdout . write ( text ) <EOL> sys . stdout . write ( u'<STR_LIT:\n>' ) <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> parser = ArgumentParser ( ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , action = '<STR_LIT:version>' , version = '<STR_LIT>' + __version__ ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , default = None , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , default = None , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , dest = '<STR_LIT>' , default = False , action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' ) <EOL> args , _ = parser . parse_known_args ( ) <EOL> tb = ThreatButt ( args . maltego ) <EOL> if args . ioc : <EOL> tb . clown_strike_ioc ( args . ioc ) <EOL> elif args . md5 : <EOL> tb . bespoke_md5 ( args . md5 ) <EOL> else : <EOL> parser . print_help ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
