Developing in Python

Just thought I'd share what I'm working on with y'all. I would greatly appreciate constructive criticism and/or advice on making things work better.

Disclaimer: I just started learning python 2 days ago [25JAN2012 at the time of writing] (and my computer science education ended at the high school level several years ago). As such, please excuse any grievous transgressions I make in speech, implementation, or action.

The following is my attempt at a proxy-checker. I realize that I may just be reinventing the wheel (props to BHW's captchaman for his beautiful Proxy Madness 4), but this particular script is going to be a component in a much larger (and hopefully useful) suite.

More on that later. Sorry about the code not being 100% out-of-the-post functional; I apparently need to wait longer before I can have links in my posts.

Something about the script I just finished (dealing with internet relay chat interfaces) triggers the moderation filter - I can't post it somewhere and link to it, and I'm not sure I should be trying to circumvent a filter anyway.

So here's the concept:

A class inherits the SingleServer___Bot, and uses

Code:

lines = (file.read()).splitlines()

to populate a list with the configuration details (stored in SW.CONF for ease of modification).

The list is then used to start the SS_B derivative (each line is one of the arguments, in order).

I've tested it, and it connects to a server and acknowledges most commands - the only one I'm having trouble with is the command that should make it change its own nickname - akin to a /nick somenick command in a common client.

If/when the restrictions on me are lifted, I'll edit this (or add another post) to include the actual code.

-Proxy scraping/leeching - need to find reliable sources and then figure out how to scrape proxies without extracting extraneous information. Gathering by hand (or manually clicking "gather proxies" and then "save" is time-consuming).

-Some implementation of Selenium. Parse pages, look for links, map a suspected route to a desired page and then behave like a human who would follow that path.

-Some sort of mastermind that controls the above components in an intelligent manner.

I plan on distributing this later, too - across many machines, if possible, all of whom need a unique nickname when they connect to the server (uuid library?). This means I should also have a script that can delegate tasks and rapidly process input/output between humans (me) and the distributed taskforce (scripts).

Something about the script I just finished (dealing with internet relay chat interfaces) triggers the moderation filter - I can't post it somewhere and link to it, and I'm not sure I should be trying to circumvent a filter anyway.

So here's the concept:

A class inherits the SingleServer___Bot, and uses

Code:

lines = (file.read()).splitlines()

to populate a list with the configuration details (stored in SW.CONF for ease of modification).

The list is then used to start the SS_B derivative (each line is one of the arguments, in order).

I've tested it, and it connects to a server and acknowledges most commands - the only one I'm having trouble with is the command that should make it change its own nickname - akin to a /nick somenick command in a common client.

If/when the restrictions on me are lifted, I'll edit this (or add another post) to include the actual code.

-Proxy scraping/leeching - need to find reliable sources and then figure out how to scrape proxies without extracting extraneous information. Gathering by hand (or manually clicking "gather proxies" and then "save" is time-consuming).

-Some implementation of Selenium. Parse pages, look for links, map a suspected route to a desired page and then behave like a human who would follow that path.

-Some sort of mastermind that controls the above components in an intelligent manner.

I plan on distributing this later, too - across many machines, if possible, all of whom need a unique nickname when they connect to the server (uuid library?). This means I should also have a script that can delegate tasks and rapidly process input/output between humans (me) and the distributed taskforce (scripts).

Does this sound feasible? What do y'all think?

This is a really strict moderation filter.

Click to expand...

If you want to upload code, just throw it on pastebin or a similar paste site, and link it here.

Regarding the idea:

You can just use file.readlines(), saves space and time. Also, "for var in file" automatically iterates over each line, which is even more efficient than doing a .readlines() call beforehand.

Also, I'm not sure that idea is feasible but you'd have to test it. You generally can't control HTTP or SOCKS proxies in the same way one would control drones in a botnet. They're pretty limited in what they can do. It's better to do something like send a simple HTTP request out to thousands of probably-working proxies, if you're trying to spam in some way. Your command and control can all be done from within your program, with no IRC required in my opinion. I'm not sure what kind of commands you had in mind though.

Agreed, doesn't Selenium require you to run a JAVA server or something? Mechanize is much better, unless like weedsmoker said, you need JS parser. But if you do, I suggest you get PyQt or PySide and lear QtWebKit

Something about the script I just finished (dealing with internet relay chat interfaces) triggers the moderation filter - I can't post it somewhere and link to it, and I'm not sure I should be trying to circumvent a filter anyway.

So here's the concept:

A class inherits the SingleServer___Bot, and uses

Code:

lines = (file.read()).splitlines()

to populate a list with the configuration details (stored in SW.CONF for ease of modification).

The list is then used to start the SS_B derivative (each line is one of the arguments, in order).

I've tested it, and it connects to a server and acknowledges most commands - the only one I'm having trouble with is the command that should make it change its own nickname - akin to a /nick somenick command in a common client.

If/when the restrictions on me are lifted, I'll edit this (or add another post) to include the actual code.

-Proxy scraping/leeching - need to find reliable sources and then figure out how to scrape proxies without extracting extraneous information. Gathering by hand (or manually clicking "gather proxies" and then "save" is time-consuming).

-Some implementation of Selenium. Parse pages, look for links, map a suspected route to a desired page and then behave like a human who would follow that path.

-Some sort of mastermind that controls the above components in an intelligent manner.

I plan on distributing this later, too - across many machines, if possible, all of whom need a unique nickname when they connect to the server (uuid library?). This means I should also have a script that can delegate tasks and rapidly process input/output between humans (me) and the distributed taskforce (scripts).

Does this sound feasible? What do y'all think?

This is a really strict moderation filter.

Click to expand...

You should look into Scrapy for scraping proxies
I would say bash scripts & cron jobs for controlling them or even a simple website using PHP

Note that adblockers might block our captcha, and other functionality on BHW so if you don't see the captcha or see reduced functionality please disable adblockers to ensure full functionality, note we only allow relevant management verified ads on BHW.