Cenzic 232 Patent
Paid Advertising
sla.ckers.org is
ha.ckers sla.cking
Sla.ckers.org
Script obfuscation, filter evasion, IDS/IPS/WAF bypassing... this is where it should live. Because this topic is too big to live anywhere else. Phj33r! 
Go to Topic: PreviousNext
Go to: Forum ListMessage ListNew TopicSearchLog In
Pages: 12Next
Current Page: 1 of 2
JavaScript Smallest NonAlnum Quine
Posted by: sirdarckcat
Date: January 28, 2010 02:47AM

__=';(_=___(___)[+[]]+___+__,+[])?("?.*|"):_;';___=/__=';(_=___(___)[+[]]+___+__,+[])?("?.*|"):_;';___=/;(_=___(___)[+[]]+___+__,+[])?("?.*|"):_;

you can make that code to actually do something like this:

__=';(_=___(___)[+[]]+___+__,alert(1),+[])?("?.*|"):_;';___=/__=';(_=___(___)[+[]]+___+__,alert(1),+[])?("?.*|"):_;';___=/;(_=___(___)[+[]]+___+__,alert(1),+[])?("?.*|"):_;


Step 1 - Discover what it is doing
Step 2 - Make it smaller
Step 3 - Win awesome props from everyone


Rules:
1.- Your code must allow arbitrary code to be part of the code... so it can be reused for other stuff.
2.- Non alphanumeric stuff only (the payload can be encoded as we previously discussed)

Greetings!!

--------------------------------
http://sirdarckcat.blogspot.com/ http://www.sirdarckcat.net/ http://foro.elhacker.net/ http://twitter.com/sirdarckcat



Edited 12 time(s). Last edit at 03/04/2010 10:47PM by sirdarckcat.

Options: ReplyQuote
Re: Make this code smaller
Posted by: SW
Date: January 28, 2010 04:36AM

I would like to but I haven't figure out this works at all yet. Is there an explanation somewhere?

Options: ReplyQuote
Re: Make this code smaller
Posted by: sirdarckcat
Date: January 28, 2010 08:52AM

hmm execute this code:
__=';(_=___(___)[+[]]+___+__,+[])?("?.*|"):_;';___=/__=';(_=___(___)[+[]]+___+__,+[])?("?.*|"):_;';___=/;(_=___(___)[+[]]+___+__,+[])?("?.*|"):_;

then, try to make a smaller one that does the same.. and can do it with any other code we would want to put it..

Greetings!!

--------------------------------
http://sirdarckcat.blogspot.com/ http://www.sirdarckcat.net/ http://foro.elhacker.net/ http://twitter.com/sirdarckcat

Options: ReplyQuote
Re: Make this code smaller
Date: March 03, 2010 07:50AM

Since no one else seems to be interested in this challenge I guess it's up to me..

My first attempt just renamed variables, did minor adjustments and restructuring which got me from 145 to 106:

ª=';!(_=_(_)[+[]]+_+ª)?("?.*|"):_';_=/ª=';!(_=_(_)[+[]]+_+ª)?("?.*|"):_';_=/;!(_=_(_)[+[]]+_+ª)?("?.*|"):_

Then I did some major restructuring which got me down to 96:

_=/!(_='_='+_+';!'+_(_)[-~-~-~_]+':_')?("?.*|"):/;!(_='_='+_+';!'+_(_)[-~-~-~_]+':_')?("?.*|"):_

The basic principle is the same, so there is nothing revolutionary about it. If numbers would have been allowed one could have done some interesting stuff like:

x=#1=/.*/(#1#)

I'm sure that some of you can easily make this even shorter, but someone has to start right..

/Jonas

Options: ReplyQuote
Re: Make this code smaller
Posted by: thornmaker
Date: March 03, 2010 10:13AM

@jonas wow! i love the _(_) trick

Options: ReplyQuote
Re: Make this code smaller
Posted by: thornmaker
Date: March 03, 2010 11:35AM

I refactored a bit. The main change is to make .* the first matching group so that you don't need [3]

_=/'.*"|',_='_='+_+','+_(_)+"_"/,'.*"|',_='_='+_+','+_(_)+"_",_
length: 63

[edit:] corrected length



Edited 1 time(s). Last edit at 03/03/2010 12:53PM by thornmaker.

Options: ReplyQuote
Re: Make this code smaller
Date: March 03, 2010 12:31PM

@thornmaker Nice work! I'll see what I can do about it tomorrow.

Options: ReplyQuote
Re: Make this code smaller
Posted by: thornmaker
Date: March 03, 2010 04:05PM

59 letters:
_=/'.+]|','_='+_+','+_(_)[+[]]/,'.+]|','_='+_+','+_(_)[+[]]

Options: ReplyQuote
Re: Make this code smaller
Posted by: Anonymous User
Date: March 03, 2010 04:28PM

_=/,'.+]|','_='+_+_(_)[+[]]/,'.+]|','_='+_+_(_)[+[]]
52 :)

Options: ReplyQuote
Re: Make this code smaller
Posted by: thornmaker
Date: March 03, 2010 05:29PM

@mario haha, nice!

the fun thing about quine sniping is that if you can eliminate a char somewhere, there's a pretty good chance you can eliminate another one somewhere else :)

Options: ReplyQuote
Re: Make this code smaller
Posted by: Anonymous User
Date: March 03, 2010 05:43PM

No way ;)

Options: ReplyQuote
Re: Make this code smaller
Date: March 04, 2010 02:19AM

@thornmaker & .mario Wow! Really neat tricks both of you! Here's something I thought of yesterday:

