Whatever the Egyptians devised against Israel, the Holy One, blessed be He, brought upon them that which they had devised for them. They devised that they should be drawers of their water. What is written? "He turned their Niles into blood, so that they could not drink of their streams" (Psalms 78:44). They devised concerning them that they should be laden as porters (Greek: pragmateutes, traveling traders). He sent frogs upon them, and they were scorching them. They devised that they should labor upon the land. The Holy One, blessed be He, made the earth swarm with gnats. They devised that they should carry their children like a tutor (paidagogos). He sent among them lions and wolves and bears. An Egyptian would have ten sons; he would tell an Israelite to lead them to the market, and the lion would come and take one, and the wolf one, and the bear one, and the leopard one, and a fiery serpent one. And he would come back to the Egyptian alone. The Egyptian would say, "Where are my sons?" The Israelite would say to him, "Sit down and I will render you an accounting." He took the lion one, and so on and so forth, until he had given him the accounting. They devised that they should shepherd their cattle, and He sent among them the pestilence, as it is said, "And all the cattle of Egypt died" (Exodus 9:6). They devised that they should be their bath attendants who washed them; He brought upon them the boils. They devised to stone them with stones; the Holy One, blessed be He, brought upon them the hail, as it is said, "And there was hail" (Exodus 9:23). They devised that they should be their vine-dressers; the Holy One, blessed be He, brought the locust and it ate their trees, as it is said, "And it ate all the herbage of the land" (Exodus 10:15). They devised to bind them in the prison-house; the Holy One, blessed be He, brought upon them darkness, as it is said, "They saw not one another" (Exodus 10:23). They devised to kill them; the Holy One, blessed be He, killed their firstborn, as it is said, "And the Lord smote all the firstborn" (Exodus 12:29). They devised to sink them in the water; the Holy One, blessed be He, also sank them in the water, as it is said, "And He overthrew Pharaoh and his host in the Sea of Reeds" (Psalms 136:15).
Measure for Measure - The Ten Plagues Answer Egypt's Schemes
Midrash Tanchuma Buber, Bo 5:1
כל מה שחשבו המצרים על ישראל הביא [הקב"ה] עליהם מה שחשבו להם, הם חשבו להם שיהו שואבי מימיהם, מה כתיב ויהפך לדם יאוריהם ונוזליהם בל ישתיון (תהלים עח מד), הם חשבו עליהם שיהו טעונין (פרגמוטרם) [פרגמוטיס], שלח עליהם צפרדעים והיו משרפים אותם, הם חשבו שיהו עושין בארץ, הרחיש הקב"ה את הארץ כנים, הם חשבו שיהו טוענין את בניהם כפדגוג הזה, שלח בהם אריות וזאבים ודובים, היה למצרי י' בנים אמר לישראל שיוליכם לשוק, והיה הארי בא ונוטל אחד, והזאב אחד, והדוב אחד, והנמר אחד, ונחש שרף אחד, והיה נכנס אצל המצרי לבדו, והמצרי אומר איכן הם בני, אומר לו ישראל שב ואני אעשה לך חשבון, נטל האריה אחד וכך וכך עד שנתן לו חשבון, והם חשבו שיהו רועים את מקניהם, ושילח בהם את הדבר, שנאמר וימת כל מקנה מצרים (שמות טו), הם חשבו שיהו בלנין (רוחצין אותם), הביא עליהן את השחין, הם חשבו לסקול אותם באבנים, הביא עליהם הקב"ה את הברד שנאמר ויהי ברד וגו' (שם שם כב), הם חשבו שיהו כורמיהם, הביא הקב"ה את הארבה ואכל אילנותיהם, שנאמר (ואכל) [ויאכל] את כל עשב הארץ וגו' (שם י טו), הם חשבו לאסור אותם בבית האסורים, הביא הקב"ה עליהם חושך, שנאמר לא ראו איש את אחיו וגו' (שם שם כג), הם חשבו להרג אותם, הקב"ה הרג בכוריהם, שנאמר וה' הכה כל בכור (שם יב כט), הם חשבו לשקע אותם במים, אף הקב"ה שקען במים, שנאמר ונער פרעה וחילו בים סוף וגו' (תהלים קלו טו).