-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pptx & xlsx rendered for --doc. test-samples and re-fuzzed
- Loading branch information
Showing
87 changed files
with
794 additions
and
887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ | |
'__version__' | ||
] | ||
|
||
__version__ = "1.9.1" | ||
__version__ = "1.9.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import io | ||
import logging | ||
from abc import ABC | ||
from typing import List | ||
|
||
from pptx import Presentation | ||
|
||
from credsweeper.credentials import Candidate | ||
from credsweeper.deep_scanner.abstract_scanner import AbstractScanner | ||
from credsweeper.file_handler.data_content_provider import DataContentProvider | ||
from credsweeper.file_handler.string_content_provider import StringContentProvider | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class PptxScanner(AbstractScanner, ABC): | ||
"""Implements pptx scanning""" | ||
|
||
def data_scan( | ||
self, # | ||
data_provider: DataContentProvider, # | ||
depth: int, # | ||
recursive_limit_size: int) -> List[Candidate]: | ||
"""Tries to scan pptx text elements for all slides""" | ||
candidates = [] | ||
try: | ||
pptx_lines = [] | ||
presentation = Presentation(io.BytesIO(data_provider.data)) | ||
for slide in presentation.slides: | ||
for shape in slide.shapes: | ||
if shape.has_text_frame: | ||
for paragraph in shape.text_frame.paragraphs: | ||
pptx_lines.append(paragraph.text) | ||
string_data_provider = StringContentProvider(lines=pptx_lines, | ||
file_path=data_provider.file_path, | ||
file_type=data_provider.file_type, | ||
info=f"{data_provider.info}|pptx") | ||
pptx_candidates = self.scanner.scan(string_data_provider) | ||
candidates.extend(pptx_candidates) | ||
except Exception as pptx_exc: | ||
logger.error(f"{data_provider.file_path}:{pptx_exc}") | ||
return candidates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import io | ||
import logging | ||
from abc import ABC | ||
from typing import List | ||
|
||
from credsweeper.credentials import Candidate | ||
from credsweeper.deep_scanner.abstract_scanner import AbstractScanner | ||
from credsweeper.file_handler.data_content_provider import DataContentProvider | ||
from credsweeper.file_handler.string_content_provider import StringContentProvider | ||
|
||
import pandas as pd | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class XlsxScanner(AbstractScanner, ABC): | ||
"""Implements xlsx scanning""" | ||
|
||
def data_scan( | ||
self, # | ||
data_provider: DataContentProvider, # | ||
depth: int, # | ||
recursive_limit_size: int) -> List[Candidate]: | ||
"""Tries to scan xlsx text elements for all slides""" | ||
candidates = [] | ||
try: | ||
book = pd.read_excel(io.BytesIO(data_provider.data), sheet_name=None, header=None) | ||
sheet_lines = [] | ||
for sheet_name, sheet_data in book.items(): | ||
text = sheet_data.fillna('').astype(str) | ||
for i in text.values: | ||
sheet_lines.append('\t'.join(i)) | ||
string_data_provider = StringContentProvider(lines=sheet_lines, | ||
file_path=data_provider.file_path, | ||
file_type=data_provider.file_type, | ||
info=f"{data_provider.info}|xlsx:{sheet_name}") | ||
sheet_candidates = self.scanner.scan(string_data_provider) | ||
candidates.extend(sheet_candidates) | ||
except Exception as xlsx_exc: | ||
logger.error(f"{data_provider.file_path}:{xlsx_exc}") | ||
return candidates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+3.76 KB
.../f818f5cfb4fbfcd1c8dd6f5d06c7829b7ef7ef5c → .../128423b9f4be724e691b1110445bc9b1798f0d5a
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
glsa_ThisI5NtTheTok3nYou8Leor0k1ngF0r_0a2a3df7 | ||
glpl_ThisI5NtTheTok3nYou8reLo0k1ngF0r_0a2a3df7 |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"Prl23Db#@" | ||
|
||
Passwd:Prl23Db#@ Prl23Db#@ | ||
PW:Prl23Db#@,password:Prl23Db#@ | ||
password:Prl23Db#@,비번:Prl23Db#@ | ||
passwd=Prl23Db#@ | ||
--pass Prl23Db#@ | ||
PIN:Prl23Db#@ | ||
paasword:Prl23Db#@ | ||
password:Prl23Db#@, paasword:Prlord: keep empty | ||
암호 : @@@hl@@@비번@@@endhl@@@ | ||
|
||
FP# 10.0.0.1 8888 TLSv#;' | ||
eo(s) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The items are AKIAGIREOGIAWSKEY123,AKIAGIREOGIAWSKEY45X | ||
the coma is necessary there REAL12 --access-key <xcFsdeGddSAdI/KFRS2CB/3fGCsdCYEXAMPLEKEY> |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.