Skip to content

Instantly share code, notes, and snippets.

@prasincs
prasincs / zkhack2024_IV_puzzleF1_writeup.md
Last active February 7, 2024 04:36 — forked from niooss-ledger/zkhack2024_IV_puzzleF1_writeup.md
Write-up for ZK Hack IV puzzle F1: Gamma Ray
@prasincs
prasincs / foscam_docs.md
Last active June 10, 2023 08:54
FOSCAM Documentation

Adapted from http://www.digitalham.co.uk/web/development/embedding-cctv/ipcam-cgi-sdk/

AFAIK, everything is based on the CGI scripts below, there might be ways to get the streams but I believe it's doable without hacking the firmware and stuff. All functions should be accessible via GET and POST methods.

ACL groups:visitor、operator and Administrator.

Upgrade_firmware.cgi and upgrade_htmls.cgi only support post method,others cgi only support get method.

next_url:

@prasincs
prasincs / aws_checklist.md
Last active June 28, 2021 18:12
AWS Secure Account Initial Setup Checklist

Creating Secure AWS Account Checklist

[ ] Add MFA for Root account

[ ] Create Password Policy Compliant with CIS Foundations

[ ] Create IAM Master and Manager Roles

[ ] Enable AWS Config

@prasincs
prasincs / sha1-hash.clj
Created February 15, 2011 08:36
clojure sha1 hash
(defn get-hash [type data]
(.digest (java.security.MessageDigest/getInstance type) (.getBytes data) ))
(defn sha1-hash [data]
(get-hash "sha1" data))
(defn get-hash-str [data-bytes]
(apply str
(map
#(.substring
@prasincs
prasincs / evident_search_buckets.rb
Created May 24, 2018 12:16
Searching Unencrypted Buckets quickly and remediate
# Requires ESP_ACCESS_KEY_ID, ESP_SECRET_ACCESS_KEY environment variables
require 'esp_sdk'
require 'open3'
def bucket_encrypted? (bucket)
stdout, stderr, status = Open3.capture3("aws s3api get-bucket-encryption --bucket #{bucket}")
status==0
end
reports = ESP::Report.all
package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"net/url"
"time"
#!/usr/bin/sh
# git-distance-based SEMVER
#
# Optional Flag: -t to cause the script to actually tag the github repo
# Using -t will cause the original behavior of Jerry's version.
# Not using -t will not touch the github repo or tags. Just will set the VERSION output and VERSION file
#
# Optional Argument: path to VERSION file. Defaults to VERSION in the current director
# major and minor, once released, are designated by add RELEASE-vx.y tag and the patch will be derived based on distance to that tag
@prasincs
prasincs / apache_dl.bash
Created August 28, 2016 19:41
Download from apache closer.cgi url directly
apache_dl(){
wget $(curl -L "$1?as_json=1" | python -c 'import sys, json; i =json.load(sys.stdin); print i["preferred"]+i["path_info"].strip()')
}
@prasincs
prasincs / qubole_snippet
Created November 16, 2017 21:21
Quark Examples
[qubole-example]
deployment_environment: qubole
master: https://api.qubole.com/api/v1.2
# custom remote services are prefixed with <name>- they're only looked at
# if the deployment_environment matches the prefix
# To be filled by environment variables
qubole-auth_token: %(QUBOLE_API_TOKEN)s
qubole-cluster_id: 1111
# This needs to be changed at some point
qubole-py_files: /tmp/mist.zip
#!/usr/bin/env bash
CURDIR="$( cd "$( dirname "$0" )" && pwd )"
DOMAIN=$1
mkdir -p $CURDIR/zones/$DOMAIN
zone_id=$(aws route53 list-hosted-zones-by-name --dns-name $DOMAIN --output text | grep HOSTEDZONES | awk '{gsub("/hostedzone/","",$3); print $3}'| head -n1)
domains=$(aws route53 list-resource-record-sets --hosted-zone-id $zone_id --query 'ResourceRecordSets[*].Name' --output text | xargs -n1 | sort -u | xargs)
for addr in $(echo $domains); do
addr=$(echo $addr | tr -d '"' )
# remove the last character