Skip to content

Instantly share code, notes, and snippets.

@yehgdotnet
yehgdotnet / server.py
Created October 28, 2021 16:02 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@yehgdotnet
yehgdotnet / ftpput.pl
Created August 21, 2021 15:11
ftpput.pl
#!/usr/bin/perl -w
#
# $Id: //websites/unixwiz/unixwiz.net/webroot/tools/ftpput.txt#1 $
#
# written by : Stephen J. Friedl
# Software Consultant
# Tustin, California USA
#
# This very simple program is a kind of inverse to wget for ftp: it
# *puts* files to a remote FTP server and returns an exit code that
@yehgdotnet
yehgdotnet / fakebeacon.py
Created October 22, 2017 15:23 — forked from tintinweb/fakebeacon.py
scapy-fakebeacon - spawn lots of fake wifi access points by injecting beacon frames with scapy (essid)
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# source: https://www.4armed.com/blog/forging-wifi-beacon-frames-using-scapy/
#
# requires:
# radiotap supported wifi nic/driver (frame injection) (works fine with Ralink RT2571W)
# iwconfig $iface mode monitor
# iw dev $iface set channel $channel
# or
@yehgdotnet
yehgdotnet / readlocal.js
Created May 25, 2021 04:14
Read local file using JavaScript
<!-- https://www.geeksforgeeks.org/how-to-read-a-local-text-file-using-javascript/ -->
<!DOCTYPE html>
<html>
<head>
<title>Read Text File</title>
</head>
<body>
<input type="file" name="inputfile"
@yehgdotnet
yehgdotnet / is-vpn-active.sh
Created May 23, 2021 07:32
Is VPN active?
while true
do
sudo ifconfig tun0 &> /dev/null && echo -e "\033[1;32m" "-- VPN is active --" "\033[0m"
sudo ifconfig tun0 &> /dev/null || echo -e "\033[1;31m" "-- VPN is NOT active --" "\033[0m"
sleep 5
done
@yehgdotnet
yehgdotnet / gist:d541c60eaa8b6cd9db71e7463ed1bb1c
Last active May 5, 2021 15:07
Tampermonkey filesave dialog
A very fast and easy solution is to use FileSaver.js :
1) Add the following line into the ==UserScript== section of your Greasemonkey script
// @require https://raw.githubusercontent.com/eligrey/FileSaver.js/master/src/FileSaver.js
2) Add the 2 following lines of code to the GM script
var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
saveAs(blob, "hello world.txt");
Purpose: To prevent deobfuscation
Symbols are usually stripped during the build process, so you need the compiled byte-code and libraries to verify whether any unnecessary metadata has been discarded.
First find the nm binary in your Android NDK and export it (or create an alias).
@yehgdotnet
yehgdotnet / review object serialisation class
Created April 27, 2021 12:58
object serialisation class
Object Serialization
Search the source code for the following keywords:
import java.io.Serializable
implements Serializable
JSON
Static analysis depends on the library being used. In case of the need to counter memory-dumping, make sure that highly sensitive information is not stored in JSON as you cannot guarantee any anti-memory dumping techniques with the standard libraries. You can check for the following keywords per library:
@yehgdotnet
yehgdotnet / shodan.go
Created October 13, 2020 00:04
golang shodan
package main
import (
"log"
//"os"
"context"
"github.com/ns3777k/go-shodan/shodan"
"fmt"
"flag"
"strings"
@yehgdotnet
yehgdotnet / goreadurlfromfile.go
Created September 28, 2020 04:49
Go read url from file (change target to your desired domain)
package main
import (
"fmt"
"regexp"
"io/ioutil"
"log"
"os"
)
func main() {
argsWithoutProg := os.Args[1]