Run through the list once, make a map of each string and how many times it occurs. Loop through it again, and append your * to any string that has a value of more than one in the map.
It simply searches all matches of current line, thus highlighting them (if the setting is enabled, which I think it's the default)
Besides, you can then use