You can buy your tickets via the cash desks of the FestungBahn funicular located in Festungsgasse 4.
Moreover you can purchase your tickets at the "Sperrbogen". You will come to the “Sperrbogen” gate before the main entrance gates of Hohensalzburg Fortress. You can reach this on foot. At the Sperrbogen, you will be able to purchase tickets for your visit to Hohensalzburg Fortress as well as your ride back down on the FestungsBahn funicular.