Coat the inside of a plastic cup in a thin layer of petroleum jelly. Place the cup upside down over the drain where you suspect the moths are living. Leave the cup for two days. If you have found the correct drain, you will see adult flies caught in the petroleum jelly.
Fill a tea kettle with water. Bring the water to a boil over high heat. Remove the plastic cup from the drain and pour the boiling water down the drain. This kills any existing larvae living in the drain.
Select a pipe cleaner that is the same diameter as your drain. Dip the pipe cleaner in household bleach, then insert its entire length into the pipe. Move the pipe cleaner up and down to remove any organic material stuck to the sides of the pipe. Discard the pipe cleaner in the trash.
Insert a plumber's snake into the drain. Turn the crank to feed the snake deep into the piping. Feed the snake into the entire length of the piping, or until you reach the end of the snake. Turn the crank in the opposite direction to retrieve the snake. This cleans out the areas of pipe that the pipe cleaner cannot reach.
Pour a gel bacteria digester down the drain following the package directions. This breaks down any organic material the snake and pipe cleaner missed.