Thanks for the tips hughzee. Got it in and that pesky check engine light is off.
The green part of the sensor was cracked so I just took all the housing off.
The only problem I ran into was that grey connector was in the way, I guess its part of the harness wiring, and just could not get it disconnected to move it. Maybe I could have used a shorter 24mm socket... So anyway i ended up using the impact wrench with extension on the 12mm bracket bolt nothing like a bit of overkill with power tools but it wasn't budging by hand.
The knock sensor broke loose nice and easily with the ratchet so that was good.
Replacement sensor installed.