Pavel314:
Buy a "mechanic's stethoscope" for $10 to $15 in any place that sells mechanic's tools:
formatting link
A mechanic's stethoscope allows you to pinpoint the source of noises. You hold the metal probe to whatever you suspect is making the noise, and the noise will be heard louder and louder as you touch the probe closer and closer to the source of the noise. It will be heard loudest when you're touching the probe to the source of the noise.
In this way, you can touch the probe to both the water supply line to the toilet, and the vent stack in your basement to see if the noise originates in the supply piping or the drain piping.
It's very possible that the thump you hear is actually the water hitting the bottom of your vent stack. If you have a mechanic's stethoscope, you can check for that noise during the day and at night, and I'll expect you'll find it's equally loud all the time, it's just that there's more competing noise during the day.
Mechanics use these tools to pinpoint the sources of noises in machinery. I have a cheap Lisle mechanic's stethoscope I bought for $15 every bit of 25 years ago, and it's a very handy tool to have because it allows me to pinpoint the source of all kinds of noises. Wish I had a similar tool to pinpoint the source of odors.