foul and loathsome sore
Ἕλκος κακὸν καὶ πονηρὸν [Helkos kakon kai ponēron] . Sore, is ἕλκος [helkos] meaning: Strictly wound; by metonymy ulcer, ulcerated sore, abscess.1 Foul is κακὸν [kakon] , which in this context means dangerous, pernicious . . . harmful.2 Loathsome is πονηρὸν [ponēron] , meaning painful, virulent, serious.3 Thus, God strikes them with dangerous and pernicious, painful and virulent wound-like ulcers or abscesses. The Beast worshipers experience a similar condition to that of Job when he was struck with boils by Satan (Job Job 2:7). The plague which strikes the Beast worshipers is like that which Aaron and Moses caused upon the men and beasts of Egypt (Ex. Ex. 9:8-11). God promised to strike Israel with similar boils if they continued in disobedience toward Him (Deu. Deu. 28:27, Deu. 28:35), but also to strike their enemies if they returned and were obedient to Him (Deu. Deu. 7:15). God describes the similar plague with which He struck Egypt: Tumors, with the scab, and with the itch, from which you cannot be healed (Deu. Deu. 28:27). The sores will not only be painful, but they will be extremely irritating because of their itch and refusal to heal. Lilje comments that those who once bore the mark of the beast are now visited by marks of God.4 See The Plagues of Egypt and the Tribulation.
came upon the men who had the mark of the beast and those who worshiped his image
Not two categories of people, but two ways of describing the same group. They are the enemies of God during the Tribulation, much as Egypt was the enemy of Israel (and God) during the Exodus. Their worship of the Beast and his image violates the second commandment, written on stonethe testimony in the ark of the covenant in the tabernacle which was mentioned just a few verses before (Rev. Rev. 15:5+): You shall not make for yourself a carved image . . . you shall not bow down to them nor serve them (Ex. Ex. 20:4). See commentary on Revelation 13:15, Revelation 13:16, and Revelation 14:9.
2 Frederick William Danker and Walter Bauer, A Greek-English Lexicon of the New Testament and Other Early Christian Literature (Chicago, IL: University of Chicago Press, 2000), 397.
3 Ibid., 690.