import urllib2
import threading
lock = threading.Lock()
dirs=['/',
      '/console',
      '/axis2',
      '/jmx-console',
      '/manager',
      '/invoker/ReadOnlyJNDIFactory']
def expscan(url,dirs):
    global lock
    url=url if url.find('://')>-1 else 'http://'+url
    for dir in dirs:
        try:
            resp=urllib2.urlopen(url+dir)
            getcode=resp.getcode()
            if getcode== 200 or getcode==403:
                lock.acquire()
                print "%s%s     %s" %(url,dir,getcode)
                print resp.info()
                lock.release()
        except:
            pass
