From 6bc2161900beb8f8b7db8fbd7148083418553499 Mon Sep 17 00:00:00 2001 From: Translator Date: Wed, 20 Aug 2025 23:38:27 +0000 Subject: [PATCH] Translated ['src/todo/hardware-hacking/side_channel_analysis.md', 'src/w --- .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 ------------------ .../macos-red-teaming/macos-mdm/README.md | 108 ++++++++++++---- .../hardware-hacking/side_channel_analysis.md | 22 ++-- .../lateral-movement/psexec-and-winexec.md | 21 ++-- 18 files changed, 103 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/macos-hardening/macos-red-teaming/macos-mdm/README.md b/src/macos-hardening/macos-red-teaming/macos-mdm/README.md index 4a7a6194c..d3d113c28 100644 --- a/src/macos-hardening/macos-red-teaming/macos-mdm/README.md +++ b/src/macos-hardening/macos-red-teaming/macos-mdm/README.md @@ -2,7 +2,7 @@ {{#include ../../../banners/hacktricks-training.md}} -**macOS MDM'leri öğrenmek için kontrol edin:** +**macOS MDM'leri hakkında bilgi almak için kontrol edin:** - [https://www.youtube.com/watch?v=ku8jZe-MHUU](https://www.youtube.com/watch?v=ku8jZe-MHUU) - [https://duo.com/labs/research/mdm-me-maybe](https://duo.com/labs/research/mdm-me-maybe) @@ -11,7 +11,7 @@ ### **MDM (Mobil Cihaz Yönetimi) Genel Bakış** -[Mobil Cihaz Yönetimi](https://en.wikipedia.org/wiki/Mobile_device_management) (MDM), akıllı telefonlar, dizüstü bilgisayarlar ve tabletler gibi çeşitli son kullanıcı cihazlarını yönetmek için kullanılır. Özellikle Apple'ın platformları (iOS, macOS, tvOS) için, özel özellikler, API'ler ve uygulamalar setini içerir. MDM'in çalışması, ya ticari olarak mevcut ya da açık kaynak olan uyumlu bir MDM sunucusuna dayanır ve [MDM Protokolü](https://developer.apple.com/enterprise/documentation/MDM-Protocol-Reference.pdf)'nü desteklemelidir. Ana noktalar şunlardır: +[Mobil Cihaz Yönetimi](https://en.wikipedia.org/wiki/Mobile_device_management) (MDM), akıllı telefonlar, dizüstü bilgisayarlar ve tabletler gibi çeşitli son kullanıcı cihazlarını yönetmek için kullanılır. Özellikle Apple'ın platformları (iOS, macOS, tvOS) için, özel özellikler, API'ler ve uygulamalar setini içerir. MDM'nin çalışması, ya ticari olarak mevcut ya da açık kaynak olan uyumlu bir MDM sunucusuna dayanır ve [MDM Protokolü](https://developer.apple.com/enterprise/documentation/MDM-Protocol-Reference.pdf)'nu desteklemelidir. Ana noktalar şunlardır: - Cihazlar üzerinde merkezi kontrol. - MDM protokolüne uyan bir MDM sunucusuna bağımlılık. @@ -19,7 +19,7 @@ ### **DEP (Cihaz Kaydı Programı) Temelleri** -Apple tarafından sunulan [Cihaz Kaydı Programı](https://www.apple.com/business/site/docs/DEP_Guide.pdf) (DEP), iOS, macOS ve tvOS cihazları için sıfırdan yapılandırma kolaylığı sağlayarak Mobil Cihaz Yönetimi (MDM) entegrasyonunu basitleştirir. DEP, cihazların kutudan çıkar çıkmaz çalışır hale gelmesini sağlayarak, minimum kullanıcı veya yönetici müdahalesi ile kayıt sürecini otomatikleştirir. Temel yönler şunlardır: +Apple tarafından sunulan [Cihaz Kaydı Programı](https://www.apple.com/business/site/docs/DEP_Guide.pdf) (DEP), iOS, macOS ve tvOS cihazları için sıfırdan yapılandırmayı kolaylaştırarak Mobil Cihaz Yönetimi (MDM) entegrasyonunu basitleştirir. DEP, cihazların kutudan çıkar çıkmaz çalışır hale gelmesini sağlayarak, kullanıcı veya yönetici müdahalesini en aza indirir. Temel yönler şunlardır: - Cihazların ilk etkinleştirme sırasında önceden tanımlanmış bir MDM sunucusuna otomatik olarak kaydolmasını sağlar. - Öncelikle yeni cihazlar için faydalıdır, ancak yeniden yapılandırma sürecindeki cihazlar için de geçerlidir. @@ -27,14 +27,14 @@ Apple tarafından sunulan [Cihaz Kaydı Programı](https://www.apple.com/busines ### **Güvenlik Dikkati** -DEP tarafından sağlanan kayıt kolaylığının faydalı olduğu kadar güvenlik riskleri de taşıyabileceğini belirtmek önemlidir. MDM kaydı için koruyucu önlemler yeterince uygulanmazsa, saldırganlar bu basitleştirilmiş süreci kullanarak kendi cihazlarını organizasyonun MDM sunucusuna kaydedebilir ve kurumsal bir cihaz gibi davranabilirler. +DEP tarafından sağlanan kayıt kolaylığının faydalı olmasına rağmen, güvenlik riskleri de oluşturabileceğini belirtmek önemlidir. MDM kaydı için koruyucu önlemler yeterince uygulanmazsa, saldırganlar bu basitleştirilmiş süreci kullanarak kendi cihazlarını organizasyonun MDM sunucusuna kaydedebilir ve kurumsal bir cihaz gibi davranabilirler. > [!CAUTION] -> **Güvenlik Uyarısı**: Basitleştirilmiş DEP kaydı, uygun koruma önlemleri alınmadığı takdirde, organizasyonun MDM sunucusunda yetkisiz cihaz kaydına olanak tanıyabilir. +> **Güvenlik Uyarısı**: Basitleştirilmiş DEP kaydı, uygun koruma önlemleri alınmadığı takdirde, organizasyonun MDM sunucusunda yetkisiz cihaz kaydına izin verebilir. ### SCEP (Basit Sertifika Kaydı Protokolü) Nedir? -- Göreceli olarak eski bir protokol, TLS ve HTTPS yaygınlaşmadan önce oluşturulmuştur. +- TLS ve HTTPS yaygınlaşmadan önce oluşturulmuş, nispeten eski bir protokoldür. - Müşterilere bir **Sertifika İmzalama Talebi** (CSR) gönderme konusunda standart bir yol sunar. Müşteri, sunucudan imzalı bir sertifika talep eder. ### Yapılandırma Profilleri (aka mobileconfigs) Nedir? @@ -42,28 +42,28 @@ DEP tarafından sağlanan kayıt kolaylığının faydalı olduğu kadar güvenl - Apple’ın **sistem yapılandırmasını ayarlama/uygulama** için resmi yolu. - Birden fazla yük içerebilen dosya formatı. - Özellik listelerine (XML türü) dayanır. -- “Kaynağını doğrulamak, bütünlüğünü sağlamak ve içeriğini korumak için imzalanabilir ve şifrelenebilir.” Temeller — Sayfa 70, iOS Güvenlik Kılavuzu, Ocak 2018. +- “Kökenlerini doğrulamak, bütünlüklerini sağlamak ve içeriklerini korumak için imzalanabilir ve şifrelenebilir.” Temeller — Sayfa 70, iOS Güvenlik Kılavuzu, Ocak 2018. ## Protokoller ### MDM - APNs (**Apple sunucuları**) + RESTful API (**MDM** **satıcı** sunucuları) kombinasyonu -- **İletişim**, bir **cihaz** ile bir **cihaz yönetim** **ürünü** ile ilişkili sunucu arasında gerçekleşir +- **İletişim**, bir **cihaz** ile bir **cihaz yönetim** **ürünü** ile ilişkili bir sunucu arasında gerçekleşir - **Komutlar**, MDM'den cihaza **plist kodlu sözlükler** şeklinde iletilir -- Tüm iletişim **HTTPS** üzerinden. MDM sunucuları genellikle pinlenir. -- Apple, MDM satıcısına kimlik doğrulama için bir **APNs sertifikası** verir +- Tüm iletişim **HTTPS** üzerinden gerçekleşir. MDM sunucuları genellikle pinlenmiştir. +- Apple, MDM satıcısına kimlik doğrulama için bir **APNs sertifikası** verir. ### DEP - **3 API**: 1 satıcılar için, 1 MDM satıcıları için, 1 cihaz kimliği için (belgelendirilmemiş): -- Sözde [DEP "bulut hizmeti" API](https://developer.apple.com/enterprise/documentation/MDM-Protocol-Reference.pdf). Bu, MDM sunucuları tarafından DEP profillerini belirli cihazlarla ilişkilendirmek için kullanılır. -- Cihazları kaydetmek, kayıt durumunu kontrol etmek ve işlem durumunu kontrol etmek için Apple Yetkili Satıcıları tarafından kullanılan [DEP API](https://applecareconnect.apple.com/api-docs/depuat/html/WSImpManual.html). -- Belgelendirilmemiş özel DEP API'si. Bu, Apple Cihazları tarafından DEP profillerini talep etmek için kullanılır. macOS'ta, `cloudconfigurationd` ikili dosyası bu API üzerinden iletişim kurmaktan sorumludur. -- Daha modern ve **JSON** tabanlı (plist'e karşı) -- Apple, MDM satıcısına bir **OAuth token** verir +- Sözde [DEP "bulut hizmeti" API'si](https://developer.apple.com/enterprise/documentation/MDM-Protocol-Reference.pdf). Bu, MDM sunucularının DEP profillerini belirli cihazlarla ilişkilendirmek için kullandığı bir API'dir. +- [Apple Yetkili Satıcıları tarafından kullanılan DEP API'si](https://applecareconnect.apple.com/api-docs/depuat/html/WSImpManual.html) cihazları kaydetmek, kayıt durumunu kontrol etmek ve işlem durumunu kontrol etmek için kullanılır. +- Belgelendirilmemiş özel DEP API'si. Bu, Apple Cihazlarının DEP profillerini talep etmek için kullandığı bir API'dir. macOS'ta, `cloudconfigurationd` ikili dosyası bu API üzerinden iletişim kurmaktan sorumludur. +- Daha modern ve **JSON** tabanlıdır (plist'e karşı) +- Apple, MDM satıcısına bir **OAuth token** verir. -**DEP "bulut hizmeti" API** +**DEP "bulut hizmeti" API'si** - RESTful - Apple'dan MDM sunucusuna cihaz kayıtlarını senkronize eder @@ -75,13 +75,13 @@ DEP tarafından sağlanan kayıt kolaylığının faydalı olduğu kadar güvenl ## Seri Numarası -2010'dan sonra üretilen Apple cihazları genellikle **12 karakterli alfanümerik** seri numaralarına sahiptir; **ilk üç haneler üretim yerini**, sonraki **iki** hane **yıl** ve **hafta** bilgisini, sonraki **üç** hane **benzersiz** **tanımlayıcıyı** ve **son dört** hane **model numarasını** temsil eder. +2010'dan sonra üretilen Apple cihazları genellikle **12 karakterli alfanümerik** seri numaralarına sahiptir; **ilk üç rakam üretim yerini**, sonraki **iki** rakam **yıl** ve **hafta** numarasını, sonraki **üç** rakam **benzersiz** **tanımlayıcıyı** ve **son dört** rakam **model numarasını** temsil eder. {{#ref}} macos-serial-number.md {{#endref}} -## Kayıt ve yönetim adımları +## Kayıt ve Yönetim Adımları 1. Cihaz kaydı oluşturma (Satıcı, Apple): Yeni cihaz için kayıt oluşturulur 2. Cihaz kaydı atama (Müşteri): Cihaz bir MDM sunucusuna atanır @@ -107,7 +107,7 @@ veya `sudo profiles show -type enrollment` komutu çalıştırıldığında - Aktivasyon Kaydı, **DEP “profili”** için içsel bir isimdir - Cihaz internete bağlandığı anda başlar - **`CPFetchActivationRecord`** tarafından yönlendirilir -- **`cloudconfigurationd`** tarafından XPC aracılığıyla uygulanır. **"Kurulum Asistanı"** (cihaz ilk kez başlatıldığında) veya **`profiles`** komutu, aktivasyon kaydını almak için bu daemon ile iletişim kurar. +- **`cloudconfigurationd`** tarafından XPC aracılığıyla uygulanır. **"Kurulum Asistanı"** (cihaz ilk kez başlatıldığında) veya **`profiles`** komutu, aktivasyon kaydını almak için bu daemon ile **iletişim kurar**. - LaunchDaemon (her zaman root olarak çalışır) Aktivasyon Kaydını almak için **`MCTeslaConfigurationFetcher`** tarafından gerçekleştirilen birkaç adım izlenir. Bu süreç, **Absinthe** adı verilen bir şifreleme kullanır. @@ -120,16 +120,16 @@ Aktivasyon Kaydını almak için **`MCTeslaConfigurationFetcher`** tarafından g 1. POST [https://iprofiles.apple.com/session](https://iprofiles.apple.com/session) 4. Oturumu kur (**`NACKeyEstablishment`**) 5. Talebi yap -1. POST [https://iprofiles.apple.com/macProfile](https://iprofiles.apple.com/macProfile) adresine `{ "action": "RequestProfileConfiguration", "sn": "" }` verisini göndererek +1. POST [https://iprofiles.apple.com/macProfile](https://iprofiles.apple.com/macProfile) verileri göndererek `{ "action": "RequestProfileConfiguration", "sn": "" }` 2. JSON yükü Absinthe ile şifrelenir (**`NACSign`**) -3. Tüm talepler HTTPS üzerinden, yerleşik kök sertifikalar kullanılır +3. Tüm talepler HTTPS üzerinden, yerleşik kök sertifikalar kullanılarak yapılır ![](<../../../images/image (566) (1).png>) Yanıt, aşağıdaki gibi bazı önemli verileri içeren bir JSON sözlüğüdür: -- **url**: Aktivasyon profili için MDM satıcı ana bilgisayarının URL'si -- **anchor-certs**: Güvenilir kökler olarak kullanılan DER sertifikalarının dizisi +- **url**: aktivasyon profili için MDM satıcı ana bilgisayarının URL'si +- **anchor-certs**: güvenilir kökler olarak kullanılan DER sertifikalarının dizisi ### **Adım 5: Profil Alma** @@ -137,11 +137,67 @@ Yanıt, aşağıdaki gibi bazı önemli verileri içeren bir JSON sözlüğüdü - **DEP profilinde sağlanan URL'ye** talep gönderilir. - **Köprü sertifikaları**, sağlanmışsa **güveni değerlendirmek** için kullanılır. -- Hatırlatma: **DEP profilinin anchor_certs** özelliği +- Hatırlatma: **anchor_certs** özelliği DEP profilinin - **Talep, cihaz tanımlaması ile basit bir .plist**'tir - Örnekler: **UDID, OS versiyonu**. - CMS imzalı, DER kodlu -- **Cihaz kimlik sertifikası (APNS'den)** kullanılarak imzalanmıştır. +- **Cihaz kimliği sertifikası (APNS'den)** kullanılarak imzalanmıştır. - **Sertifika zinciri**, süresi dolmuş **Apple iPhone Cihaz CA**'sını içerir. -![](<../../../images/image (567) (1) (2) (2) (2) (2) (2) (2) (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1 +![](<../../../images/image (567) (1) (2) (2) (2) (2) (2) (2) (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (2).png>) + +### Adım 6: Profil Yükleme + +- Alındıktan sonra, **profil sistemde saklanır** +- Bu adım otomatik olarak başlar (eğer **kurulum asistanındaysa**) +- **`CPInstallActivationProfile`** tarafından yönlendirilir +- XPC üzerinden mdmclient tarafından uygulanır +- Bağlama Daemon (root olarak) veya Bağlama Ajanı (kullanıcı olarak), bağlama bağlamına bağlı olarak +- Yapılandırma profilleri, yüklemek için birden fazla yük içerir +- Çerçeve, profilleri yüklemek için eklenti tabanlı bir mimariye sahiptir +- Her yük türü bir eklenti ile ilişkilendirilmiştir +- XPC (çerçevede) veya klasik Cocoa (ManagedClient.app içinde) olabilir +- Örnek: +- Sertifika Yükleri, CertificateService.xpc kullanır + +Genellikle, bir MDM satıcısı tarafından sağlanan **aktivasyon profili** aşağıdaki yükleri **içerecektir**: + +- `com.apple.mdm`: cihazı MDM'ye **kaydetmek** için +- `com.apple.security.scep`: cihaza güvenli bir **istemci sertifikası** sağlamak için. +- `com.apple.security.pem`: cihaza güvenilir CA sertifikalarını **yüklemek** için. +- MDM yüklemesi, belgelerdeki **MDM kontrolü** ile eşdeğerdir +- Yük **anahtar özellikleri** içerir: +- - MDM Kontrol URL'si (**`CheckInURL`**) +- MDM Komut Polling URL'si (**`ServerURL`**) + tetiklemek için APNs konusu +- MDM yüklemesi için, **`CheckInURL`**'ye bir talep gönderilir +- **`mdmclient`** içinde uygulanır +- MDM yüklemesi diğer yüklerden bağımsız olabilir +- **Belirli sertifikalara pinlenmiş taleplere** izin verir: +- Özellik: **`CheckInURLPinningCertificateUUIDs`** +- Özellik: **`ServerURLPinningCertificateUUIDs`** +- PEM yükü aracılığıyla iletilir +- Cihazın bir kimlik sertifikası ile tanımlanmasına izin verir: +- Özellik: IdentityCertificateUUID +- SCEP yükü aracılığıyla iletilir + +### **Adım 7: MDM komutlarını dinleme** + +- MDM kontrolü tamamlandıktan sonra, satıcı **APNs kullanarak push bildirimleri gönderebilir** +- Alındığında, **`mdmclient`** tarafından işlenir +- MDM komutlarını sorgulamak için, ServerURL'ye bir talep gönderilir +- Daha önce yüklenmiş MDM yüklemesini kullanır: +- **`ServerURLPinningCertificateUUIDs`** pinleme talebi için +- **`IdentityCertificateUUID`** TLS istemci sertifikası için + +## Saldırılar + +### Diğer Organizasyonlarda Cihaz Kaydı + +Daha önce belirtildiği gibi, bir cihazı bir organizasyona kaydetmek için **sadece o Organizasyona ait bir Seri Numarası gereklidir**. Cihaz kaydedildikten sonra, birçok organizasyon yeni cihaza hassas veriler yükleyecektir: sertifikalar, uygulamalar, WiFi şifreleri, VPN yapılandırmaları [ve benzeri](https://developer.apple.com/enterprise/documentation/Configuration-Profile-Reference.pdf).\ +Bu nedenle, kayıt süreci doğru bir şekilde korunmazsa, bu saldırganlar için tehlikeli bir giriş noktası olabilir: + +{{#ref}} +enrolling-devices-in-other-organisations.md +{{#endref}} + +{{#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 b908c28bf..ea82d0975 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}} -Side-channel saldırıları, fiziksel veya mikro-mimari "sızıntı"yı gözlemleyerek sırları geri kazanır; bu sızıntı, iç durumla *ilişkili* ancak cihazın mantıksal arayüzünün bir parçası *değildir*. Örnekler, bir akıllı kartın anlık çektiği akımı ölçmekten, bir ağ üzerindeki CPU güç yönetimi etkilerini kötüye kullanmaya kadar uzanır. +Side-channel saldırıları, fiziksel veya mikro-mimari "sızıntıları" gözlemleyerek sırları geri kazanır; bu sızıntılar, iç durumla *ilişkili* ancak cihazın mantıksal arayüzünün *bir parçası* değildir. Örnekler, bir akıllı kartın anlık akımını ölçmekten, bir ağ üzerinden CPU güç yönetimi etkilerini kötüye kullanmaya kadar uzanır. --- @@ -12,7 +12,7 @@ Side-channel saldırıları, fiziksel veya mikro-mimari "sızıntı"yı gözleml |-------|-------------|---------| | Güç tüketimi | Akıllı kartlar, IoT MCU'lar, FPGA'lar | Osiloskop + şönt direnç/HS probu (örn. CW503) | | Elektromanyetik alan (EM) | CPU'lar, RFID, AES hızlandırıcıları | H-alan probu + LNA, ChipWhisperer/RTL-SDR | -| Çalışma süresi / önbellekler | Masaüstü & bulut CPU'ları | Yüksek hassasiyetli zamanlayıcılar (rdtsc/rdtscp), uzaktan zaman uçuşu | +| İcra süresi / önbellekler | Masaüstü & bulut CPU'ları | Yüksek hassasiyetli zamanlayıcılar (rdtsc/rdtscp), uzaktan zaman uçuşu | | Akustik / mekanik | Klavyeler, 3-D yazıcılar, röleler | MEMS mikrofon, lazer vibrometre | | Optik & termal | LED'ler, lazer yazıcılar, DRAM | Fotodiyot / yüksek hızlı kamera, IR kamera | | Hata kaynaklı | ASIC/MCU kriptoları | Saat/voltaj hatası, EMFI, lazer enjeksiyonu | @@ -22,7 +22,7 @@ Side-channel saldırıları, fiziksel veya mikro-mimari "sızıntı"yı gözleml ## Güç Analizi ### Basit Güç Analizi (SPA) -Bir *tek* iz gözlemleyin ve zirveleri/çukurları işlemlerle doğrudan ilişkilendirin (örn. DES S-kutuları). +*Tek* bir iz gözlemleyin ve zirveleri/çukurları işlemlerle doğrudan ilişkilendirin (örn. DES S-kutuları). ```python # ChipWhisperer-husky example – capture one AES trace from chipwhisperer.capture.api.programmers import STMLink @@ -40,12 +40,12 @@ print(trace.wave) # numpy array of power samples import numpy as np corr = np.corrcoef(leakage_model(k), traces[:,sample]) ``` -CPA, en son teknoloji olarak kalmaya devam ediyor, ancak makine öğrenimi varyantları (MLA, derin öğrenme SCA) artık ASCAD-v2 (2023) gibi yarışmalarda hakim durumda. +CPA, en son teknoloji olmayı sürdürüyor ancak makine öğrenimi varyantları (MLA, derin öğrenme SCA) artık ASCAD-v2 (2023) gibi yarışmalarda hakim durumda. --- ## Elektromanyetik Analiz (EMA) -Yakın alan EM probları (500 MHz–3 GHz), şant eklemeden güç analizine *eşit* bilgiler sızdırır. 2024 araştırması, spektrum korelasyonu ve düşük maliyetli RTL-SDR ön uçları kullanarak **>10 cm** mesafeden bir STM32'den anahtar kurtarma gösterdi. +Yakın alan EM probeleri (500 MHz–3 GHz), şant eklemeden güç analizine *eşit* bilgiler sızdırır. 2024 araştırması, spektrum korelasyonu ve düşük maliyetli RTL-SDR ön uçları kullanarak **>10 cm** mesafeden bir STM32'den anahtar kurtarma gösterdi. --- @@ -55,15 +55,11 @@ Modern CPU'lar, paylaşılan kaynaklar aracılığıyla sırları sızdırır: * **Downfall / Gather Data Sampling (Intel, 2023)** – geçici yürütme ile SMT iş parçacıkları arasında AVX-gather verilerini okuma. * **Zenbleed (AMD, 2023) & Inception (AMD, 2023)** – spekülatif vektör yanlış tahmini, kayıtları alanlar arası sızdırır. -Spectre sınıfı sorunları için geniş bir inceleme için bkz. {{#ref}} -../../cpu-microarchitecture/microarchitectural-attacks.md -{{#endref}} - --- ## Akustik ve Optik Saldırılar * 2024 "​iLeakKeys", bir **akıllı telefon mikrofonu üzerinden Zoom** kullanarak dizüstü bilgisayar tuş vuruşlarını %95 doğrulukla kurtardığını gösterdi. -* Yüksek hızlı fotodiyotlar, DDR4 aktivite LED'ini yakalar ve AES tur anahtarlarını <1 dakika içinde yeniden inşa eder (BlackHat 2023). +* Yüksek hızlı fotodiyotlar, DDR4 aktivite LED'ini yakalar ve AES tur anahtarlarını <1 dakikada yeniden oluşturur (BlackHat 2023). --- @@ -84,9 +80,9 @@ Hataları yan kanal sızıntısı ile birleştirmek, anahtar aramasını kısalt --- -## Savunmalar ve Güçlendirme -* **Sabit zaman** uygulamaları ve bellek-ağır algoritmalar. -* **Maskeleme/karıştırma** – sırları rastgele paylara ayırın; birinci dereceden direnç TVLA tarafından sertifikalandırılmıştır. +## Savunmalar ve Sertleştirme +* **Sabit zaman** uygulamaları ve bellek-zor algoritmalar. +* **Maskeleme/karıştırma** – sırları rastgele paylara bölün; birinci dereceden direnç TVLA tarafından sertifikalandırılmıştır. * **Gizleme** – yonga üzeri voltaj regülatörleri, rastgeleleştirilmiş saat, çift ray mantığı, EM kalkanları. * **Hata tespiti** – yedek hesaplama, eşik imzaları. * **Operasyonel** – kripto çekirdeklerinde DVFS/turbo'yu devre dışı bırakın, SMT'yi izole edin, çok kiracılı bulutlarda birlikte yerleştirmeyi yasaklayın. diff --git a/src/windows-hardening/lateral-movement/psexec-and-winexec.md b/src/windows-hardening/lateral-movement/psexec-and-winexec.md index 7ba91f618..4f6cf6140 100644 --- a/src/windows-hardening/lateral-movement/psexec-and-winexec.md +++ b/src/windows-hardening/lateral-movement/psexec-and-winexec.md @@ -35,9 +35,9 @@ sc.exe \\TARGET delete HTSvc ``` Notlar: - Bir hizmet olmayan EXE başlatıldığında bir zaman aşımı hatası bekleyin; yürütme yine de gerçekleşir. -- Daha OPSEC dostu kalmak için, dosyasız komutları (cmd /c, powershell -enc) tercih edin veya bırakılan artefaktları silin. +- Daha OPSEC dostu kalmak için, dosyasız komutları (cmd /c, powershell -enc) tercih edin veya bırakılan kalıntıları silin. -Daha ayrıntılı adımları bulmak için: https://blog.ropnop.com/using-credentials-to-own-windows-boxes-part-2-psexec-and-services/ +Daha ayrıntılı adımlar için: https://blog.ropnop.com/using-credentials-to-own-windows-boxes-part-2-psexec-and-services/ ## Araçlar ve örnekler @@ -94,7 +94,7 @@ smbexec.py -hashes LMHASH:NTHASH DOMAIN/user@HOST ```cmd SharpLateral.exe redexec HOSTNAME C:\\Users\\Administrator\\Desktop\\malware.exe.exe malware.exe ServiceName ``` -- [SharpMove](https://github.com/0xthirteen/SharpMove), bir komutu uzaktan çalıştırmak için hizmetin değiştirilmesi/oluşturulmasını içerir. +- [SharpMove](https://github.com/0xthirteen/SharpMove), bir komutu uzaktan çalıştırmak için hizmet modifikasyonu/oluşturmasını içerir. ```cmd SharpMove.exe action=modsvc computername=remote.host.local command="C:\windows\temp\payload.exe" amsi=true servicename=TestService SharpMove.exe action=startservice computername=remote.host.local servicename=TestService @@ -108,9 +108,9 @@ cme smb HOST -u USER -H NTHASH -x "ipconfig /all" --exec-method smbexec PsExec benzeri teknikler kullanırken tipik host/ağ artefaktları: - Hedefte kullanılan admin hesabı için Güvenlik 4624 (Oturum Açma Türü 3) ve 4672 (Özel Ayrıcalıklar). -- ADMIN$ erişimini ve hizmet ikili dosyalarının oluşturulmasını/yazılmasını gösteren Güvenlik 5140/5145 Dosya Paylaşımı ve Dosya Paylaşımı Ayrıntılı olayları (örn. PSEXESVC.exe veya rastgele 8 karakterli .exe). +- ADMIN$ erişimi ve hizmet ikili dosyalarının oluşturulması/yazılması (örneğin, PSEXESVC.exe veya rastgele 8 karakterli .exe) gösteren Güvenlik 5140/5145 Dosya Paylaşımı ve Dosya Paylaşımı Ayrıntılı olayları. - Hedefteki Hizmet Yüklemesi için Güvenlik 7045: PSEXESVC, RemComSvc veya özel (-r / -service-name) gibi hizmet adları. -- Sysmon 1 (Süreç Oluştur) için services.exe veya hizmet görüntüsü, 3 (Ağ Bağlantısı), 11 (Dosya Oluştur) C:\Windows\ içinde, 17/18 (Borular Oluşturuldu/Bağlandı) \\.\pipe\psexesvc, \\.\pipe\remcom_* gibi borular için veya rastgele eşdeğerleri. +- Sysmon 1 (Süreç Oluştur) services.exe veya hizmet görüntüsü için, 3 (Ağ Bağlantısı), 11 (Dosya Oluştur) C:\Windows\ içinde, 17/18 (Borular Oluşturuldu/Bağlandı) \\.\pipe\psexesvc, \\.\pipe\remcom_* veya rastgele eşdeğerler gibi borular için. - Sysinternals EULA için Kayıt defteri artefaktı: HKCU\Software\Sysinternals\PsExec\EulaAccepted=0x1 operatör hostunda (eğer bastırılmamışsa). Av fikirleri @@ -121,22 +121,24 @@ Av fikirleri ## Yaygın hataları giderme - Hizmetler oluşturulurken Erişim reddedildi (5): gerçekten yerel admin olmama, yerel hesaplar için UAC uzaktan kısıtlamaları veya hizmet ikili dosyası yolunda EDR müdahale koruması. - Ağ yolu bulunamadı (53) veya ADMIN$'ye bağlanılamadı: SMB/RPC'yi engelleyen güvenlik duvarı veya admin paylaşımlarının devre dışı bırakılması. -- Kerberos başarısız oluyor ama NTLM engelleniyor: IP ile veya Kerberos olmayan sunuculara bağlanırken hostname/FQDN kullanın, uygun SPN'leri sağladığınızdan emin olun veya Impacket kullanırken biletlerle -k/-no-pass sağlayın. +- Kerberos başarısız oluyor ama NTLM engelleniyor: IP ile veya Kerberos sunucularına bağlanırken hostname/FQDN kullanın, uygun SPN'leri sağladığınızdan emin olun veya Impacket kullanırken biletlerle -k/-no-pass sağlayın. - Hizmet başlatma süresi doluyor ama yük çalıştı: gerçek bir hizmet ikili dosyası değilse beklenir; çıktıyı bir dosyaya yakalayın veya canlı I/O için smbexec kullanın. -## Güçlendirme notları (modern değişiklikler) -- Windows 11 24H2 ve Windows Server 2025, varsayılan olarak dışa dönük (ve Windows 11 içe dönük) bağlantılar için SMB imzalamayı gerektirir. Bu, geçerli kimlik bilgileri ile meşru PsExec kullanımını bozmaz ancak imzasız SMB relay istismarını önler ve imzalamayı desteklemeyen cihazları etkileyebilir. -- Yeni SMB istemcisi NTLM engelleme (Windows 11 24H2/Server 2025), IP ile bağlanırken veya Kerberos olmayan sunuculara bağlanırken NTLM geri dönüşünü engelleyebilir. Güçlendirilmiş ortamlarda bu, NTLM tabanlı PsExec/SMBExec'i bozacaktır; Kerberos (hostname/FQDN) kullanın veya meşru ihtiyaç durumunda istisnalar yapılandırın. +## Güçlendirme notları +- Windows 11 24H2 ve Windows Server 2025, varsayılan olarak outbound (ve Windows 11 inbound) bağlantılar için SMB imzalamayı gerektirir. Bu, geçerli kimlik bilgileri ile meşru PsExec kullanımını bozmaz ancak imzasız SMB relay istismarını önler ve imzalamayı desteklemeyen cihazları etkileyebilir. +- Yeni SMB istemcisi NTLM engelleme (Windows 11 24H2/Server 2025), IP ile bağlanırken veya Kerberos olmayan sunuculara bağlanırken NTLM geri dönüşünü engelleyebilir. Güçlendirilmiş ortamlarda bu, NTLM tabanlı PsExec/SMBExec'i bozacaktır; Kerberos (hostname/FQDN) kullanın veya meşru ihtiyaç varsa istisnalar yapılandırın. - En az ayrıcalık ilkesi: yerel admin üyeliğini en aza indirin, Just-in-Time/Just-Enough Admin'i tercih edin, LAPS'i zorlayın ve 7045 hizmet yüklemeleri üzerinde izleme/uyarı yapın. ## Ayrıca bakınız - WMI tabanlı uzaktan yürütme (genellikle daha dosyasız): + {{#ref}} ./wmiexec.md {{#endref}} - WinRM tabanlı uzaktan yürütme: + {{#ref}} ./winrm.md {{#endref}} @@ -147,4 +149,5 @@ Av fikirleri - PsExec - Sysinternals | Microsoft Learn: https://learn.microsoft.com/sysinternals/downloads/psexec - Windows Server 2025 & Windows 11'de SMB güvenlik güçlendirmesi (varsayılan olarak imzalama, NTLM engelleme): https://techcommunity.microsoft.com/blog/filecab/smb-security-hardening-in-windows-server-2025--windows-11/4226591 + {{#include ../../banners/hacktricks-training.md}}