pmeerw's blog

Mon, 21 Jul 2008

Obfuscation pointers

On obfuscating SQL queries,here is an example:

select"NVL2"(q'<'>',"UTL_RAW".cast_to_varchar2(to_char(stats_mode(column_value)+exp(sum(ln(rownum*tan((select"REGEXP_SUBSTR"(xmltype(oracle).extract('/ROWSET/ROW/_x0032_'),'[^>:D<^]+',9)from(select"MAX"(decode(rownum,316,"+"))ilu,max(decode(rownum,845,"+"))"INU"from(select/*--*/UNIQUE/*@*/KEYWORD"+"from"V$RESERVED_WORDS"))model/*..-*/partition/*----*/by('"DUAL"'world)dimension/*--*/by(7.67e183d"X")measures(ilu,inu,lpad(':*',999)oracle)(oracle[any]=to_char(dbms_xmlgen.getxml(concat(inu[cv()],'+1."2"')||ilu[cv(x)]||cv(world)))))+.27322671529864645387899781380413953366)))),rpad('FM',34,'X')))||Initcap(concat(regexp_substr(dburitype('/SYS/DBA_PROCEDURES/ROW[PROCEDURE_NAME=''GETKEY'']/OBJECT_NAME').getxml().getstringval(),'_O.*S......_',35),replace((select"STATS_MODE"(regexp_substr(table_name,'[COTTON+XE]{4,}'))from"DICT"),'X','S'))),count(*))from/**/table(sys.odcinumberlist(4*23))connect/**/by.1>1.connect/**/by.25>rownum/100.group/**/by()
/
There have been three Haskell obfuscation contests, here is an example:
module Main where{import List;import System;
 import Data.HashTable as H;(???????)=(concat
 );(??????)(???)(????)=((groupBy)(???)(????))
 ;(??????????????????????)(????)=((??????????
 )((tail).(???????))((????????????????????)((
 ??????)(?????????????????????)(????))));(??)
 =([' ']);(??????????????)=((hashString));(?)
 =((>>=));(???????????????????????)([((???)),
 (????)])=((?????????????)(???))?(\(?????)->(
 (????????????????)(==)(??????????????))?(\((
 ???))->((??????????????????)(???????????????
 )(???)(?????))>>((?????????????????)(???))?(
 \((?????))->((((???????????????????)((????))
 ((??????????????????????))((?????))))))));((
 ???????????????????????))(??)=(????????????)
 ("usage f dic out");(?????????????????????)(
 (???),(??????))((????),(????????????????????
 ))=((???)==(????));(?????????????????)(???)=
 (toList)(???);(????????????????????)(????)=(
 ((??????????)(((??????????)(snd)))((????))))
 ;(??????????????????)(???????????????)(???)(
 (?????))=(((mapM)(((???????????????)(???)))(
 (lines)(?????))));(???????????????????)(????
 )(???????????????????????)(?????)=(?????????
 )(????)((unlines)((???????????????????????)(
 ?????)));(????????????????)(???)((????))=(((
 new)(???)(????)));(main)=((???????????)?(((\
 (???)->((???????????????????????)(???))))));
 (???????????????)(???)(????)=((????????)(???
 )((sort)(????))((??)++(????)));(???????????)
 =(getArgs);(????????????)(???)=((((print))((
 ???))));(??????????)(???)(????)=(((map)(???)
 (????)));(????????)((???))(????)(?????)=((((
 H.insert))((???))(????)(?????)));(?????????)
 ((???))((????))=(((writeFile)(???)((????))))
 ;(?????????????)(???)=(((readFile)((???))))}
In Python you'd nest lambda expressions... below codes computes the primes < 1000:
print filter(None,map(lambda y:y*reduce(lambda x,y:x*y!=0,
map(lambda x,y=y:y%x,range(2,int(pow(y,0.5)+1))),1),range(2,1000)))
And some obfuscated Python treats, such as a Brainf*ck interpreter; and a commercial Python obfuscator!

posted at: 15:28 | path: /programming | permanent link

Made with PyBlosxom