This file contains hidden or 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
| # ============================================================================= | |
| # Airflow DAG Validator — PROOF OF CONCEPT | |
| # ============================================================================= | |
| # /!\ WARNING: This script is a Proof of Concept (POC) only. | |
| # It is intended to demonstrate the feasibility of static analysis on | |
| # Airflow DAG files prior to deployment. It must NOT be used as the sole | |
| # security mechanism in a production environment. | |
| # | |
| # Purpose: | |
| # Scans Airflow DAG files submitted by clients before they are deployed on |
This file contains hidden or 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
| import org.jsoup.Jsoup; | |
| import org.jsoup.nodes.Document; | |
| import org.jsoup.safety.Safelist; | |
| import org.jsoup.select.Elements; | |
| import java.net.URI; | |
| import java.net.URISyntaxException; | |
| import java.net.URLDecoder; | |
| import java.net.http.HttpClient; | |
| import java.net.http.HttpRequest; |
This file contains hidden or 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
| package eu.righettod.sdb; | |
| import com.google.crypto.tink.Aead; | |
| import com.google.crypto.tink.InsecureSecretKeyAccess; | |
| import com.google.crypto.tink.KeysetHandle; | |
| import com.google.crypto.tink.aead.AeadConfig; | |
| import com.google.crypto.tink.aead.AesGcmKey; | |
| import com.google.crypto.tink.aead.AesGcmParameters; | |
| import com.google.crypto.tink.util.SecretBytes; | |
| import org.bouncycastle.crypto.generators.Argon2BytesGenerator; |
This file contains hidden or 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
| import sys | |
| import os | |
| import re | |
| from termcolor import colored | |
| from lxml import etree | |
| from lxml.etree import XMLParser | |
| from pathlib import Path | |
| """ | |
| Script to search for CWE records using either a CWE ID or a term. |
This file contains hidden or 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
| #!/bin/bash | |
| # Assume that PYTHON3 and GIT are installed | |
| # and available for the user execution the script | |
| # https://semgrep.dev/docs/cli-reference | |
| PYENV_HOME="/tmp/pyenv" | |
| SEMGREP_RULES_HOME="/tmp/semgrep-rules" | |
| SEMGREP_RULES_FOLDER="python" | |
| SEMGREP_FINDINGS_FILE="semgrep-findings.json" | |
| function initialize(){ |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <!-- | |
| POC to remove a "sensitive" information from the clipboard after a short period of time. | |
| It is used, as an hardening measure, for a legit feature to copy the info into the clipboard. | |
| Here the info taken is an IBAN for the example. | |
| https://developer.mozilla.org/en-US/docs/Web/API/Clipboard | |
| --> |
This file contains hidden or 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
| #!/bin/bash | |
| echo "Folder:" | |
| pwd | |
| for line in $(grep -rFc "@WebMethod" * | grep -v ":0") | |
| do | |
| services_count=$(echo $line | cut -d':' -f2) | |
| java_class_file=$(echo $line | cut -d':' -f1) | |
| auth_annot_count=$(grep -rFc "@RolesAllowed" $java_class_file) | |
| if [ "$services_count" != "$auth_annot_count" ] | |
| then |
This file contains hidden or 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
| package eu.righettod.snippet; | |
| import org.apache.pdfbox.Loader; | |
| import org.apache.pdfbox.pdmodel.PDDocument; | |
| import org.apache.pdfbox.pdmodel.PDDocumentCatalog; | |
| import org.apache.pdfbox.pdmodel.PDDocumentInformation; | |
| import org.apache.pdfbox.pdmodel.PDDocumentNameDictionary; | |
| import org.apache.pdfbox.pdmodel.common.PDMetadata; | |
| import org.apache.pdfbox.pdmodel.interactive.action.*; | |
| import org.apache.pdfbox.pdmodel.interactive.annotation.AnnotationFilter; |
This file contains hidden or 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
| function Test-WebAcademy-Labs-Status($sessionCookieValue){ | |
| $storageFile="$env:USERPROFILE\.webacademy-labs-status" | |
| $session = New-Object Microsoft.PowerShell.Commands.WebRequestSession | |
| $cookie = New-Object System.Net.Cookie | |
| $cookie.Name = "SessionId" | |
| $cookie.Value = $sessionCookieValue | |
| $cookie.Domain = ".portswigger.net" | |
| $session.Cookies.Add($cookie); | |
| Write-Host "[i] Status storage file: $storageFile" -ForegroundColor Cyan | |
| Write-Host "[+] Retrieving labs status from PortSwigger labs web page..." -ForegroundColor Yellow |
This file contains hidden or 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
| id: CVE-2022-21449 | |
| info: | |
| name: CVE-2022-21449 test exposure | |
| description: The JDK 15-18 have a vulnerability in validation of ECDSA signature so this template detect exposure to CVE-2022-21449 by the JWT validation API in place. | |
| author: righettod | |
| severity: info | |
| tags: cve,2022,java | |
| reference: https://neilmadden.blog/2022/04/19/psychic-signatures-in-java |
NewerOlder