Skip to content

Commit

Permalink
The Lazagne TTP is actually ready to go
Browse files Browse the repository at this point in the history
  • Loading branch information
l50 committed Aug 1, 2023
1 parent df57b32 commit a8eec30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ The script below runs `LaZagne` tool at a specified path. Post execution, it
cleans up the artifacts:

```bash
./ttpforge -c config.yaml \
run ttps/privilege-escalation/credential-theft/enumerate-creds-lazagne \
/enumerate-creds-lasagna.yaml --arg lazagne_path=/path/to/lazagne \
ttpforge -c config.yaml \
run ttps/privilege-escalation/credential-theft/enumerate-creds-lazagne/enumerate-creds-lazagne.yaml \
--arg lazagne_path=~/lazagne \
--arg cleanup=true
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,29 @@ args:
steps:
- name: setup
inline: |
set -e
if ! command -v python3 &> /dev/null; then
echo "Error: Python3 is not installed on the current system, cannot run laZagne"
echo "Error: Python3 is not installed on the current system, cannot run LaZagne"
exit 1
fi
if ! command -v pip3 &> /dev/null; then
echo "Error: pip3 is not installed on the current system, cannot run laZagne"
echo "Error: pip3 is not installed on the current system, cannot run LaZagne"
exit 1
fi
if ! command -v git &> /dev/null; then
echo "Error: git is not installed on the current system, cannot run laZagne"
echo "Error: git is not installed on the current system, cannot run LaZagne"
exit 1
fi
if [ -d "{{ args.lazagne_path }}" ]; then
if [[ -d "{{args.lazagne_path}}" && -n "$(ls -A $LAZPATH)" ]]; then
echo "Info: LaZagne already present on the current system"
else
sudo git clone https://github.com/AlessandroZ/LaZagne.git {{ args.lazagne_path }}
git clone https://github.com/AlessandroZ/LaZagne.git {{args.lazagne_path}}
fi
echo "Info: Ensuring the latest LaZagne dependencies are installed and up-to-date"
cd {{ args.lazagne_path }} && sudo pip3 install -r requirements.txt
if ! command -v python3 &> /dev/null || ! command -v pip3 &> /dev/null || ! command -v git &> /dev/null; then
echo "Error: Python3, pip3, or git is not installed on the current system, cannot run laZagne"
else
if [ ! -d "{{ args.lazagne_path }}" ]; then
sudo git clone https://github.com/AlessandroZ/LaZagne.git {{ args.lazagne_path }}
cd {{ args.lazagne_path }} && sudo pip3 install -r requirements.txt
fi
fi
cd {{args.lazagne_path}} && pip3 install -r requirements.txt
- name: run-lazagne
inline: |
Expand All @@ -60,19 +49,19 @@ steps:
exit 1
fi
echo "Running laZagne"
cd "{{ args.lazagne_path }}" && python3 "${TARGET_OS}/laZagne.py all"
echo "Running LaZagne"
cd {{args.lazagne_path}} && python3 "${TARGET_OS}/laZagne.py all"
- name: cleanup
inline: |
set -e
if [[ "{{args.cleanup}}" == true ]]; then
if [ -d "{{ args.lazagne_path }}" ]; then
if [ -d "{{args.lazagne_path}}" ]; then
echo "Cleaning up LaZagne repository..."
sudo rm -rf {{ args.lazagne_path }}
sudo rm -rf {{args.lazagne_path}}
fi
echo "Uninstalling Python packages..."
cd {{ args.lazagne_path }} && sudo pip3 uninstall -y -r requirements.txt
cd {{args.lazagne_path}} && sudo pip3 uninstall -y -r requirements.txt
fi

0 comments on commit a8eec30

Please sign in to comment.