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 / zipslip_validation.php
Last active November 16, 2024 02:35
Function to validate that a ZIP file do not contains "ZIP SLIP" payload entries.
<?php
/**
* Function to validate that a ZIP file do not contains "ZIP SLIP" payload entries.
* @param string $zipFilePath Path to the ZIP to test.
* @return bool TRUE only if the archive do not contains ZIP SLIP payload entries.
* @link https://snyk.io/research/zip-slip-vulnerability
* @link https://stackoverflow.com/a/3599093/451455 (inspired from)
*/
function isZipValid($zipFilePath){
$isValid = false;
@righettod
righettod / keychain_data_persistence_mstg_check.py
Created July 21, 2020 06:28
Python3 script to find common entries in 2 export of a iOS device keychain performed via objection.
import json
import binascii
import hashlib
import argparse
from tabulate import tabulate
"""
Python3 script to find common entries in 2 export of a iOS device keychain performed via objection.
The objective is to help performing the following test of the OWASP MSTG:
@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 / retirejs_report.py
Last active November 10, 2021 09:17
Quick script to format the results of a JSON scan report from RetireJS.
"""
Script was migrated below for better evolution and consistency:
https://github.com/righettod/toolbox-pentest-web/blob/master/scripts/generate-report-retirejs.py
"""
@righettod
righettod / Android-Utils.md
Last active January 2, 2020 09:31
Utility PowerShell module when manipulating APK on Windows

The code has been transformed to the following project

@righettod
righettod / pdf_metadata_cleanup.md
Last active May 12, 2025 21:56
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 / 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 / ws_soap_fuzz.py
Last active October 5, 2019 08:28
Simple dirty script to fuzz a SOAP request using the BURP Sniper approach using Windows authentication.
# Simple dirty script to fuzz a SOAP request using the Burp Sniper approach:
# See https://portswigger.net/burp/documentation/desktop/tools/intruder/positions
# Dependencies:
# pip install lxml requests_ntlm requests tabulate tqdm
import requests
import urllib3
from requests_ntlm import HttpNtlmAuth
from lxml import etree as ET
from tabulate import tabulate
from hashlib import sha1
@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';--
@righettod
righettod / check_cve_state.py
Last active March 24, 2019 09:39
Script to verify, for a set of CVE, if the MITRE has released them and if a link to the security advisory on the CVE owner site has been added (python 3).
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to verify, for a set of CVE, if the MITRE has released them
and if a link to the security advisory on the CVE owner site has been added.
Dependencies: pip install requests
"""
import requests
import collections