For Facebook I'd say don't friend anyone you don't know. Also if guys are sending you messages there should be a way to report them for sexual harassment.