Depends on what you mean by "bad bacteria". Are you worried about Pedio or your beer getting sick and shampoo like? Because that could easily happen. I don't typically mind as I will let the beer ride out.
I do not live in a great area for sitting out a thing of wort and capturing a culture. What I have done in the past with great results is taken fresh fruit from friends who live out in the country and cultured the yeast and bacteria off of that. I think the key components are; not aerate the wort, that will just invite acetobacter in early. Start with a low wort, I use 1.030. Step up fairly frequently.
I do a 250ml starter, then add another 250ml (remove fruit if cultivating from that) at about day 3. Then after a week I add another 250ml. I want an acidic base and some alcohol to form to ward off mold and other nasty ****. I then let that go for a while (maybe too long because I am lazy and forgetful) then cold crash it, and build another 500ml starter at about 1.035-1.040 and let that go for a long while, or until ready to use in a beer, which depending on the age I may do another starter.