Skip to content

Instantly share code, notes, and snippets.

@NSEcho
NSEcho / monitor.md
Created February 27, 2021 18:10
How to monitor syslog on device
$ launchctl load -w /System/Library/LaunchDaemons/com.apple.syslogd.plist
$ launchctl start /System/Library/LaunchDaemons/com.apple.syslogd.plist
$ launchctl list | grep -i syslog # To check if it is running
6863	0	com.apple.syslogd
$ apt-get install socat
$ socat - UNIX-CONNECT:/var/run/lockdown/syslog.sock

========================
ASL is here to serve you
@NSEcho
NSEcho / Call sprintf with frida.py
Last active March 19, 2021 14:07
Example that shows how to call sprintf with Frida
from __future__ import print_function
import frida
session = frida.attach("Twitter")
script = session.create_script("""\
var sprintf_ = new NativeFunction(Module.getExportByName(null, 'sprintf'), \
'int', ['pointer', 'pointer', '...', 'pointer']);
console.log("[*] Found sprintf at address", sprintf_.toString())
var output = Memory.alloc(128);
@NSEcho
NSEcho / scan.sh
Created March 24, 2021 10:27
Automate external scanning
#!/bin/bash
if [ $# -ne 1 ]; then
echo "You need to provide range file"
echo "./scan.sh <FILENAME>"
exit 1
fi
GREEN='\033[0;32m'
END='\033[0m'
#!/bin/bash
# Create a filename which contains the links you would like to take the screenshot of and pass it as first param.
# Make sure that the urls have correct scheme (http:// or https://)
# The second param is the prefix for screenshots saved.
# Screenshots will be in format: <PREFIX><COUNTER>.png
# Note: Firefox should not be running when running this script.
if [ $# -ne 2 ]; then
echo "You need to provide input file"
/*
typedef struct {
char *name;
int age;
}person;
// Returns new person with name "test => name" and age equals age
person * create_person(char *name, int age) {
person * p = (person*)malloc(sizeof(person));
p->name = (char*)malloc(sizeof(char) * 250);
package main
import (
"fmt"
"reflect"
)
func printMe(arg string) {
fmt.Println(arg)
}
#!/bin/bash
# Script to get labels which will become vulnrefs inside Owasp table
# You need to pass one parameter to the script, the path where
# the vulns/ directory is located
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
END='\033[0m'
package main
import (
"fmt"
"sync"
)
type checkFn func(username string) bool
type SingleCheck struct {
@NSEcho
NSEcho / fuzzer.sh
Created October 19, 2021 19:49
Simple radamsa fuzzing template
#!/bin/bash
while true; do
radamsa sample.xml > input.xml
/path/to/binary/you/are/fuzzing ./input.xml
if [ $? -gt 0 ]; then
crash_filename=$(date +"%F %T")
cp input.xml "${crash_filename}.xml"
echo "Crash found!"
exit
fi
@NSEcho
NSEcho / client.c
Created October 29, 2021 11:08
Mach ports client and server
// cc client.c -o client
#include <stdio.h>
#include <stdlib.h>
#include <mach/mach.h>
#include <bootstrap.h>
#include <string.h>
#include <unistd.h>
typedef struct {
mach_msg_header_t header;