secondary vent stack ending in attic

A previous owner apparently moved the toilet in one of the bathrooms and installed a secondary vent stack to that, which ends in the attic and doesn't go through the roof. It is a small grey plastic pipe about 1.5-2" in diameter.

The attic is just a crawl space below the roof, and it doesn't cause any odors (if you put your nose right up to it and sniff deeply, you can tell its a plumbing vent). The regular metal vent pipe that vents the rest of the bathroom/shower is a few feet away.

We are having the roof completely reshingled soon and I'd like to extend that vent pipe through the roof before the reshingling so they can install the flashing when they reshingle. Is that fairly easy to do yourself? I'd like to use metal pipe to go through the roof like the other vents for bathroom and kitchen, but I'm not sure what kind of metal pipe they are, or how to tell.

(My main reason for wanting to use metal pipe is so the roofing inspector wouldn't think new plumbing work had been done--the work done by that previous owner was certainly done without a permit! But perhaps this is not a good reason to extend that vent stack outside with metal instead of plastic pipe. What do you think?)

And if I do use a metal pipe to extend this vent up through the roof, what sort of connector would I use to connect it to the end of the plastic pipe ending in the attic?

And, how do I tell what kind of plastic pipe that is (dark grey, probably installed in early 1980's.)

Dark gray sounds like electrical nonmetallic conduit. My non-professional opinion is that the easiest thing to do would be to connect the "electrical vent" to the existing stack in the attic, and maintain the single roof penetration.

I'd be more worried about what's going on at the other end of this vent, and how the toilet is currently plumbed.

A real plumber on-site would be the best source of advice in all aspects of this.

Gray pipe might indicate Sch. 80 pipe which would be fine. If you are sure it is a plumbing vent you can get a 1.5" female adaptor or 2" female glue X 1.5" female thread adaptor and glue it on to the pipe and then thread an Air Admitance Valve (AAV) into the adaptor and you are done.

While the pipe smells like a plumbing vent, are you sure that the previous owner did not run an empty conduit fromt he basement up the attic just in case he had to fish electrical wires in the future? The easisest solution would be to add an air admittance valve on top of the suspected DWV vent rather than bringing it through the roof or cutting into the existing vent.