Connecting to flanged pipe with missing nut

I'm staying at a friend's house for vacation and I've discovered he's got a bucket sitting under the bathroom sink because he can't get a new drain trap put in. I'm tired of emptying the bucket.

Figured it would be simple to put a new trap in, but turns out that when he removed the old trap he just used brute force, and the threaded end of the trap got sheared off and was still stuck inside the nut on the drain pipe. Obviously that made it impossible to connect a new trap, so then he cut off the old nut (and the sheared off end of the trap stuck inside it). So now there's just the flanged drain pipe with no nut. Is there a type of fitting I can use that will allow me to connect a new trap to the existing pipe, or is the only plausible option at this point to replace the pipe?

Connecting to flanged pipe with missing nut

Okay, here's a picture of what remains. You can see the tailpipe coming down from the sink in the top half of the picture, and then the flanged pipe (with the now missing nut) coming up through the bottom of the cabinet. Thoughts?

Connecting to flanged pipe with missing nut

Going to have to go under the house to find the other end of that pipe to be able to undo the nut that compresses the sealing ring holding the pipe in place.
That style drain no longer meets code if anyone cares.
I really needed to be run through the wall not through the floor.

Connecting to flanged pipe with missing nut

Or get a universal radiator hose from the auto parts store and 2 radiator clamps and MAKE an S trap. Just make sure the hose is LOOOOONG enough to accomplish the job. A good temporary/quick work around. O'reily has ALL kinds of lengths ..... http://www.oreillyauto.com/site/c/se...%28R%29&mc=GAT