From 52b83b2084bbd8bba5b4e1f06fae5ee54eb1b857 Mon Sep 17 00:00:00 2001 From: mbrg <11074433+mbrg@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:31:19 +0200 Subject: [PATCH 1/2] install prereqs on the devcontainer --- .devcontainer/devcontainer.json | 4 +-- .devcontainer/setup.sh | 62 +++++++++++++++++++++++++++++++++ .gitignore | 4 ++- 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100755 .devcontainer/setup.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 68bf46d..98726be 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/python { - "name": "Python 3", + "name": "PowerPwn", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/python:1-3.8", @@ -13,7 +13,7 @@ // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "pip3 install --user -r requirements.txt", - "postCreateCommand": "pip install .", + "postCreateCommand": "chmod +x .devcontainer/setup.sh && .devcontainer/setup.sh", "postStartCommand": "git config --add safe.directory ${containerWorkspaceFolder}", // Configure tool-specific properties. diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100755 index 0000000..e3afb4e --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,62 @@ +# npm +sudo apt update +sudo apt install nodejs npm -y +# ffuf +wget https://github.com/ffuf/ffuf/releases/download/v2.1.0/ffuf_2.1.0_linux_arm64.tar.gz +tar -xzf ffuf_2.1.0_linux_arm64.tar.gz ffuf +rm -rf ffuf_2.1.0_linux_arm64.tar.gz +sudo mv ffuf /usr/local/bin/ffuf +# amass +wget https://github.com/owasp-amass/amass/releases/download/v4.2.0/amass_Linux_arm64.zip +unzip -j amass_Linux_arm64.zip "amass_Linux_arm64/amass" +rm -rf amass_Linux_arm64.zip +sudo mv amass /usr/local/bin/amass +# puppeteer prereqs +sudo apt-get install -y \ + ca-certificates \ + fonts-liberation \ + libappindicator3-1 \ + libasound2 \ + libatk-bridge2.0-0 \ + libatk1.0-0 \ + libc6 \ + libcairo2 \ + libcups2 \ + libdbus-1-3 \ + libexpat1 \ + libfontconfig1 \ + libgbm1 \ + libgcc1 \ + libglib2.0-0 \ + libgtk-3-0 \ + libnspr4 \ + libnss3 \ + libpango-1.0-0 \ + libpangocairo-1.0-0 \ + libstdc++6 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxi6 \ + libxrandr2 \ + libxrender1 \ + libxss1 \ + libxtst6 \ + lsb-release \ + wget \ + xdg-utils +# puppeteer +npm i puppeteer +# puppeteer in dir +cd puppeteer_get_substrate_bearer +npm install +npx puppeteer browsers install chrome +cd .. +# powerpwn +pip install . + diff --git a/.gitignore b/.gitignore index cffd210..4fc68e1 100644 --- a/.gitignore +++ b/.gitignore @@ -151,4 +151,6 @@ tokens.json .dump node_modules/ whoami_* -copilot_dump_* \ No newline at end of file +copilot_dump_* +ffuf* +amass* \ No newline at end of file From feaf4171742f63dc4eaa05d863855c48f9092b2f Mon Sep 17 00:00:00 2001 From: AvishaiEZen <152059625+AvishaiEZen@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:59:08 +0000 Subject: [PATCH 2/2] adding env vars --- .devcontainer/setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index e3afb4e..6848aef 100755 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -59,4 +59,6 @@ npx puppeteer browsers install chrome cd .. # powerpwn pip install . - +# set env vars +export PYTHONPATH=/workspaces/power-pwn/src/:$PYTHONPATH +export PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium