Could be numerous issues.
Does the knock increase in line with increasing the revs?
Is the oil level at maximum on the dipstick?
How is your oil pressure?
Sump pan oil leak is a cheap and easy fix, link is below.
The oil on the gearbox will probably be oil getting blown back from your sump leak.