skelsec / pypykatz

Mimikatz implementation in pure Python
MIT License
2.77k stars 367 forks source link

kerberos brute: 'generator' object is not subscriptable #142

Open exploide opened 7 months ago

exploide commented 7 months ago

Trying to brute-force usernames currently results in an error:

> pypykatz kerberos brute dc.test.local Administrator@test.local
[KERBEROS][BRUTE] Error while enumerating users! Reason: 'generator' object is not subscriptable
  File "/home/user/.local/pipx/venvs/pypykatz/lib64/python3.12/site-packages/pypykatz/kerberos/kerberos.py", line 182, in brute
    realm = targets[0].realm
            ~~~~~~~^^^
skelsec commented 6 months ago

Wow, I believe you're the only person used that feature in years. Thanks for the issue, it will be fixed in the next release!

mmutj commented 5 months ago

same error on kerberos spnroast. @skelsec

pypykatz kerberos spnroast 'kerberos+password://HTB.LOCAL\amanda:Ashare1972@10.10.10.103' -t 'mrlky' -e 23 -d htb.local
[KERBEROS][SPNROAST] Error! Reason: 'generator' object is not subscriptable
  File "/usr/lib/python3/dist-packages/pypykatz/kerberos/kerberos.py", line 249, in spnroast
    kdomain = targets[0].domain
              ~~~~~~~^^^

Wow, I believe you're the only person used that feature in years. Thanks for the issue, it will be fixed in the next release!

sechvn commented 3 weeks ago

For anyone who is getting the above errors, specifically with trying to use the kerberos function, just copy out the code into a text editor of choice or vim, and find the kerberoas spn roast function and add the following above the 'kdomain = targets[0].domain: targets = list(targets)

This will fix the issue. I'm assuming a similar fix will also work for the brute function of the tool.