fortra / impacket

Impacket is a collection of Python classes for working with network protocols.
https://www.coresecurity.com
Other
12.98k stars 3.49k forks source link

[enhancement] Adding column to show if SPN exists in finddelegations.py #1727

Closed p0dalirius closed 1 month ago

p0dalirius commented 3 months ago

Hi,

I have added a new column "SPN Exists" to easily see if SPN Jacking is possible.

Here is a redacted example of output: image

Best regards,

gabrielg5 commented 1 month ago

Hi @p0dalirius,

Checking your changes I found a path that is triggering an error when generating the output.

This line is not setting any value to the new column https://github.com/fortra/impacket/blob/269ce69872f0e8f2188a80addb0c39fedfa6dcb8/examples/findDelegation.py#L228

which is resulting in an exception iterating rows to draw the table https://github.com/fortra/impacket/blob/269ce69872f0e8f2188a80addb0c39fedfa6dcb8/examples/findDelegation.py#L40-L44

Also, could you revert those quoting changes? that makes the PR more atomic and helps validate what is the real change

thank you!!

p0dalirius commented 1 month ago

Hi @gabrielg5,

I have fixed the code path

I have reverted the quoting changes, although the code really should be double quoted and not single quoted everywhere.

Best regards,

gabrielg5 commented 1 month ago

Hey @p0dalirius,

great! just one last ask before merging this PR... Can you extract the spnExists resolution to an external function to avoid duplicating those lines?

thank you!

p0dalirius commented 1 month ago

Done :)

gabrielg5 commented 1 month ago

Merging now.. Thank you!