For example, did you have to take credit for that particular situation? What was the true downside of your boss taking credit? Why not cover for him and gain the ally? Build the relationship and you'll often find that it pays back in multiples.
Business is 99% about relationships. The only way you can get what you want is by helping others get what they want.
Why not work with them, teach them, and make them better. Instead of being upset, be on their side. Almost always, they'll help you in return. Being confrontational and going around them though, will only guarantee more negative outcomes. Remember that your boss's boss and other colleagues probably don't want to deal with someone who is seemingly more interested in getting credit rather than getting things done.
I had a colleague who once told me "the trick to making good ideas happen is to make your boss think it was their idea". And they were completely right! It didn't stop them from quitting in frustration years later having never been promoted.
These days I'd just quietly polish the CV and move along. But I have a much better job now.
Communication is important - very important - but it's also often what people focus on when the reality is just a bigger pain in the ass ("so and so is a selfish twit who takes credit for others' work" is much harder to say than "we need to address communication issues between departments")