The match-winning strike also earned Peterborough a double over Hereford having beaten them 2-0 at London Road earlier in the campaign.
A delighted Ferguson said: "We were very professional and it was a good performance. We got a great start but probably we should have been further ahead at the break.
"But the first half was as good as we have played for a while. We did have further chances and at 1-0 you never know and Hereford gave us a good test.
"We had chances to kill the game off especially late on and I knew at sometime we would come under pressure, but we stood strong."