(Exodus 10:22:) "And there was thick darkness in all the land of Egypt three days." There were seven days of darkness over the Egyptians. For the first three days, whoever was sitting and sought to stand could stand, and whoever was standing and sought to sit could sit. And for another three days, whoever was sitting could not stand, and whoever was [standing] could not sit. Behold, that is six. And which is the seventh day? As it is said (Exodus 14:20), "And there was the cloud and the darkness, yet it gave light by night" — the cloud was in Egypt, giving light to Israel and darkness to the Egyptians, as it is said (Exodus 10:23), "But all the children of Israel had light in their dwellings." And Israel would enter the houses of the Egyptians, and whatever the Egyptians had, Israel would search out and see. And at the hour when the Holy One, blessed be He, said to Israel (Exodus 3:22), "But every woman shall ask of her neighbor, and of her that sojourns in her house," etc., Israel would go in among the Egyptians, and each and every one would say to his fellow, to his neighbor, "Lend me that vessel which you have." And he would say, "I have none." And he would say, "I know that you have it, and behold it is inside your chest; behold it is in such-and-such a place; I saw it in your hand." And he would lend him that vessel. And from where did Israel know? Rather, in those days of darkness they had entered their houses and seen their silver and their gold and their vessels which they had. Rabbi Abin the Levite said: Also the plague of blood, when it came upon the Egyptians, the Nile was turned to blood, as it is said (Exodus 7:24), "And all the Egyptians dug round about the Nile for water to drink," etc. What did they do? They would see Israel filling his jar from the Nile, and they would go after him and ask of him to drink water, and it would become blood within their mouths. Rabbi Abin said: Whatever they took from Israel by purchase, they would drink as water, for it is impossible for a person to be without water; so they would take water from Israel, and from there Israel grew rich. [And here too, when the plague of darkness came upon them, they came to know the houses of the Egyptians, and from there Israel grew rich.]
Seven Days of Darkness and How Israel Came to Know Egypt's Hidden Wealth
Midrash Tanchuma Buber, Bo 3:1
ויהי חשך אפלה בכל ארץ מצרים שלשת ימים (שמות י כב). ז' ימים של חושך היה על המצרים, ג' ימים הראשונים מי שהיה יושב ומבקש לעמוד עומד, ומי שהיה עומד ומבקש לישב היה יושב, ועוד ג' ימים אחרים מי שהיה יושב לא היה יכול לעמוד, ומי שהיה (יושב) [עומד] לא היה יכול לישב, הרי ו' ואיזהו יום שביעי, שנאמר ויהי הענן והחשך ויאר את הלילה (שם יד כ), היה הענן במצרים ומאיר לישראל ומחשך למצרים, שנאמר ולכל בני ישראל היה אור במושבותם (שם י כג), והיו ישראל נכנסין לבתיהם של מצרים, וכל מה שהיה למצרים היו ישראל מחפשין ורואים, ובשעה שאמר הקב"ה לישראל ושאלה אשה משכנתה ומגרת ביתה וגו' (שם ג כב), היו ישראל נכנסין אצל מצרים ואומר כל אחד ואחד לחבירו לשכינו השאילני אותו הכלי שיש לך, והוא אומר אין לי, והוא אומר אני יודע שיש לך, והרי היא בתוך התיבה שלך, הרי הוא במקום פלוני, אני ראיתי אותו בידך, והיה משאילו אותו הכלי, ומהיכן היו ישראל יודעין, אלא באותן ימי החשך היו נכנסין לתך בתיהן ורואין כספם וזהבם וכליהם שהיו להם, אמר ר' אבין הלוי אף מכת הדם כשבאת על המצרים נהפך היאור לדם, שנאמר ויחפרו כל מצרים סביבות היאור מים לשתות וגו' (שם ז כד), מה היו עושין, היו רואין לישראל ממלא את חביתו מן היאור, והיו הולכין אחריו ומבקשין ממנו לשתות מים, והיו נעשין לתוך פיהם דם, אמר ר' אבין מה שהיו לוקחין מישראל במקח היו שותין מים, שאי אפשר לאדם להיות בלא מים, והיו לוקחין מישראל מים, ומשם העשירו ישראל, [ואף כאן כשבאת מכת חשך עליהן הכירו בתיהן של מצרים ומשם העשירו ישראל].