Sunteți pe pagina 1din 45

The UBot Studio

SCRIPT REFERENCE

The Action & Chosen Commands

CHOSEN COMMANDS
CLICK CHOSEN CHANGE CHOSEN ATTRIBUTE SELECT RANDOM CHILD CHOSEN SEND KEYS FILE CHOSEN SEND KEYS FIELD CHOSEN CHANGE FILE FIELD CHOSEN FOCUS CHOSEN SCRAPE CHOSEN TABLE SAVE CHOSEN IMAGE

ACTION COMMANDS
NAVIGATE NAVIGATE WITH POSTDATA DOWNLOAD FILE CLICK DIALOG BUTTON SET ACTIVE WINDOW/CLOSE WINDOW SET DIALOG TEXT CLOSE ALL DIALOGS CLEAR COOKIES CHANGE PROXY/SET PROXY CREDENTIALS SEND EMAIL BUILD ACCOUNT/CREATE ACCOUNT CHANGE IFRAME BODY WRITE TO BROWSER RUN JAVASCRIPT SAVE BROWSER IMAGE SHELL

CHOSEN COMMANDS:
CLICK CHOSEN: This command will click a link or a button. You can also use it to check or uncheck a checkbox. There are no parameters required for this command, it is simply placed after the node that identifies the element (i.e. choose by attribute, choose by position, etc).

In this example you can see the element (web button) was chosen by attribute (1) and the click chosen command was placed directly after it (2). Running this script will cause the button to be pressed and will navigate to the sales page.

CHANGE CHOSEN ATTRIBUTE: This command, after choosing an element, lets you change a value within that element. This is useful for, among other things, filling in form fields, setting checkboxes to a given value, setting drop down fields, and selecting radio buttons. When brought into the scripting area you will need to provide two (2) parameters: 1. 2. Attribute to change Value

In this example we will use it to fill a form field with a specified value. Like any other node, you can pull your content from a variety of sources (i.e. lists, variables, files, etc).

We will be using the ubotstudio.com playground (simple form) fpr this example:

Since all the form fields use the same process for filling them we will only be filling one field: Step 1) Right click inside the username field and select choose by attribute. By default it will have the attribute Name chosen, which is fine for this example. In this case you can see in the image below that the element has a unique name. We will leave it as is and keep the search method on exact match.

Click ok. Step 2) Right click inside the username field again and select change chosen attribute.

Although it defaults to name you want to change it to value and enter whatever value you like. Click OK and that's it. When you run the script it will fill that field with your specified username.

SELECT RANDOM CHILD CHOSEN: This command is very useful for dealing with drop down lists. It allows you to have the script randomly choose a value from the drop down list.

The first step is to right click the drop down menu and choose it by attribute:

Again, the name attribute is fine in this example. Click ok.

Now right click the drop down menu again and click on select random child chosen. The entire code looks like this:

It will now choose a random value from the drop down list every time you run the script.

SEND KEYS FILE CHOSEN: This command is used specifically for filling text into file input fields, as a means of getting around the lack of direct access to them. This command will not steal focus, and runs entirely in the background. To simulate typing on elements other than file fields, use send keys chosen field. This command no longer works if you have internet explorer 8 installed.

In the above image the form field is chosen by attribute (1), and then filled with the specified path (2). In some cases when you are unable to use the browse button, this technique may work for you instead.

SEND KEYS FIELD CHOSEN: This command will simulate keystrokes to input fields other than file fields. This is useful in cases where the field reacts to keystrokes with javascript, and change chosen attribute does not trigger the javascript associated with the element.

Above is an example of a form where the button is not activated unless triggered by keystrokes, etc. For the field containing the first name we would simply choose the field by attribute and then use the send keys field chosen command to simulate the keystrokes:

When changing chosen attribute does not trigger the activation, this is the next logical step to take.

CHANGE FILE FIELD CHOSEN:


This command sets the file in a file field. In this example you will see a file upload field that has a browse button. This command allows you to enter the file without interacting with the browse function (It places the path to the file directly in the file field):

The first step is to choose the file field by attribute:

The final step is to choose the change file field chosen command and enter the path to your file:

When the script is run, this is the result:

FOCUS CHOSEN:
This command brings the chosen element into focus. This can be very useful with the input commands. In this example we will click a button that is not responding to the click chosen command. The first step is to choose the button by attribute. Here is the button we are dealing with:

Choose by attribute:

Add the focus chosen command:

Now when this script is run you will see the button has been given focus (The small dotted line inside the button):

Now you can use a send keys command under input commands to hit Enter to press the button:

Once the entire script is run you can see the button has been pressed:

When the button is pressed it changes the background color to yellow.

