Some years later, having gained a reputation as a theological controversialist and become a person of importance among the Nonconformists, he attracted the notice of Anthony Ashley-Cooper, 1st Earl of Shaftesbury and the party which favoured the exclusion of the Duke of York from the throne, and he began to write political pamphlets just at the time when the feeling against the Roman Catholics was at its height.
Ferguson was deeply implicated in the Rye House Plot, although he asserted that he had frustrated both this and a subsequent attempt to assassinate the king, and he fled to the Netherlands with Shaftesbury in 1682, returning to England early in 1683.
For his share in another plot against Charles II he was declared an outlaw, after which he entered into communication with Archibald Campbell, 9th Earl of Argyll, Monmouth and other malcontents.
Having overcome Monmouth's reluctance to take part in this movement, he accompanied the duke to the west of England and drew up the manifesto against James II, escaping to the Netherlands after the Battle of Sedgemoor.
In a proclamation issued for his arrest in 1683 he is described as "a tall lean man, dark brown hair, a great Roman nose, thin-jawed, heat in his face, speaks in the Scottish accent, a sharp piercing eye, stoops a little in the shoulders."