Skip to content

Instantly share code, notes, and snippets.

View savitoh's full-sized avatar
🏠
Working From Home

Sávio Raires de Souza savitoh

🏠
Working From Home
View GitHub Profile
@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active January 28, 2024 08:19
Log4j RCE CVE-2021-44228 Exploitation Detection

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders

sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
@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.
@petrbouda
petrbouda / memory-limit-request-jvm.md
Last active May 30, 2024 09:48
Memory LIMIT and REQUEST in Containers and JVM

Memory LIMIT and REQUEST in Containers and JVM

  • Do you run a JVM inside a container on Kubernetes (or maybe OpenShift)?
  • Do you struggle with REQUEST and LIMIT parameters?
  • Do you know the impact of those parameters on your JVM?
  • Have you met OOM Killer?

Hope you will find answers to these questions in this example-based article.

How to set up JVM Heap size in a Container

@anderson-custodio
anderson-custodio / profiling-jvm-kubernetes-visualvm.md
Last active January 23, 2024 13:41
Profiling JVM on Kubernetes using VisualVM

Profiling JVM on Kubernetes using VisualVM

Enable JMX server

Edit Dockerfile to enable JMX server and change the hostname with the IP where the container will run:

FROM openjdk:8-jre-alpine
ADD ./target/app.jar app.jar
EXPOSE 8080
ENTRYPOINT java -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=192.168.1.2 -jar app.jar
@koraktor
koraktor / RepositoryImpl.java
Created August 18, 2017 10:43
Combining specifications and projections in Spring Data JPA
public class RepositoryImpl<T, ID extends Serializable>
extends SimpleJpaRepository<T, ID extends Serializable> {
ProjectionFactory projectionFactory;
public <P> List<P> findProjected(Specification<?> spec, Sort sort, Class<P> projectionClass) {
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Tuple> tupleQuery = criteriaBuilder.createTupleQuery();
Root<?> root = tupleQuery.from(getDomainClass());
@MariadeAnton
MariadeAnton / hi-satellite.md
Last active August 7, 2022 18:06
Travis CI Demo Examples - GitHub Satellite 2019
@alanphil
alanphil / login_test.scala
Created August 16, 2016 14:04
Gatling login example and showing how to pull out the HTTP authorization header into a variable
package test
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class LoginTest extends Simulation {
@rkueny
rkueny / snx_install.sh
Created July 21, 2016 08:33
Checkpoint SNX VPN client installation shell script
mkdir temp && cd temp
# for linux 'amd64' architecture install those packages:
sudo apt-get install libx11-6:i386 libpam0g:i386 libstdc++5:i386 lib32z1 lib32ncurses5 lib32bz2-1.0
wget https://vpnportal.aktifbank.com.tr/SNX/INSTALL/snx_install.sh
sudo ./snx_install.sh
cd .. && rm -rf temp/
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 20, 2024 01:55
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites