Implementation for different cryptocurrencies

pull/398/head
Miroslav Stampar 2019-09-20 15:06:39 +02:00
parent 3a9d0157e4
commit 5136ef12e2
1 changed files with 44 additions and 8 deletions

View File

@ -99,15 +99,51 @@ def search_crytocurrency(item_id, item_content):
default_max_execution_time = 30 default_max_execution_time = 30
regex_bitcoin_public_address = r'(?<![a-km-zA-HJ-NP-Z0-9])[13][a-km-zA-HJ-NP-Z0-9]{26,33}(?![a-km-zA-HJ-NP-Z0-9])'
cryptocurrency_dict = {'bitcoin': { cryptocurrency_dict = {
'name': 'bitcoin', 'bitcoin': {
'regex': regex_bitcoin_public_address, 'name': 'bitcoin', # e.g. 1NbEPRwbBZrFDsx1QW19iDs8jQLevzzcms
'max_execution_time': default_max_execution_time, 'regex': r'\b[13][A-Za-z0-9]{26,33}\b',
'tag': 'infoleak:automatic-detection="bitcoin-address"', 'max_execution_time': default_max_execution_time,
} 'tag': 'infoleak:automatic-detection="bitcoin-address"',
} },
'ethereum': {
'name': 'ethereum', # e.g. 0x8466b50B53c521d0B4B163d186596F94fB8466f1
'regex': r'\b0x[A-Za-z0-9]{40}\b',
'max_execution_time': default_max_execution_time,
'tag': 'infoleak:automatic-detection="ethereum-address"',
},
'bitcoin-cash': {
'name': 'bitcoin-cash', # e.g. bitcoincash:pp8skudq3x5hzw8ew7vzsw8tn4k8wxsqsv0lt0mf3g
'regex': r'bitcoincash:[a-za0-9]{42}\b',
'max_execution_time': default_max_execution_time,
'tag': 'infoleak:automatic-detection="bitcoin-cash-address"',
},
'litecoin': {
'name': 'litecoin', # e.g. MV5rN5EcX1imDS2gEh5jPJXeiW5QN8YrK3
'regex': r'\b[ML][A-Za-z0-9]{33}\b',
'max_execution_time': default_max_execution_time,
'tag': 'infoleak:automatic-detection="litecoin-address"',
},
'monero': {
'name': 'monero', # e.g. 47JLdZWteNPFQPaGGNsqLBAU3qmTcWbRda4yJvaPTCB8JbY18MNrcmfCcxrfDF61Dm7pJc4bHbBW57URjwTWzTRH2RfsUB4
'regex': r'\b4[A-Za-z0-9]{94}\b',
'max_execution_time': default_max_execution_time,
'tag': 'infoleak:automatic-detection="monero-address"',
},
'zcash': {
'name': 'zcash', # e.g. t1WvvNmFuKkUipcoEADNFvqamRrBec8rpUn
'regex': r'\bt[12][A-Za-z0-9]{33}\b',
'max_execution_time': default_max_execution_time,
'tag': 'infoleak:automatic-detection="zcash-address"',
},
'dash': {
'name': 'dash', # e.g. XmNfXq2kDmrNBTiDTofohRemwGur1WmgTT
'regex': r'\bX[a-za0-9]{33}\b',
'max_execution_time': default_max_execution_time,
'tag': 'infoleak:automatic-detection="dash-address"',
}
}
if __name__ == "__main__": if __name__ == "__main__":