I brought twenty exploding laser pens, though I needn't have packed so many, as the guards were already asleep.
Needn't have + past participle is used when an action was performed, but it was unnecessary. Modal need never takes "to".
I was so terrified of the villain's fluffy white cat that I dared not pet it!
Dared not is the past tense of the modal auxiliary dare. It is followed directly by a bare infinitive (pet), so "dared not to" is incorrect.
In hindsight, I ought not to have handed over my secret ID badge when the villain politely asked for it.
The standard negative past form of ought to is ought not to have + past participle. Dropping the "to" (ought not have) is a common error, and using did (didn't ought to) is considered non-standard dialect.