Dougie, I'm assuming you mean the two squarish plates, one on either side of the prop shaft on the underside of the arm that supports the aft dive plane?
If so, then I think that yes, those are quite possibly sacrificial anodes. They're about the right size for something as big as a U-boat, and around the stern is where I'd most expect to see them, especially near the propellors and rudders because it's there that you'd find most of the dissimilar metals (bronze - steel props, stainless steel shafts, hinges and bearings for the dvie planes and rudders, etc.)
The squares in your picture aren't in the same location, nor are they the same size and shape in the picture I'd seen before, but like I said, shape isn't definitive, since most boat builders will use whatever is available. Milspecs of the day would just call for "anodes" and not specify what manufacturer or model they have to be, just that they provide enough zinc to do the job. And when a boat came in for refit, they'd replace old anodes with whatever was handy too.
Location isn't necessarily going to be the same on each boat either, just that they have to have all the sensitive areas protected, and each builder could make his own deceision as to where. It might even change from one boat to the next or from one refit to the next.
The main thing is that they have to be there, not what they look like.
There'd be a minimum of one for each propellor and one for each rudder, and there could be as many as two for each I think.