Measure the vent pipe so you know what size aluminum flashing you need. Measure the inside diameter of the pipe and make a note of it. Purchase sufficient flashing in the proper size. Most pipes should have an interior diameter of between 1 and 3 inches.
Remove the old aluminum flashing and the rubber gasket from the vent pipe. There should be six roofing nails holding the flashing to the roof. Two nails are at the bottom of the flashing and are exposed. Two nails are in the middle of the flashing, just under the shingles. The final two are probably holding a shingle down as well as the flashing. Carefully pry up the shingles using your putty knife, being careful not to damage them. Loosen at least 10 inches of shingle on either side of the flashing you need to remove. You will have to loosen two rows of shingles to get to the final two nails.
Insert your putty knife under a nail head between the bottom of the flashing and the shingle under the flashing. Carefully insert your flat pry bar between the putty knife and the flashing and carefully pry up one of the two lower nails. Do the same thing with each nail until all six nails have been removed.
Remove the flashing itself by turning it 90 degrees, and then gently work it out from under the shingles. If more shingles need to be loosened before the flashing can be removed, use your putty knife to loosen them, rather than loosening them with the flashing.
Brush any debris away from the vent pipe where it comes out of the roof.
Center a 1-square-foot piece of roofing membrane on top of the vent pipe and draw a circle on the bottom of the membrane around the vent pipe with a marking pen. Use a utility knife to carefully cut around the inside of the circle you just drew, so that the roofing membrane will fit down over the pipe snugly. Once the membrane has been pressed down onto the roof, use your utility knife to cut away the excess edges so that the new flashing will overlap the membrane by approximately 1 inch on all sides.
Run a bead of silicon roofing caulk around the pipe where it comes out of the roof. Remove the backing plastic from the roofing membrane and slip the membrane down over the pipe until it is flat on the roof. Run another bead of caulking around the pipe on the top side of the membrane. Use your utility knife to cut away the excess edges of the membrane so that the new flashing will overlap the membrane by approximately 1 inch on all sides.
Install the new flashing over the pipe by first stretching and working the rubber around the opening in the flashing so that the vent pipe will pass through this opening (with the rubber being very tight around the pipe). Spread a little caulking on the inside of the rubber seal to help the pipe pass through it more smoothly and slip the new flashing onto the pipe at a 90-degree angle, so that the new flashing can be slipped under the shingles the same way the old one came out.
Lift the top two rows of shingles as you lower the new flashing into place. Rotate the flashing so it is aligned the same way the old flashing was and pound in six nails to hold the new flashing in the same place as the old flashing. Place a large bead of caulk on the top of the metal flashing and lower the shingles back into place.
Lift the edges of the shingles slightly and run a bead of caulking under them so the caulking will hold them down. Press down on the shingles with the palm of your hand to seal everything snugly.
Clean the vent pipe with acetone if necessary.