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 / socket.recvfrom_into.py
Created February 23, 2014 20:36
Exploit: python socket.recvfrom_into() remote buffer overflow
#!/usr/bin/env python
'''
# Exploit Title: python socket.recvfrom_into() remote buffer overflow
# Date: 21/02/2014
# Exploit Author: @sha0coder
# Vendor Homepage: python.org
# Version: python2.7 and python3
# Tested on: linux 32bit + python2.7
# CVE : CVE-2014-1912
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hellobits"
config.vm.box_url = "http://hellobits.com/vagrant/hellobits.box"
config.vm.synced_folder ".", "/Projects", id: "vagrant-root"
# config.vm.network :private_network, ip: "192.168.50.2"
forward_port = ->(guest, host = guest) do
@infoslack
infoslack / list of packages
Created February 27, 2014 17:42
Slackware minimal installation
aaa_base
aaa_elflibs
aaa_terminfo
bash
bin
bzip2
coreutils
devs
dhcpcd
dialog
@infoslack
infoslack / ssh-conf.sh
Last active August 29, 2015 13:57
Função para adicionar aliases em .ssh/config de forma fácil. Adicione a função ao seu .bashrc ou similar ;)
ssh-conf(){
if [ $# -lt 2 ]; then
echo "Faz assim: ssh-conf <Host> [<user>@]<hostname>]" >&2
return 1
fi
short=$1
arg=$2
if $(echo "$arg" | grep '@' >/dev/null); then
@infoslack
infoslack / block-bot.sh
Created March 20, 2014 19:52
Bloqueando Botnet da China
#!/bin/sh
ISO="cn"
IPT=/sbin/iptables
WGET=/usr/bin/wget
EGREP=/bin/egrep
SPAMLIST="countrydrop"
ZONEROOT="/root/iptables"
@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 / 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