- Mar 21, 2013
- 24,786
- 31,558
Are you still running bots written in Python, C#, C++ or Perl? Worse yet, are you still running bots written in.....(gasp) VB??
Time has come to update your arsenal!
This short piece is just a few tips I'd like to share here to get you started in headless browser programming. But first things first.
What the heck is a headless browser?
Well it's just what the name implies. It's a fully featured web browser with no graphical interface. It's the guts of a web browser but without all the fluff and bloating that's required for end users. You're black hats after all, you don't need no pretty interface!
How do I use a headless browser?
You tell it to do stuff and it does stuff pretending to be a real human. Right now how do bots work? They are independent HTTP stacks built by bot writers so the bot will pretend to be a human. But this is really lacking these days. Google itself has a graphical bot crawling the web, and they can "see" your website. They even rank your stuff based on where you put the content, ads and so on(which IMO has created great distortions, but anyway).
Real black hats automate everything! So if you find yourself doing stuff by hand, you program a browser to do it for you. Of course you could use some macro or scripting package for Firefox, but that's a big waste because the browser takes over 1 GB of memory just to show up on your screen. If you're scripting 1000's of bots, you'll need one of NASA's computers to do it. With headless browsers you have tiny bots that act just like a real browser.
OK, so how do I get started?
(Before you do anything, I'll say : if you're not using Linux for your Black Hat work yet, then you are entirely out of the loop. I do a lot of browsing and run some softwares on Windows, but all my programming and most black hat botting is done on Linux.)
You need a headless browser you can program. These are some popular ones:
After you're familiar with the browsers themselves, you can try a higher level library such as :
PhantomJS
Right now PhantomJS is the hottest one, but it's quickly getting "too popular" and smart website owners have started to detect and fight it. So you may want to try out SlimerJS. One of the really cool features of SlimerJS is it's capable of taking snapshots. So if you wondered how folks make those thumbnail images of sites, or full page capture of sites, in bulk then SlimerJS is your answer.
Here is PhantomJS quick start guide. With 2 lines of Javascript you have a running web browser on your command line!
Create the script and run it with
command after you install the package. For example if you save your script to
you run it with
With PhantomJS you can load jQuery and do everything to a loaded page you'd do IF YOU WERE IN the page. You can load w w w .yo urco mpetitorhere .c om and then run YOUR JQUERY scripts in their page!
Here are examples of automating interaction with loaded pages with PhantomJS.
SlimerJS
Getting started with SlimerJS is just as simple. Here is the quick start guide to get you rolling.
Again with SlimerJS the loaded web page is now 100% under your control for botting and scripting. From the documentation : "Once a web page is opened, you may need to execute a javascript function into the context of the web page, in order to retrieve data or to manipulate the page content."
What do I do with this?
If you haven't realized the potential here yet, then you're probably in the wrong business!!
First of all Javascript is becoming the de-facto language for the WWW. Now all your bots can be written using Javascript and using REAL browsers. With these headless browsers you can make link harvesters, automated thumbnail generators, automatic posting and publishing on social media, everything a human can do on a web browser can be done using a headless browser! It is unlimited WWW scripting and automation potential - anything a human can do, your script and do too.
Well, this has been barto's sunday morning Black Coffee Black Hat momento. I hope you find this useful! Cheers!
Time has come to update your arsenal!
This short piece is just a few tips I'd like to share here to get you started in headless browser programming. But first things first.
What the heck is a headless browser?
Well it's just what the name implies. It's a fully featured web browser with no graphical interface. It's the guts of a web browser but without all the fluff and bloating that's required for end users. You're black hats after all, you don't need no pretty interface!
How do I use a headless browser?
You tell it to do stuff and it does stuff pretending to be a real human. Right now how do bots work? They are independent HTTP stacks built by bot writers so the bot will pretend to be a human. But this is really lacking these days. Google itself has a graphical bot crawling the web, and they can "see" your website. They even rank your stuff based on where you put the content, ads and so on(which IMO has created great distortions, but anyway).
Real black hats automate everything! So if you find yourself doing stuff by hand, you program a browser to do it for you. Of course you could use some macro or scripting package for Firefox, but that's a big waste because the browser takes over 1 GB of memory just to show up on your screen. If you're scripting 1000's of bots, you'll need one of NASA's computers to do it. With headless browsers you have tiny bots that act just like a real browser.
OK, so how do I get started?
(Before you do anything, I'll say : if you're not using Linux for your Black Hat work yet, then you are entirely out of the loop. I do a lot of browsing and run some softwares on Windows, but all my programming and most black hat botting is done on Linux.)
You need a headless browser you can program. These are some popular ones:
After you're familiar with the browsers themselves, you can try a higher level library such as :
PhantomJS
Right now PhantomJS is the hottest one, but it's quickly getting "too popular" and smart website owners have started to detect and fight it. So you may want to try out SlimerJS. One of the really cool features of SlimerJS is it's capable of taking snapshots. So if you wondered how folks make those thumbnail images of sites, or full page capture of sites, in bulk then SlimerJS is your answer.
Here is PhantomJS quick start guide. With 2 lines of Javascript you have a running web browser on your command line!
Create the script and run it with
Code:
phantomjs
Code:
testing.js
Code:
phantomjs testing.js
With PhantomJS you can load jQuery and do everything to a loaded page you'd do IF YOU WERE IN the page. You can load w w w .yo urco mpetitorhere .c om and then run YOUR JQUERY scripts in their page!
Here are examples of automating interaction with loaded pages with PhantomJS.
SlimerJS
Getting started with SlimerJS is just as simple. Here is the quick start guide to get you rolling.
Again with SlimerJS the loaded web page is now 100% under your control for botting and scripting. From the documentation : "Once a web page is opened, you may need to execute a javascript function into the context of the web page, in order to retrieve data or to manipulate the page content."
What do I do with this?
If you haven't realized the potential here yet, then you're probably in the wrong business!!
First of all Javascript is becoming the de-facto language for the WWW. Now all your bots can be written using Javascript and using REAL browsers. With these headless browsers you can make link harvesters, automated thumbnail generators, automatic posting and publishing on social media, everything a human can do on a web browser can be done using a headless browser! It is unlimited WWW scripting and automation potential - anything a human can do, your script and do too.
Well, this has been barto's sunday morning Black Coffee Black Hat momento. I hope you find this useful! Cheers!