credsweeper 1.11.3__py3-none-any.whl → 1.11.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of credsweeper might be problematic. Click here for more details.
- credsweeper/__init__.py +1 -1
- credsweeper/__main__.py +1 -1
- credsweeper/app.py +21 -44
- credsweeper/common/constants.py +2 -5
- credsweeper/credentials/candidate_key.py +1 -1
- credsweeper/credentials/credential_manager.py +4 -3
- credsweeper/credentials/line_data.py +2 -5
- credsweeper/deep_scanner/abstract_scanner.py +269 -14
- credsweeper/deep_scanner/deb_scanner.py +55 -0
- credsweeper/deep_scanner/deep_scanner.py +39 -241
- credsweeper/deep_scanner/gzip_scanner.py +1 -1
- credsweeper/deep_scanner/jclass_scanner.py +74 -0
- credsweeper/deep_scanner/patch_scanner.py +48 -0
- credsweeper/deep_scanner/pkcs_scanner.py +41 -0
- credsweeper/deep_scanner/rpm_scanner.py +49 -0
- credsweeper/deep_scanner/sqlite3_scanner.py +79 -0
- credsweeper/file_handler/byte_content_provider.py +2 -2
- credsweeper/file_handler/content_provider.py +1 -1
- credsweeper/file_handler/data_content_provider.py +3 -4
- credsweeper/file_handler/diff_content_provider.py +2 -2
- credsweeper/file_handler/file_path_extractor.py +1 -1
- credsweeper/file_handler/files_provider.py +2 -4
- credsweeper/file_handler/patches_provider.py +5 -2
- credsweeper/file_handler/string_content_provider.py +2 -2
- credsweeper/file_handler/struct_content_provider.py +1 -1
- credsweeper/file_handler/text_content_provider.py +2 -2
- credsweeper/filters/__init__.py +1 -0
- credsweeper/filters/value_base64_encoded_pem_check.py +1 -1
- credsweeper/filters/value_base64_key_check.py +9 -14
- credsweeper/filters/value_entropy_base64_check.py +2 -6
- credsweeper/filters/value_json_web_key_check.py +37 -0
- credsweeper/filters/value_pattern_check.py +64 -16
- credsweeper/ml_model/features/file_extension.py +1 -1
- credsweeper/ml_model/ml_validator.py +43 -21
- credsweeper/rules/config.yaml +51 -9
- credsweeper/rules/rule.py +3 -3
- credsweeper/scanner/scan_type/multi_pattern.py +1 -2
- credsweeper/secret/config.json +6 -6
- credsweeper/utils/hop_stat.py +3 -3
- credsweeper/utils/pem_key_detector.py +6 -4
- credsweeper/utils/util.py +154 -79
- {credsweeper-1.11.3.dist-info → credsweeper-1.11.5.dist-info}/METADATA +3 -6
- {credsweeper-1.11.3.dist-info → credsweeper-1.11.5.dist-info}/RECORD +46 -40
- credsweeper/deep_scanner/pkcs12_scanner.py +0 -45
- {credsweeper-1.11.3.dist-info → credsweeper-1.11.5.dist-info}/WHEEL +0 -0
- {credsweeper-1.11.3.dist-info → credsweeper-1.11.5.dist-info}/entry_points.txt +0 -0
- {credsweeper-1.11.3.dist-info → credsweeper-1.11.5.dist-info}/licenses/LICENSE +0 -0
credsweeper/utils/util.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import ast
|
|
2
2
|
import base64
|
|
3
|
+
import contextlib
|
|
3
4
|
import json
|
|
4
5
|
import logging
|
|
5
6
|
import math
|
|
6
7
|
import os
|
|
8
|
+
import random
|
|
7
9
|
import re
|
|
8
10
|
import string
|
|
9
|
-
import struct
|
|
10
11
|
import tarfile
|
|
11
12
|
from dataclasses import dataclass
|
|
12
13
|
from pathlib import Path
|
|
@@ -15,6 +16,18 @@ from typing import Any, Dict, List, Tuple, Optional, Union
|
|
|
15
16
|
import numpy as np
|
|
16
17
|
import whatthepatch
|
|
17
18
|
import yaml
|
|
19
|
+
from cryptography.hazmat.primitives import hashes
|
|
20
|
+
from cryptography.hazmat.primitives.asymmetric import padding
|
|
21
|
+
from cryptography.hazmat.primitives.asymmetric.dh import DHPrivateKey, DHPublicKey
|
|
22
|
+
from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKey, DSAPublicKey
|
|
23
|
+
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKey, EllipticCurvePublicKey
|
|
24
|
+
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey, Ed25519PublicKey
|
|
25
|
+
from cryptography.hazmat.primitives.asymmetric.ed448 import Ed448PrivateKey, Ed448PublicKey
|
|
26
|
+
from cryptography.hazmat.primitives.asymmetric.types import PrivateKeyTypes
|
|
27
|
+
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PublicKey, X25519PrivateKey
|
|
28
|
+
from cryptography.hazmat.primitives.asymmetric.x448 import X448PublicKey, X448PrivateKey
|
|
29
|
+
from cryptography.hazmat.primitives.serialization import load_der_private_key
|
|
30
|
+
from cryptography.hazmat.primitives.serialization.pkcs12 import load_key_and_certificates
|
|
18
31
|
from lxml import etree
|
|
19
32
|
from typing_extensions import TypedDict
|
|
20
33
|
|
|
@@ -152,11 +165,10 @@ class Util:
|
|
|
152
165
|
@staticmethod
|
|
153
166
|
def is_known(data: Union[bytes, bytearray]) -> bool:
|
|
154
167
|
"""Returns True if any known binary format is found to prevent extra scan a file without an extension."""
|
|
155
|
-
if isinstance(data, (bytes, bytearray)):
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return True
|
|
168
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"\x7f\x45\x4c\x46") and 127 <= len(data):
|
|
169
|
+
# https://en.wikipedia.org/wiki/Executable_and_Linkable_Format
|
|
170
|
+
# minimal ELF is 127 bytes https://github.com/tchajed/minimal-elf
|
|
171
|
+
return True
|
|
160
172
|
return False
|
|
161
173
|
|
|
162
174
|
@staticmethod
|
|
@@ -165,14 +177,13 @@ class Util:
|
|
|
165
177
|
Returns True when two zeroes sequence is found in begin of data.
|
|
166
178
|
The sequence never exists in text format (UTF-8, UTF-16). UTF-32 is not supported.
|
|
167
179
|
"""
|
|
168
|
-
if 0 <= data.find(b"\0\0", 0, MAX_LINE_LENGTH):
|
|
180
|
+
if isinstance(data, (bytes, bytearray)) and 0 <= data.find(b"\0\0", 0, MAX_LINE_LENGTH):
|
|
169
181
|
return True
|
|
170
|
-
|
|
171
|
-
return False
|
|
182
|
+
return False
|
|
172
183
|
|
|
173
|
-
NOT_LATIN1_PRINTABLE_SET =
|
|
174
|
-
|
|
175
|
-
|
|
184
|
+
NOT_LATIN1_PRINTABLE_SET = set(range(0, 256)) \
|
|
185
|
+
.difference(set(x for x in string.printable.encode(ASCII))) \
|
|
186
|
+
.difference(set(x for x in range(0xA0, 0x100)))
|
|
176
187
|
|
|
177
188
|
@staticmethod
|
|
178
189
|
def is_latin1(data: Union[bytes, bytearray]) -> bool:
|
|
@@ -182,7 +193,7 @@ class Util:
|
|
|
182
193
|
non_latin1_cnt = sum(1 for x in data[:MAX_LINE_LENGTH] if x in Util.NOT_LATIN1_PRINTABLE_SET)
|
|
183
194
|
# experiment for 255217 binary files shown avg = 0.268264 ± 0.168767, so let choose minimal
|
|
184
195
|
chunk_len = min(MAX_LINE_LENGTH, len(data))
|
|
185
|
-
result = 0.1 > non_latin1_cnt / chunk_len
|
|
196
|
+
result = bool(0.1 > non_latin1_cnt / chunk_len)
|
|
186
197
|
return result
|
|
187
198
|
|
|
188
199
|
@staticmethod
|
|
@@ -229,7 +240,7 @@ class Util:
|
|
|
229
240
|
if binary_suggest and LATIN_1 == encoding and (Util.is_binary(content) or not Util.is_latin1(content)):
|
|
230
241
|
# LATIN_1 may convert data (bytes in range 0x80:0xFF are transformed)
|
|
231
242
|
# so skip this encoding when checking binaries
|
|
232
|
-
logger.warning("Binary file detected")
|
|
243
|
+
logger.warning("Binary file detected %s", repr(content[:8]))
|
|
233
244
|
break
|
|
234
245
|
text = content.decode(encoding, errors="strict")
|
|
235
246
|
if content != text.encode(encoding, errors="strict"):
|
|
@@ -379,26 +390,31 @@ class Util:
|
|
|
379
390
|
@staticmethod
|
|
380
391
|
def is_zip(data: Union[bytes, bytearray]) -> bool:
|
|
381
392
|
"""According https://en.wikipedia.org/wiki/List_of_file_signatures"""
|
|
382
|
-
if isinstance(data, (bytes, bytearray)) and
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
# empty archive - no sense to scan
|
|
388
|
-
|
|
389
|
-
|
|
393
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"PK") and 4 <= len(data):
|
|
394
|
+
if 0x03 == data[2] and 0x04 == data[3]:
|
|
395
|
+
# normal PK
|
|
396
|
+
return True
|
|
397
|
+
elif 0x05 == data[2] and 0x06 == data[3]:
|
|
398
|
+
# empty archive - no sense to scan in other scanners, so let it be a zip
|
|
399
|
+
return True
|
|
400
|
+
elif 0x07 == data[2] and 0x08 == data[3]:
|
|
390
401
|
# spanned archive - NOT SUPPORTED
|
|
391
|
-
|
|
392
|
-
return False
|
|
402
|
+
return False
|
|
393
403
|
return False
|
|
394
404
|
|
|
395
405
|
@staticmethod
|
|
396
406
|
def is_com(data: Union[bytes, bytearray]) -> bool:
|
|
397
407
|
"""According https://en.wikipedia.org/wiki/List_of_file_signatures"""
|
|
398
|
-
if isinstance(data, (bytes, bytearray)) and
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
408
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1"):
|
|
409
|
+
# Compound File Binary Format: doc, xls, ppt, msi, msg
|
|
410
|
+
return True
|
|
411
|
+
return False
|
|
412
|
+
|
|
413
|
+
@staticmethod
|
|
414
|
+
def is_rpm(data: Union[bytes, bytearray]) -> bool:
|
|
415
|
+
"""According https://en.wikipedia.org/wiki/List_of_file_signatures"""
|
|
416
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"\xED\xAB\xEE\xDB"):
|
|
417
|
+
return True
|
|
402
418
|
return False
|
|
403
419
|
|
|
404
420
|
@staticmethod
|
|
@@ -411,81 +427,105 @@ class Util:
|
|
|
411
427
|
or
|
|
412
428
|
0x20 == data[262] and 0x20 == data[263] and 0x00 == data[264]
|
|
413
429
|
):
|
|
414
|
-
|
|
430
|
+
with contextlib.suppress(Exception):
|
|
415
431
|
chksum = tarfile.nti(data[148:156]) # type: ignore
|
|
416
432
|
unsigned_chksum, signed_chksum = tarfile.calc_chksums(data) # type: ignore
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
433
|
+
if chksum == unsigned_chksum or chksum == signed_chksum:
|
|
434
|
+
return True
|
|
435
|
+
return False
|
|
436
|
+
|
|
437
|
+
@staticmethod
|
|
438
|
+
def is_deb(data: Union[bytes, bytearray]) -> bool:
|
|
439
|
+
"""According https://en.wikipedia.org/wiki/Deb_(file_format)"""
|
|
440
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"!<arch>\n"):
|
|
441
|
+
return True
|
|
420
442
|
return False
|
|
421
443
|
|
|
422
444
|
@staticmethod
|
|
423
445
|
def is_bzip2(data: Union[bytes, bytearray]) -> bool:
|
|
424
446
|
"""According https://en.wikipedia.org/wiki/Bzip2"""
|
|
425
|
-
if isinstance(data, (bytes, bytearray)) and 10 <= len(data)
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
return True
|
|
447
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"\x42\x5A\x68") and 10 <= len(data) \
|
|
448
|
+
and 0x31 <= data[3] <= 0x39 \
|
|
449
|
+
and 0x31 == data[4] and 0x41 == data[5] and 0x59 == data[6] \
|
|
450
|
+
and 0x26 == data[7] and 0x53 == data[8] and 0x59 == data[9]:
|
|
451
|
+
return True
|
|
431
452
|
return False
|
|
432
453
|
|
|
433
454
|
@staticmethod
|
|
434
455
|
def is_gzip(data: Union[bytes, bytearray]) -> bool:
|
|
435
456
|
"""According https://www.rfc-editor.org/rfc/rfc1952"""
|
|
436
|
-
if isinstance(data, (bytes, bytearray)) and
|
|
437
|
-
|
|
438
|
-
return True
|
|
457
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"\x1F\x8B\x08"):
|
|
458
|
+
return True
|
|
439
459
|
return False
|
|
440
460
|
|
|
441
461
|
@staticmethod
|
|
442
462
|
def is_pdf(data: Union[bytes, bytearray]) -> bool:
|
|
443
463
|
"""According https://en.wikipedia.org/wiki/List_of_file_signatures - pdf"""
|
|
444
|
-
if isinstance(data, (bytes, bytearray)) and
|
|
445
|
-
|
|
446
|
-
|
|
464
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"%PDF-"):
|
|
465
|
+
return True
|
|
466
|
+
return False
|
|
467
|
+
|
|
468
|
+
@staticmethod
|
|
469
|
+
def is_jclass(data: Union[bytes, bytearray]) -> bool:
|
|
470
|
+
"""According https://en.wikipedia.org/wiki/List_of_file_signatures - java class"""
|
|
471
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"\xCA\xFE\xBA\xBE"):
|
|
472
|
+
return True
|
|
447
473
|
return False
|
|
448
474
|
|
|
449
475
|
@staticmethod
|
|
450
476
|
def is_jks(data: Union[bytes, bytearray]) -> bool:
|
|
451
477
|
"""According https://en.wikipedia.org/wiki/List_of_file_signatures - jks"""
|
|
452
|
-
if isinstance(data, (bytes, bytearray)) and
|
|
453
|
-
|
|
454
|
-
return True
|
|
478
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"\xFE\xED\xFE\xED"):
|
|
479
|
+
return True
|
|
455
480
|
return False
|
|
456
481
|
|
|
457
482
|
@staticmethod
|
|
458
483
|
def is_lzma(data: Union[bytes, bytearray]) -> bool:
|
|
459
484
|
"""According https://en.wikipedia.org/wiki/List_of_file_signatures - lzma also xz"""
|
|
460
|
-
if isinstance(data, (bytes, bytearray)) and
|
|
461
|
-
|
|
462
|
-
|
|
485
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith((b"\xFD7zXZ\x00", b"\x5D\x00\x00")):
|
|
486
|
+
return True
|
|
487
|
+
return False
|
|
488
|
+
|
|
489
|
+
@classmethod
|
|
490
|
+
def is_sqlite3(cls, data):
|
|
491
|
+
"""According https://en.wikipedia.org/wiki/List_of_file_signatures - SQLite Database"""
|
|
492
|
+
if isinstance(data, (bytes, bytearray)) and data.startswith(b"SQLite format 3\0"):
|
|
493
|
+
return True
|
|
463
494
|
return False
|
|
464
495
|
|
|
465
496
|
@staticmethod
|
|
466
|
-
def is_asn1(data: Union[bytes, bytearray]) ->
|
|
467
|
-
"""Only sequence type 0x30 and size correctness
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
if
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
len_bytes = data[2:2 + byte_len]
|
|
478
|
-
try:
|
|
479
|
-
long_size = struct.unpack(">h", len_bytes)
|
|
480
|
-
except struct.error:
|
|
481
|
-
long_size = (-1,) # yapf: disable
|
|
482
|
-
length = long_size[0]
|
|
483
|
-
elif 0x80 < length and 1 == byte_len: # small size
|
|
484
|
-
length = data[2]
|
|
497
|
+
def is_asn1(data: Union[bytes, bytearray]) -> int:
|
|
498
|
+
"""Only sequence type 0x30 and size correctness are checked
|
|
499
|
+
Returns size of ASN1 data over 128 bytes or 0 if no interested data
|
|
500
|
+
"""
|
|
501
|
+
if isinstance(data, (bytes, bytearray)) and 2 <= len(data) and 0x30 == data[0]:
|
|
502
|
+
# https://www.oss.com/asn1/resources/asn1-made-simple/asn1-quick-reference/basic-encoding-rules.html#Lengths
|
|
503
|
+
length = data[1]
|
|
504
|
+
if 0x80 == length:
|
|
505
|
+
if data.endswith(b"\x00\x00"):
|
|
506
|
+
# assume, all data are ASN1 of various size
|
|
507
|
+
return len(data)
|
|
485
508
|
else:
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
509
|
+
# skip the case where the ASN1 size is smaller than the actual data
|
|
510
|
+
return 0
|
|
511
|
+
elif 0x80 < length:
|
|
512
|
+
byte_len = 0x7F & length
|
|
513
|
+
len_limit = 2 + byte_len
|
|
514
|
+
if 4 >= byte_len and len(data) >= len_limit:
|
|
515
|
+
length = 0
|
|
516
|
+
for i in range(2, len_limit):
|
|
517
|
+
length <<= 8
|
|
518
|
+
length |= data[i]
|
|
519
|
+
if len(data) >= length + len_limit:
|
|
520
|
+
return length + len_limit
|
|
521
|
+
else:
|
|
522
|
+
# unsupported huge size
|
|
523
|
+
return 0
|
|
524
|
+
else:
|
|
525
|
+
# less than 0x80
|
|
526
|
+
if len(data) >= length + 2:
|
|
527
|
+
return length + 2
|
|
528
|
+
return 0
|
|
489
529
|
|
|
490
530
|
@staticmethod
|
|
491
531
|
def is_html(data: Union[bytes, bytearray]) -> bool:
|
|
@@ -540,12 +580,12 @@ class Util:
|
|
|
540
580
|
@staticmethod
|
|
541
581
|
def is_eml(data: Union[bytes, bytearray]) -> bool:
|
|
542
582
|
"""According to https://datatracker.ietf.org/doc/html/rfc822 lookup the fields: Date, From, To or Subject"""
|
|
543
|
-
if isinstance(data, (bytes, bytearray))
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
583
|
+
if isinstance(data, (bytes, bytearray)) \
|
|
584
|
+
and (b"\nDate:" in data or data.startswith(b"Date:")) \
|
|
585
|
+
and (b"\nFrom:" in data or data.startswith(b"From:")) \
|
|
586
|
+
and (b"\nTo:" in data or data.startswith(b"To:")) \
|
|
587
|
+
and (b"\nSubject:" in data or data.startswith(b"Subject:")):
|
|
588
|
+
return True
|
|
549
589
|
return False
|
|
550
590
|
|
|
551
591
|
@staticmethod
|
|
@@ -658,10 +698,13 @@ class Util:
|
|
|
658
698
|
result = ast.unparse(src).splitlines()
|
|
659
699
|
return result
|
|
660
700
|
|
|
701
|
+
PEM_CLEANING_PATTERN = re.compile(r"\\[tnrvf]")
|
|
702
|
+
WHITESPACE_TRANS_TABLE = str.maketrans('', '', string.whitespace)
|
|
703
|
+
|
|
661
704
|
@staticmethod
|
|
662
705
|
def decode_base64(text: str, padding_safe: bool = False, urlsafe_detect=False) -> bytes:
|
|
663
706
|
"""decode text to bytes with / without padding detect and urlsafe symbols"""
|
|
664
|
-
value = text
|
|
707
|
+
value = text.translate(Util.WHITESPACE_TRANS_TABLE)
|
|
665
708
|
if padding_safe:
|
|
666
709
|
pad_num = 0x3 & len(value)
|
|
667
710
|
if pad_num:
|
|
@@ -672,6 +715,38 @@ class Util:
|
|
|
672
715
|
decoded = base64.b64decode(value, validate=True)
|
|
673
716
|
return decoded
|
|
674
717
|
|
|
718
|
+
@staticmethod
|
|
719
|
+
def load_pk(data: bytes, password: Optional[bytes] = None) -> Optional[PrivateKeyTypes]:
|
|
720
|
+
"""Try to load private key from PKCS1, PKCS8 and PKCS12 formats"""
|
|
721
|
+
with contextlib.suppress(Exception):
|
|
722
|
+
# PKCS1, PKCS8 probes
|
|
723
|
+
private_key = load_der_private_key(data, password)
|
|
724
|
+
return private_key
|
|
725
|
+
with contextlib.suppress(Exception):
|
|
726
|
+
# PKCS12 probe
|
|
727
|
+
private_key, _certificate, _additional_certificates = load_key_and_certificates(data, password)
|
|
728
|
+
return private_key
|
|
729
|
+
return None
|
|
730
|
+
|
|
731
|
+
RANDOM_DATA = random.randbytes(20)
|
|
732
|
+
|
|
733
|
+
@staticmethod
|
|
734
|
+
def check_pk(pkey: PrivateKeyTypes) -> bool:
|
|
735
|
+
"""Check private key with encrypt-decrypt random data"""
|
|
736
|
+
if isinstance(pkey, (EllipticCurvePrivateKey, DSAPrivateKey, Ed448PrivateKey, Ed25519PrivateKey, DHPrivateKey,
|
|
737
|
+
X448PrivateKey, X25519PrivateKey)):
|
|
738
|
+
# One does not simply perform check the keys
|
|
739
|
+
return True
|
|
740
|
+
if isinstance(pkey, (EllipticCurvePublicKey, DSAPublicKey, Ed448PublicKey, Ed25519PublicKey, DHPublicKey,
|
|
741
|
+
X448PublicKey, X25519PublicKey)) or not pkey:
|
|
742
|
+
# These aren't the keys we're looking for
|
|
743
|
+
return False
|
|
744
|
+
# DSA, RSA
|
|
745
|
+
pd = padding.OAEP(mgf=padding.MGF1(algorithm=hashes.SHA1()), algorithm=hashes.SHA1(), label=None)
|
|
746
|
+
ciphertext = pkey.public_key().encrypt(Util.RANDOM_DATA, padding=pd)
|
|
747
|
+
refurb = pkey.decrypt(ciphertext, padding=pd)
|
|
748
|
+
return bool(refurb == Util.RANDOM_DATA)
|
|
749
|
+
|
|
675
750
|
@staticmethod
|
|
676
751
|
def get_chunks(line_len: int) -> List[Tuple[int, int]]:
|
|
677
752
|
"""Returns chunks positions for given line length"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: credsweeper
|
|
3
|
-
Version: 1.11.
|
|
3
|
+
Version: 1.11.5
|
|
4
4
|
Summary: Credential Sweeper
|
|
5
5
|
Project-URL: Homepage, https://github.com/Samsung/CredSweeper
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/Samsung/CredSweeper/issues
|
|
@@ -37,6 +37,7 @@ Requires-Dist: python-dateutil
|
|
|
37
37
|
Requires-Dist: python-docx
|
|
38
38
|
Requires-Dist: python-pptx
|
|
39
39
|
Requires-Dist: pyyaml
|
|
40
|
+
Requires-Dist: rpmfile
|
|
40
41
|
Requires-Dist: whatthepatch
|
|
41
42
|
Requires-Dist: xlrd
|
|
42
43
|
Description-Content-Type: text/markdown
|
|
@@ -140,11 +141,7 @@ cat output.json
|
|
|
140
141
|
"value_start": 12,
|
|
141
142
|
"value_end": 19,
|
|
142
143
|
"variable": "password",
|
|
143
|
-
"
|
|
144
|
-
"iterator": "BASE64_CHARS",
|
|
145
|
-
"entropy": 2.120589933192232,
|
|
146
|
-
"valid": false
|
|
147
|
-
}
|
|
144
|
+
"entropy": 2.12059
|
|
148
145
|
}
|
|
149
146
|
]
|
|
150
147
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
credsweeper/__init__.py,sha256=
|
|
2
|
-
credsweeper/__main__.py,sha256=
|
|
3
|
-
credsweeper/app.py,sha256=
|
|
1
|
+
credsweeper/__init__.py,sha256=S6PVgyvVpXL4kDDCKSMW68iD69swkC7zB295w-9P8_U,632
|
|
2
|
+
credsweeper/__main__.py,sha256=W8T3LHhTjzdsn7tYXX9_cPRfgnNX1_Qr02Mw_s2IfQM,17221
|
|
3
|
+
credsweeper/app.py,sha256=GSKNb-sR7N4qTnZAyDsYVLmQm0zVMyQb4fQrxYLJfsk,20917
|
|
4
4
|
credsweeper/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
credsweeper/common/__init__.py,sha256=mYiHEDV0hSeWcFx0Wb8oIRDCPR92ben0mCuC9-gCTgI,184
|
|
6
|
-
credsweeper/common/constants.py,sha256=
|
|
6
|
+
credsweeper/common/constants.py,sha256=ZCE5VCpCMx1qmhVEfh2VYmjofQfaYzVip-ej0qJEPT8,5475
|
|
7
7
|
credsweeper/common/keyword_checklist.py,sha256=6EKNdMMryZykedAOhEc-MF1byi5oXmAiljq61T_nco4,2258
|
|
8
8
|
credsweeper/common/keyword_checklist.txt,sha256=a8GW-wF6D83uVFYxMWEsUFlth6c1B_KDpF8_Xpj0mE8,7169
|
|
9
9
|
credsweeper/common/keyword_pattern.py,sha256=ZBJshY8hEP8CUFWQIrqQHcSLwPnUBTblNgFMOEoYUCY,3285
|
|
@@ -14,26 +14,31 @@ credsweeper/credentials/__init__.py,sha256=bn7BEgGqKcwlCLi5-7_sXlBmIpK7s5RrNcG_e
|
|
|
14
14
|
credsweeper/credentials/augment_candidates.py,sha256=0YGjpTYRWQpzJcxpvOt_ytKBOWtHkOdMIHbMnJX22Ag,802
|
|
15
15
|
credsweeper/credentials/candidate.py,sha256=a6CNNKqCEnOm_EEHVFBPGOgqheXegvTDh1TWL_gT-KQ,5508
|
|
16
16
|
credsweeper/credentials/candidate_group_generator.py,sha256=rN_c4-ogPz0h-z2aPgzbu0hUz68L69xfd9oyzkooTUc,1243
|
|
17
|
-
credsweeper/credentials/candidate_key.py,sha256=
|
|
18
|
-
credsweeper/credentials/credential_manager.py,sha256=
|
|
19
|
-
credsweeper/credentials/line_data.py,sha256=
|
|
17
|
+
credsweeper/credentials/candidate_key.py,sha256=NsYGPqqjfm6z2MGtcQbiUGiWmKUCuzflXlZYf_vn_84,917
|
|
18
|
+
credsweeper/credentials/credential_manager.py,sha256=cHEfIs2xb3n400D5Q6AC5CDM9jzzK_Fcb-VKVRh_H2U,4187
|
|
19
|
+
credsweeper/credentials/line_data.py,sha256=8-9sgK3n1gMg_L63Ked8f5PlIpimWTqnYCNCEmx6WZ0,20622
|
|
20
20
|
credsweeper/deep_scanner/__init__.py,sha256=Lp94BjQPZTgEa77E0v6xZaXZvQf2A-QTHsjqCzZxUFw,62
|
|
21
|
-
credsweeper/deep_scanner/abstract_scanner.py,sha256=
|
|
21
|
+
credsweeper/deep_scanner/abstract_scanner.py,sha256=oLT2bNof-5-sycXPHYpLKlfe2ULhU1lQCGk0BcD_6-s,15794
|
|
22
22
|
credsweeper/deep_scanner/byte_scanner.py,sha256=oHeA8mGe995SHqWvONhTDBIE5j50TQASHA9Mv6LHYuQ,1125
|
|
23
23
|
credsweeper/deep_scanner/bzip2_scanner.py,sha256=74RsjmeuffEuxmKl04lXIZt3q_Zvxj-gLHXACqVSU_o,1619
|
|
24
|
-
credsweeper/deep_scanner/
|
|
24
|
+
credsweeper/deep_scanner/deb_scanner.py,sha256=oX7xR_yl8JIno_n087RO1mD2mXrkKsOaFfkAqqiUFgg,2485
|
|
25
|
+
credsweeper/deep_scanner/deep_scanner.py,sha256=urWeFHeZrDgZmnNlSoFSPmtbDJowr1ukNUd9GiRcJ6s,6289
|
|
25
26
|
credsweeper/deep_scanner/docx_scanner.py,sha256=_xIuw5SkGU1wO_9C3fXVycM-iSmU9qUzWa53etuFvMI,4153
|
|
26
27
|
credsweeper/deep_scanner/eml_scanner.py,sha256=iRLr2yvBWGktT2oXxl-haqnhJN3tglO1Mej10hFk0as,3512
|
|
27
28
|
credsweeper/deep_scanner/encoder_scanner.py,sha256=ULv9AgfG_ZLCYYgyUeQicna9u1i-rlmOiE4euvqahmY,1315
|
|
28
|
-
credsweeper/deep_scanner/gzip_scanner.py,sha256=
|
|
29
|
+
credsweeper/deep_scanner/gzip_scanner.py,sha256=DwG3rSC2YxvE6aTiSKDXoqMSM1wCag_1AX2NYnDQYTM,1695
|
|
29
30
|
credsweeper/deep_scanner/html_scanner.py,sha256=Mh6gUxvlMnI4Kys7V8ZBBExQSsOYqYUbil7FYiXX4lc,1486
|
|
31
|
+
credsweeper/deep_scanner/jclass_scanner.py,sha256=yv1An74TYSLQPil3BAL7emc2rgE1zB6Kbb3NOo65eBk,2971
|
|
30
32
|
credsweeper/deep_scanner/jks_scanner.py,sha256=1BqHfOmqcznrhMN-9aH-L8yamIAj72OYr7_DBuuj0_c,1867
|
|
31
33
|
credsweeper/deep_scanner/lang_scanner.py,sha256=6d_n3Gjj8HPvNayalDn48QGbRMofmOwFUyS6V8JQsVU,1340
|
|
32
34
|
credsweeper/deep_scanner/lzma_scanner.py,sha256=RTx9AdIJNblKupXLtO-K6vz8RBO9z_vYc0A15Ij0db4,1693
|
|
33
35
|
credsweeper/deep_scanner/mxfile_scanner.py,sha256=Qq2-9nfqYr63chDzzKsMIyHKvagPcWIpF4ngLFGwLyM,2098
|
|
36
|
+
credsweeper/deep_scanner/patch_scanner.py,sha256=f371z_6-fxl5AESWB3BGU7_mozfHwTF3NdsaHFB8MME,2255
|
|
34
37
|
credsweeper/deep_scanner/pdf_scanner.py,sha256=LMyIoVJPNFOFnAfcZ5Akr7PTWSUBNPT6GtQB1U5hI0g,3048
|
|
35
|
-
credsweeper/deep_scanner/
|
|
38
|
+
credsweeper/deep_scanner/pkcs_scanner.py,sha256=nUdCUuCaYn5hGTFtcYhmFZSgLTw0UHaSTjh6UFz5l88,1734
|
|
36
39
|
credsweeper/deep_scanner/pptx_scanner.py,sha256=aMX6GgnUEShonHjlqhaI5w970b-2yxmKsld5kY1XdeQ,1828
|
|
40
|
+
credsweeper/deep_scanner/rpm_scanner.py,sha256=MyLQMBxdAatum5_zRNK9VFbqXJ9u16xqf3jmjUm4TUM,2288
|
|
41
|
+
credsweeper/deep_scanner/sqlite3_scanner.py,sha256=9XaFTtSZoiaKKPIrDpxDsFIh8m3wILR3c2927dWgXCQ,3510
|
|
37
42
|
credsweeper/deep_scanner/tar_scanner.py,sha256=L3a9OUhQQweDNLVbe_LNLhldtVeU8DlS0Ux3ip_KN2w,2425
|
|
38
43
|
credsweeper/deep_scanner/tmx_scanner.py,sha256=6BsMysSSSJrxtssh4bf1e4vwpps7yXDDvByFkyLhC_o,1946
|
|
39
44
|
credsweeper/deep_scanner/xlsx_scanner.py,sha256=Ck8j14OWy9LTXK0GBASCdPq9VhZe5ceUv0uZShFFpo8,2706
|
|
@@ -42,18 +47,18 @@ credsweeper/deep_scanner/zip_scanner.py,sha256=rWNV43OV8FTpXGMkAlRCwnnaJ-WdiIpre
|
|
|
42
47
|
credsweeper/file_handler/__init__.py,sha256=fAQvFQvgPQ7lAPVjPWmAdKArRCS5pB4QEk01jkVVB-E,662
|
|
43
48
|
credsweeper/file_handler/abstract_provider.py,sha256=sl0XrlbRDak885UzD7HBruXAD9vJHso-glqI_ekZxuo,1437
|
|
44
49
|
credsweeper/file_handler/analysis_target.py,sha256=FEznSNcUbTaqGa3ZKy8FusdqDR7CxFX1fwIrA_LdwoY,2752
|
|
45
|
-
credsweeper/file_handler/byte_content_provider.py,sha256=
|
|
46
|
-
credsweeper/file_handler/content_provider.py,sha256=
|
|
47
|
-
credsweeper/file_handler/data_content_provider.py,sha256=
|
|
50
|
+
credsweeper/file_handler/byte_content_provider.py,sha256=aqYndCeDSF1BLEYUzwcl3BASuuUr1vlU6l-Eo73eEw4,1930
|
|
51
|
+
credsweeper/file_handler/content_provider.py,sha256=HYlAL1wRZeQe49upKt4_Y00Gsja88jWKeIeNbkm2hR0,3888
|
|
52
|
+
credsweeper/file_handler/data_content_provider.py,sha256=fKeScBiHxC4Fj4Ty48HoMFI3eK_t3RKYrBFCNUwkhDc,17662
|
|
48
53
|
credsweeper/file_handler/descriptor.py,sha256=LQHjzmRL0fl8mlKwA--Nl_D4mKFtg9VsUJnWZqtjFhU,185
|
|
49
|
-
credsweeper/file_handler/diff_content_provider.py,sha256
|
|
50
|
-
credsweeper/file_handler/file_path_extractor.py,sha256=
|
|
51
|
-
credsweeper/file_handler/files_provider.py,sha256=
|
|
52
|
-
credsweeper/file_handler/patches_provider.py,sha256=
|
|
53
|
-
credsweeper/file_handler/string_content_provider.py,sha256=
|
|
54
|
-
credsweeper/file_handler/struct_content_provider.py,sha256=
|
|
55
|
-
credsweeper/file_handler/text_content_provider.py,sha256=
|
|
56
|
-
credsweeper/filters/__init__.py,sha256=
|
|
54
|
+
credsweeper/file_handler/diff_content_provider.py,sha256=FtlHa7Y5LrXrzQNFOeRhVqQjtbWe0m82wmXHHjPXntw,3209
|
|
55
|
+
credsweeper/file_handler/file_path_extractor.py,sha256=lSwbl2Q4eTEo8U-SghzijoFL6H0q3W7LtE-iGF3Qkvg,6889
|
|
56
|
+
credsweeper/file_handler/files_provider.py,sha256=qpaIQw9JWGrxv-mQyD_1KPoWppyaZYaBoZJDt3DykFU,2569
|
|
57
|
+
credsweeper/file_handler/patches_provider.py,sha256=uI7UoN8R2DA1ZB4u-Y2bF2YcIU4-wA1g7eAQTavApE0,3121
|
|
58
|
+
credsweeper/file_handler/string_content_provider.py,sha256=e7mHLwa5bkHthI3hr5pP7ZlyoFfPeeVbmTAlZG2-xB4,2481
|
|
59
|
+
credsweeper/file_handler/struct_content_provider.py,sha256=H1ZhSosaWJEOtzWYC1rve0glrJUu2UDYjmOx-9DDNxs,1595
|
|
60
|
+
credsweeper/file_handler/text_content_provider.py,sha256=5Qg_4LIYB3O4MZo4Gqtno4o8rPU2hPy6tOR_7wS87Kw,3003
|
|
61
|
+
credsweeper/filters/__init__.py,sha256=PxkARBwh1n8dIi5vtAXn7INdxA0YlLbaAoYfoEwU_UA,3345
|
|
57
62
|
credsweeper/filters/filter.py,sha256=CqZbTsIDNVVwQyOjNekgNr_i1nPS4foutm0AvGAjM5M,826
|
|
58
63
|
credsweeper/filters/line_git_binary_check.py,sha256=G5N-woSLXC1mdiD80AhXbOpJCjGwtvFwFwMmRu87qlY,1595
|
|
59
64
|
credsweeper/filters/line_specific_key_check.py,sha256=rM66tPmUCXPaCUpNokIkJukOyxOL4FB8ig74ezYrbBs,1536
|
|
@@ -64,8 +69,8 @@ credsweeper/filters/value_atlassian_token_check.py,sha256=rAuMC5JUxnXZwPxoKtrwFV
|
|
|
64
69
|
credsweeper/filters/value_azure_token_check.py,sha256=GlIqmzinjtQ4GU8-_ZyFTM2uo1ylRxRFKqnJaW_0110,1946
|
|
65
70
|
credsweeper/filters/value_base32_data_check.py,sha256=nS_X5vb5e0fXnjxGjyGE9wedmAj6B14AG8dEjRClREQ,1390
|
|
66
71
|
credsweeper/filters/value_base64_data_check.py,sha256=J5dMgJsfs13MxijOMqGLYU8PZz5eEDUBrWVKp0mE3T0,1449
|
|
67
|
-
credsweeper/filters/value_base64_encoded_pem_check.py,sha256=
|
|
68
|
-
credsweeper/filters/value_base64_key_check.py,sha256=
|
|
72
|
+
credsweeper/filters/value_base64_encoded_pem_check.py,sha256=k7J6FY3SCdgnHRkoSCPMKcUgyTOOTl4t4tHZI6hvSiA,1600
|
|
73
|
+
credsweeper/filters/value_base64_key_check.py,sha256=yu3j34TT5dv-ttRS5bGEqgl0AWS414O2Knqn9tKtTSE,1904
|
|
69
74
|
credsweeper/filters/value_base64_part_check.py,sha256=wV_qGv9xK4H8EB903Qw5xbVtjAQ19ZZKhhHFoQ53AT8,4958
|
|
70
75
|
credsweeper/filters/value_blocklist_check.py,sha256=CSsD68QRF1zFLM2MB5pGRRs95O8IepZ9AUZYdxlBf-c,1145
|
|
71
76
|
credsweeper/filters/value_camel_case_check.py,sha256=cCBogfL5X9ufAbkl5QwqN6qvHz4XYaeaENC6ew4m4Ac,1233
|
|
@@ -75,7 +80,7 @@ credsweeper/filters/value_dictionary_value_length_check.py,sha256=lQj6pmKitFJXqB
|
|
|
75
80
|
credsweeper/filters/value_discord_bot_check.py,sha256=Zv8SIkYGvd2mn6MGo4JGH-amGnJJBXqa992aQ9ZXlK4,1480
|
|
76
81
|
credsweeper/filters/value_entropy_base32_check.py,sha256=PKFp6eOXZ8yiK00JNxWPbxw4LnAeE16u39ePNozTGEg,642
|
|
77
82
|
credsweeper/filters/value_entropy_base36_check.py,sha256=ZHa_AUtskBCmfhUQwjgkolB1OuB2t1GRDi8SDl7o_A8,651
|
|
78
|
-
credsweeper/filters/value_entropy_base64_check.py,sha256=
|
|
83
|
+
credsweeper/filters/value_entropy_base64_check.py,sha256=Kp6AU1rOqEnO4MJ7xoQhMSbvoJKMBBcEQvZz_JsX_kY,812
|
|
79
84
|
credsweeper/filters/value_entropy_base_check.py,sha256=Z4ymeTPs5tPL37BtQQe05yp6kyY8c_caYZXwpOF9-ZU,1241
|
|
80
85
|
credsweeper/filters/value_file_path_check.py,sha256=2hwqr2xCwzuL6Ya6X1uyClQld0RSMBGRJvAJCKPcRzw,3512
|
|
81
86
|
credsweeper/filters/value_github_check.py,sha256=nRYvTxvhFo2PCMwneg5K4I7gJ3tBNzOOYDEhun0pxwg,1441
|
|
@@ -83,13 +88,14 @@ credsweeper/filters/value_grafana_check.py,sha256=4wagCuVCSDoO5Kc0-U4Y7eUvBlYUAJ
|
|
|
83
88
|
credsweeper/filters/value_grafana_service_check.py,sha256=fL8v4pXS-GopeE_WKNB6rlm9XFzdNapCxO5dH0Z14B4,1133
|
|
84
89
|
credsweeper/filters/value_hex_number_check.py,sha256=XuMw6zBQP4WQoH3Y7a4DZnKMVVVC09_bAfB21I8FBfA,976
|
|
85
90
|
credsweeper/filters/value_jfrog_token_check.py,sha256=jugEhQBRjd6Zb9VYoQqBlki1TyeNoupIrzXB-frpjho,1656
|
|
91
|
+
credsweeper/filters/value_json_web_key_check.py,sha256=KegWqDC3oSi5FgsBWd2kH_GrojBSWwV9NPqHiZxfh7A,1325
|
|
86
92
|
credsweeper/filters/value_json_web_token_check.py,sha256=Tvu0rsb8NJ2jnZc5EWZ_dbJCQZlSDdBoGpB0WM18n64,2829
|
|
87
93
|
credsweeper/filters/value_last_word_check.py,sha256=ZEJ-pqpMLSBQE_bCz325WZK5g_fXbfk6bv5Csz0J_MM,900
|
|
88
94
|
credsweeper/filters/value_method_check.py,sha256=mkTmSGnQBKtELTpNrKh6v_5VyORrVLVH8Zps7nJI4e4,1113
|
|
89
95
|
credsweeper/filters/value_not_allowed_pattern_check.py,sha256=Hq0ToZ_XL70N4CAwbSG0XD9mRTsqIhTqgT5YWlgfwwg,1178
|
|
90
96
|
credsweeper/filters/value_not_part_encoded_check.py,sha256=LyebBZlR1aXFkOSDOq1jnqJKLDmEI8nHr5OXa3J09b0,3805
|
|
91
97
|
credsweeper/filters/value_number_check.py,sha256=UxRQ24XFKPpEbpkOH3_YgrrBSBTeP9WwYRGWB9Ez-V0,1130
|
|
92
|
-
credsweeper/filters/value_pattern_check.py,sha256=
|
|
98
|
+
credsweeper/filters/value_pattern_check.py,sha256=sPl2c_bmucUj4VCBgAHM6q4YixQcfrjrJR0HDmmIFKM,5375
|
|
93
99
|
credsweeper/filters/value_similarity_check.py,sha256=qa2NPSpyP8RIqllXIlky66Bk85PDU2ss_dQW-vcm3Qw,1172
|
|
94
100
|
credsweeper/filters/value_split_keyword_check.py,sha256=MY-EZmHSYzuglxVug9MQYtwWlMTAAwr1L3lyaOaT6VE,1113
|
|
95
101
|
credsweeper/filters/value_string_type_check.py,sha256=QmgniKlNTPKB4fLrvj9QxMmt8yQkmB9gxtZv50J4YYI,1985
|
|
@@ -112,11 +118,11 @@ credsweeper/logger/logger.py,sha256=E427IHUgX5jOCUKYlXKwQiyXNIUSYBpP45ldNCfVjFw,
|
|
|
112
118
|
credsweeper/ml_model/__init__.py,sha256=Bvw_WgOmNwzFrBP0tKgWapasYcU7IRT0zMpbmWD6DwU,58
|
|
113
119
|
credsweeper/ml_model/ml_config.json,sha256=QDPNRl-QT9TY7NPgOjjsekDdPvxI3IZkyXcr5VSa6eY,16049
|
|
114
120
|
credsweeper/ml_model/ml_model.onnx,sha256=1z_vsA2d74qvEUfDDxGGsWmUvRLotd7AM1C7QlkO1bE,10979845
|
|
115
|
-
credsweeper/ml_model/ml_validator.py,sha256=
|
|
121
|
+
credsweeper/ml_model/ml_validator.py,sha256=ROAMlC394DCVNqqXxqT8y-jbx9y1oKuWY9yMvzFJjZI,12881
|
|
116
122
|
credsweeper/ml_model/features/__init__.py,sha256=OtWcKTbXsM4hi4P8G6f-T_FC6pQVOz_le2FbN2Kak1c,1020
|
|
117
123
|
credsweeper/ml_model/features/entropy_evaluation.py,sha256=Mzv6bSui2XbX-WBLHk0gI0x_9RHgRjM7n9ep0VfDCIw,2605
|
|
118
124
|
credsweeper/ml_model/features/feature.py,sha256=6qYXKh1vDC0rgFn1zrXsCbr52W4r3jL6Ju1UUECBPWY,1094
|
|
119
|
-
credsweeper/ml_model/features/file_extension.py,sha256=
|
|
125
|
+
credsweeper/ml_model/features/file_extension.py,sha256=9kpw5bIk4i6vUZlcw8LMSivViSK_Y1u7crQsIuWcsOk,692
|
|
120
126
|
credsweeper/ml_model/features/has_html_tag.py,sha256=ZvcW1gU1_v9iMjb4ho1a3jHbWioOxtggCc1ZqmtSWl8,1116
|
|
121
127
|
credsweeper/ml_model/features/is_secret_numeric.py,sha256=eSI2glS_WdFuozX5E7YbFoF7gZlFHu1zj4dd8nJpSrk,401
|
|
122
128
|
credsweeper/ml_model/features/length_of_attribute.py,sha256=8H4Zc1mOjGXV5mwZkjvCt7xKKiiKPIEJDBhdlz8j3PE,1192
|
|
@@ -131,23 +137,23 @@ credsweeper/ml_model/features/word_in_transition.py,sha256=SgG8D37lXnDaFOKagi9lb
|
|
|
131
137
|
credsweeper/ml_model/features/word_in_value.py,sha256=QCVJRpcqEg-xC9a94fppqQbvReQLZSHNi0Zrtmr9Ul0,571
|
|
132
138
|
credsweeper/ml_model/features/word_in_variable.py,sha256=aETM5N2AF7FJhmrzLYDvMpKt-K1D8J0ZULxsgSRMXPU,534
|
|
133
139
|
credsweeper/rules/__init__.py,sha256=alXS8IivUs-AKKbVHiWvSjFpg1urJZLKItuFr61HHyg,40
|
|
134
|
-
credsweeper/rules/config.yaml,sha256=
|
|
135
|
-
credsweeper/rules/rule.py,sha256=
|
|
140
|
+
credsweeper/rules/config.yaml,sha256=CkhTgmi97QSPT7ZyL1n_mJKg9rdJYXUBeMs5U3e9SVw,39122
|
|
141
|
+
credsweeper/rules/rule.py,sha256=JyK712m75E4ALxq7gEh_ex_b0MZvC0Bw2_2pzeAoLFY,10209
|
|
136
142
|
credsweeper/scanner/__init__.py,sha256=KUh1uUEgZOd12DiXV-TQP3OvByI9tsyqN1KCdw994h8,48
|
|
137
143
|
credsweeper/scanner/scanner.py,sha256=2znRjqV9Mx4D0z9elUslOQIoLbfDybu1hF1TEaRzTkc,10127
|
|
138
144
|
credsweeper/scanner/scan_type/__init__.py,sha256=JHOdDZv5bmGsj0dhIiApvjcFzQ8LYkCQdWmhxAs4lgI,288
|
|
139
|
-
credsweeper/scanner/scan_type/multi_pattern.py,sha256=
|
|
145
|
+
credsweeper/scanner/scan_type/multi_pattern.py,sha256=IArPTLKfi3FYNoHq9OYVUjrrT7wHZwSCTPrpl8SP1IQ,3816
|
|
140
146
|
credsweeper/scanner/scan_type/pem_key_pattern.py,sha256=R_rxKS-cx79g08BOdnhHUyDU9_je3qQuPsVPqEMPB18,1501
|
|
141
147
|
credsweeper/scanner/scan_type/scan_type.py,sha256=AtKfIsYgvxmHp508j3DfwiEDp0zD77YPzYjrrwKy1no,9396
|
|
142
148
|
credsweeper/scanner/scan_type/single_pattern.py,sha256=TCbjbeK0NrWzU6eBMZqHjYXo3xAfc0a7z3HDbbyHY-c,954
|
|
143
|
-
credsweeper/secret/config.json,sha256=
|
|
149
|
+
credsweeper/secret/config.json,sha256=X1sr2kXBfmr_9-6qZ1t3aCzg5Cv-rGQaZsZqxeVi99o,3501
|
|
144
150
|
credsweeper/secret/log.yaml,sha256=h29atN5Kvk68oKuTYG2Mi4f2uNO3dvwhOkzCRBKo1rg,952
|
|
145
151
|
credsweeper/utils/__init__.py,sha256=wPdTkrSBAkR3rppFZ68k6MiT_P7tIHuAb3AcwndJCWg,63
|
|
146
|
-
credsweeper/utils/hop_stat.py,sha256=
|
|
147
|
-
credsweeper/utils/pem_key_detector.py,sha256=
|
|
148
|
-
credsweeper/utils/util.py,sha256=
|
|
149
|
-
credsweeper-1.11.
|
|
150
|
-
credsweeper-1.11.
|
|
151
|
-
credsweeper-1.11.
|
|
152
|
-
credsweeper-1.11.
|
|
153
|
-
credsweeper-1.11.
|
|
152
|
+
credsweeper/utils/hop_stat.py,sha256=vMd_1lcpDo4yaFhi61X0tJeeE83qUbzPckvxZcrgsgs,3010
|
|
153
|
+
credsweeper/utils/pem_key_detector.py,sha256=Z0vFTF8pELCW2O4vgRH5rQhnM_XcndFxo_r4KVP3XA0,7566
|
|
154
|
+
credsweeper/utils/util.py,sha256=xyO4kZt99fAe3Ui5uCgo__rrOJkQbKTI94v8YdH5hhc,32625
|
|
155
|
+
credsweeper-1.11.5.dist-info/METADATA,sha256=lAAy2KsTBbtiXBHOXru5UPiF2NBu-xsZjzCpcuSgvHU,10371
|
|
156
|
+
credsweeper-1.11.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
157
|
+
credsweeper-1.11.5.dist-info/entry_points.txt,sha256=SLGNZshvi3zpWPhVmRP-oDXRMRPBS4tzRDy6xYOXwqA,58
|
|
158
|
+
credsweeper-1.11.5.dist-info/licenses/LICENSE,sha256=aU7mGjBKbmRHNLVXXzcPdKmTtBxRwDPtjflQRfN7fFg,1065
|
|
159
|
+
credsweeper-1.11.5.dist-info/RECORD,,
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
from abc import ABC
|
|
3
|
-
from typing import List, Optional
|
|
4
|
-
|
|
5
|
-
import cryptography.hazmat.primitives.serialization.pkcs12
|
|
6
|
-
|
|
7
|
-
from credsweeper.credentials import Candidate
|
|
8
|
-
from credsweeper.deep_scanner.abstract_scanner import AbstractScanner
|
|
9
|
-
from credsweeper.file_handler.data_content_provider import DataContentProvider
|
|
10
|
-
|
|
11
|
-
logger = logging.getLogger(__name__)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class Pkcs12Scanner(AbstractScanner, ABC):
|
|
15
|
-
"""Implements pkcs12 scanning"""
|
|
16
|
-
|
|
17
|
-
def data_scan(
|
|
18
|
-
self, #
|
|
19
|
-
data_provider: DataContentProvider, #
|
|
20
|
-
depth: int, #
|
|
21
|
-
recursive_limit_size: int) -> Optional[List[Candidate]]:
|
|
22
|
-
"""Tries to scan PKCS12 to open with standard password"""
|
|
23
|
-
for pw_probe in self.config.bruteforce_list:
|
|
24
|
-
try:
|
|
25
|
-
(private_key, _certificate, _additional_certificates) \
|
|
26
|
-
= cryptography.hazmat.primitives.serialization.pkcs12.load_key_and_certificates(data_provider.data,
|
|
27
|
-
pw_probe.encode())
|
|
28
|
-
# the password probe has passed, it will be the value
|
|
29
|
-
value = pw_probe or "<EMPTY PASSWORD>"
|
|
30
|
-
info = (f"{data_provider.info}|PKCS12:"
|
|
31
|
-
f"'{value}' {'sensitive data' if private_key else 'default password'}")
|
|
32
|
-
candidate = Candidate.get_dummy_candidate(
|
|
33
|
-
self.config, #
|
|
34
|
-
data_provider.file_path, #
|
|
35
|
-
data_provider.file_type, #
|
|
36
|
-
info, #
|
|
37
|
-
"PKCS12")
|
|
38
|
-
candidate.line_data_list[0].line = f"'{value}' is the password"
|
|
39
|
-
candidate.line_data_list[0].value = value
|
|
40
|
-
candidate.line_data_list[0].value_start = 1
|
|
41
|
-
candidate.line_data_list[0].value_end = 1 + len(candidate.line_data_list[0].value)
|
|
42
|
-
return [candidate]
|
|
43
|
-
except Exception as pkcs_exc:
|
|
44
|
-
logger.debug(f"{data_provider.file_path}:{pw_probe}:{pkcs_exc}")
|
|
45
|
-
return None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|