Yeah, right.. “Uhhhh, we’re Al Qaeda and we’d like to buy one of your 777’s and put our black flag logo on the tail, please?” /s Sheesh!
I'm sure they could buy it through any number of front companies. Buying one has the advantage of not alerting everyone in the world that there's a missing jet out there. But shoestring operations conducted on the basis of the jihadist equivalent of church collection plates don't have the luxury of unlimited budgets.
Whatever the method of acquisition, my guess is they'd probably paint it with the logo of some non-descript airline or freight company, enter the airspace of the target nation during the small hours of the morning and carry out the assigned mission.