Skip to content

Instantly share code, notes, and snippets.

View 003random's full-sized avatar
:shipit:
../../../dev/random

003random 003random

:shipit:
../../../dev/random
View GitHub Profile
@003random
003random / cert_info.go
Last active March 20, 2024 15:05
Prints SSL certificate info from a given URL. Including the encoded public key and cert itself
package main
import (
"fmt"
"os"
"bytes"
"encoding/pem"
"crypto/tls"
"crypto/x509"
)
@003random
003random / ssrf.go
Last active October 2, 2023 21:13
Golang SSRF Protection/Prevention
package main
import (
"context"
"errors"
"log"
"net"
"net/http"
"strings"
"time"
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers accessPolicy="Read, Script, Write">
<add name="web_config" path="*.config" verb="*" modules="IsapiModule" scriptProcessor="%windir%\system32\inetsrv\asp.dll" resourceType="Unspecified" requireAccess="Write" preCondition="bitness64" />
</handlers>
<security>
<requestFiltering>
<fileExtensions>
<remove fileExtension=".config" />
@003random
003random / get neighbors from a 2 dimensional array index in python
Last active November 18, 2022 20:52
get neighbors from a 2 dimensional array index in python
def neighbors(matrix, rowNumber, colNumber):
result = []
for rowAdd in range(-1, 2):
newRow = rowNumber + rowAdd
if newRow >= 0 and newRow <= len(matrix)-1:
for colAdd in range(-1, 2):
newCol = colNumber + colAdd
if newCol >= 0 and newCol <= len(matrix)-1:
if newCol == colNumber and newRow == rowNumber:
continue
if [[ "$(dig @1.1.1.1 A,CNAME {test321123,testingforwildcard,plsdontgimmearesult}.$domain +short | wc -l)" -gt "1" ]]; then
echo "[!] Possible wildcard detected."
fi
package main
import (
"log"
"net"
"os"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
package main
import (
"fmt"
"log"
"net"
"os"
"time"
"github.com/google/gopacket"
@003random
003random / main.go
Last active December 7, 2020 15:15
Golang SSRF protection IPv4
package main
import (
"context"
"errors"
"log"
"net"
"net/http"
"strings"
"time"
<img src=x onerror=alert(0)>
#!/usr/bin/env bash
while getopts ":d:" opt; do
case $opt in
d)
domain=$OPTARG
;;
esac
done