Cursing Abu Bakr and Umar during Ziyarah of all Imam's (as)

حدَّثني أبي ; وجماعة مشايخي ، عن محمّد بن يحيى العطّار ، وحدَّثني محمّد بن الحسين بن متّ الجوهريّ جميعاً ، عن محمّد بن أحمدَ بن يحيى بن عِمران ، عن عليِّ بن حَسّان ، عن عُروةَ بن إسحاق ابن أخي شعيب العَقرقوفيّ عمّن ذكره ـ عن أبي عبدالله: قال : تقول إذا أتيت قبر الحسين بن عليٍّ ويجزئك عند قبر كلِّ إمامٍ :

...

ثمّ تقول : اللّهُمَّ الْعَنِ اللَّذَيْنِ بَدَّلا نِعْمَتَكَ ، وَخَالَفا كِتابَكَ ، وَجَحَدا آياتِكَ ، وَاتَّهَما رَسُولَكَ ، احْشُ قُبُورَهُما وَأجْوافَهُما ناراً وَأَعَدَّ لَهُما عَذاباً أليماً ، وَاحْشُرْهُما وَأشْياعَهُما وأتْباعَهُما إلى جَهَنَّمِ زُرْقاً ، وَاحْشُرْهُما وَأشْياعَهُما وأتْباعَهُما يَومَ الْقيامَةِ عَلى وُجُوهِهِم عُمْياً وَبُكْماً وَصُمّاً ، مَأواهُمْ جَهَنَّمُ كُلَّما خَبَتْ زِدْناهُمْ سَعِيراً ، اللّهُمَّ لا تَجْعَلْهُ آخِرَ الْعَهْدِ مِنْ زِيارَةِ قَبرْ ابْنِ نَبيِّكَ ، وَابْعَثْهُ مَقاماً مَحْمُوداً تَنْتَصِرُ بِهِ لِدينِكَ وَتَقْتُلُ بِهِ عَدُوَّكَ ، فَإنَّكَ وَعَدْتَهُ ذلِكَ وَأنْتَ الرَّبُّ الَّذِي لا تُخلِفُ الميعادَ

وكذلك تقول عند قُبور كلَّ الأئمَّة

Imam Sadiq (as) said,

"Recite the following when you come to the grave of al-Husain bin Ali (as), and you may also recite the same besides the graves of all Imams (as)"

(Only required portion is quoted here)

"O Allah, curse the two (Abu Bakr and Umar) who changed Your blessings, disobeyed Your Book, denied Your signs and accused Your Messenger. Stuff their graves and stomachs with fire and prepare a painful chastisement for them. O'Allah, raise the two of them and their associates and their followers blind in Hell. And on Judgment Day raise the two of them and their associates and their followers on their faces, blind and dumb and deaf; their abode is hell; whenever it becomes diminished We will increase to their burning. O Allah, do not make this the last time I come to the Ziyarat of the grave of the son of Your Prophet. Raise him in the praised status where You support Your religion with him and kill Your enemies through him. Indeed You promised this to him and You are the Lord who does not fail His promise."

You can recite the same by the graves of all Imam's (as).

[Source: Kamil al-Ziyarat, Pg. 332]