SRL Archive - News and General

New Script Selling / Authing/Thingy idea


Sir R. M8gic1an

2009-09-15 11:48:37

The title got you interested, did it now?

Well, for those of you who have no knowledge of PHP&*SQL you might as well leave the thread now.

Selling a scar script which isn't later decrypted and destributed freely is a hard achievement, especially if Markus is around as he has earnt himself quite a reputation of decrypting scripts for the fun of it.

However, you can't decrypt something you can't see, now can you? No, i am not talking about pushing the code out of the margin and making it "invisible". I am talking about not having the code in scar and still have it executed.

How? Simple. Use (some) purely logical functions in your script. You won't need scar's abilities to get the result of purely logical functions, you can use something else. (Does anyone see where I'm going yet? ;) )

An auth system usually just sends a login and a password to a website which checks it against a database and returns true/false. This is not what we'll be doing.

SQL Database will have a table with (at least) 3 fields.
| Username | Password | Key |

The 'Key' is the interesting part. When you send your auth information, if it is correct the website will return you a randomly generated key (eg: AfegFG24q3rfE) and you store it in a string var.


var
Key: string;
function Auth(user, pw: string):boolean;
begin
Key := ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', user, pw);
end;

If the Auth is true (After you check it against your db) you return the 'key' as result, and you store it in your database as well.

So far, nothing too unusual.
Now comes the fun part. Remember me talking about pure logical functions and how you don't need scar for that?


Function WhatIsBestAxe(MyLevel: integer):integer;
begin
case MyLevel of
1..20 : Result := Axe_Bronze;
21..30: Result := Axe_Mith;
31..40: Result := Axe_Addy;
41..60: Result := Axe_Rune;
61..99: Result := Axe_Dragon;
end;
end;

[php]
function WhatIsBestAxe ($key, $MyLevel)
{
if ! ($key == $DbKey) { retun $KillScript; exit; }
if ($MyLevel >= 61) { return $Axe_Dragon; exit; }
if ($MyLevel >= 41) { return $Axe_Rune; exit; }
if ($MyLevel >= 31) { return $Axe_Addy; exit; }
if ($MyLevel >= 21) { return $Axe_Mith; exit; }
else { return $Axe_Bronze; }
}
[/php]

Please excuse my php, I haven't properly used it in a very long time. I could probably use a Switch Case for that, but i wouldn't quite remember how to, syntax wise.

This is just an example. You could have 10's of purely logical functions. How would you use it?


Function WhatIsBestAxe(MyLevel: integer):integer;
begin
Result := ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', MyKey, MyLevel);
end;

Now, if Markus saw this, he probably would just re-write the function in ScarScript and be done with it. If it were 10 functions like this, he might still do it. Now Imagine you obfuscated it?


function aaaaaa(aaa: integer):integer;
begin
Result := ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', aaaaaaaa, aaa);
end;

function aaaaaaaaaa(aaaaa: integer):integer;
begin
Result := ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', aaaaaaaa, aaaaa);
end;

function aaaaaaaaaaa(aaaaaaaaaaaaaaa: integer):integer;
begin
Result := ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', aaaaaaaa, aaaaaaaaaaaaaaa);
end;

function aaaaaa(aaa: integer):integer;
begin
Result := ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', aaaaaaaa, aaa);
end;

Now, what the hell would Markus do?! he has no idea what each function does! How the hell would he get around that? Re-write the script? Might as well not have bought it in that case :)

Now, if you wanted to be really annoying towards him,

function aaaaaa(aaa: integer):integer;begin;Result := ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', aaaaaaaa, aaa);end;function aaaaaaaaaa(aaaaa: integer):integer;begin;Result :=ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', aaaaaaaa, aaaaa);end;function aaaaaaaaaaa(aaaaaaaaaaaaaaa: integer):integer;begin;Result := ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', aaaaaaaa, aaaaaaaaaaaaaaa);end;function aaaaaa(aaa: integer):integer;begin;Result := ConnectToWebsiteOrWhateverTheFunctionNameIs('www.', aaaaaaaa, aaa);end;

