Files

setup.src
  • import_code("/home/me/h/libs/list.src")
  • import_code("/home/me/h/libs/disk.src")
  • import_code("/home/me/h/libs/passwords.src")
  • comp = get_shell.host_computer
  • print "setup hacking script"
  • comp.File("/home/me/h/src/tableAttack.src").copy(home_dir + "/Config", "tableAttack.src")
  • comp.File("/home/me/h/src/rserverInstaller.src").copy(home_dir + "/Config", "rserverInstaller.src")
  • print "compiling cli tools"
  • if comp.File(home_dir + "/vegaTools") then comp.File(home_dir + "/vegaTools").delete
  • comp.File("/home/me/h/cli").copy(home_dir, "vegaTools")
  • comp.create_folder(home_dir, "vegaTools")
  • for f in comp.File(home_dir + "/vegaTools").get_files
  • b = get_shell.build(home_dir + "/vegaTools/" + f.name, home_dir + "/vegaTools")
  • while true
  • comp.touch(home_dir, ".vega_watch")
  • watch_file = comp.File(home_dir + "/.vega_watch")
  • watch_data = {}
  • f = function(o)
  • return o.split("=")
  • end function
  • if watch_file.get_content.len > 1 then watch_data = watch_file.get_content.split(char(10)).map(@f).to_map
  • for f in comp.File("/home/me/h/cli").get_files
  • if watch_data.hasIndex(f.name) == false then watch_data[f.name] = md5(f.get_content)
  • if b isa string then print(f.name + " error: <color=red>" + b + "</color>")
  • f.delete
  • compiled_script = comp.File(home_dir + "/vegaTools/" + f.name[:-4])
  • if watch_data[f.name] != md5(f.get_content) or compiled_script == null then
  • print "compiling " + f.name
  • f.copy(home_dir + "/vegaTools", f.name)
  • b = get_shell.build(home_dir + "/vegaTools/" + f.name, home_dir + "/vegaTools")
  • if b.len > 0 then print(f.name + " error: <color=red>" + b + "</color>")
  • comp.File(home_dir + "/vegaTools/" + f.name).delete
  • watch_data[f.name] = md5(f.get_content)
  • end if
  • end for
  • f = function(o)
  • return o[0] + "=" + o[1]
  • end function
  • watch_file.set_content watch_data.to_list.map(@f).join(char(10))
  • if params.hasIndex(0) == false or params[0] != "-w" then break
  • end while
  • Disk.init("/home/me/Config", "passwords")
  • // setup passwords db
  • if Disk.read_chars.len > 0 then exit
  • if(Disk.blobs.len > 1) then exit("password generation setup already completed")
  • PasswordGenerator.init(PASSWORDS)
  • print "generating passwords, it will take a while"
  • HASH_TABLE=PasswordGenerator.AllPasswords
  • print "done"
  • print "parsing passwords obj"
  • f = function(o)
  • return o[1]
  • end function
  • pass_list = HASH_TABLE.to_list.map(@f)
  • print "done"
  • print "writing to disk"
  • Disk.write(pass_list.join(char(10)))
  • print "done"