Skip to content

Instantly share code, notes, and snippets.


Cosmin Popescu cosminpopescu14

View GitHub Profile
cosminpopescu14 /
Created December 11, 2021 07:06 — forked from Neo23x0/
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 -r '\$\{jndi:(ldap[s]?|rmi|dns):/[^\n]+' /var/log
View build_native_image
native-image --no-server -jar demo-native-0.0.1-SNAPSHOT.jar -H:IncludeResources=E:\Projects\demo-native\target\classes\META-INF\native-image\org.springframework.aot\spring-aot\ -H:ReflectionConfigurationFiles=E:\Projects\demo-native\target\classes\META-INF\native-image\org.springframework.aot\spring-aot\reflect-config.json -H:DynamicProxyConfigurationFiles=E:\Projects\demo-native\target\classes\META-INF\native-image\org.springframework.aot\spring-aot\proxy-config.json -H:+ReportExceptionStackTraces -cp demo-native-0.0.1-SNAPSHOT.jar -H:-AllowVMInspection --allow-incomplete-classpath
cosminpopescu14 / fix_usb_stick
Created March 21, 2021 08:36
Fix a USB stick
View fix_usb_stick
cosmin@pop-os:~$ sudo fdisk /dev/sda
Welcome to fdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xfd679ce9.
Command (m for help): m
cosminpopescu14 / hide_pie_series_.html
Last active March 4, 2021 06:02
Hide all series form a pie chart from chartjs
View hide_pie_series_.html
<!DOCTYPE html>
<html lang="en">
<script src=""></script>
<script src=""
View mvn_build_4_cores
D:\Proiecte\Java\code-with-quarkus-profanity\code-with-quarkus-profanity>mvn -T 4 clean install
[INFO] Scanning for projects...
[WARNING] Some problems were encountered while building the effective model for org.acme:code-with-quarkus-profanity:jar:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compi
ler-plugin @ line 105, column 15
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
import java.util.*;
public class Bani {
public static void main(String[] args) {
var input = List.of(1891,
View apache_reverse_proxy_config
<VirtualHost *:8081>
ProxyPreserveHost On
ErrorLog ${APACHE_LOG_DIR}/error_quarkus.log
CustomLog ${APACHE_LOG_DIR}/access_quarkus.log combined
# Servers to proxy the connection, or;
# List of application servers:
# Usage:
# ProxyPass / http://[IP Addr.]:[port]/
# ProxyPassReverse / http://[IP Addr.]:[port]/
import java.math.BigInteger;
public class RSA {
private final static BigInteger one = new BigInteger("1");
private final static SecureRandom random = new SecureRandom();
View GetRandom.cs
using System;
using System.Linq;
namespace Craaash
class Program
static void Main(string[] args)
public class FizzBuzz {
public static void main(String[] args) {
IntStream.range(1, 100)
.mapToObj( x -> x % 15 == 0 ? "FizzBuzz" : x % 5 == 0 ? "Buzz" : x % 3 == 0 ? "Fizz" : x)