difference between attained and obtained
Typically, attain is used to refer to the achievement of abstract goals and objectives. Obtain, on the other hand, is used in situations where the item that is acquired is actually physically acquired. I obtain objects, but I attain goals.
They're synonyms. Gain is the most general. Attain usually means to reach a goal or milestone (he attained the rank of captain). Obtain usually implies careful planning or some effort to get to the thing or goal. But they have probably something like 80% overlap in meaning.