Here is the pipe to work on. Notice the old silicon (wrong type) around the pipe and the deterioration of the rubber seal.
Use a pocketknife to scrape any rough edges and sharp points from upper end of plastic vent pipe to prevent any ripping of the new rubber seal when slideing it over the pipe.
Cut away any old caulk from around the vent pipe. Use the knife blade to scrape the pipe clean and smooth as needed.
Apply a thick bead of lap-seal caulk around the seam between the vent pipe and old rubber gasket. Then run a second bead of caulk just below the first bead
Slide the replacement rubber gasket over the pipe and press it down firmly onto the old gasket making sure that the vent pipe is now completely sealed.
Please note that this is a fix that you can do yourself with the materials being purchased at most "big box" stores. You should measure the inside diameter and outside diameter of the pipe in questions so you get the correct gasket as they do come in different sizes.
At Jahn's Roofing we do not repair the flashing in this manner, we remove the shingles and replace the entire roof vent flashing with a new one and then replace the shingles. After all we are roofers.