Obfuscated codes are ways to make the cracker go mad!
Or mabbe it could take your sleep away..
trying to crack these are really cool..
Here's the world famous obfuscated code in C..
#include <stdio.h>
main(t,_,a)char *a;{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==2?_<13?
main(2,_+1,"%s %d %d\n"):9:16:t<0?t<-72?main(_,t,
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#\
;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# \
){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' \
iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# \
}'+}##(!!/")
:t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
:0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}
You could even write obfuscated code in Python!! It's there in python website..
You could write obfuscated code in any language..though it's easier writing in low level and middle level languages..
A novice could find the basic steps in wikipedia...
This is a one in python from the python website..
# Mandelbrot set
print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,
Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,
Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,
i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y
>=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(
64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy
))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24)
# \___ ___/ \___ ___/ | | |__ lines on screen
# V V | |______ columns on screen
# | | |__________ maximum of "iterations"
# | |_________________ range on y axis
# |____________________________ range on x axis
Monday, February 8, 2010
Tuesday, December 1, 2009
MyCrawler
Well, I thought of sharing the crawler that I wrote!!
'''
Created on Nov 16, 2009
My very first, very own Crawler in Python !!
@author: Anish Rajan Kurian
'''
from sys import argv # Gets the argument(starting url),
from random import random # Random number appended to file name
from urlparse import urlsplit # Split the url for the filename
from htmllib import HTMLParser # Parse html to obtain the anchors
from urllib import urlretrieve # Retrieve the url n save it
from urllib2 import urlopen # Open the url !
from formatter import NullFormatter # Sends a Null Formatter to the parser
class Crawler:
'''
The crawler which initially starts with the user provided url
Then saves the page
Then crawls through that page to find more URLs
'''
def __init__(self, *tocrawl):
'''Constructor'''
self.crawllist = list(tocrawl)
self.crawled = []
self.url = ''
def save(self):
'''Saves the page to HD'''
print 'To crawl:', self.crawllist
self.url = self.crawllist.pop()
filename = urlsplit(self.url)[1] + str(random()) + '.html'
urlretrieve(self.url, filename)
print 'Saved : ', filename
def crawl(self):
'''Crawls through the page to find more URLs'''
try:
if self.url not in self.crawled:
urlobj = urlopen(self.url)
response = urlobj.read()
parser = HTMLParser(NullFormatter())
parser.feed(response)
parser.close()
for newlink in parser.anchorlist:
self.crawllist.append(newlink)
print 'New Links Obtained:', newlink
print 'Number of URLs to crawl:', len(self.crawllist)
except:
pass
def addtolist(self):
'''Adds to crawled URLs list'''
self.crawled.append(self.url)
def usage():
'''
Prints usage
'''
usage1 = '''
Usage : python crawler.py [url]
Example : python crawler.py http://www.google.com
Note : Python VM required to run.
'''
usage2 = '''
Alternately,
Run directly by adding
1) #!/usr/bin/env python to top of crawler.py
2) Give executable permission
Usage : ./crawler.py [url]
Example : ./crawler.py http://www.google.com
'''
mymsg = '''
Now that you are clear with the usage, next time you can run without
this being printed!!
Anyways, for now..
'''
print usage1 + '\n' + '-' * 75
print usage2 + '\n' + '-' * 75
print mymsg
def main():
'''
Main Program
'''
try:
if len(argv) < 2 or len(argv) > 2:
usage()
start = str(raw_input('Enter start url [example:'\
'http://www.google.com] :'))
else:
start = str(argv[1])
tocrawl = (start)
crawler = Crawler(tocrawl)
while len(crawler.crawllist) != 0:
try:
crawler.save()
except:
crawler.addtolist()
continue
crawler.crawl()
crawler.addtolist()
else:
print 'Crawl Over!!'
except KeyboardInterrupt, kbi:
print kbi
exit(1)
# Start
if __name__ == '__main__':
main()
'''
Created on Nov 16, 2009
My very first, very own Crawler in Python !!
@author: Anish Rajan Kurian
'''
from sys import argv # Gets the argument(starting url),
from random import random # Random number appended to file name
from urlparse import urlsplit # Split the url for the filename
from htmllib import HTMLParser # Parse html to obtain the anchors
from urllib import urlretrieve # Retrieve the url n save it
from urllib2 import urlopen # Open the url !
from formatter import NullFormatter # Sends a Null Formatter to the parser
class Crawler:
'''
The crawler which initially starts with the user provided url
Then saves the page
Then crawls through that page to find more URLs
'''
def __init__(self, *tocrawl):
'''Constructor'''
self.crawllist = list(tocrawl)
self.crawled = []
self.url = ''
def save(self):
'''Saves the page to HD'''
print 'To crawl:', self.crawllist
self.url = self.crawllist.pop()
filename = urlsplit(self.url)[1] + str(random()) + '.html'
urlretrieve(self.url, filename)
print 'Saved : ', filename
def crawl(self):
'''Crawls through the page to find more URLs'''
try:
if self.url not in self.crawled:
urlobj = urlopen(self.url)
response = urlobj.read()
parser = HTMLParser(NullFormatter())
parser.feed(response)
parser.close()
for newlink in parser.anchorlist:
self.crawllist.append(newlink)
print 'New Links Obtained:', newlink
print 'Number of URLs to crawl:', len(self.crawllist)
except:
pass
def addtolist(self):
'''Adds to crawled URLs list'''
self.crawled.append(self.url)
def usage():
'''
Prints usage
'''
usage1 = '''
Usage : python crawler.py [url]
Example : python crawler.py http://www.google.com
Note : Python VM required to run.
'''
usage2 = '''
Alternately,
Run directly by adding
1) #!/usr/bin/env python to top of crawler.py
2) Give executable permission
Usage : ./crawler.py [url]
Example : ./crawler.py http://www.google.com
'''
mymsg = '''
Now that you are clear with the usage, next time you can run without
this being printed!!
Anyways, for now..
'''
print usage1 + '\n' + '-' * 75
print usage2 + '\n' + '-' * 75
print mymsg
def main():
'''
Main Program
'''
try:
if len(argv) < 2 or len(argv) > 2:
usage()
start = str(raw_input('Enter start url [example:'\
'http://www.google.com] :'))
else:
start = str(argv[1])
tocrawl = (start)
crawler = Crawler(tocrawl)
while len(crawler.crawllist) != 0:
try:
crawler.save()
except:
crawler.addtolist()
continue
crawler.crawl()
crawler.addtolist()
else:
print 'Crawl Over!!'
except KeyboardInterrupt, kbi:
print kbi
exit(1)
# Start
if __name__ == '__main__':
main()
Monday, November 23, 2009
Google's Go
Well, Google is out with it's Go language.
There are hell lotta blogs on this but still I thought of scribbling my thoughts on Go..
The question is, will Go be the next choice of system programmers?
Is it really a language worth much hype? "Google's language" after all..
That too with lotta geniuses like Ken Thomson behind it..
I really couldn't find much similarity between Go and Python..[They say go = python + c]
They claim it to be simple.. mabbe for existing C++ programmers..yea, Go might be perfect for existing C++ programmers to migrate..since keeps a hold on pointers and performs garbage collection and stuff..
And why is google bringing out a systems programming language when they themselves are into development of the "web OS", Chrome OS ?
There are hell lotta blogs on this but still I thought of scribbling my thoughts on Go..
The question is, will Go be the next choice of system programmers?
Is it really a language worth much hype? "Google's language" after all..
That too with lotta geniuses like Ken Thomson behind it..
I really couldn't find much similarity between Go and Python..[They say go = python + c]
They claim it to be simple.. mabbe for existing C++ programmers..yea, Go might be perfect for existing C++ programmers to migrate..since keeps a hold on pointers and performs garbage collection and stuff..
And why is google bringing out a systems programming language when they themselves are into development of the "web OS", Chrome OS ?
Sunday, November 22, 2009
PyLint
Well, I just used PyLint and found out that my Python programs scored just around 4 outta 10.
Well, I got em to be 10 outta 10.
Now my code follows PEP 8, I guess.
Tried some cgi scripts too on resin server.
Well, I got em to be 10 outta 10.
Now my code follows PEP 8, I guess.
Tried some cgi scripts too on resin server.
Python Craze
It's been a couple of weeks since I am crazy about Python.
Don't really know what it has got but I'm simply loving it.
Really disappointed in missing the PyCon India 2009. :(
Wrote a couple of python progs including a quine and a crawler.
A crawler in python is like a Hello World in other languages I guess. ;)
Anyways, got a long way to go with Python.
Don't really know what it has got but I'm simply loving it.
Really disappointed in missing the PyCon India 2009. :(
Wrote a couple of python progs including a quine and a crawler.
A crawler in python is like a Hello World in other languages I guess. ;)
Anyways, got a long way to go with Python.
Subscribe to:
Posts (Atom)