_=/,'.+]|','_='+_+[_(_)]/,'.+]|','_='+_+[_(_)]

46

Removing the second capture group so that indexing is no longer needed.

Options: ReplyQuote
Re: Make this code smaller
Date: March 04, 2010 02:35AM

Damn! I'm sniping myself..

_=/,\'.+]|,'_='+_+[_(_)]/,'_='+_+[_(_)]

39

Never thought it could go this low.



Edited 1 time(s). Last edit at 03/04/2010 02:52AM by Jonas Magazinius.

Options: ReplyQuote
Re: Make this code smaller
Posted by: Anonymous User
Date: March 04, 2010 04:37AM

@Jonas - absolutely awesome. The backslash trick is excellent!

Options: ReplyQuote
Re: Make this code smaller
Posted by: Gareth Heyes
Date: March 04, 2010 05:18AM

You guys inspired me to find this:-
http://www.thespanner.co.uk/2010/03/04/my-regexp-is-still-leaking/

hehehehhe

------------------------------------------------------------------------------------------------------------
"People who say it cannot be done should not interrupt those who are doing it.";
labs : [www.businessinfo.co.uk]
blog : [www.thespanner.co.uk]
Hackvertor : [hackvertor.co.uk]

Options: ReplyQuote
Re: Make this code smaller
Posted by: thornmaker
Date: March 04, 2010 11:30AM

@Jonas nice! I tried to think of a way to eliminate the back reference too but I couldn't come up with anything. I think your quine is shorter than any of the ones listed at http://web-graphics.com/pages/quine.php too. awesome :)

@Gareth so I guess we can use /.+/() for other no-alphanumeric contest, right?

Options: ReplyQuote
Re: Make this code smaller
Posted by: Gareth Heyes
Date: March 04, 2010 12:33PM

@thornmaker

That was the original idea but we need +. :( unless we can invent a new concat method or access object properties without [] or .

------------------------------------------------------------------------------------------------------------
"People who say it cannot be done should not interrupt those who are doing it.";
labs : [www.businessinfo.co.uk]
blog : [www.thespanner.co.uk]
Hackvertor : [hackvertor.co.uk]

Options: ReplyQuote
Re: Make this code smaller
Posted by: satyr
Date: March 06, 2010 03:08AM

_=/'_='+[_,_(_)]|'.+?]/,'_='+[_,_(_)]

37

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Posted by: thornmaker
Date: March 06, 2010 07:38PM

@satyr well done!

does anyone know of *any* (nontrivial) JS quine that is shorter?

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Posted by: thornmaker
Date: March 06, 2010 08:03PM

quine: /x/

length: 3!!! :D



Edited 2 time(s). Last edit at 03/06/2010 08:04PM by thornmaker.

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Posted by: sirdarckcat
Date: March 06, 2010 08:05PM

1


prints itself and it's length

--------------------------------
http://sirdarckcat.blogspot.com/ http://www.sirdarckcat.net/ http://foro.elhacker.net/ http://twitter.com/sirdarckcat

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Posted by: thornmaker
Date: March 06, 2010 08:05PM

grr... sniper!!! well i can beat that...

quine:

length: 0 :)



Edited 1 time(s). Last edit at 03/06/2010 08:06PM by thornmaker.

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Posted by: sirdarckcat
Date: March 06, 2010 08:10PM

wait, we fail:
1.- Your code must allow arbitrary code to be part of the code... so it can be reused for other stuff.

--------------------------------
http://sirdarckcat.blogspot.com/ http://www.sirdarckcat.net/ http://foro.elhacker.net/ http://twitter.com/sirdarckcat

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Posted by: sirdarckcat
Date: March 06, 2010 08:10PM

so we are on 37 still
_=/'_='+[_,_(_)]|'.+?]/,'_='+[_,_(_)]

--------------------------------
http://sirdarckcat.blogspot.com/ http://www.sirdarckcat.net/ http://foro.elhacker.net/ http://twitter.com/sirdarckcat

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Posted by: Anonymous User
Date: March 07, 2010 02:43PM

That comma re-usal trick is just awesome. I give up haha - very nice!

@sdc and thornmaker:
[/./,/./]
:P



Edited 1 time(s). Last edit at 03/07/2010 02:43PM by .mario.

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Date: March 07, 2010 10:16PM

I can't give up just yet!

_=/[^'_='+_(_)]+(.+?)].+/,'_='+_(_)

35

@satyr - Really beautiful work, nice and clean!

----------------34----------------
_=/.+?('['_='+_(_)]+).+/,'_='+_(_)

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Date: March 07, 2010 10:50PM

Just when you think you've found the smallest possible you come up with a new idea..

_=/.+?('['_='+_(_)]+).+/,'_='+_(_)

34

----------------34----------------
_=/.+?('['_='+_(_)]+).+/,'_='+_(_)

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Posted by: sirdarckcat
Date: March 08, 2010 04:28AM

@Jonas Magazinius amazing :), terrific idea

--------------------------------
http://sirdarckcat.blogspot.com/ http://www.sirdarckcat.net/ http://foro.elhacker.net/ http://twitter.com/sirdarckcat

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Posted by: Anonymous User
Date: March 08, 2010 05:01AM

_=/[,'_='+_+_(_)]+/,'_='+_+_(_)
31

Options: ReplyQuote
Re: JavaScript Smallest NonAlnum Quine
Date: March 08, 2010 08:05AM

@.mario, damn that's beautiful...

----------------34----------------
_=/.+?('['_='+_(_)]+).+/,'_='+_(_)

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


Sorry, only registered users may post in this forum.