meter 145 Posted October 10, 2010 Report Share Posted October 10, 2010 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. 11 Quote Link to post Share on other sites
meter 145 Posted October 10, 2010 Author Report Share Posted October 10, 2010 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 1 Quote Link to post Share on other sites
UBotBuddy 331 Posted October 10, 2010 Report Share Posted October 10, 2010 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 Quote Link to post Share on other sites
meter 145 Posted October 10, 2010 Author Report Share Posted October 10, 2010 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. Quote Link to post Share on other sites
Net66 54 Posted October 15, 2010 Report Share Posted October 15, 2010 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 Quote Link to post Share on other sites
UBotBuddy 331 Posted October 15, 2010 Report Share Posted October 15, 2010 WoW! If I could give you +10 I would but I gave you +1 any way. Quote Link to post Share on other sites
Fotis32 2 Posted October 15, 2010 Report Share Posted October 15, 2010 How i can use this for X-Forward-For ? Can anyone script the syntax for me? Thanks Quote Link to post Share on other sites
IRobot 43 Posted October 15, 2010 Report Share Posted October 15, 2010 Thanks for sharing this gem, meter. +1 from me as well. Quote Link to post Share on other sites
Praney Behl 314 Posted October 15, 2010 Report Share Posted October 15, 2010 @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 Praney 5 Quote Link to post Share on other sites
Praney Behl 314 Posted October 15, 2010 Report Share Posted October 15, 2010 Note: Use it with care, remember to play safe.. With greater power comes greater responsibility. Quote Link to post Share on other sites
Super Dave 26 Posted October 15, 2010 Report Share Posted October 15, 2010 Great share Meter. As with the others, I'm curious how you feel about distributing it with our code? Quote Link to post Share on other sites
meter 145 Posted October 15, 2010 Author Report Share Posted October 15, 2010 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). Quote Link to post Share on other sites
meter 145 Posted October 15, 2010 Author Report Share Posted October 15, 2010 How i can use this for X-Forward-For ? Can anyone script the syntax for me? ThanksSorry, have no idea what you're trying to say Quote Link to post Share on other sites
Jeff 0 Posted October 24, 2010 Report Share Posted October 24, 2010 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? Quote Link to post Share on other sites
Praney Behl 314 Posted October 24, 2010 Report Share Posted October 24, 2010 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 Quote Link to post Share on other sites
Jeff 0 Posted October 24, 2010 Report Share Posted October 24, 2010 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. Quote Link to post Share on other sites
meter 145 Posted October 24, 2010 Author Report Share Posted October 24, 2010 Jeff, when ChangeUserAgent.exe is run from Ubot, do you see a bunch of numbers in a console window? Quote Link to post Share on other sites
Jeff 0 Posted October 24, 2010 Report Share Posted October 24, 2010 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: Quote Link to post Share on other sites
Super Dave 26 Posted October 24, 2010 Report Share Posted October 24, 2010 Is uBot caching the page? Quote Link to post Share on other sites
Jeff 0 Posted October 24, 2010 Report Share Posted October 24, 2010 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 Quote Link to post Share on other sites
Super Dave 26 Posted October 24, 2010 Report Share Posted October 24, 2010 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> 1 Quote Link to post Share on other sites
Frank 177 Posted October 24, 2010 Report Share Posted October 24, 2010 Excellent share!!! This is much needed within the ubot community. Quote Link to post Share on other sites
meter 145 Posted October 24, 2010 Author Report Share Posted October 24, 2010 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: 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 Quote Link to post Share on other sites
Jeff 0 Posted October 24, 2010 Report Share Posted October 24, 2010 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 Quote Link to post Share on other sites
Jeff 0 Posted October 24, 2010 Report Share Posted October 24, 2010 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 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.