mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 00:28:22 +00:00
chg: [tron] add TRON crytocurrency detection + correlation. Thanks @pventuzelo for the contribution
This commit is contained in:
parent
0c28b38638
commit
0dfd92bcd6
3 changed files with 14 additions and 8 deletions
|
@ -68,7 +68,7 @@ def get_object_all_subtypes(obj_type): # TODO Dynamic subtype
|
|||
if obj_type == 'chat-thread':
|
||||
return r_object.smembers(f'all_chat-thread:subtypes')
|
||||
if obj_type == 'cryptocurrency':
|
||||
return ['bitcoin', 'bitcoin-cash', 'dash', 'ethereum', 'litecoin', 'monero', 'zcash']
|
||||
return ['bitcoin', 'bitcoin-cash', 'dash', 'ethereum', 'litecoin', 'monero', 'tron', 'zcash']
|
||||
if obj_type == 'pgp':
|
||||
return ['key', 'mail', 'name']
|
||||
if obj_type == 'username':
|
||||
|
|
|
@ -60,7 +60,7 @@ class CryptoCurrency(AbstractSubtypeObject):
|
|||
pass
|
||||
|
||||
def is_valid_address(self):
|
||||
if self.type == 'bitcoin' or self.type == 'dash' or self.type == 'litecoin':
|
||||
if self.subtype == 'bitcoin' or self.subtype == 'dash' or self.subtype == 'litecoin' or self.subtype == 'tron':
|
||||
return check_base58_address(self.id)
|
||||
else:
|
||||
return True
|
||||
|
@ -80,6 +80,8 @@ class CryptoCurrency(AbstractSubtypeObject):
|
|||
return 'ZEC'
|
||||
elif self.subtype == 'dash':
|
||||
return 'DASH'
|
||||
elif self.subtype == 'tron':
|
||||
return 'TRX'
|
||||
return None
|
||||
|
||||
def get_link(self, flask_context=False):
|
||||
|
@ -140,7 +142,7 @@ class CryptoCurrency(AbstractSubtypeObject):
|
|||
|
||||
def get_all_subtypes():
|
||||
# return ail_core.get_object_all_subtypes(self.type)
|
||||
return ['bitcoin', 'bitcoin-cash', 'dash', 'ethereum', 'litecoin', 'monero', 'zcash']
|
||||
return ['bitcoin', 'bitcoin-cash', 'dash', 'ethereum', 'litecoin', 'monero', 'tron', 'zcash']
|
||||
|
||||
|
||||
# def build_crypto_regex(subtype, search_id):
|
||||
|
@ -172,6 +174,8 @@ def get_subtype_by_symbol(symbol):
|
|||
return 'zcash'
|
||||
elif symbol == 'DASH':
|
||||
return 'dash'
|
||||
elif symbol == 'TRX':
|
||||
return 'tron'
|
||||
return None
|
||||
|
||||
|
||||
|
@ -189,10 +193,6 @@ def get_all_cryptocurrencies_by_subtype(subtype):
|
|||
def sanitize_cryptocurrency_name_to_search(name_to_search, subtype): # TODO FILTER NAME + Key + mail
|
||||
if subtype == '':
|
||||
pass
|
||||
elif subtype == 'name':
|
||||
pass
|
||||
elif subtype == 'mail':
|
||||
pass
|
||||
return name_to_search
|
||||
|
||||
def search_cryptocurrency_by_name(name_to_search, subtype, r_pos=False):
|
||||
|
|
|
@ -92,7 +92,13 @@ CURRENCIES = {
|
|||
'regex': r'\b(?<![+/=])X[A-Za-z0-9]{33}(?![+/=])\b',
|
||||
'max_execution_time': default_max_execution_time,
|
||||
'tag': 'infoleak:automatic-detection="dash-address"',
|
||||
}
|
||||
},
|
||||
'tron': {
|
||||
'name': 'tron', # e.g. TYdds9VLDjUshf9tbsXSfGUZNzJSbbBeat
|
||||
'regex': r'\b(?<![+/=])T[0-9a-zA-Z]{33}(?![+/=])\b',
|
||||
'max_execution_time': default_max_execution_time,
|
||||
'tag': 'infoleak:automatic-detection="tron-address"',
|
||||
},
|
||||
}
|
||||
##################################
|
||||
##################################
|
||||
|
|
Loading…
Reference in a new issue