Rashi on the Former Prophets
1 Samuel 5
Beside Dagon. The idol was made in the form of a fish.
The threshold. The equivalent of אַסְקוּפָה [=threshold].
And He devastated them. An expression [שְׁמָמָה] meaning desolation.
With hemorrhoids. The mesentery of the large intestine, a plague of the rectum. Mice would enter their recta, disembowel them, and crawl out.
And they were afflicted internally.וַיִשָֹּתְרוּ is identical with וַיִסָּתְרוּ for it is listed in the Masora among those words written with a 'שֹ' and explained as though it were written with a 'ס' meaning "there was a plague in the hidden parts of the body."
Deadly upheaval. All upheavals [mentioned in Scripture] are caused by thunder. The following is the origin: "Adonoy thundered with a great noise on that day against the Philistines, making them panic. It is so explained in the Aggadah of Thirty-Two Rules of R. Eliezer, the son of R. Yose Haglili.
You arrive at the cited line; the whole work is yours to read around it. The text is set from the cited public-domain edition.