Skip to content

Instantly share code, notes, and snippets.

View ericfourrier's full-sized avatar
🦉
Building neat tools to secure cloud and source code

Eric Fourrier ericfourrier

🦉
Building neat tools to secure cloud and source code
View GitHub Profile
  • nmap 192.168.1.0/24: This scans the entire class C range
  • nmap -p <port ranges>: This scans specific ports
  • nmap -sP 192.168.1.0/24: This scans the network/find servers and devices that are running
  • sudo nmap -sP 192.168.1.0/24 : Using sudo can be necessary on mac to get the MAC Adress
  • nmap -O 192.168.1.1-42 : Scan from port 1 to 42
  • nmap -O 192.168.1.150 :# Os detection with target ip
  • nmap –iflist: This shows host interfaces and routes
  • nmap –sV 192.168.1.1: This detects remote services' version numbers
  • nmap –sS 192.168.1.1: This performs a stealthy TCP SYN scan
  • nmap –sO 192.168.1.1: This scans for the IP protocol
#!/bin/sh
cd /tmp
wget http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20160210_all.deb
apt-get install libnewt0.52 whiptail parted triggerhappy lua5.1 alsa_utils
dpkg -i raspi-config_20160210_all.deb
docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm
# scan all ports
nmap -sP 192.168.1.0/24
# scan all ports and try to detect mac address
sudo nmap -sP 192.168.1.0/24
# scan list of posts
nmap -O 192.168.1.1-42 # scan from 1 to 42
# Os detection
#History of logins
cat /var/log/auth.log
df_season=df.groupby(df.date.dt.month)[colname].sum()
df_season=df.groupby(df.date.dt.dayofweek)[colname].sum()
df_season=df.groupby(df.date.dt.quarter)[colname].sum()
#etc
scp -c blowfish -C username@ip:path_remote path_client
SELECT table_schema AS "database_name", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;
# Quick look to the size of mysql of all databases
ls -lah /var/lib/mysql
# Load library ------------------------------------------------------------
library(dplyr)
# Basic functions to explore NA in Dataframe --------------------------------------------------------------
# Identify all missing variables per columns
countNaCol <- function(data) {
result <- vapply(data,function(x) sum(is.na(x)),integer(1))
result <- data.frame(Nbna = result, napercentage = round(result/nrow(data),3))