Jump to content
UBot Underground

How to Change Useragent in Ubot.


Recommended Posts

http://img829.imageshack.us/img829/5816/54046799.jpg

 

Here is an old program I wrote that changes the Useragent in Ubot. Seeing as people are requesting this feature, I recompiled it and put it here for yall:

 

http://www.mediafire.com/?dlw76b7zikuez1k

 

How to install:

Put ChangeUserAgent.exe in the same directory as the Ubot exe (UBotDevTool.exe) or the compiled but.

 

How to use:

ChangeUserAgent.exe takes 3 parameters.

First parameter is the running exe name of the bot you want to change the useragent of (without the .exe) (note: bot must be running).

Second parameter is the useragent you want to replace (the old useragent).

Third parameter is the useragent you want to replace the old one with (the new useragent).

 

How it works:

It scans the memory of the target process for the old useragent string and replaces it with the new one.

 

Requires:

Administrator rights and .Net 3.0.

 

Sample Ubot code:

http://img196.imageshack.us/img196/9117/24415012.jpg

 

That's that. Enjoy.

  • Like 11
Link to post
Share on other sites
  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

http://img829.imageshack.us/img829/5816/54046799.jpg   Here is an old program I wrote that changes the Useragent in Ubot. Seeing as people are requesting this feature, I recompiled it and put it here

@Meter Thanks alot for this wonderful share, you get my +1   Are we allowed to add to our bots and distribute it?   Ok I thought to make this curry a little more spicy I'll add some chillies to it..

Oh and one last note: The new useragent's length must be equal to or less than the old useragent's length. Seeing that the old Ubot useragent was:   Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1;

Posted Images

Oh and one last note: The new useragent's length must be equal to or less than the old useragent's length. Seeing that the old Ubot useragent was:

 

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E; AskTbTRL2/5.8.0.12304)

 

... this shouldn't be a problem :D

  • Like 1
Link to post
Share on other sites

Two questions:

 

1. Does this mask/hide what our Browser is (within UBot that is) ?

 

2. What do I gain from doing this?

 

3. What would be an example for wanting to do this? (ok...3 questions) LOL

Link to post
Share on other sites

1. Yes. It makes your browser be whatever you want it to be from within Ubot.

2. Dodge websites that have blacklisted your useragent for scraping. Or change the Useragent so that a website presents its mobile version instead of its full version to you, making it easier to automate. Or change the useragent so that it present the Mozilla Firefox version of the site instead of the IE format of the site, since the IE format of the site might bug out Ubot... and other little things like that.

3. See 2.

Link to post
Share on other sites

1. Yes. It makes your browser be whatever you want it to be from within Ubot.

2. Dodge websites that have blacklisted your useragent for scraping. Or change the Useragent so that a website presents its mobile version instead of its full version to you, making it easier to automate. Or change the useragent so that it present the Mozilla Firefox version of the site instead of the IE format of the site, since the IE format of the site might bug out Ubot... and other little things like that.

3. See 2.

 

Thanks for this meter. Are we allowed to distribute this with our compiled bots?

 

Andy

Link to post
Share on other sites

@Meter Thanks alot for this wonderful share, you get my +1 :)

 

Are we allowed to add to our bots and distribute it?

 

Ok I thought to make this curry a little more spicy I'll add some chillies to it..

 

Here is a list of around 16,000 User agents you may need to fool those websites... all you need to do is loop them through your code/script.. ;)

 

Well it surely can't get easier than this...

 

Here is my list : :)

 

http://hotfile.com/dl/76148146/6c06e68/User_Agents.txt.html

 

Enjoy :D

 

Praney

  • Like 5
Link to post
Share on other sites

Thanks for this meter. Are we allowed to distribute this with our compiled bots?

 

Andy

 

Great share Meter.

 

As with the others, I'm curious how you feel about distributing it with our code?

 

 

Feel free to use this code in any way you see fit :) Just please remember that this is a hack, and thus its stability can't be guaranteed. Furthermore, it might alert some antiviruses due to the way its reading and writing to the memory of another process (common behaviour in viruses).

