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

heartbleed-keyscan.py script is broken #4

Open
georgikoemdzhiev opened this issue Feb 28, 2022 · 2 comments
Open

heartbleed-keyscan.py script is broken #4

georgikoemdzhiev opened this issue Feb 28, 2022 · 2 comments

Comments

@georgikoemdzhiev
Copy link

georgikoemdzhiev commented Feb 28, 2022

Hello,

I have tried to use the heartbleed-keyscan.py script on a server memory dump (following the Hands On Hacking book) but the script raises the following exception:

Key size: 128
Data length: 262162
server_memory_dump_heartbleed_exploit.bin Offset 0x26e8d:
q = 176895773405621116307788280133420039997222041927523934480318688488979297390501409476979381325487723537203899797473386523980759525945000992510418473771155902173861665533756659990531321296655916345221796401613446653288929898078029282412625028093260043133036581197733169859097558754479002499112198768900474336027
p = 151364638100355176693661398024098730528154159832442956085348149483923804360079088674951666688921823944270058619788401459978290166687493918707176668921114637104351859831061576926116485098591107562914922077134214166121123797285938887040317276229708349784252604661316025693481643254971077966517600088960886610599

Traceback (most recent call last):
  File "/home/kali/Downloads/keyscan.py", line 67, in <module>
    sys.exit(main(*sys.argv[1:]))
  File "/home/kali/Downloads/keyscan.py", line 61, in main
    seq.setComponentByPosition (len (seq), Integer (x))
  File "/usr/lib/python3/dist-packages/pyasn1/type/univ.py", line 2267, in __len__
    return len(self._componentValues)
  File "/usr/lib/python3/dist-packages/pyasn1/type/base.py", line 214, in plug
    raise error.PyAsn1Error('Attempted "%s" operation on ASN.1 schema object' % name)
pyasn1.error.PyAsn1Error: Attempted "__len__" operation on ASN.1 schema object

Please find the pem and server_memory file in the attached zip to recreate the issue
files.zip

@georgikoemdzhiev
Copy link
Author

georgikoemdzhiev commented Feb 28, 2022

I found a workaround on the internet which involved downgrading the pyasn1 package:

pip uninstall pyasn1
pip install pyasn1==0.4.5

I was running version 0.4.8

@hackerhouse-opensource
Copy link
Owner

hackerhouse-opensource commented May 4, 2024

Thanks for sharing, I have marked this as won't fix for the time being as it's difficult to support changes to packages made by others. I appreciate the information though and will review it the next time I do a book errata review. Anyone else who notices errata in the book, please email us at [email protected] rather than raise issues on github as they may not be reviewed as quickly.

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

2 participants