"Having" is a gerund in this sentence. You cannot use an infinitive here ("to have").
If you want to use a clause, then you need to follow the timeframe: "She also confessed that she had..."
Have a closer look at how "confess" works, and the rules become clear.