The Midrash Shoher Tob (Tehillim 91) speaks about a dangerous "demon" called "Keteb Meriri" that is covered with scales and hair, has eyeballs all over its body, and sees from the eye situated on its chest. It generally resides in areas that are partly sunny and partly shady, and moves by rolling like a ball. Anyone who comes near this demon, the Midrash comments, exposes himself to great danger. The Midrash in fact relates that there were schoolchildren who suffered harm as a result of "Keteb Meriri." It is specifically during the three weeks of between Shiba Asar Be’Tamuz and Tisha B’Ab, the Midrash teaches, that this harmful spirit surfaces and poses danger.
It is very uncharacteristic for the Shulhan Aruch, which was written as a strictly Halachic code, to include Kabbalistic concepts in presenting Halachic guidelines. Yet, the Shulhan Aruch indeed writes that during the three weeks one should not go outdoors to partially shady areas between the fourth and ninth hours (referring to Halachic hours) of the day, when this demon is most threatening. He adds that during this period, parents should make a point not to hit their children, and teachers should likewise refrain from smacking students, in order to avoid risks. The Midrash tells the story of Rabbi Abahu who saw a teacher with a branch ready to hit an unruly student. Rabbi Abahu sharply condemned the teacher, noting that "Keteb Meriri" was standing right behind him with an iron rod, ready to strike. This story shows the dangers of administering any type of corporal punishment during this period, when we are exposed to the dangers of "Keteb Meriri."
The Aruch Ha’shulhan (work by Rabbi Yehiel Michel Epstein, Byelorussia, 1829-1908) cites authorities who limit this Halacha to uninhabited areas, such as forests and the like. Inside a city, however, the presence of many people, as well as the presence of Mezuzot on the doorposts, offers a degree of protection from this harmful spirit. On one level, this restriction essentially renders this Halacha practically irrelevant nowadays, when we usually spend our time in towns, cities and other inhabited areas. Nevertheless, this Halacha demonstrates the importance of avoiding danger during this three-week period and keeping a "low profile," as this period is particularly suited for mishaps and calamity, Heaven forbid. It is therefore advisable to remain in safe, secure quarters during the three weeks, especially between the fourth and ninth hours of the day.
Summary: It is advisable to avoid desolate, outdoor areas between the fourth and ninth hours of the day (as defined by Halacha) during the three weeks between Shiba Asar Be’Tamuz and Tisha B’Ab. More generally, it is proper to avoid all dangerous situations during this period, which is a particularly inauspicious time for the Jewish people.