Turn off your mac. then turn it back on and hold the left shift key to get it into safe mode.
Open your finder ( magnifying glass ) type in disk utility, and launch the disk utility application.
On the left side of the disk utility window, click your mac hd, then at the upper right hand side, click first aid, then click start first aid..
Once complete.Shut down your mac.
Then, unplug your wireless router and modem from power for 1 minute, then plug them back in. ( or you may have a single combo unit, if so unplug that for a minute )
Then, after a minute passes plug them back in and turn them on. When the lights are all lit up, start your mac and try safari.
if it still cant access those pages, then lets reset safari..
From the Safari menu bar, please select Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data > for time frame choose from the beginning of time and confirm.
Once complete, close safari, reopen it and test.
If you have another browser on your mac and safari still isnt working, please go to avast.com and download the
version of avast malware protection and scan your computer to see if anything still comes up for now.
If this doesnt work or if you get stuck or run into any issues, let me know.
Please update with results once you try this.
If you are satisfied with the help I have provided, please remember to click and submit a 5 star rating on this page. Your feedback is important as it is the only way I am credited for assisting you. Thank you.