def bin(arg2): try : launch(arg2) except OSError as e: if e.errno == os.errno.ENOENT: stg.prog_install(prog) launch(arg2)
def auda(arg2): try: launch(arg2) except OSError as e: if e.errno == os.errno.ENOENT: stg.prog_install([prog, arg2]) launch(arg2)
def launch(arg2): test = sb.Popen([prog,arg2], stdout=sb.PIPE, stdin=sb.PIPE, stderr=sb.STDOUT) output = test.communicate()[0] res = output.find('Cannot open file') if res==16: stg.io_error() exit() return else: test = sb.call([prog,'-e',arg2]) print "Embedded Files :" folder = '_'+arg2+'.extracted' overwrite = '_'+arg2+'-0.extracted' if os.path.isdir(overwrite): os.system('mv '+overwrite+'/* '+folder+'/ && rm -rf '+overwrite) if os.path.isdir(folder): os.system('cd '+folder+'&&'+'file *') print "" ;stg.spinning_cursor(); print "" print "Contents have been saved to " + stg.color.OKYELLOW +folder+ stg.color.END + " in my directory :)\n" if os.path.isdir(folder): for file in os.listdir(folder): path = folder+'/'+file chk_ext = magic.from_file(path, mime=True) if (chk_ext=='text/plain'): print stg.color.OKBLUE + "Reading txt's if present" + stg.color.END print "----------"+file+"----------";os.system('cat ' + path);print "\n---------------------------\n"; elif (chk_ext=='application/zip'): zf = zipfile.ZipFile(path) try: zf.testzip() except RuntimeError as e: if 'encrypted' in str(e): print 'H0ly Sh1t !!, '+file+' is encrypted!' try: prog2 = 'fcrackzip' p = sb.Popen([prog2,'--version'], stdout=sb.PIPE, stdin=sb.PIPE, stderr=sb.STDOUT) yn1 = 'y' while yn1: while (yn1): yn1 = raw_input('Do you want to crack this zip with fcrackzip (y/n)') if yn1=='y': wordlist=raw_input('\nEnter the location of your wordlist\n') os.system(prog2 + ' -u -D -p '+ wordlist +' ' + path) exit() elif yn1=='n': print stg.color.FAIL exit("Program Exited") else : print("Please enter a vaild choice") continue except OSError as e: if e.errno == os.errno.ENOENT: stg.prog_install(prog2) else: print "\nNo Embedded Files Found.."
def soxy(arg2): if os.geteuid() == 0: try: launch(arg2) except OSError as e: if e.errno == os.errno.ENOENT: stg.prog_install([prog, arg2]) launch(arg2) else: stg.root_exit()
def pngch(arg2): dotLoc = arg2.find('.') ext = arg2[dotLoc + 1::] if ext == 'png': try: launch(arg2) except OSError as e: if e.errno == os.errno.ENOENT: stg.prog_install(prog) launch(arg2) else: stg.io_error() exit()
def wave(arg2): dotLoc = arg2.find('.') ext = arg2[dotLoc + 1::] if ext == 'wav': if os.path.isfile(prog): launch(arg2) else: print stg.color.OKBLUE + "Gathering necessary files for wavsteg\n" + stg.color.END spinning_cursor() try: os.system( "git clone https://github.com/ragibson/Steganography.git") launch(arg2) except OSError as e: if e.errno == os.errno.ENOENT: stg.prog_install('git') launch(arg2) else: stg.io_error() exit()
def strings(arg2): prog = 'strings' try: test = sb.Popen([prog, arg2], stdout=sb.PIPE, stdin=sb.PIPE, stderr=sb.STDOUT) output = test.communicate()[0] res = output.find('No such file') if res > 22: stg.io_error() exit() return else: yn1 = 'y' while yn1: while (yn1): print stg.color.OKBLUE yn1 = raw_input( 'Do you want to search for some specific strings (y/n)' ) print stg.color.END if yn1 == 'y': grep_string = raw_input( "\nEnter the Pattern/String to search for \n") os.system('strings ' + arg2 + ' | grep ' + grep_string) exit() elif yn1 == 'n': sb.call([prog, arg2]) exit() else: print("Please enter a vaild choice") continue except OSError as e: if e.errno == os.errno.ENOENT: stg.prog_install('binutils')
def launch(arg2): test = sb.Popen(['python3', '--version'], stdout=sb.PIPE, stdin=sb.PIPE, stderr=sb.STDOUT) output = test.communicate()[0] res = 'Python 3.' in output if not res: print "You need to have Python ver_3.* to run WavSteg" yn1 = 'y' while yn1: while (yn1): yn1 = raw_input('Do you want to install it now (y/n)') if yn1 == 'y': stg.prog_install('python3.6') execute(arg2) elif yn1 == 'n': print stg.color.FAIL exit("Program Exited") else: print("Please enter a vaild choice") continue else: execute(arg2)