Skip to content

Instantly share code, notes, and snippets.

View thesp0nge's full-sized avatar
🏡
Working from home

Paolo Perego thesp0nge

🏡
Working from home
View GitHub Profile
var searchQuery = window.location.hash.substr(1);
document.write("Risultati per la ricerca: " + searchQuery);
#include <stdio.h>
#include <string.h>
void copyString(char* input) {
char buffer[10];
strcpy(buffer, input);
printf("Copia effettuata: %s\n", buffer);
}
int main() {
FileInputStream fileIn = new FileInputStream("data.ser");
ObjectInputStream in = new ObjectInputStream(fileIn);
Object obj = in.readObject();
in.close();
if (obj instanceof MyClass) {
MyClass myObj = (MyClass) obj;
// Operazioni su myObj
}
import os
filename = input("Inserisci il nome del file da aprire: ")
command = "cat " + filename
os.system(command)
#!/usr/bin/env python3
import sys
import requests
import random
import string
import re
def viewItem(s, target, query):
url = "http://%s/item/viewItem.php?id=5+or+%s" % (target, query)
@thesp0nge
thesp0nge / README
Last active October 10, 2022 10:33
Tools useful in security research activities to be included in openSUSE
openSUSE is a widely known European Linux distribution.
Among a lot of benifits and killing features, robust for servers and modern for laptop, it's flexible enough to become a
platform for security researchers.
The plan is to collect a set of tools, commonly used in a penetration test or a code review, and create a post installation
script to transform the distribution in a powerful hacking station.
@thesp0nge
thesp0nge / .gitignore
Last active May 12, 2022 16:15
A skelethon for a web crawler for the Codesake suite
*.db
*.swp
@thesp0nge
thesp0nge / apt-security-check
Last active March 1, 2022 11:03
A slightly hacked version of apt-check that takes care only about security packages that need an update.
#!/usr/bin/python3
#
# apt-security-check - paolo@codiceinsicuro.it
#
# A slightly hacked version of apt-check that takes care only about security
# packages that need an update.
#
# Tested on Ubuntu 16.04.5 LTS, 18.04.1 LTS
@thesp0nge
thesp0nge / ova_to_virt.sh
Created June 8, 2021 13:54
An OVA to QCOW2 file format converter, useful for KVM
#!/bin/bash
MYNAME=`basename $0`
QEMU=`which qemu-img`
if [ ! -x $QEMU ]; then
echo "$MYNAME: qemu-img is not installed. Can't continue."
exit -5
fi
@thesp0nge
thesp0nge / KeyTest.java
Last active April 30, 2020 15:08
A source code to show KeyStore usage for storing <key, values> couples... like passwords
// Code used in https://codiceinsicuro.it/chicchi/keystore-non-solo-certificati/
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;