well the suspension mounting top is like a rubber with on both sides a metal plate,sometimes after some years ,cars that driven on bad roads can have the rubber torn by age and "road abuse" . the rubber tears and eventually can break up and the two plates knock on eachother,what gets amplified by the body off the car...
most off the time you only hear it on bad roads.. on a perfect road without bumps it can be harder to notice it.iff you drive can you feel like the car sometimes want to tilt a bit instead of being smooth and flat in corners? that is also a indication something has space to move around like it shouldent.
iff you press on your car , you can hear the sound also sometimes iff a top mount is gone. just be carefull not to overpress and dent the car
the guibo is the rubber donut between te engine and the drive line to the rear diff.. that can produce also a knocking sound because it has some space to move around.. i doubt that its that because yo can feel it in the shifter, but i wanted to mention it anyway.
if you had your x pipe installed, they had to remove a exhaust hanger plate right after the cats and afterwards they installed it back. maybe its the x-pipe thats hitting that exhaustplate when its warm and a bit expanded.normally between the x-pipe and the exhaustplate there are rubber bushings also maybe the forgot those and thats why the plate is closer to the x pipe , with ratteling noise as result when driving.
a worn thrust arm bushing or rear ball joint or a wheelbearing thats going could cause this sound also like marckula suggested .
just some thoughts though..worth to check it out.