You would have to hunt down the location of the rattling pipes inside the wall, then cut a hole in the wall, purchase some pipe straps and screw them in place over the pipes to secure them to the stud. Then you would have to patch, tape, mud, prime and paint the hole you cut in the wall
This is known as water hammering, you can try to clear the lines by draining your lines of any airlocks by closing your main water valve, opening the faucet furthest from the water source, then opening the one closest to the source (usually the hose bibb outside) and draining the system.
Then turn the water back on and close the last faucet first and allow the air to escape from the other faucet until you get a steady flow of water . If that doesn't work then you will need a plumber to create or install a anti-hammering device near your commode.
Then turn the water back on and close the last faucet first and allow the air to escape from the other faucet until you get a steady flow of water . If that doesn't work then you will need a plumber to create or install a anti-hammering device near your commode.