1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anyone have a sec to help me out with Imacros?

Discussion in 'BlackHat Lounge' started by adrien23, Mar 12, 2010.

  1. adrien23

    adrien23 Regular Member

    Joined:
    Aug 19, 2009
    Messages:
    323
    Likes Received:
    55
    I'm trying to make a macro that basically does this,
    1. refresh page
    2. click typing area
    3. type desired content
    4. clicks the button to submit content

    And basically does that every 10-15 minutes...I tried recording it but keep getting error "RuntimeError: element TEXTAREA specified by ID:c4b99b069ce86474ea6767_input was not found, line: 3"
     
  2. dietbird

    dietbird Junior Member

    Joined:
    Nov 3, 2009
    Messages:
    126
    Likes Received:
    64
    You have to make a .csv with the value you want the macro to put in your text area.

    Here's an example:

    Code:
    VERSION BUILD=6861208     
    TAB T=1     
    TAB CLOSEALLOTHERS     
    SET !DATASOURCE datasourceinput.csv
    SET !DATASOURCE_COLUMNS 5
    SET !DATASOURCE_LINE {{!LOOP}}
    URL GOTO=https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=zpwhtygjntrz&scc=1&ltmpl=default&ltmplcache=2     
    TAG POS=1 TYPE=A ATTR=TXT:Create<SP>an<SP>account<SP>ยป<SP>   
    'New page loaded      
    URL GOTO=http://google.com  
    TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:createaccount ATTR=ID:FirstName CONTENT={{!col1}}
    TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:createaccount ATTR=ID:LastName CONTENT={{!col2}}
    TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:createaccount ATTR=ID:Email CONTENT={{!col3}}
    TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:createaccount ATTR=ID:Passwd CONTENT={{!col4}}
    TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:createaccount ATTR=ID:PasswdAgain CONTENT={{!col4}}
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:createaccount ATTR=ID:PersistentCookie&&VALUE:yes CONTENT=NO 
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:createaccount ATTR=ID:smhck&&VALUE:1 CONTENT=NO 
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:createaccount ATTR=ID:homepageSet&&VALUE:1 CONTENT=NO 
    TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:createaccount ATTR=ID:IdentityAnswer CONTENT={{!col5}}
    WAIT SECONDS=10
    As you can see, we first define our datasource, then how many columns it contains (Depending on how many textfields you have to fill, it may be 1 and it may be 10).

    The rest is pretty much self explanatory.
     
  3. Classytallpaul

    Classytallpaul Newbie

    Joined:
    Oct 6, 2009
    Messages:
    20
    Likes Received:
    27
    Occupation:
    Owner of Winclub.ca - Roulette Coaching
    Location:
    Toronto, Canada
    dont forget to use the wildcard character

    ie

    ID:*

    instead of

    ID:c4b99b069ce86474ea6767

    whats the website ? maybee i can help you with it.
     
  4. heavyweight

    heavyweight Junior Member Premium Member

    Joined:
    Aug 10, 2009
    Messages:
    131
    Likes Received:
    65
    I'm kinda bored.
    Give me link to the page and I'll create it for you
     
  5. blue141

    blue141 Regular Member

    Joined:
    Feb 17, 2009
    Messages:
    340
    Likes Received:
    172
    Sorry to post again about the same macro, but this issue just cropped up. The macro works great, but every so often the website is unavailable for whatever reason, and when the macro cannot access it, the macro 'times out'.

    Here's the error message the macro displays:

    Error: Website did not respond (Timeout)
    (Error code: -322)

    my question is how to put a command in there to retry after a period of time so if this happens, it will try to restart from where it left off. Here's the code to the actual macro so you can see how it is set up:

    VERSION BUILD=6900210
    TAB T=1
    TAB CLOSEALLOTHERS
    URL GOTO=http://(this is the website url)
    CMDLINE !DATASOURCE book1.csv
    SET !DATASOURCE_COLUMNS 1
    SET !LOOP 2
    SET !DATASOURCE_LINE {{!LOOP}}
    TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:processleads.php ATTR=ID:fname CONTENT=
    TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:processleads.php ATTR=ID:email CONTENT={{!COL1}}
    WAIT SECONDS=30
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:processleads.php ATTR=VALUE:Submit