This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy path2021-slideteam_net.py
56 lines (44 loc) · 1.7 KB
/
2021-slideteam_net.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import collections
from parsers import base
class Parse(base.Parser):
"""
SlideTeam breach data parser
Source File SHA-1: adc3e5fa5baccd657be89979da97a4415c1cd33b slideteam.net_1.4m_magento_april2020.csv
Good Lines: 1,463,526
"""
name = "None"
web = "slideteam.net"
year = "2021"
def row_format(self, r: str) -> tuple:
"""
sample:
entity_id,website_id,email,group_id,increment_id,store_id,created_at,updated_at,is_active,
disable_auto_group_change,created_in,prefix,firstname,middlename,lastname,suffix,dob,
password_hash,rp_token,rp_token_created_at,default_billing,default_shipping,taxvat,
confirmation,gender,failures_num,first_failure,lock_expires,cid,uuid
name,website,year,domain,email,password,hash,salt
:param r:
:return:
"""
row = r.split(',')
email = row[2].strip()
domain = email.split('@')[1] if '@' in email else ''
try:
pw_hash = row[17].strip().split(':')[0]
except:
pw_hash = ''
try:
salt = row[17].strip().split(':')[1]
except:
salt = ''
#print(email + ':' + pw_hash + ':' + salt)
return self.name, self.web, int(self.year), domain, email, '', pw_hash, salt
def process_rows(self) -> collections.abc.Iterable[tuple]:
"""
Returns rows for the caller to process
"""
with open(self.source, 'r', encoding='utf-8', errors='ignore') as source:
for row in source:
if row is None:
continue
yield self.row_format(row)