Skip to content

Instantly share code, notes, and snippets.

View epomatti's full-sized avatar
😈

Evandro Pomatti epomatti

😈
View GitHub Profile
@epomatti
epomatti / protobuf.md
Created April 26, 2023 22:11
Install Go / Golang protobuf / protobuffer / protoc

Install Protobuf on Ubuntu

Frequently you'll need $GOPATH/bin available with your $PATH.

Example with ~/.bashrc file for Ubuntu:

export GOPATH=/home/pomatti/go
export PATH=$PATH:$GOPATH/bin
@epomatti
epomatti / Dockerfile
Created April 26, 2023 15:23
Go remote debug
# Commands
# docker build --tag godebug .
# docker run --security-opt="seccomp=unconfined" --cap-add=SYS_PTRACE -p:5001:5000 -p:2345:2345 godebug
FROM golang:1.19.2
WORKDIR /usr/src/app
COPY go.mod go.* ./
@epomatti
epomatti / gist:7aaa57c20a0f919988530b8aec1c04a3
Created March 5, 2023 17:27
theHarvester and patator bruteforce
theHarvester -d <domain> -b all
patator http_fuzz \
url="https://<...>" \
method=POST \
header="Authorization: Basic <...>" \
body="username=FILE0&password=FILE1&grant_type=password" \
resolve=<domain>:<ip> \
0="usernames.txt" \
1="passwords.txt" \
@epomatti
epomatti / buildspec.yaml
Last active March 2, 2023 00:26
AWS CodeBuild buildspec.yaml
version: 0.2
phases:
pre_build:
commands:
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
build:
commands:
- docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG .
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
@epomatti
epomatti / gist:cfecb619361bff6e6503b9be750b0a4b
Created March 1, 2023 23:19
Azure App Service Docker images
App Service images: https://github.com/Azure-App-Service/ImageBuilder
Base images: https://github.com/microsoft/Oryx
@epomatti
epomatti / aws.md
Last active February 23, 2023 12:59
AWS Assessment Permissions

AWS Audit Permissions

Handy policies for assessment of AWS resources in a read-only approach, useful when you're doing some audit.

Request/add the policies below.

Managed policies:

  • AWSResourceExplorerReadOnlyAccess
    • Or AWSResourceExplorerFullAccess if the service has not yet been enabled
@epomatti
epomatti / emails.md
Last active December 19, 2022 18:58
Email Verification Protocols

Email Verification Protocols

  • MX (Mail Exchange): Determines where your emails should be routed to on the internet. It is the equivalnet of an A record where you set the server IP, which in the MX case it will be the mail server FQDN or IP.
    • Multiple entries can be added for additional availability.
    • Priority is added ot the DNS entries as well.
    • Example: @ MX mailhost1.example.com
  • SPF (Sender Policy Framework) - Receiving server queries DNS and confirms sender's origin.
    • Verify the origin of the sender (IP4, IP6, include, MX. Syntax: http://www.open-spf.org/SPF_Record_Syntax).
    • DNS entries that tells servers receiving emails which sender servers are allowed to send emails on behalf of a domain.
  • Servers that receive emails query the DNS to confirm it came from an authorized sending server or IP address.
@epomatti
epomatti / cloud-migration-strategies.md
Created September 3, 2022 17:16
Cloud Migration Strategies

Cloud Migration Strategies

  • REHOST
    • Definition: Migrate the application with no changes.
    • Also known as: Lift and shift
    • Example: App and DB run on VMs on-premises, migrate to EC2 instances as-is.
  • REPLATFORM
    • Definition: Migrate the application changing base infrastructure without major changes to architecture and code.
    • Example: App, DB and NFS run on VMs on-premises, migrate to use Beanstalk, RDS and EFS, with minimal patching in the code.
  • REFACTOR / RE-ARCHITECT
@epomatti
epomatti / readme.md
Last active September 20, 2022 21:39
Yarn 3 init

Here's how to init your Node.js project with latest Yarn version:

Enable corepack (Node.js >=16.10)

corepack enable

Set the latest versions: