Skip to content

Instantly share code, notes, and snippets.

View le4ker's full-sized avatar

Panos Sakkos le4ker

View GitHub Profile
@le4ker
le4ker / padding-oracle-attack.rb
Last active September 17, 2023 09:56
A demonstration of Padding Oracle Attack
View padding-oracle-attack.rb
# # # # # # # # # # # # # # # # # # # # # # # # #
# Demonstration of Padding Oracle Attack #
# Author: Panos Sakkos <panos.sakkos@gmail.com> #
# Date: May 2017 #
# License: MIT #
# # # # # # # # # # # # # # # # # # # # # # # # #
require 'openssl'
class PaddingOracle
View fluentd.conf
<source>
@type tail
path /var/log/nginx/**.log
pos_file /var/log/td-agent/le4ker.me/nginx/log.pos
tag nginx
read_from_head true
<parse>
@type none
</parse>
</source>
View nginx-certbot
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
View ecs-certbot.sh
# https://superuser.com/questions/1072408/how-to-install-lets-encrypt-on-amazon-linux
sudo certbot certonly --standalone --debug
@le4ker
le4ker / parent.html
Created September 16, 2019 20:42
Embed Blocktopus to a Token Sale landing page
View parent.html
<html>
<body>
<script>
// The following Javascript resizes the iframe's height when Blocktopus' embeded page's height changes
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
if (event.data.event_id == 'blocktopus_height') {
iframe = document.getElementById("blocktopus_iframe");
iframe.height = event.data.value + "px";
@le4ker
le4ker / embed-blocktopus-sign-in.html
Last active September 6, 2019 00:16
Blocktopus embed iframe for signing-in to third-party service
View embed-blocktopus-sign-in.html
<html>
<body>
<script>
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
if (event.data.event_id == 'blocktopus_height') {
iframe = document.getElementById("blocktopus_iframe");
iframe.height = event.data.value + "px";
View ecs-certbot-renew.sh
# sudo rm -rf /opt/eff.org
#cd /opt/letsencrypt
#sudo ./letsencrypt-auto renew --standalone --debug
sudo rm -rf /opt/eff.org/*
sudo pip install -U certbot
sudo /usr/local/bin/certbot renew --standalone --debug --preferred-challenges http-01,dns-01
# https://community.letsencrypt.org/t/upcoming-tls-sni-deprecation-in-certbot/76383
@le4ker
le4ker / B8745955.asc
Last active July 27, 2018 14:04
panos.sakkos@etherize.io
View B8745955.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFtbJegBEACjlZEmw+ryId5XPgqHq2q7EjoaU2xSYJURPLm5by0OqWVm6rxI
gS3l4G6/rdcX7DESElRKHCYGg+9r+GmyDCM15SMK/LkG2lKnC48qogWHsgVcb7u0
JlyAx2SCwnMFG+ndYj+ytYiSix9YY8uvq1TjLCqNQtZcAbkaAEVZ2SUZiwgQxCxt
ynRZd4v/v6WECgR6fE4uDNQnQ9mTS/gnhlEZR0vQs4YAELbK8sDLz7AETGV1Ajvo
Y5x1jlQ4fZ+S4j52/L5+3YysZ5jIXgctS5tk35erODhDO3tsC/vW+35QgJniZiG1
mwpJVTylCTsb2sgJkXrDCuQUm0B8q8emIBOwAXLxlMRqfoTX4NVyVsNBAxE0AC2L
iKFV/L7Yl/SuBS08VBY9x5lLf5RSnPQLGX4LebRHyqWaE8sO9VV+Brf/fXlRWnRH
iTyWOUoXELPh+yFX/Qcd+qS30J3KY6rYyScQ8/kjWW0fuIh0q4BxDLYgT0h+sjlG
View cbc-bit-flipping.rb
# # # # # # # # # # # # # # # # # # # # # # # # # #
# Demonstration of CBC Bit Flipping Attack #
# Author: Panos Sakkos <panos.sakkos@gmail.com> #
# Date: October 2017 #
# License: MIT #
# # # # # # # # # # # # # # # # # # # # # # # # # #
require 'openssl'
class UnauthenticatedEncryption
@le4ker
le4ker / change_page_protection
Last active May 28, 2017 22:07
Change the page protection in Linux kernel
View change_page_protection
static void disable_page_protection(void)
{
unsigned long cr0 = read_cr0();
if(cr0 & (1 << 16))
{
cr0 &= ~ (1 << 16);
write_cr0(cr0);
}
}