And the final trick, each time you execute a function outside of scar, you give a person a newly generated random key.

:)

/me waits for Markus' reply

~RM

Runescape Pro

2009-09-15 11:57:39

Very cool. Interesting in every way, yet it's pure giberish to me. =P
It's makes me think about writing a master script, but selling a script isn't worth it IMHO. Look at Wizzup?'s ess miner. If he can write that thing for free, why should anyone be greedy and sell a script? Idk, Cool post is what im getting at. =]

Wizzup?

2009-09-15 12:06:16

The idea is cool, but I think you missed something. ;)
This will be really slow, in general. It will also put a big load on your server.
Most functions are called very often. You will spent a lot of time waiting on the server, and the server will be very busy doing simple requests that it really shouldn'e be doing.

Anyway, what's even more important is this: You can't do any sort of findcolor on the screen, unless you intend to pass the bitmap of the screen every time…?

I don't think this is practical. :)

Runescape Pro

2009-09-15 12:09:13

From: wizzup?
the idea is cool, but i think you missed something. ;)
this will be really slow, in general. It will also put a big load on your server.
Most functions are called very often. You will spent a lot of time waiting on the server, and the server will be very busy doing simple requests that it really shouldn'e be doing.

Anyway, what's even more important is this: You can't do any sort of findcolor on the screen, unless you intend to pass the bitmap of the screen every time…?

I don't think this is practical. :)


pwnd! Xd

Sir R. M8gic1an

2009-09-15 12:11:31

From: Wizzup?

Anyway, what's even more important is this: You can't do any sort of findcolor on the screen, unless you intend to pass the bitmap of the screen every time…?

I don't think this is practical. :)


Purely Logical functions ;) as to how often you call them, it would suffice do most setup functions on the server, meaning that you would perhaps have to wait a bit before you actually start autoing, but that would be enough for a cracker to be pwned ;)

~RM

Wizzup?

2009-09-15 12:13:26

From: Rasta Magician
Purely Logical functions ;) as to how often you call them, it would suffice do most setup functions on the server, meaning that you would perhaps have to wait a bit before you actually start autoing, but that would be enough for a cracker to be pwned ;)

~RM


That would do it. But I still don't think it's worth the server load. :p

Simtoon

2009-09-15 14:39:22

Spacing out code is easy to unspace it, open notepad++ and then backspace!
Then get the website and get the script!

rogeruk

2009-09-15 15:07:51

Well if the entire script isnt obfuscated then you can just look at what vars lead to where.

Simtoon

2009-09-15 15:17:24

Can't you just use a DLL file like Benland does it?

Sir R. M8gic1an

2009-09-15 16:42:38

From: Simtoon
Spacing out code is easy to unspace it, open notepad++ and then backspace!
Then get the website and get the script!


I believe you understood very little of this post.

@rogeruk: that's why you ob the whole thing…

and yes, you could always use a pluggin, this is jsut an alternative.

~RM

nielsie95

2009-09-15 16:51:03

It's pretty easy to "crack" this. Sooner or later you'll have to use to the values returned by the PHP. When they get used, you can see what they're for and just replace them with a constant value. So for the axe function I'd just do Result := axe_Rune and comment the rest.

rogeruk

2009-09-15 18:35:50

If you can ob it so it cant be de-obbed then no need just do a standard auth

Markus

2009-09-15 18:37:29

I feel honored lol, I never fully cracked the stressminer so I'm not that good cracker :rolleyes: (never tried though due to lack of both auth and plugin).
Anyways, your idea is quite good, but you forget for easiness sake that every internet call already is > 100ms, and, that if I just do a bit of packet sniffing/proxying I see lots of funny stuff floating around between my pc and your script.
Obfuscation is a joke ofcourse, first, I'll rename all of the functions to something I can remember (func_001 for example). After I figured out a few functions of what they do, I'll start refactoring them (= completely renaming them to good names).
Plus, it'll make the script real slow, a getpage is > 100ms, thus will take some time (of course for this kind of functions that aren't time critical, that doesn't matter too much).
Putting some encryption on the web-scar gate could help a bit, but what if I put some writeln's in the decryption/getpage function? ;)
And, logic is logic. If I just take the *good* functions out (walking/finding and the actual stuff that does something), that doesn't leave too many "logic" functions. The logic functions have to modify at least some script vars (which are usually easy to determine, just take a look around what they do/where they are used and you got at least a bit of good stuff) which are used by the 'non-logic' part of the script.
And using a key is just a joke, only thing it's fun for, is keeping track of how long I've been running a script by sending a message/signal to the server every X minutes.

