From d5f2d42e3d341699111b9a5ebaf2190b1d25ebfd Mon Sep 17 00:00:00 2001 From: Translator Date: Wed, 20 Aug 2025 23:37:55 +0000 Subject: [PATCH] Translated ['src/windows-hardening/lateral-movement/psexec-and-winexec.m --- .github/workflows/translate_af.yml | 119 ------------------ .github/workflows/translate_de.yml | 119 ------------------ .github/workflows/translate_el.yml | 119 ------------------ .github/workflows/translate_es.yml | 119 ------------------ .github/workflows/translate_fr.yml | 119 ------------------ .github/workflows/translate_it.yml | 119 ------------------ .github/workflows/translate_ja.yml | 119 ------------------ .github/workflows/translate_ko.yml | 119 ------------------ .github/workflows/translate_pl.yml | 119 ------------------ .github/workflows/translate_pt.yml | 119 ------------------ .github/workflows/translate_sr.yml | 119 ------------------ .github/workflows/translate_sw.yml | 119 ------------------ .github/workflows/translate_tr.yml | 119 ------------------ .github/workflows/translate_uk.yml | 119 ------------------ .github/workflows/translate_zh.yml | 119 ------------------ .../hardware-hacking/side_channel_analysis.md | 50 ++++---- .../lateral-movement/psexec-and-winexec.md | 45 +++---- 17 files changed, 47 insertions(+), 1833 deletions(-) delete mode 100644 .github/workflows/translate_af.yml delete mode 100644 .github/workflows/translate_de.yml delete mode 100644 .github/workflows/translate_el.yml delete mode 100644 .github/workflows/translate_es.yml delete mode 100644 .github/workflows/translate_fr.yml delete mode 100644 .github/workflows/translate_it.yml delete mode 100644 .github/workflows/translate_ja.yml delete mode 100644 .github/workflows/translate_ko.yml delete mode 100644 .github/workflows/translate_pl.yml delete mode 100644 .github/workflows/translate_pt.yml delete mode 100644 .github/workflows/translate_sr.yml delete mode 100644 .github/workflows/translate_sw.yml delete mode 100644 .github/workflows/translate_tr.yml delete mode 100644 .github/workflows/translate_uk.yml delete mode 100644 .github/workflows/translate_zh.yml 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/todo/hardware-hacking/side_channel_analysis.md b/src/todo/hardware-hacking/side_channel_analysis.md index 6efbbeb2f..70e6d8c54 100644 --- a/src/todo/hardware-hacking/side_channel_analysis.md +++ b/src/todo/hardware-hacking/side_channel_analysis.md @@ -6,23 +6,23 @@ --- -## Основні канали витоку +## Main Leakage Channels -| Канал | Типовий об'єкт | Інструменти | -|-------|----------------|-------------| -| Споживання енергії | Смарт-картки, IoT МК, FPGA | Осцилограф + шунтуючий резистор/HS зонд (наприклад, CW503) | -| Електромагнітне поле (EM) | ЦП, RFID, прискорювачі AES | H-провід + LNA, ChipWhisperer/RTL-SDR | -| Час виконання / кеші | Настільні та хмарні ЦП | Таймери високої точності (rdtsc/rdtscp), віддалений час прольоту | -| Акустичний / механічний | Клавіатури, 3-D принтери, реле | Мікрофон MEMS, лазерний віброметр | -| Оптичний та тепловий | LED, лазерні принтери, DRAM | Фотодіод / камера високої швидкості, ІЧ-камера | -| Витік, викликаний помилками | ASIC/МК криптографії | Глітч годинника/напруги, EMFI, лазерна ін'єкція | +| Channel | Typical Target | Instrumentation | +|---------|---------------|-----------------| +| Power consumption | Smart-cards, IoT MCUs, FPGAs | Oscilloscope + shunt resistor/HS probe (e.g. CW503) +| Electromagnetic field (EM) | CPUs, RFID, AES accelerators | H-field probe + LNA, ChipWhisperer/RTL-SDR +| Execution time / caches | Desktop & cloud CPUs | High-precision timers (rdtsc/rdtscp), remote time-of-flight +| Acoustic / mechanical | Keyboards, 3-D printers, relays | MEMS microphone, laser vibrometer +| Optical & thermal | LEDs, laser printers, DRAM | Photodiode / high-speed camera, IR camera +| Fault-induced | ASIC/MCU cryptos | Clock/voltage glitch, EMFI, laser injection --- -## Аналіз потужності +## Power Analysis -### Простий аналіз потужності (SPA) -Спостерігайте за *однією* траєкторією та безпосередньо асоціюйте піки/долини з операціями (наприклад, S-блоки DES). +### Simple Power Analysis (SPA) +Спостерігайте за *однією* траєкторією та безпосередньо асоціюйте піки/долини з операціями (наприклад, DES S-boxes). ```python # ChipWhisperer-husky example – capture one AES trace from chipwhisperer.capture.api.programmers import STMLink @@ -45,7 +45,7 @@ CPA залишається передовою технологією, але в --- ## Електромагнітний аналіз (EMA) -Проби EM ближнього поля (500 МГц–3 ГГц) витікають ідентичну інформацію до аналізу потужності *без* вставлення шунтів. Дослідження 2024 року продемонструвало відновлення ключа на **>10 см** від STM32, використовуючи кореляцію спектра та недорогі RTL-SDR передавачі. +Проби EM ближнього поля (500 МГц–3 ГГц) витікають ідентичну інформацію до аналізу потужності *без* вставлення шунтів. Дослідження 2024 року продемонструвало відновлення ключа на **>10 см** від STM32, використовуючи кореляцію спектра та недорогі RTL-SDR фронтенди. --- @@ -55,48 +55,44 @@ CPA залишається передовою технологією, але в * **Downfall / Gather Data Sampling (Intel, 2023)** – транзитне виконання для читання даних AVX-gather через потоки SMT. * **Zenbleed (AMD, 2023) & Inception (AMD, 2023)** – спекулятивне неправильне передбачення векторів витікає регістри між доменами. -Для широкого розгляду проблем класу Spectre дивіться {{#ref}} -../../cpu-microarchitecture/microarchitectural-attacks.md -{{#endref}} - --- ## Акустичні та оптичні атаки * 2024 "​iLeakKeys" показав 95 % точності відновлення натискань клавіш ноутбука з **мікрофона смартфона через Zoom**, використовуючи класифікатор CNN. -* Швидкі фотодіоди захоплюють активність LED DDR4 і реконструюють раунди AES за <1 хвилину (BlackHat 2023). +* Швидкі фотодіоди захоплюють активність LED DDR4 і реконструюють AES раундові ключі за <1 хвилину (BlackHat 2023). --- -## Введення помилок та диференційний аналіз помилок (DFA) -Комбінування помилок з витоком з боку каналу скорочує пошук ключів (наприклад, 1-трасовий AES DFA). Останні інструменти за ціною хобі: -* **ChipSHOUTER & PicoEMP** – сплески електромагнітних імпульсів менше 1 нс. -* **GlitchKit-R5 (2025)** – платформа для спотворення годинника/напруги з відкритим кодом, що підтримує SoC RISC-V. +## Впровадження помилок та диференційний аналіз помилок (DFA) +Комбінування помилок з витоками з бокового каналу скорочує пошук ключів (наприклад, 1-трасовий AES DFA). Останні інструменти за ціною хобі: +* **ChipSHOUTER & PicoEMP** – спотворення електромагнітним імпульсом менше 1 нс. +* **GlitchKit-R5 (2025)** – платформа для спотворення годинника/напруги з відкритим кодом, що підтримує RISC-V SoC. --- ## Типовий робочий процес атаки 1. Визначити канал витоку та точку монтажу (пін VCC, конденсатор декуплінгу, точка ближнього поля). 2. Вставити тригер (GPIO або на основі шаблону). -3. Зібрати >1 тис. трас з належним вибірковим/фільтраційним процесом. +3. Зібрати >1 тис. трас з належним семплюванням/фільтрами. 4. Попередня обробка (вирівнювання, видалення середнього, LP/HP фільтр, вейвлет, PCA). 5. Статистичне або ML відновлення ключа (CPA, MIA, DL-SCA). -6. Перевірити та повторити для викидів. +6. Перевірити та ітеративно працювати з викидами. --- ## Захист та зміцнення * **Постійний час** реалізації та алгоритми, стійкі до пам'яті. * **Маскування/перемішування** – розділити секрети на випадкові частки; сертифікована стійкість першого порядку TVLA. -* **Приховування** – регулятори напруги на чіпі, випадковий годинник, двоєрельсові логіки, електромагнітні екрани. +* **Приховування** – регулятори напруги на чіпі, випадковий годинник, двоє рейкової логіки, електромагнітні екрани. * **Виявлення помилок** – надмірні обчислення, порогові підписи. -* **Операційні** – вимкнути DVFS/turbo в криптографічних ядрах, ізолювати SMT, заборонити спільне розміщення в багатокористувацьких хмарах. +* **Операційний** – вимкнути DVFS/турбо в криптографічних ядрах, ізолювати SMT, заборонити спільне розміщення в багатокористувацьких хмарах. --- ## Інструменти та фреймворки * **ChipWhisperer-Husky** (2024) – осцилограф 500 MS/s + тригер Cortex-M; Python API як вище. * **Riscure Inspector & FI** – комерційний, підтримує автоматизовану оцінку витоків (TVLA-2.0). -* **scaaml** – бібліотека SCA на основі TensorFlow (v1.2 – 2025). +* **scaaml** – бібліотека глибокого навчання SCA на базі TensorFlow (v1.2 – 2025). * **pyecsca** – відкритий фреймворк ECC SCA ANSSI. --- diff --git a/src/windows-hardening/lateral-movement/psexec-and-winexec.md b/src/windows-hardening/lateral-movement/psexec-and-winexec.md index 0345bc5a5..8a51388a5 100644 --- a/src/windows-hardening/lateral-movement/psexec-and-winexec.md +++ b/src/windows-hardening/lateral-movement/psexec-and-winexec.md @@ -4,17 +4,17 @@ ## Як вони працюють -Ці техніки зловживають Менеджером контролю служб Windows (SCM) віддалено через SMB/RPC для виконання команд на цільовому хості. Загальний процес: +Ці техніки зловживають Менеджером керування службами Windows (SCM) віддалено через SMB/RPC для виконання команд на цільовому хості. Загальний процес: 1. Аутентифікація на цільовому хості та доступ до спільної папки ADMIN$ через SMB (TCP/445). -2. Копіювання виконуваного файлу або вказівка команди LOLBAS, яку служба буде виконувати. +2. Копіювання виконуваного файлу або вказівка команди LOLBAS, яку служба виконає. 3. Створення служби віддалено через SCM (MS-SCMR через \PIPE\svcctl), вказуючи на цю команду або двійковий файл. 4. Запуск служби для виконання корисного навантаження та, за бажанням, захоплення stdin/stdout через іменований канал. 5. Зупинка служби та очищення (видалення служби та будь-яких скинутих двійкових файлів). Вимоги/попередні умови: - Локальний адміністратор на цільовому хості (SeCreateServicePrivilege) або явні права на створення служби на цільовому хості. -- Доступний SMB (445) та спільна папка ADMIN$; Дозволено віддалене управління службами через брандмауер хоста. +- Доступний SMB (445) та спільна папка ADMIN$; Дозволене віддалене керування службами через брандмауер хоста. - Обмеження UAC для віддалених: з локальними обліковими записами фільтрація токенів може блокувати адміністратора через мережу, якщо не використовувати вбудованого адміністратора або LocalAccountTokenFilterPolicy=1. - Kerberos проти NTLM: використання імені хоста/FQDN дозволяє Kerberos; підключення за IP часто повертається до NTLM (і може бути заблоковане в захищених середовищах). @@ -37,7 +37,7 @@ sc.exe \\TARGET delete HTSvc - Очікуйте помилку тайм-ауту при запуску EXE, що не є службою; виконання все ще відбувається. - Щоб залишатися більш дружніми до 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/ ## Інструменти та приклади @@ -104,47 +104,50 @@ SharpMove.exe action=startservice computername=remote.host.local servicename=Tes cme smb HOST -u USER -p PASS -x "whoami" --exec-method psexec cme smb HOST -u USER -H NTHASH -x "ipconfig /all" --exec-method smbexec ``` -## OPSEC, виявлення та артефакти +## OPSEC, detection and artifacts Типові артефакти хоста/мережі при використанні технік, подібних до PsExec: -- Безпека 4624 (Тип входу 3) та 4672 (Спеціальні привілеї) на цілі для облікового запису адміністратора, що використовується. -- Безпека 5140/5145 Події спільного доступу до файлів та деталі спільного доступу до файлів, що показують доступ до ADMIN$ та створення/запис службових бінарних файлів (наприклад, PSEXESVC.exe або випадковий 8-символьний .exe). -- Безпека 7045 Встановлення служби на цілі: імена служб, такі як PSEXESVC, RemComSvc або користувацькі (-r / -service-name). -- Sysmon 1 (Створення процесу) для services.exe або образу служби, 3 (З'єднання з мережею), 11 (Створення файлу) в C:\Windows\, 17/18 (Трубопровід створено/підключено) для трубопроводів, таких як \\.\pipe\psexesvc, \\.\pipe\remcom_*, або випадкові еквіваленти. +- Security 4624 (Logon Type 3) та 4672 (Special Privileges) на цілі для облікового запису адміністратора, що використовується. +- Security 5140/5145 події File Share та File Share Detailed, що показують доступ до ADMIN$ та створення/запис службових бінарних файлів (наприклад, PSEXESVC.exe або випадковий 8-символьний .exe). +- Security 7045 Service Install на цілі: імена служб, такі як PSEXESVC, RemComSvc або користувацькі (-r / -service-name). +- Sysmon 1 (Process Create) для services.exe або зображення служби, 3 (Network Connect), 11 (File Create) в C:\Windows\, 17/18 (Pipe Created/Connected) для труб, таких як \\.\pipe\psexesvc, \\.\pipe\remcom_*, або випадкові еквіваленти. - Артефакт реєстру для EULA Sysinternals: HKCU\Software\Sysinternals\PsExec\EulaAccepted=0x1 на хості оператора (якщо не подавлено). Ідеї для полювання - Сповіщення про встановлення служб, де ImagePath включає cmd.exe /c, powershell.exe або TEMP-локації. - Шукати створення процесів, де ParentImage є C:\Windows\PSEXESVC.exe або діти services.exe, що працюють як LOCAL SYSTEM, виконуючи оболонки. -- Позначати іменовані трубопроводи, що закінчуються на -stdin/-stdout/-stderr або відомі імена трубопроводів клонів PsExec. +- Позначати іменовані труби, що закінчуються на -stdin/-stdout/-stderr або відомі імена труб-клонів PsExec. -## Усунення поширених збоїв +## Troubleshooting common failures - Доступ заборонено (5) при створенні служб: не справжній локальний адміністратор, обмеження UAC для локальних облікових записів або захист від підробки EDR на шляху до бінарного файлу служби. -- Мережева адреса не знайдена (53) або не вдалося підключитися до ADMIN$: брандмауер блокує SMB/RPC або адміністративні спільні папки вимкнені. -- Kerberos не вдається, але NTLM заблоковано: підключайтеся за допомогою імені хоста/FQDN (не IP), забезпечте правильні SPN або надайте -k/-no-pass з квитками при використанні Impacket. +- Мережева адреса не знайдена (53) або не вдалося підключитися до ADMIN$: брандмауер блокує SMB/RPC або адміністративні спільні ресурси вимкнені. +- Kerberos не вдається, але NTLM заблоковано: підключайтеся за допомогою hostname/FQDN (не IP), забезпечте правильні SPN або надайте -k/-no-pass з квитками при використанні Impacket. - Час запуску служби вичерпано, але корисне навантаження виконано: очікується, якщо це не справжній бінарний файл служби; захопіть вихід у файл або використовуйте smbexec для живого I/O. -## Примітки щодо зміцнення (сучасні зміни) -- Windows 11 24H2 та Windows Server 2025 вимагають підписування SMB за замовчуванням для вихідних (та вхідних з Windows 11) з'єднань. Це не порушує законне використання PsExec з дійсними обліковими даними, але запобігає зловживанню непідписаним SMB реле та може вплинути на пристрої, які не підтримують підписування. -- Нове блокування NTLM клієнта SMB (Windows 11 24H2/Server 2025) може запобігти зворотному зв'язку NTLM при підключенні за IP або до серверів, що не підтримують Kerberos. У зміцнених середовищах це зламає PsExec/SMBExec на основі NTLM; використовуйте Kerberos (ім'я хоста/FQDN) або налаштуйте винятки, якщо це дійсно потрібно. +## Hardening notes +- Windows 11 24H2 та Windows Server 2025 вимагають підписування SMB за замовчуванням для вихідних (та Windows 11 вхідних) з'єднань. Це не порушує законне використання PsExec з дійсними обліковими даними, але запобігає зловживанню непідписаним SMB реле та може вплинути на пристрої, які не підтримують підписування. +- Нове блокування NTLM клієнта SMB (Windows 11 24H2/Server 2025) може запобігти зворотному зв'язку NTLM при підключенні за IP або до серверів, що не підтримують Kerberos. У захищених середовищах це зламає PsExec/SMBExec на основі NTLM; використовуйте Kerberos (hostname/FQDN) або налаштуйте винятки, якщо це дійсно потрібно. - Принцип найменших привілеїв: мінімізуйте членство локальних адміністраторів, надавайте перевагу Just-in-Time/Just-Enough Admin, впроваджуйте LAPS та моніторте/сповіщайте про встановлення служб 7045. -## Дивіться також +## See also + +- WMI-based remote exec (often more fileless): -- WMI-орієнтоване віддалене виконання (часто безфайлове): {{#ref}} ./wmiexec.md {{#endref}} -- WinRM-орієнтоване віддалене виконання: +- WinRM-based remote exec: + {{#ref}} ./winrm.md {{#endref}} -## Посилання +## References - PsExec - Sysinternals | Microsoft Learn: https://learn.microsoft.com/sysinternals/downloads/psexec -- Зміцнення безпеки SMB у Windows Server 2025 та Windows 11 (підписування за замовчуванням, блокування NTLM): https://techcommunity.microsoft.com/blog/filecab/smb-security-hardening-in-windows-server-2025--windows-11/4226591 +- SMB security hardening in Windows Server 2025 & Windows 11 (signing by default, NTLM blocking): https://techcommunity.microsoft.com/blog/filecab/smb-security-hardening-in-windows-server-2025--windows-11/4226591 + {{#include ../../banners/hacktricks-training.md}}