There was a scuttling noise in our attic several weeks ago. Actually, I never heard it, personally, but both Merrianne (my wife) and our daughter said they heard it. Also, Merrianne went up into the attic once when she heard the noise, and said she saw it disappear into a corner. After that, I went up into the attic about a half dozen times, every time they heard the alleged “noise,” but never saw the rat, myself. However, there were signs of rat activity, like droppings, gnawed items, and insulation moved aside into a running path. Since we have tree rats (aka squirrels) as pets, we did not want to kill ordinary rats if we could avoid it. They were welcome to live in our neighborhood, just not in our house.
I noticed that the rat had taken a liking to the seeds in some gourds that we were drying in the attic, so I removed all of those. That was step #1, remove the food source.
From listening to the scampering, we determined the rat’s schedule for going out to forage for food. I waited for the rat to be out, then sealed the hole. I had to be careful of the timing, because if I sealed the rat in, it would either gnaw at everything until it created another hole, or die in our attic, leaving a mess to clean up later. [Other sites on the internet advise sealing the hole right away, but that strategy includes setting killer traps inside for any rats that are sealed in.]
By the way, here is why I put a screen into the hole, instead of just expanding foam. This is a hole that I plugged a couple years ago. Something tried to chew through, but was stopped at the metal screen.