def main(self): # Detect operating system, to compose the compatibility elements.checkOS() # options parser = optparse.OptionParser("python" + " " + "%prog -u <<URL>> -c <<Cookie>>", version="1.0.2") parser.add_option("-u", "--url", dest="Url", type="string", help="specify hostname to run on") parser.add_option("-c", "--cookie", dest="Cookie", type="string", help="specify Cookie") (options, args) = parser.parse_args() host = options.Url cookie = options.Cookie if host and cookie: self.shell(host, cookie) else: parser.print_help() elements.close(0)
def rootConnection(self): if os.getuid() != 0: elements.go("\t" + "-------------------------") elements.go("\t" + "> Welcome to " + elements.name + " <") elements.go("\t" + "-------------------------") elements.go(elements.color["blueBold"] + "[*] " + elements.color["white"] + "Hello " + elements.color["greenBold"] + os.uname()[1] + "," + elements.color["white"] + " I hope you enjoy my role") elements.go(elements.color["redBold"] + "[x] " + elements.color["white"] + "You must run in mode " + elements.color["whiteBold"] + "root" + elements.color["white"] + " to be able to operate.") elements.close(0)
# Copyright 2016 by Jose Pino <*****@*****.**> # ############################################### # # try: # import requests # except: ################################ print "\t\nPlease install requests library, you can do it executing: \n" # print "\t\npip install requests" ################################ from core.backcookie import Backcookie # from core.elements import elements # # # ################################################################################ # Backcookie is like the people who finds the love of his life every 2 months. # ################################################################################ # # Make a call to run the shell console appShell = Backcookie() # Request root home to run <backcookie> with all permissions appShell.rootConnection() if __name__ == "__main__": try: # General expression this is expressed after the root appShell.main() except Exception as error: elements.close(elements.color['red'] + "Error: " + elements.color['blue'] + "%s" % error + elements.color['white']) # Result of error