Somali pirates have hijacked dozens of ships over the last two years , taking in tens of millions of dollars in ransom .