We have a house from the early 50s that has a finished basement. In our basement bathroom, we have this open pipe coming out from the wall. For the first couple of years, nothing came out of it, but a while back (months) there were a couple of strange blasts of dirty substance (we never saw them actually happen - just the residue, so we don’t know what provoked them), and now a small amount of water trickles out of it when you use the basement sink (not toilet). Can anyone tell me what this pipe might be for, and whether it is safe just to cap it off with a hose cap or something? We do have a sump pump, which is located on the opposite side of the house, so I don’t imagine this could be related..? Also, there is a window well on the outside of the house close by from a basement window that was blocked off when the previous owners finished this bathroom (don’t know if that could be related). Thanks for the advice!
The pipe might be a cleanout for your drains or maybe the drain for an earlier fixture there. The black and red thing was a cap. It has been broken or sawn off. Just replace that cap with an identical one, or better, get an actual cleanout that fits the grey pipe and install that instead. I'd avoid using a compression fitting like this especially in a basement. There are situations where the basement drain can develop pressure behind it, and the cap then pops off. Very unpleasant. An actual cleanout looks like this