-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into Fork-Article
- Loading branch information
Showing
21 changed files
with
801 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build and deploy a PR on dev.iscsc.fr | ||
|
||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Trigger the workflow on every pull request, but because of the environment (later defined) | ||
# it will require manual approval to run | ||
pull_request: | ||
|
||
jobs: | ||
# Build job | ||
build-and-deploy-dev: | ||
runs-on: ubuntu-latest | ||
# Force to respect the 'dev-deployment' environment rules, in our case 1 maintainer approval | ||
environment: deployment-dev | ||
steps: | ||
# Checkout repo AND ITS SUBMODULES | ||
- name: 🛒 Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: 💉 Inject Development Banner | ||
run: | | ||
cat ./development_banner.html >> ./src/themes/poison/layouts/partials/sidebar/sidebar.html | ||
# Build the static website with the provided docker-compose rules, overriding some elements, see docker-compose.dev.yml | ||
- name: 🛠️ Build with HUGO | ||
run: | | ||
docker compose -f docker-compose.yml -f docker-compose.dev.yml run builder | ||
# Create the SSH key file and fill the known_hosts to avoid a prompt from ssh (1st time connecting to remote host) | ||
- name: 🔐 Create Key File | ||
run: | | ||
mkdir ~/.ssh | ||
touch ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
- name: 🔐 Load Host Keys | ||
run: | | ||
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts | ||
- name: 🔑 Populate Key | ||
run: | | ||
echo "${{ secrets.PRIVATE_SSH_KEY }}" > ~/.ssh/id_rsa | ||
# Upload the build to the remote server location: the volume shared by the nginx container serving http requests | ||
- name: 🚀 Upload | ||
run: | | ||
rsync --archive --stats --verbose --delete ./build/blog/dev/* ${{ secrets.CI_USER_NAME }}@iscsc.fr:${{ secrets.REPO_PATH_ON_REMOTE }}/build/blog/dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div style="background-color:red; color: white; font-size: 2rem; text-align: center; position: fixed; width: 100%; margin-bottom: 50rem;"> | ||
THIS IS A DEVELOPMENT WEBSITE, please go to <a href="https://iscsc.fr" style="font-weight: bold; color:darkslategrey;">https://iscsc.fr</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
services: | ||
builder: | ||
command: --logLevel info --baseURL="https://dev.iscsc.fr" --buildFuture | ||
volumes: | ||
# The container is mode-agnostique: it always builds in /build/blog | ||
# the volume shared on the host side determines where it should go | ||
- ./build/blog/dev:/build/blog:rw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/bash | ||
|
||
PATH=$(/usr/bin/getconf PATH || /bin/kill $$) | ||
|
||
die() { | ||
echo "[!] Something went wrong, exiting..." | ||
exit 1 | ||
} | ||
|
||
echo "[+] Connected to iscsc.fr" | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "[!] Must provide one and only one argument: repo path on remote"; | ||
die; | ||
fi | ||
REPO_PATH="$1"; shift | ||
|
||
echo "[+] Change directory" | ||
cd ${REPO_PATH} || die | ||
|
||
REMOTE_URL="iscsc/blog.iscsc.fr" | ||
REMOTE_NAME=$(git remote -v | grep --ignore-case "${REMOTE_URL}" | grep "(fetch)" | awk '{print $1}') | ||
MAIN_BRANCH_NAME=main | ||
|
||
echo "[+] iScsc remote name is '${REMOTE_NAME}'" | ||
echo "[+] Fetch '${MAIN_BRANCH_NAME}' from '${REMOTE_NAME}'" | ||
git fetch "${REMOTE_NAME}" "${MAIN_BRANCH_NAME}" || die | ||
|
||
echo "[+] Checkout on '${MAIN_BRANCH_NAME}'" | ||
git checkout "${MAIN_BRANCH_NAME}" || die | ||
|
||
REMOTE_MAIN_REF_NAME="${REMOTE_NAME}/${MAIN_BRANCH_NAME}" | ||
|
||
echo "[+] Remote ref is '${REMOTE_MAIN_REF_NAME}'" | ||
echo "[+] Rebase on '${REMOTE_MAIN_REF_NAME}'" | ||
git rebase "${REMOTE_MAIN_REF_NAME}" || die | ||
|
||
echo "[+] git log from here:" | ||
git log --color --decorate --oneline --max-count=20 main | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: "article title" | ||
summary: "article name contains an upper case letter" | ||
date: 2024-05-05T12:00:00+02:00 | ||
lastUpdate: 2024-05-05T12:00:00+02:00 | ||
tags: ["some","tags"] | ||
author: ctmbl | ||
draft: false | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: "WU Chall Base32 - THCon" | ||
summary: "Understand basics of encoded strings to reverse base32" | ||
date: 2024-04-29T12:35:51+0200 | ||
tags: ["THCon","write-up","FR","Supwn"] | ||
author: clementS | ||
draft: false | ||
--- | ||
|
||
# Base64Custom | ||
**Entrée : un fichier txt contenant une chaîne de charactère encodée :** | ||
**KREEGTaOPNRDIcbFGYaFeMLTLcaHOMbTGBWWKXbJNZXGSdDd** | ||
|
||
> Indice :[..] He said he just changed the sextets into quintuplets ? what does that even mean?? | ||
## Etape 1: comprendre comment fonctionne un encodage de string et plus particulièrement l’encodage base64 | ||
Pour représenter un string, on associe à chaque charactère, un indice. Exemple : A->0, B->1,C->3….a->27,b->28… | ||
Les représentations les plus commune sont la bijection ASCII et UTF-8. La bijection ASCII comporte 128 charactères (A..Za..z1..9 ?/…). | ||
|
||
Pour représenter un string on va écrire à la suite chaque identifiant de chaque charactère. Exemple 1 : « Aa »->0 26 | ||
Ici on veut représenter notre chaîne de charactère en utilisant ASCII (128 charactères) . On représentera donc chaque id sur 7 bits (2^7 = 128 bits). | ||
0 26 -> 00000 11010 | ||
|
||
L’encodage en base64, permet de transférer plus facilement des données. En effet, son alphabet est [A..Za..z0..9 ?/], il ne possède donc aucun charactère spéciaux. Il prend en entrée une suite de bits, et les groupes par 6 (il complète avec des 0, à la fin si ca tombe pas juste). | ||
-> 000000 000111 00*0000* | ||
|
||
-> Pour avoir la représentation textuelle, on utilise l’alphabet bijection Base64. On a donc un tout autre string. Ici il devient : AHA | ||
|
||
## Etape 2: On attaque le concret. | ||
On sait que ici, on a pris le FLAG, on l’a mis en base 32 (groupement bits par 5, et à pris sa représentation). On doit donc faire l’étape inverse. On peut en théorie prendre n’importe quelle alphabet mais en analysant la chaîne donnée on remarque que elle est composée des caractères [A..Za..f]. | ||
## Etape 3 : Subtilité. | ||
Comme on l’a préciser tout à l’heure, on peut mettre des 0 à la fin si on a pas assez de bits pour bien convertir. On regarde si il faut éventuellement retirer un bit ou en ajouter. | ||
## Etape 4 : La dernière étape correspond a représenter les bits avec le format universelle pour représenter un texte : ASCII. | ||
|
||
> Rq : Il faut différencier encodage base64 et ASCII | ||
Base64 prend en entrée des bits et renvoie un chaine de charactère. C’est juste une bijection. ASCII prend en entrée une chaîne de charactère et renvoie des bits ou inversement. C’est une façon de représenter facilement un texte pour l’ordinateur. | ||
|
||
## Résumé | ||
``` | ||
Flag -------> 00101010001110 ------> AGSHhhbsf | ||
Encodage ASCII Bijection Base 32 | ||
On doit reverse le process : | ||
AGSHhhbsf ------> 00101010001110 -------> Flag | ||
Bijection Base 32 Décodage ASCII | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.