SRL Archive - Discussions and Debates

SMART Detection & USER_AGENT/TITLE


Clarity

2014-11-04 17:06:12

Obviously SMART isn't being actively detected automatically. Anecdotal evidence suggests that they do detect it when they investigate accounts further (as a result of reports, botwatch flagging, whatever).

While ideally, we should never be autoflagged (that's dependent on script quality I guess), let's assume we are…

After discussion with some programming friends and reading of some forum posts, it seems that Jagex could be seeing SMART via either the USER_AGENT or the window title. Both are extreme giveaways, in that the window title is "SMART etc etc" and the user agent is a very outdated and unused version of Firefox that literally everyone using SMART mysteriously switches to from normal versions when they do botlike activities.

Currently this is what is in the SMART source:

public static final String VERSION = "8.3";
public static final String TITLE = "SMARTv" + VERSION + " - SMART Minimizing Autoing Resource Thing - By BenLand100";
public static final String USER_AGENT; //default for an (old) firefox version is set below
static {
String osname = System.getProperty("os.name");
String windowing = "X11";
if (osname.contains("Windows")) windowing = "Windows";
else if (osname.contains("Mac")) windowing = "Macintosh";
USER_AGENT = "Mozilla/5.0 (" + windowing + "; U; " + osname + " " + System.getProperty("os.version") + "; " + Locale.getDefault().getLanguage()+"-"+Locale.getDefault().getCountry()+"; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10";
}

I went to What's My User Agent? to get my user agent string while using my current browser and replaced it in SMART's source. Changed the title as well:


public static final String TITLE = "RuneScape - MMORPG - The No.1 Free Online Multiplayer Game - Mozilla Firefox";
public static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0";

Also modified user_agent and titles everywhere else it was used in the source.

Questions
  • Will this help us? Or does this accomplish nothing and the problem goes far beyond this? I don't know much about the software aspect of antiban. I do know that Jagex can only detect so much until they start breaching our computer privacy, so if we can cover our bases up until that point, we should be OK?
  • Could they be tracking all the user agents associated with an account? Would this be stored in our own jagexcache or on their servers?
  • Can we change SMART's source to spoof a variety of user agents, and specify which one we want it to select?

Like this (credit Obscurity):

gameClients:[
{
name:'FireFox',
versions:['32.0.3','32.0.2','32.0.1'] //~ Etc
}
{
name:'Chrome Webkit',
versions:['40.0.2202.3','40.0.2402.3'] //~ Etc
}
//~ Etc
]

Kave

2014-11-04 17:19:56

I thought about this aswell even started to use disguise again for Simbas window name. Just couldn't be bothered to go all the way and recompile smart though.

Clarity

2014-11-04 17:34:54

From: Kave
I thought about this aswell even started using to use disguise again for Simbas window name. Just couldn't be bothered to go all the way and recompile smart though.

Yeah, with something like that I wonder how far Jagex is able to go looking at our computer before they breach privacy (or whatever the laws are).

I suppose by playing the game we agree to everything in the privacy policy. It says:


We use Cookies, collect and store IP-addresses, alphanumeric IDs and other unique identifiers in order to identify specific computers that access the Jagex Products. We identify and store the versions of Java and .NET (if any) on your computer along with your browser and operating system, and details of your device's hardware and software specifications.

For more information about Cookies, the information they collect and how to disable them, please visit our Cookies page.

We generate and store logs indicating usage of the Jagex Products such as activity in our games and public and private chat communications. This includes monitoring play patterns and anti-tamper checks which verify the correct internal operation of our software and are designed to spot abusive or inappropriate activities.

We may track your use of certain features and areas of the Jagex Products to help us improve them.

If our client software held on your computer fails, it sends an automatic error report to our server to help us fix it. This error report only includes information about the internal state of our own client software and which browser/java version it is running on. It does not include data from elsewhere on your system and so does not reveal Personally Identifiable Information to us.

We store 'save game' and 'game settings' information to enable us to provide a better games service in which your activities and achievements are remembered in the game, and we conduct polls to find better ways of serving the needs of our users.

Olly

2014-11-04 17:57:34

SetWindowTitle in new Simba versions. ;)

