Skip to content

Instantly share code, notes, and snippets.

View aripalo's full-sized avatar

Ari Palo aripalo

View GitHub Profile
@byt3bl33d3r
byt3bl33d3r / log4j_rce_check.py
Created December 10, 2021 06:02
Python script to detect if an HTTP server is potentially vulnerable to the log4j 0day RCE (https://www.lunasec.io/docs/blog/log4j-zero-day/)
#! /usr/bin/env python3
'''
Needs Requests (pip3 install requests)
Author: Marcello Salvati, Twitter: @byt3bl33d3r
License: DWTFUWANTWTL (Do What Ever the Fuck You Want With This License)
This should allow you to detect if something is potentially exploitable to the log4j 0day dropped on December 9th 2021.
@rajbos
rajbos / api-calls.sh
Last active January 17, 2024 09:14
Load jwt token from GitHub App for authentication
#!/bin/bash
# Purpose
# grab the jwt token
# make API calls as the GitHub App used
# get a temporary jwt token from the key file and app id (hardcoded in the file:)
generated_jwt=$(./github-app-jwt.sh)
github_api_url="https://api.github.com/app"
@lansolo99
lansolo99 / doc.md
Last active November 10, 2022 05:57
Docusaurus Rapidoc integration
title sidebar_label hide_table_of_contents
Document example calling API
Document example calling API
true

Document example calling API

import Rapidoc from "@theme/Rapidoc"

@benkehoe
benkehoe / aws-profile-for-bashrc.sh
Last active April 2, 2024 10:41
AWS_PROFILE env var management
# MIT No Attribution
#
# Copyright 2022 Ben Kehoe
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
@darko-mesaros
darko-mesaros / cdk-ssm-ec2.ts
Last active May 19, 2020 11:11
Launch an EC2 instance with CDK, by using the latest Amazon Linux AMI - Powered by SSM Parameter store! 🔏
import * as cdk from '@aws-cdk/core';
import * as ec2 from '@aws-cdk/aws-ec2';
export class CdkSsmEc2Stack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// import the default VPC
const vpc = ec2.Vpc.fromLookup(this, 'VPC', {
@slawekzachcial
slawekzachcial / aws-sigv4-ssm-get-parameter.sh
Last active May 20, 2024 14:48
Using CURL to call AWS ReST API, signing request with v4 signature
#!/bin/bash
# Source: https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html
[[ -n "${AWS_ACCESS_KEY_ID}" ]] || { echo "AWS_ACCESS_KEY_ID required" >&2; exit 1; }
[[ -n "${AWS_SECRET_ACCESS_KEY}" ]] || { echo "AWS_SECRET_ACCESS_KEY required" >&2; exit 1; }
readonly parameterName="SlawekTestParam"
readonly method="POST"
@ottokruse
ottokruse / cdk-package.ts
Last active August 9, 2023 11:06
Script to publish CDK assets (e.g. Lambda function code) to S3 and generate parameter files, so you can combine cdk synth with CloudFormation deployments. This is essentially the equivalent of 'sam package' but then for CDK. Tested to work for Lambda and S3-deployments
#!/usr/bin/env ts-node
// This script uploads your assets to the CDK staging bucket in S3 (just as cdk deploy would)
// and writes out two files:
// - parameters.ini to use in CLI deployments (see instructions below)
// - parameters.json to use in AWS CodePipeline for CloudFormation deployments
//
// Installation instructions:
// - Save this script cdk-package.ts to the root of your CDK repo (i.e. next to cdk.json) and make it executable
// - Install script dependencies: npm install jsonpath aws-sdk adm-zip @types/jsonpath @types/adm-zip
AWSChatbotRole:
Type: AWS::IAM::Role
Properties:
RoleName: AWSChatbotRole
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: 'chatbot.amazonaws.com'
@andrewodri
andrewodri / Dockerfile
Last active December 22, 2023 20:56
Connect Fargate instance to SSM Session Manager
FROM debian:10-slim
RUN apt-get update -y && \
apt-get install -y awscli curl gnupg && \
apt-key adv --fetch-keys "https://nginx.org/keys/nginx_signing.key" && \
echo "deb http://nginx.org/packages/debian buster nginx" > /etc/apt/sources.list.d/nginx.list
RUN curl --silent --show-error --location --output /tmp/amazon-ssm-agent.deb "https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/debian_amd64/amazon-ssm-agent.deb" && \
dpkg -i /tmp/amazon-ssm-agent.deb
@BigSully
BigSully / DNS over TLS for unbound
Last active May 26, 2024 17:48
DNS over TLS configuration for unbound, including Google DNS, Cloudflare DNS and Quad9 DNS
server:
logfile: ""
# verbosity: 2
username: "nobody"
interface: 0.0.0.0
access-control: 0.0.0.0/0 allow
prefetch: yes
# include: "/opt/unbound/local.conf"
# include: "/opt/unbound/customize.conf"