Jump to content
UBot Underground

[Source] Cbrowser Set Random User Agent (Large List)


Recommended Posts

Hey guys,

 

I wanted to share this code with those who own the CBrowser plugin and want to use updated random user agents in their

bots.

 

Enjoy!

download file("http://techpatterns.com/downloads/firefox/useragentswitcher.xml","{$special folder("Desktop")}\\useragentswitcher.xml")
wait(1)
clear list(%Useragents)
add list to list(%Useragents,$list from text($find regular expression($read file("{$special folder("Desktop")}\\useragentswitcher.xml"),"(?<=useragent=\").*?(?=\")"),"
"),"Delete","Global")
save to file("{$special folder("Desktop")}\\Useragents.txt",%Useragents)
set(#user_agent,$random list item($list from file("{$special folder("Desktop")}\\Useragents.txt")),"Global")
plugin command("Communication.dll", "CBrowser Container", "PhantomJS", "", $plugin function("Communication.dll", "$CBrowser Set User Agent", #user_agent)) {
    plugin command("Communication.dll", "CBrowser Navigate", "http://whatsmyuseragent.com/")
    plugin command("Communication.dll", "CBrowser Save Screenshot", "C:\\Users\\Chris\\Desktop\\screenshot.png")
}

  • Like 1
Link to post
Share on other sites

Nice little trick!

 

Try this regex out "(?<=useragent=\")(?=.*Chrome|Mozilla|Opera)(?!.*Mobile).*?(?=\")" it filters all user agents that contain Chrome, Mozilla, and Opera, but it leaves out all that contain Mobile.

Edited by diskwizz
  • Like 1
Link to post
Share on other sites

Hey Diskwizz,

 

What would be the best way to rotate the most common browser sizes and use it in

the plugin with this code so that every new window is a random size?

download file("http://techpatterns.com/downloads/firefox/useragentswitcher.xml","{$special folder("Desktop")}\\useragentswitcher.xml")
wait(1)
clear list(%Useragents)
add list to list(%Useragents,$list from text($find regular expression($read file("{$special folder("Desktop")}\\useragentswitcher.xml"),"(?<=useragent=\\\")(?=.*Chrome|Mozilla|Opera)(?!.*Mobile).*?(?=\\\")"),"
"),"Delete","Global")
save to file("{$special folder("Desktop")}\\Useragents.txt",%Useragents)
set(#user_agent,$random list item($list from file("{$special folder("Desktop")}\\Useragents.txt")),"Global")
plugin command("Communication.dll", "CBrowser Container", "PhantomJS", "", "{$plugin function("Communication.dll", "$CBrowser Set User Agent", #user_agent)}{$plugin function("Communication.dll", "$CBrowser Window Size", 1024, 920)}") {
    plugin command("Communication.dll", "CBrowser Navigate", "http://whatsmyuseragent.com/")
    plugin command("Communication.dll", "CBrowser Save Screenshot", "C:\\Users\\Chris\\Desktop\\screenshot.png")
}

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...