Wanted

2009-09-15 19:48:18

Idea is epic fail.

SCAR loads all code into memory before it's run… just take it from memory and recompile it.

Sir R. M8gic1an

2009-09-15 20:56:24

From: IceFire908
Idea is epic fail.

SCAR loads all code into memory before it's run… just take it from memory and recompile it.


errrr…..what?

~RM

Laur€ns

2009-09-15 21:32:43

From: Rasta Magician
errrr…..what?

~RM


Exactly my thoughts. Elaborate please, IceFire.

Markus

2009-09-15 23:18:12

From: IceFire908
Idea is epic fail.

SCAR loads all code into memory before it's run… just take it from memory and recompile it.

Uhm yea, SCAR's going to load remote PHP code in it's own memory, although it can't access it or whatever?

Infantry001

2009-09-15 23:28:21

So I'm just wondering… how secure is a plugin?

Nadeem

2009-09-15 23:33:07

This idea would be good if it wasn't for the overload + time management.

I think a better approach extending RM's idea, would be to dynamically load the code in memory packets when script first runs and have a check call every 3-5 minutes, probably still crackable but not for the average joe :)

Another way would possibly be to inject new processes into scar itself.



~NS

Gu3st...

2009-09-16 01:37:46

From: Infantry001
So I'm just wondering… how secure is a plugin?
I have been wondering the same thing.. Can't users view plugins?

noidea

2009-09-16 02:04:19

Imposible, if you make it a .dll

Nadeem

2009-09-16 02:16:14

From: noidea
Imposible, if you make it a .dll


It is possible actually, just a bit difficult :)

It can always be resource hacked / transformed into its assembly form (with struggles / bugs), and if your an assembly gawd you can rewrite that in a more understandable language from there on



~NS

mixster

2009-09-16 22:13:14

Want a good authing idea?
BenLand puts a couple of extra string params for setting up Smart which relate to a database he controls with registered users and passwords. If the input data does not match, then it does not setup Smart and so the script epic fails (with a little writeln to say why ofc). Voila - now only people who register with him can use it :)

Summary: make something complex for those who do not know and then plugin it and authorise it through that - as long as they need it to run, they're screwed. If it's not complex enough, then someone else makes an open version of it and you lose The Game.

Gu3st...

2009-09-17 00:00:21

From: mixster
Want a good authing idea?
BenLand puts a couple of extra string params for setting up Smart which relate to a database he controls with registered users and passwords. If the input data does not match, then it does not setup Smart and so the script epic fails (with a little writeln to say why ofc). Voila - now only people who register with him can use it :)

Summary: make something complex for those who do not know and then plugin it and authorise it through that - as long as they need it to run, they're screwed. If it's not complex enough, then someone else makes an open version of it and you lose The Game.
Hm.. That's smart (lol)
That is one Real Uber Nice Epic Sweet Cool Awesome Poonage Idea (Runescapi for short)

marpis

2009-09-17 01:42:10

This gave me an idea:
Use this same technique to so that some functions randomly "change place" with each other. Like this:


// In scar you see
function MyFunc: Variant;
begin
Result := RandomlyLoadFunctionOnline;
end;

// in server happens
if random(2) = 0 then
Result := 5
else
Result := 'pickaxe';

Later you could use it like

if VarType(MyFunc) = varString then
tango
else
samba;

You could also do this only once in the startup of the script, and save the results into a variable, so you'd need to connect the server only once.

