Skip to content

Instantly share code, notes, and snippets.

View cosminpopescu14's full-sized avatar
🎯
Focusing

Cosmin Popescu cosminpopescu14

🎯
Focusing
View GitHub Profile
@cosminpopescu14
cosminpopescu14 / log4j_rce_detection.md
Created December 11, 2021 07:06 — forked from Neo23x0/log4j_rce_detection.md
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
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\native-image.properties -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
cosminpopescu14 / fix_usb_stick
Created March 21, 2021 08:36
Fix a 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
cosminpopescu14 / hide_pie_series_.html
Last active March 4, 2021 06:02
Hide all series form a pie chart from chartjs
<!DOCTYPE html>
<html lang="en">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
crossorigin="anonymous"></script>
D:\Proiecte\Java\code-with-quarkus-profanity\code-with-quarkus-profanity>mvn -T 4 clean install
[INFO] Scanning for projects...
[WARNING]
[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]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
package com.company;
import java.util.*;
public class Bani {
public static void main(String[] args) {
var input = List.of(1891,
1975,
1987,
<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]/
package com.company;
import java.math.BigInteger;
import java.security.SecureRandom;
public class RSA {
private final static BigInteger one = new BigInteger("1");
private final static SecureRandom random = new SecureRandom();
using System;
using System.Linq;
namespace Craaash
{
class Program
{
static void Main(string[] args)
{
package com.company;
import java.util.stream.IntStream;
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)
.forEach(System.out::println);