Clarity

2014-11-04 18:41:37

From: Olly
SetWindowTitle in new Simba versions. ;)

As in newer than 1.1? I couldn't find that.

Edit: I got it working via recompiling anyway:


And the user agent is my own unique string now.

Olly

2014-11-04 18:47:05

From: Clarity
As in newer than 1.1? I couldn't find that.


Yes, non released ones.

@ Buildbot in the simba-next.

Clarity

2014-11-04 18:54:46

From: Olly
Yes, non released ones.

@ Buildbot in the simba-next.


Ah very cool, found 1200 :)

The Mayor

2014-11-04 19:03:17

From: Olly
SetWindowTitle in new Simba versions. ;)


Just the SMART window?

Olly

2014-11-04 19:12:50

From: The Mayor
Just the SMART window?


Anything.

e: Anyway…


<BenLand100> > Target exp_spawnClient(char* java_exec, char* remote_path, char *root, char *params, int width, int height, char *initseq, char *useragent, char* javaargs, char* plugins) {
BenLand100 points at the useragent variable


Yes SmartSpawnClient has a useragent param.

@Clarity

Clarity

2014-11-04 19:14:57

From: The Mayor
Just the SMART window?



Playing around:


From: Olly
Anything.

e: Anyway…



Yes SmartSpawnClient has a useragent param.

@Clarity


Ah…whoopsie. did not see that. Thanks so much! People should use that tbh…it doesn't strike me as a good idea to send what we're sending now.

Ashaman88

2014-11-04 20:34:05

From: Olly
Anything.

e: Anyway…



Yes SmartSpawnClient has a useragent param.

@Clarity


hm should there be a global var for that parameter (default '')? Would be easier for users/scriptwriters to edit

tls

2014-11-04 20:35:18

That would be simple detection, and I believe it is more complex than that. How most loaders work: Create a classloader instance, load the rs classloader as a child to that instance, the child instance loads rs classes/applet. There is a method in classloader called getParent. All they have to do is check the classloader that is the parent to their classloader and discover it is a botclient.

Clarity

2014-11-04 20:42:51

From: tls
That would be simple detection, and I believe it is more complex than that. How most loaders work: Create a classloader instance, load the rs classloader as a child to that instance, the child instance loads rs classes/applet. There is a method in classloader called getParent. All they have to do is check the classloader that is the parent to their classloader and discover it is a botclient.

Can we spoof those in any way?

Brandon

2014-11-05 11:30:43

From: tls
That would be simple detection, and I believe it is more complex than that. How most loaders work: Create a classloader instance, load the rs classloader as a child to that instance, the child instance loads rs classes/applet. There is a method in classloader called getParent. All they have to do is check the classloader that is the parent to their classloader and discover it is a botclient.


Are you sure that would actually work? IIRC, browsers also use a classloader of their own to load applets: sun.plugin2.applet.Plugin2ClassLoader.. dunno.. but still..

Kevin

2014-11-05 11:53:33

From: Ashaman88
hm should there be a global var for that parameter (default '')? Would be easier for users/scriptwriters to edit


I concur and see no reason why not. I can submit a request to make that possible in github tonight if you think that's fine?

Ashaman88

2014-11-24 13:41:27

From: Kevin
I concur and see no reason why not. I can submit a request to make that possible in github tonight if you think that's fine?


Forgot to say that it was added a couple weeks ago :)

Kevin

2014-11-24 14:03:10

From: Ashaman88
Forgot to say that it was added a couple weeks ago :)


Aw, I was even willing to do srl work :(

So what is the new variable name?

Ashaman88

2014-11-24 14:25:15

From: Kevin
Aw, I was even willing to do srl work :(

So what is the new variable name?


smartUserAgent: string := '';

Word

Hoodz

2014-11-24 16:22:13

@Clarity; you could write a function that gets your own user agent with getPage + explode etc.

edit: i try to make one really quickly

edit2: ooh im stupid.. simba is using its own user agent ;)


function getUserAgent(): String;
var
webPage, userAgent: String;
begin
webPage := getPage('http://whatsmyuseragent.com/');
userAgent := Between('<h2 class="info">', '</h2>', webPage);
result := userAgent;
writeln(userAgent); {Mozilla 4.0/ (compatible; Simba/1100; Synapse)}
end;

Clarity

2014-11-27 04:03:48

From: hoodz
@Clarity; you could write a function that gets your own user agent with getPage + explode etc.

edit: i try to make one really quickly

edit2: ooh im stupid.. simba is using its own user agent ;)


