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
@cosminpopescu14
cosminpopescu14 / main.cs
Created March 22, 2020 15:28 — forked from gistlyn/main.cs
Simple OrmLite CRUD demo
using System;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
public class User
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cosminpopescu14
cosminpopescu14 / main.go
Created August 14, 2019 03:32 — forked from geosoft1/main.go
Simple blockchain example
package main
import (
"crypto/sha256"
"encoding/hex"
"strconv"
"time"
)
type Data struct {
Methode 1
<p:dataTable var="entry" value="#{hashMap.entrySet().toArray()}">
<p:column headerText="key">
<h:outputText value="${entry.key}" />
</p:column>
<p:column headerText="value id">
<h:outputText value="${entry.value.id}" />
</p:column>
</p:dataTable>
@cosminpopescu14
cosminpopescu14 / .htaccess
Created December 9, 2018 16:01 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@cosminpopescu14
cosminpopescu14 / squash.php
Created May 30, 2018 14:06 — forked from woganmay/squash.php
Use PHP to flatten a multidimensional stdClass object (like a json_decode result)
<?php
function squash($array, $prefix = '')
{
$flat = array();
$sep = ".";
if (!is_array($array)) $array = (array)$array;
foreach($array as $key => $value)
@cosminpopescu14
cosminpopescu14 / curl-post.php
Created April 16, 2018 09:51 — forked from lesstif/curl-get.php
PHP CURL POST example
<?php
class Log {
public static function debug($str) {
print "DEBUG: " . $str . "\n";
}
public static function info($str) {
print "INFO: " . $str . "\n";
}
}