SCRAPE CHOSEN TABLE: This command creates a table based on a chosen table. For the purpose of this example we will use the table located at http://www.w3schools.com/html/html_tables.asp :

If you recall from previous discussions the structure of a table is as follows:

...where the first column and the first row are both 0's and not 1's. So Bob would be located in column 0, row 0.

That will be essential to understand later when you are trying to grab data from your table. To begin this example, we can clearly see that the fruit names and percentages are part of a table (you can actually see the borders of the table). Therefore the first step is to pick anything inside the table and choose it by attribute. For this example we will choose apples:

The reason you can choose anything in the table is because you will be using the choose ancestor command to grab the table. You will find this command in the right click menu when you right click on the item you just chose by attribute (apples):

You will then be asked for the html tag you would like to use. In this case it is table (without the quotes):

The final step is to select the scrape chosen table command and bring it into the scripting area (either by dragging it or double clicking it): You will give the table a name (and don't forget to add a clear table command at the top of the script). Just so you can see the structure of the scraped table, we will save the table to a .csv file and then open it up. We do this by using the save to file command (under variable commands) and giving it a name and a location:

Once the script is run we can locate the csv file in our documents

folder and open it up:

As you can see the table was scraped intact. Apples is located in column 0, row 0 and it's corresponding percentage is located in column 1, row 0. You now have the option to use the create table from file command to create this table at a future time.

SAVE CHOSEN IMAGE:


This command allows you to save the image of an element. Using the website from the example above we are simply going to save the site's logo as an image on our hard drive:

This requires only two nodes:

As a result of running that script, the image is saved to your desktop:

That's it. Simply choose an image by attribute and use the save chosen image command. Give it a name and a location (path to the image file).

ACTION COMMANDS: NAVIGATE: The navigate command simply visits whatever URL you choose. The only parameters are the url and Yes and No, which correspond to whether or not the script should wait until the site finishes loading before moving onto the next command. This is set to Yes default and will be chosen most of the time.

***The default url that will appear in the parameter window is the URL of the site that's currently in the browser element in Ubot.

NAVIGATE WITH POSTDATA: The navigate with postdata command navigates to a site while simultaneously submitting the data that would normally be submitted through a web form. Postdata is defined as: Data sent from a Web browser or other HTTP client to a Web server. There are three (3) parameters to fill when you choose this command:

Obtaining postdata info There are a few ways to do this, but for the purposes of this reference you will be shown only one. You will need to download the Mozilla Firefox web browser if you don't already have it. You can download it from HERE Next you will need to download and install an add-on for Firefox called Tamper Data which can be downloaded from HERE

When you open Firefox navigate to the URL containing the web form:

Next open up the tamper data add-on you just installed:

It will look like this:

You will then need to fill out the web form and click submit:

After you click submit you can go back and look at the tamper data window and you will see it now contains a lot of information. In the top window you will just want to locate the post method near the top of the list and highlight it. Once it is highlighted the lower left window will contain the postdata string you will need for your Ubot command. Simply right click the string and click on copy to send it to your clipboard. ***NOTE: The postdata string will begin with POSTDATA=. Remove that from the string!

DOWNLOAD FILE: This command allows you to download a file from the internet and save it to the hard drive on your computer. There are two (2) parameters associated with this command. 1) Enter a URL where you will enter the url of the file you wish to download, and 2) Choose a file where you will tell Ubot where to store your file (including the name of the file you choose):

CLICK DIALOG BUTTON: The click dialog button command allows for the pressing of any (usually javascript) dialog button that appears on the screen. Sometimes these will be in the form of warnings or alerts (ie - "You are now navigating away from Nationalcitybank.com. Please press OK to continue."), and other times they will be to tell you that something has been done incorrectly-Perhaps youve forgotten to fill in a form field on an account creation page. The command requires only one parameter - the text of the button that requires clicking. (This is not the window text, but the text of the button itself, usually something like "OK".) Please note that dialog boxes can halt the flow of the script, and the command that raises the dialog should be done inside a thread command.

SET ACTIVE WINDOW/CLOSE WINDOW: This command will bring a desired window into focus according to its title. The title of the window is located in the upper left corner. Using the example from the Click Dialog Button reference, you will see the window name is File Download Security Warning (see image)

***There is no need to enter the title manually into the node as you can simply click on the desired window once you bring the node into the scripting area. The Close Window Command is used to close the window you chose to make active (the active window).

SET DIALOG TEXT: This command will type text into a dialog window into a field with a specified label. Please note that dialog boxes can halt the flow of the script, and the command that raises the dialog should be done inside a thread command. This command contains two parameters: 1) Enter Label Text(Case sensitive) This refers to the label of the field you wish to enter text into. 2) What Would You Like To Type This refers to the text you wish to enter into the field.

