new: [btc] Very simple BTC expansion

chg: [req] yara-python is preferred
pull/247/head
Steve Clement 2018-11-06 00:48:36 +09:00
parent 74bf2f2678
commit 7bafa939b0
3 changed files with 53 additions and 2 deletions

View File

@ -21,9 +21,10 @@ domaintools_api
pygeoip pygeoip
bs4 bs4
oauth2 oauth2
yara yara-python
sigmatools sigmatools
stix2-patterns stix2-patterns
maclookup maclookup
vulners vulners
psutil psutil
blockchain

View File

@ -1,3 +1,3 @@
from . import _vmray from . import _vmray
__all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns', 'domaintools', 'eupi', 'farsight_passivedns', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns', 'geoip_country', 'wiki', 'iprep', 'threatminer', 'otx', 'threatcrowd', 'vulndb', 'crowdstrike_falcon', 'yara_syntax_validator', 'hashdd', 'onyphe', 'onyphe_full', 'rbl', 'xforceexchange', 'sigma_syntax_validator', 'stix2_pattern_syntax_validator', 'sigma_queries', 'dbl_spamhaus', 'vulners', 'yara_query'] __all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns', 'btc', 'domaintools', 'eupi', 'farsight_passivedns', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns', 'geoip_country', 'wiki', 'iprep', 'threatminer', 'otx', 'threatcrowd', 'vulndb', 'crowdstrike_falcon', 'yara_syntax_validator', 'hashdd', 'onyphe', 'onyphe_full', 'rbl', 'xforceexchange', 'sigma_syntax_validator', 'stix2_pattern_syntax_validator', 'sigma_queries', 'dbl_spamhaus', 'vulners', 'yara_query']

View File

@ -0,0 +1,50 @@
import json
import blockchain
misperrors = {'error': 'Error'}
mispattributes = {'input': ['btc'], 'output': ['text']}
moduleinfo = {'version': '0.1', 'author': 'Steve Clement',
'description': 'Simple BTC expansion service to \
get quick information from MISP attributes',
'module-type': ['expansion', 'hover']}
moduleconfig = []
def handler(q=False):
if q is False:
return False
request = json.loads(q)
if request.get('btc'):
toquery = request['btc']
else:
return False
try:
address = blockchain.blockexplorer.get_address(toquery)
except Exception as e:
misperrors['error'] = e
return misperrors
finalBalance = address.final_balance*(1/100000000)
totalRX = address.total_received*(1/100000000)
totalTX = address.total_sent*(1/100000000)
totalTransactions = address.n_tx
answer = 'Current balance: \
{} - \
{} total received - \
{} total sent - \
{} transactions.\
'.format(finalBalance, totalRX, totalTX, totalTransactions)
r = {'results': [{'types': mispattributes['output'],
'values':[str(answer)]}]}
return r
def introspection():
return mispattributes
def version():
moduleinfo['config'] = moduleconfig
return moduleinfo