Simplified: function called AAAAAA is randomly either GetBestAxeAvailable: String; or GetWCLevel: Integer.

This would be very confusing to most people trying to crack the code

Infantry001

2009-09-17 03:05:48

From: marpis
This gave me an idea:
Use this same technique to so that some functions randomly "change place" with each other. Like this:


// In scar you see
function MyFunc: Variant;
begin
Result := RandomlyLoadFunctionOnline;
end;

// in server happens
if random(2) = 0 then
Result := 5
else
Result := 'pickaxe';

Later you could use it like

if VarType(MyFunc) = varString then
tango
else
samba;

You could also do this only once in the startup of the script, and save the results into a variable, so you'd need to connect the server only once.

Simplified: function called AAAAAA is randomly either GetBestAxeAvailable: String; or GetWCLevel: Integer.

This would be very confusing to most people trying to crack the code

Would also be confusing for the scripter… 0_o

Well, face it, guys. There is no impregnable code. Windows continues to get cracked, even with such high paid security specialists. If something is protected, it will get cracked (eventually).

Rubix

2009-09-17 04:34:30

just popping in, read the 2nd line, now im leaving my mark.

marpis

2009-09-17 11:44:16

From: infantry001
would also be confusing for the scripter… 0_o

well, face it, guys. There is no impregnable code. Windows continues to get cracked, even with such high paid security specialists. If something is protected, it will get cracked (eventually).


md5 ;)

mixster

2009-09-17 20:08:46

ehm, MD5 can be bruteforced (very easily if you do some research before hand or use a rainbow table) and that's not applicable for code since it hashes it and hashes are pretty useless except for comparing 2 values, so it would be impossible to hash a script and run it etc. Silly marpis!

Widget

2009-09-18 09:29:05

$CRC=738205660
$ENCRYPTED
54F6E9FDED26AE6C3C2ACCD712E9F07824334CBB626DFCE90C28E387D1C56EE2E6969A83B3F4AA3CF
8FD5234D4631F33E0CC40C7586329AE3E9BA5374300BF72BEE20FE59C6B27BBE574B884FD363A683B
A0FFF1BFF0FFED1E8FDD89817CA3EACFC086625710CCE622EB9499FC11624FB6A83CDE483B4344919
86025DC79A563EEB79D35C81B0976FA408A76DFE1DBAB43917AE319532EC85BE727
Make Freddy put script encryption/authentication back in SCAR (this script won't work on SCARs newer than 3.15) and then we could just use that :p

Sir R. M8gic1an

2009-09-18 10:47:13

From: Widget
$CRC=738205660
$ENCRYPTED
54F6E9FDED26AE6C3C2ACCD712E9F07824334CBB626DFCE90C28E387D1C56EE2E6969A83B3F4AA3CF
8FD5234D4631F33E0CC40C7586329AE3E9BA5374300BF72BEE20FE59C6B27BBE574B884FD363A683B
A0FFF1BFF0FFED1E8FDD89817CA3EACFC086625710CCE622EB9499FC11624FB6A83CDE483B4344919
86025DC79A563EEB79D35C81B0976FA408A76DFE1DBAB43917AE319532EC85BE727
Make Freddy put script encryption/authentication back in SCAR (this script won't work on SCARs newer than 3.15) and then we could just use that :p


Markus cracked that :p

~RM

Wizzup?

2009-09-18 14:08:59

From: Rasta Magician
Markus cracked that :p

~RM


Markus just took the script of the memory, BenLand100 100% reversed the algorithm and was able to encrypt his own scripts.

MylesMadness

2009-09-18 14:53:38

From: Wizzup?
Markus just took the script of the memory, BenLand100 100% reversed the algorithm and was able to encrypt his own scripts.
Its ben, he can divide by 0.

mastaraymond

2009-09-18 19:02:00

Create your own scar that runs entirely from a dll.

Widget

2009-09-18 19:35:55

Oh ok, didn't realize Markus had gotten it from memory (me and Sky Scripter can do that as well :p). I was just using Ben's encrypter to make it anyway.