The midrash can be found in Exodus Rabah 9:12 as an argument between R' Yehudah and R' Nehemiah. One says that warning of each plague lasted 24 days, and the plague itself lasted 7 days. The other says that the warning lasted 7 days and the plague itself lasted 24.

The Etz Yosef on that midrash provides more detailed information, including other sources, as to the consensus that events surrounding each plague lasted 1 month, with the exception of the plague of the firstborn.