Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 984: character maps to <undefined> when running sample #3

Open
chetstriker opened this issue Aug 9, 2021 · 1 comment

Comments

@chetstriker
Copy link

When running command: python ./docem.py -s samples/xxe/docx_sample_oxml_xxe_mod0/ -pm xss -pf payloads/xxe_special_6.txt -pt per_document -kt -sx docx


||_|
| | || ||| || ||| ||
_| _| _| | | |||| _| _| _|
_| _| _| _| _| _| | | |
||
| || ||
| ||
| _| _| _|

Current version: 1.3

Examples:
./docem.py -s samples/xxe/docx_sample_oxml_xxe_mod0/ -pm xss -pf payloads/xxe_special_6.txt -pt per_document -kt -sx docx
./docem.py -s samples/xxe/docx_sample_oxml_xxe_mod1/ -pm xss -pf payloads/xxe_special_1.txt -pt per_file -kt -sx docx
./docem.py -s samples/xxe/sample_oxml_xxe_mod1.docx -pm xxe -pf payloads/xxe_special_2.txt -kt -pt per_place
./docem.py -s samples/xss_sample_0.odt -pm xss -pf payloads/xss_tiny.txt -pm per_place

Document Embed XSS & XXE tool

Current magic_symbol: XXCb8bBA9XX

=========== Current setup ===========
sample file path: samples/xxe/docx_sample_oxml_xxe_mod0/
sample is a directory: True
payload mode: xss
payload file: payloads/xxe_special_6.txt
payload type: per_document
number of payloads: 5
keep unpacked files: True

======== Count magic symbols ========
0 symbols in docProps_app
0 symbols in docProps_core
Traceback (most recent call last):
File "./docem.py", line 500, in
tree_embedding, embedding_info = document_tree_embedding_points(paths, tree, magic_symbol)
File "./docem.py", line 330, in document_tree_embedding_points
file_in_sample_read = file_in_sample.read()
File "C:\Python37x64\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 984: character maps to


@chetstriker
Copy link
Author

I'm adding that this is being run on Windows 11 in my case and guessing it has something to do with Windows using 1251 encoding by default where it's causing issues trying to read a unicode character. I'm probably going to either just run it in linux or try to alter the default character set unless you know of an easier fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant