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

esentutl.py crashes while dumping table from ntds.dit #43

Closed
GoogleCodeExporter opened this issue Apr 15, 2015 · 6 comments
Closed

esentutl.py crashes while dumping table from ntds.dit #43

GoogleCodeExporter opened this issue Apr 15, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

While dumping the "datatable" table of an ntds.dit I get the following message.

''ascii' codec can't decode byte 0xcd in position 0: ordinal not in range(128)"

and esentutl stops short of finishing the dump afterwards. I think it's 
happening around where there are some Chinese characters in the database.

Using impacket version 0.9.12-dev from the svn

Original issue reported on code.google.com by jsp5...@gmail.com on 22 May 2014 at 2:44

@GoogleCodeExporter
Copy link
Author

Hey there.. 
Yeah.. most probably that's the case.. i'm attaching an esentutl.py version 
with traceback enabled. You should run it using:
python esentutl.py <arguments>

Could you please send me the output?.. That will help me understand where 
inside ese.py there's a decode error.

thanks!
beto

Original comment by bet...@gmail.com on 22 May 2014 at 1:06

  • Changed state: Accepted

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks for the quick response. Here's the output from esentutl.py with 
traceback enabled:

Traceback (most recent call last):
  File "/Users/parkijo/Tools/temp/esentutl.py", line 88, in main
    exportTable(ese, options.table)
  File "/Users/parkijo/Tools/temp/esentutl.py", line 40, in exportTable
    record = ese.getNextRow(cursor)
  File "/Library/Python/2.7/site-packages/impacket/ese.py", line 812, in getNextRow
    return self.getNextRow(cursor)
  File "/Library/Python/2.7/site-packages/impacket/ese.py", line 814, in getNextRow
    return self.__tagToRecord(cursor, tag['EntryData'])
  File "/Library/Python/2.7/site-packages/impacket/ese.py", line 962, in __tagToRecord
    record[column] = record[column].decode(stringDecoder)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcd in position 0: ordinal 
not in range(128)
None
'ascii' codec can't decode byte 0xcd in position 0: ordinal not in range(128)


Original comment by jsp5...@gmail.com on 22 May 2014 at 3:34

@GoogleCodeExporter
Copy link
Author

Sure..

Okey.. this might be related to 
https://code.google.com/p/impacket/source/detail?r=1145&path=/trunk/examples/sec
retsdump.py, where some NTDS.dit records might get corrupted, so I'm forcing to 
skip them in secretsdump. 

I'm attaching another esentutl.py that is doing the same skip. Please give it a 
try, and let me know if many rows are skipped.


Original comment by bet...@gmail.com on 22 May 2014 at 3:48

Attachments:

@GoogleCodeExporter
Copy link
Author

It looks like it's working well now. I didn't see too much missing from the 
output.

Original comment by jsp5...@gmail.com on 23 May 2014 at 4:09

@GoogleCodeExporter
Copy link
Author

great to know.. i'll commit this change then.

thanks for the bug report!
beto

Original comment by bet...@gmail.com on 23 May 2014 at 6:49

@GoogleCodeExporter
Copy link
Author

Fixed at https://code.google.com/p/impacket/source/detail?r=1225

Original comment by bet...@gmail.com on 23 May 2014 at 6:52

  • Changed state: Fixed

ShutdownRepo referenced this issue in ThePorgs/impacket Nov 26, 2022
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