CLOSE ALL DIALOGS: This command is used to close ALL dialogs that appear. There are only two options for this command: On and Off (see image):

If you turn this option On, you MUST remember to turn it off in your script when you no longer need it. Take care in using this command because as previously stated it closes ALL dialogs (which can include Ubot dialogs as well). If you don't shut it off, you won't be able to save your script as the save dialog will be closed automatically.

CLEAR COOKIES: This command is used to clear the domain cookies of a given website. It can be very useful if you need to log in to the same website several times using different login credentials. Simply drag this node into the scripting area wherever you need to apply it.

CHANGE PROXY/SET PROXY CREDENTIALS: This command is used to flip proxies. You can do this using a list from a file, or with a variable, or with specified proxies. You could, for example, search a page that contains proxies, test them, and implement them all in a single script. There is only one parameter associated with this command:

You simply enter the proxy in the format specified (ip address:port) so it would look like this: 127.0.0.1:80 ***NOTE: To reset the proxy use the following ip:port combination: 127.0.0.1:localhost SET PROXY CREDENTIALS is used if your proxy requires a username and password to access it. Simply enter the username and password. Place this command after the change proxy command in your scripting area.

SEND EMAIL: This command allows UBot scripts to connect to smtp email accounts and create and send emails. These emails could contain information relevant to the script thats being run - for instance, you could email someone a list of scraped page information. Or you could scrape email addresses and email the client yourself! This command has 7 required parameters:

1) Enter server Here is where you will provide the smtp server you wish to use for sending emails. (i.e. smtp.mydomain.com) 2) Enter Username Here is where you will provide the username to log into that mail server. 3) Enter password Here is where you will enter the password to log in to that mail server. 4) Enter To: here is where you will enter the email address you wish to send the email to. 5) Enter From Here is where you will enter the email address that is sending the email (who is it from?) 6) Enter Subject Here is where you will enter the subject of your email. 7) Enter Message Here is where you will enter the body of your message. ***NOTE Remember that the body of the message can come from a file (text file for example) by using the $read file constant. Be creative!

BUILD ACCOUNT/CREATE ACCOUNT: The create account function builds all of the information necessary to create most accounts on most web pages. These values will be stored in the account constants, such as $first name, $last name, and so on. The build account works similarly to create account, but allows you to specify some of the values. The create account command only requires you to choose between male and female:

An example of using this command in a practical application would be the creation of new accounts on a website where you need the registrations to have different credentials.

So if the idea was to create 5 different accounts at www.feedage.com, you would set the script up as depicted in the following image:

The fill field parameter called Text are all filled with automatically

generated values from Ubot's account constants menu (see image):

With each cycle of the loop those parameters will be filled with different values due to the create account command being placed inside the loop.

By contrast, the build account command allows you to set the variables in order to have the ability to re-use them throughout the

script.

You can use the same method as we used in the create account command (allow Ubot to auto generate the values), OR you can specify what you would like them to be by typing in the values yourself. If you are using auto generated values, then the male/female option will allow the auto generator to choose the appropriate values. It has little effect if you are entering your own values.

CHANGE IFRAME BODY: This command is used to change the html with an iFrame making it possible to enter values into fields that are embedded within an iFrame. So what is an iFrame?
An IFrame (Inline Frame) is an HTML document embedded inside another HTML document on a website. The IFrame HTML element is often used to insert content from another source, such as an advertisement, into a Web page.

Application of this command is quite simple. You need only to navigate to the page containing the iFrame, drag the command into the scripting area and place the text you want entered into the filed in the parameter box.

***NOTE If there is more than one iFrame, you will need to choose the appropriate one for that particular text entry.

WRITE TO BROWSER: This command allows you to write (or display) html or text to the main browser. You can be very creative with this command and create html pages that appear to be custom made for individuals by combining techniques such as the $replace command.

An example of this would be (see image): I created a simple html page and saved the html to a text file:

In order to customize the page I am simply going to replace QQQQQ with the name of the user. This can be accomplished by setting a variable, in this case, #name and using the $replace command to insert a new name into the page by reading the file:

RUN JAVASCRIPT: This command allows you run javascript code. The only requirement is that the current browser is set to a javascript enabled page (such as Google). There are a multitude of commands you can execute using javascript, but one of the more popular ones is the alert box. The javascript code to deploy an alert box is: alert('Your message here');

which will result in the following action:

SAVE BROWSER IMAGE: This command will take a screenshot of the current browser and save it as an image file. Simply enter the path and file name where you want to save the image to:

SHELL: This command allows you to run an executable file from your local computer. Whether you want to run a shell command to clean your browsing history or run a custom program you designed, this command will allow you to do that. Simply enter the path to the .exe file you wish to run:

S-ar putea să vă placă și