It looks like something spilled or overflowed at one time and things got really wet. The water could've come from anywhere and ran along the piping. There's not a really good way to know if there's a leak other than a pressure testing. But that doesn't really seem practical in a home buyer situation. If it's not wet right now there's probably no leak. The only exception would be if there's a leak in a drain somewhere. You could run every plumbing fixture excessively to see if water shows up.