header += colorize("%Bold", lineify(titles[n], lens[n])[0]) + ' | ' separator = separator[:-1] header = header[:-1] print(separator + "\n" + header + "\n" + separator) for line in elements: tmp = [] for n in range(len(lens)): tmp.append(lineify(line[n], lens[n])) print(tablify(tmp)) for elem in singles: if not elements: print('+' + ('-' * (tty_cols - 2)) + '+') print(tablify([lineify(elem, (tty_cols - 4))])) print() # `phpinfo --browser` (view html output in browser) elif len(plugin.argv) == 2 and plugin.argv[1] == "--browser": html_output = server.payload.Payload("html_format.php").send() tmp_file = Path(filename="phpinfo.html") tmp_file.write(html_output) if tmp_file.browse(): print("[*] Successfully opened %r in browser" % tmp_file) else: print("[-] Failed to open %r in web browser" % tmp_file) print("[-] Try to change BROWSER environment variable") else: sys.exit(plugin.help)
def browser(html_string_buffer): file = Path("phpinfo.html") file.write(html_string_buffer) file.browse() del file
def browser(html_string_buffer): file= Path("phpinfo.html") file.write(html_string_buffer) file.browse() del file
separator += ('-' * (lens[n])) + '-+-' header += colorize("%Bold", lineify(titles[n], lens[n])[0]) + ' | ' separator = separator[:-1] header = header[:-1] print(separator + "\n" + header + "\n" + separator) for line in elements: tmp = [] for n in range(len(lens)): tmp.append(lineify(line[n], lens[n])) print(tablify(tmp)) for elem in singles: if not elements: print('+' + ('-' * (tty_cols - 2)) + '+') print(tablify([lineify(elem, (tty_cols - 4))])) print() # `phpinfo --browser` (view html output in browser) elif len(plugin.argv) == 2 and plugin.argv[1] == "--browser": html_output = server.payload.Payload("html_format.php").send() tmp_file = Path(filename="phpinfo.html") tmp_file.write(html_output) if tmp_file.browse(): print("[*] Successfully opened %r in browser" % tmp_file) else: print("[-] Failed to open %r in web browser" % tmp_file) print("[-] Try to change BROWSER environment variable") else: sys.exit(plugin.help)