Skip to content

Instantly share code, notes, and snippets.

View righettod's full-sized avatar
👨‍💻
In learning mode...

Dominique RIGHETTO righettod

👨‍💻
In learning mode...
View GitHub Profile
@righettod
righettod / payloads.txt
Last active February 10, 2024 12:22
Payloads to try to discover blind SQLi when no error is returned.
# The situation is the following:
# Your enter ab in a feature and it return data to you but when your enter ab' it indicate that there is not data found.
#
# So, does it means that there is no SQLi because ab' is well handled OR the error is catched
# and a "not data found message" is returned?
#
# The goal here is to submit a payload that, if interpreted by the SQL DB, will give ab and then data will be returned
# then indicating that there is a SQLi because the payload is interpreted.
ab';#
ab';--
import uuid
import binascii
from datetime import datetime
"""
Python3 script trying to reproduce the "Sandwich Attack: A New Way Of Brute Forcing UUIDs"
described on "https://versprite.com/blog/universally-unique-identifiers/".
"""
@righettod
righettod / CVE-2022-21449.yaml
Last active December 18, 2023 06:50
Nuclei template to detect exposure to CVE-2022-21449 by the JWT validation API in place.
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
@righettod
righettod / log4shell-payloads.md
Last active December 18, 2023 06:41
List of log4shell payloads seen on my twitter feeds

Objective

This gist gather a list of log4shell payloads seen on my twitter feeds.

💨 I will update it every time I see new payloads.

The goal is to allows testing detection regexes defined in protection systems.

⚠️ ⚠️ ⚠️

@righettod
righettod / clickjacking-payload-template.html
Created October 5, 2019 08:27
Payload template for Clickjaking attack.
<head>
<!-- Big up to https://portswigger.net/web-security/clickjacking labs :) -->
<style>
.target_website {
position:relative;
width:800px;
height:400px;
#Set opacity to 0.5 to see overlay allowing preparation of the attack
#Set opacity to 0.00001 to made the target frame site transparent and bypass some browser protection on opacity like one in chrome for example
#See https://www.w3schools.com/css/css_image_transparency.asp
@righettod
righettod / find-javaee-jws-methods-without-authz.sh
Created July 28, 2023 08:49
Script to identify classes defining JavaEE JWS web accessible methods without an authorization annotation on them.
#!/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
@righettod
righettod / ios-detect-screen-capture-and-screen-recording.swift
Created July 17, 2020 08:48
Code to detect when a user perform a screen capture or screen recording of an application in order to prevent it when possible
import UIKit
//Inspired from the code below:
//https://github.com/takashings/ScreenCapturedSample/blob/master/ScreenCapturedSample/ForScreenCapturedViewController.swift
//https://www.hackingwithswift.com/example-code/uikit/how-to-detect-when-the-user-takes-a-screenshot
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//Define a listener to handle the case when a screen recording is launched
@righettod
righettod / pdf_metadata_cleanup.md
Last active May 23, 2023 14:21
Java and C# code to cleanup the metadata from a PDF document.

Code sample

All librairies used are free and open source.

Java

/* 
  See https://pdfbox.apache.org 
  See https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox for released artifacts
@righettod
righettod / SecurityUtils.java
Last active February 12, 2023 10:42
Provides different utilities methods to apply processing from a security perspective.
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;
@righettod
righettod / venom_security_headers_tests_suite.yml
Last active November 2, 2022 19:02
VENOM sample HTTP security response headers test suites.
name: HTTP security response headers test suites
# TOOLS
# VENOM HOME: https://github.com/ovh/venom
# VENOM RELEASE: https://github.com/ovh/venom/releases
# VENOM ASSERTION KEYWORDS: https://github.com/ovh/venom#assertion
# REF AND RUN
# REF BASE: https://owasp.org/www-project-secure-headers/
# RUN CMD: venom run --var="target_site=https://righettod.eu" venom_security_headers_tests_suite.yml
# venom run --var="target_site=https://righettod.eu" --var="internet_facing=true" venom_security_headers_tests_suite.yml
# venom run --var="target_site=https://righettod.eu" --var="internet_facing=true" --var="logout_url=/logout" venom_security_headers_tests_suite.yml