ubot studio script reference

Download Ubot Studio Script Reference

If you can't read please download the document

Upload: tomaszfoster

Post on 22-Oct-2015

205 views

Category:

Documents


2 download

DESCRIPTION

Ubot Studio Documentation and script reference

TRANSCRIPT

  • 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 positio n, 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.

  • CHA NGE CHOSEN ATTRIBUTE :

    This command, a fter 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. Attribute to change

    2. 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) Ri

    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 a s is and keep the search method on exact match.

  • Click ok.

    chosen attribute.

    enter whatever value you like. Crun 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 fro m 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 interne t 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 KE YS 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 el ement.

    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 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

    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 t his 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

    Once the entire script is run you can see the but ton 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.

    http://www.w3schools.com/html/html_tables.asp
  • 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

    bring it into the scripting area (either by dragging it or double clicking it):

    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 locati on:

    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 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 comman d. 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

    http://www.mozilla.com/en-US/firefox/https://addons.mozilla.org/en-US/firefox/addon/966/
  • 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 l ist and highlight it. Once it is highlighted the lower left window will contain the postdata string you will need for your Ubot command.

    clipboard. ***NOTE: The postdata string will beRemove 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)

    you will enter the url of the file you wish to download, and

    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 yfield 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".) Ple ase 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

    ***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.