Those were installed along with some other piece of software you
installed on your Mac. In order to avoid such adware in the future, you
need to be more vigilant in ensuring that you never download software
from untrusted sources.
There are untrusted third-party download web sites that are well known
to inject adware into downloads: CNET Downloads, VersionTracker,
MacUpdate, and so on. If you use one of those sites to download software
to install on your computer, you are asking for trouble. If you want to
install a legitimate piece of Mac software, you should avoid such
third-party sites and instead go directly to the software maker's web
site to download their software.
For instance let's say you want to download HandBrake, a popular video
encoding tool from MacUpdate.com. Rather than downloading it from
MacUpdate, you should do a web search for "handbrake" to find that the
official Handbrake site is at
https://handbrake.fr, then go there and
download it from there instead.
Another source for Mac malware is any web site that displays a pop-up
message asking you to download and install "Flash" or any web site that
tells you your computer is supposedly insecure and that you need to
download software from the web site to protect yourself (often under the
name MacKeeper, but it could be named just about anything). Web sites
cannot scan your computer directly, which means such messages are bogus
and are only trying to use fear to trick you into downloading and
installing malware. Don't fall for that trick. A legitimate web site
will not tell you your computer is infected. And again you should never
download software from random untrusted sources.
I would also recommend you remove Adobe Flash completely from your
computer and avoid clicking any web notice that insists you install
Flash, since often that web site will bundle malware or adware with that
download. Also, more often than not, Flash is completely unnecessary.
For instance, let's say you've completely removed Flash from your
computer. You visit a web site to watch a video, and the video shows a
banner that says you need Flash installed to watch it. Rather than
installing Flash, you can set your web browser's User Agent string to
any iOS string, and nine times out of ten, the video will play without
issue. This is because the overwhelming majority of web sites are coded
to use Flash when they detect a computer (Mac, Windows) is viewing it,
and use HTML5 when they detect a mobile device (iOS, Android) is viewing
it. With Safari, there is built-in functionality to allow you to change
your User Agent string (go to Safari Preferences > Advanced and enabled
"Show Develop menu", then choose Develop > User Agent from the menu
bar). Instructions are different for other browsers:
<
http://osxdaily.com/2013/01/16/change-user-agent-chrome-safari-firefox/>
Finally, if you encounter a web site that you absolutely must view that
won't work with an iOS User Agent string (which, again, is extremely
rare), and you want to install Adobe Flash again, go directly to the
trusted source, which is Adobe's web site, to download it:
<
https://get.adobe.com/flashplayer/>