function getUserAgent(): String;
var
webPage, userAgent: String;
begin
webPage := getPage('http://whatsmyuseragent.com/');
userAgent := Between('<h2 class="info">', '</h2>', webPage);
result := userAgent;
writeln(userAgent); {Mozilla 4.0/ (compatible; Simba/1100; Synapse)}
end;


Using its own user agent? That sounds like a bad idea.

Hoodz

2014-11-27 04:07:56

From: Clarity
Using its own user agent? That sounds like a bad idea.


Try the snippet

Flight

2014-11-27 09:30:35

From: Olly
SetWindowTitle in new Simba versions. ;)


I'd like to ask you about this. This procedure, and many others, require a "PtrUInt" type as a parameter; what exactly is this? Do you have documentation for it? I'd like to see some examples of it being used.

Clarity

2014-11-27 09:42:39

From: Flight
I'd like to ask you about this. This procedure, and many others, require a "PtrUInt" type as a parameter; what exactly is this? Do you have documentation for it? I'd like to see some examples of it being used.


Until then, recompiling SMART with the official browser window title and my own user agent took about 2 minutes in Notepad++

https://villavu.com/forum/showthread.php?t=86387

rj

2014-11-27 10:11:24

From: Flight
I'd like to ask you about this. This procedure, and many others, require a "PtrUInt" type as a parameter; what exactly is this? Do you have documentation for it? I'd like to see some examples of it being used.


Yea I don't understand the parameters in a lot of the simbas functions, like I can decipher what they probably are but don't understand what to put. PTRUInt sounds like a pointer to a unsigned integer, but IDK wtf a unsigned integer is

tls

2014-11-27 12:25:15

From: Robert
Yea I don't understand the parameters in a lot of the simbas functions, like I can decipher what they probably are but don't understand what to put. PTRUInt sounds like a pointer to a unsigned integer, but IDK wtf a unsigned integer is


Think about the word "unsigned". It means exactly what you would think. There is no memory set aside for a negative sign. So there is twice as much(plus 1) memory for the positive numbers.

Brandon

2014-11-27 13:36:05

Unsigned either uses the first bit as a flag OR two's compliment hardware wise.
Unsigned uses the exact same amount of memory as signed.

PtrUint can represent a handle, pointer, hwnd, etc..

SetWindowTitle(p: ptruint; t: string);

Would most likely have P being a window handle and t being the title that the window should change to.

Olly

2014-11-27 15:28:13

From: Flight
I'd like to ask you about this. This procedure, and many others, require a "PtrUInt" type as a parameter; what exactly is this? Do you have documentation for it? I'd like to see some examples of it being used.


It's the window handle, so

SetWindowTitle(GetNativeWindow(), 'Hello') // Your targeted window in Simba

or via GetProceses

arr := getproceses();
SetWindowTitle(arr[0].Handle, 'Hello');

PtrUInt = size of pointer
32 bit = 4 (UInt32)
64 bit = 8 (UInt64)

slacky

2014-11-27 15:56:18

From: Flight
I'd like to ask you about this. This procedure, and many others, require a "PtrUInt" type as a parameter; what exactly is this? Do you have documentation for it? I'd like to see some examples of it being used.

Whenever a pointer is converted to an integer it has to be the size of the native pointer. For any 32bit application PtrUInt will be Int32, while on any 64bit application it's 64bit.
For example:

{$x+}
begin
var i:=5;
var pp := PtrUInt(@i); //works if simba is 32bit or 64bit
//var pp := UInt32(@i); //can fail if simba is 64bit
WriteLn(pp);
end;

Edit: I see that this was already answered :P