Link to post
Share on other sites
  • 2 weeks later...

Has this script actually worked for anyone else? I haven't been able to get it to successfully change the user agent and I've been at it for hours. I execute all of the commands given above, with the ChangeUserAgent.exe file in both the directory that the bot is in, and the directory where ubotdevtool.exe is located. (even tho it doesn't matter because I navigated to the ChangeUserAgent.exe in the shell command). All of my variables are populated, then I revisit the whatsmyuseragent.com via the navigate command, and it is still the same. I've tried this as a script call, a rub sub, and even as its own standalone bot and script. Nothing works.

 

Anyone had any success with this?

Link to post
Share on other sites

I think that may be due to a different OS, as different versions of Windows have different paths to system files..

 

What OS are you on..?

 

Praney

 

Windows 7,

 

The path I'm using to call the ChangeUserAgent.exe is the full path from the drive to the directory where it is located.

Link to post
Share on other sites

Jeff, when ChangeUserAgent.exe is run from Ubot, do you see a bunch of numbers in a console window?

 

Yes, I've attached a screenshot of the console window so you can see it.

 

After the execution of the shell script, I then navigate back to http://whatsmyuseragent.com in order to see if the user agent changed to the new one or not and it remains the same.

 

Thanks a million for looking into this for me

 

Console Window: post-1554-12879396935283_thumb.gif

Link to post
Share on other sites

Is uBot caching the page?

 

That's actually a great question. I'm not sure how to check whether it is or isn't. Does anyone out there know if UBot caches the page? If it does, do you know a way I can check to see if my user agent has changed or not after the execution of the shell script?

 

- Jeff

Link to post
Share on other sites

Throw this code into a php file on your server and use it instead of the other .com

 

<!-- UA.PHP -->
<HTML>
<HEAD>
 <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
</HEAD>
<BODY>
 <CENTER><B><DIV id='useragent'><?=$_SERVER['HTTP_USER_AGENT'];?></DIV></B></CENTER>
</BODY>
</HTML>

  • Like 1
Link to post
Share on other sites

Yes, I've attached a screenshot of the console window so you can see it.

 

After the execution of the shell script, I then navigate back to http://whatsmyuseragent.com in order to see if the user agent changed to the new one or not and it remains the same.

 

Thanks a million for looking into this for me

 

Console Window: post-1554-12879396935283_thumb.gif

That's weird Jeff, according to your screenshot my program is working perfectly. Really, it could be that Ubot is caching the page, but I doubt it (since it never happened to me). Try emptying the cache in between runs and see.

 

Aside from that, I really don't know what could be happening :(

Link to post
Share on other sites

That's weird Jeff, according to your screenshot my program is working perfectly. Really, it could be that Ubot is caching the page, but I doubt it (since it never happened to me). Try emptying the cache in between runs and see.

 

Aside from that, I really don't know what could be happening :(

 

Thanks for looking into it for me, I really appreciate it. I'm going to use that script just posted and see if the user agent is changing or not. I'll get to that tonight and bring back my findings :)

Link to post
Share on other sites

Throw this code into a php file on your server and use it instead of the other .com

 

<!-- UA.PHP -->
<HTML>
<HEAD>
 <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
</HEAD>
<BODY>
 <CENTER><B><DIV id='useragent'><?=$_SERVER['HTTP_USER_AGENT'];?></DIV></B></CENTER>
</BODY>
</HTML>

 

Thanks to everyone who helped me look into this problem!

 

Super Dave - I used this code to check whether or not the user agent was changing and it indeed WAS!

 

Meter - The script works great.

 

The problem was with the caching of the user agent by browser within UBot, so I couldn't notice the change even though it was happening. For anyone else who is experiencing a problem with this script not changing your user agent, upload the code above to a directory on your server somewhere and navigate to that location after running the change user agent script, if it changes, you have succeeded.

 

For everyone who for some reason doesn't have the pages caching, then you're golden :)

 

Thanks again, time to get back to this bot!

 

- Jeff

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