Skip to content

Instantly share code, notes, and snippets.

View miticojo's full-sized avatar

Giorgio Crivellari miticojo

View GitHub Profile
@miticojo
miticojo / regex-utils.md
Last active May 29, 2021 09:43
Usefull regex
  • /etc/fstab
    groups dev/mount/opts/ord1/ord2
    ^(?'dev'[^#][\w\S]*)\s*(?'mount'[\w\S]*)\s*(?'fs'[\w]*)\s*(?'opts'[\w\S]*)\s*(?'ord1'[\d]*)\s*(?'ord2'[\d]*)$
  • /etc/passwd
    groups user/uid/gid/desc/home/shell
    ^(?'user'[^#][\w\S]*):x:(?'uid'[\w]*):(?'gid'[\w]*):(?'desc'[\w\s]*):(?'home'[\w\S]*):(?'shell'[\w\S]*)$
  • /etc/shadow
    ^(?'user'[^#][\w-_]*):(?'passw'['\w$!\*']*):(?'last_pwd_ch'['\d']*):(?'minage'['\d']*):(?'maxage'['\d']*):(?'warnage'['\d']*):(?'inact_age'['\d']*):(?'expires'['\d']*):$
@miticojo
miticojo / linuxprivchecker.py
Created November 13, 2016 23:24
Linux privilege checker
#!/usr/env python
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.
@miticojo
miticojo / ose-gitlab-persistent.yml
Created November 18, 2016 06:47
OSE 3.x CI-CD templates
# source: https://github.com/sdellang/gitlab-openshift-persistent
apiVersion: v1
kind: Template
metadata:
creationTimestamp: null
annotations:
description: "Template for deployment od scalable Gitlab with peristence and integrated postfix"
iconClass: icon-git
tags: instant-app,gitlab
name: gitlab-persistent
@miticojo
miticojo / Dockerfile
Last active December 4, 2016 07:24
Centos 7 with Python 3.5.2 and virtualenv
MAINTAINER miticojo[AT]gmail.com
FROM centos:7
# set python version to install
ARG PYTHON_VER=3.5.2
ENV PYTHON_URL=https://www.python.org/ftp/python/$PYTHON_VER/Python-$PYTHON_VER.tgz
# install minimum requirements to compile, run compilation, install pip and virtualenv, finally clean used files
RUN yum install -y gcc make openssl-devel\
&& curl $PYTHON_URL | tar -xzf - -C /usr/src/ \
@miticojo
miticojo / pv.sh
Created December 13, 2016 09:52
script per generazione pv
SERVER=`hostname`
COUNT=50
mkdir -p /exports
chmod 770 /exports
chown nfsnobody:nfsnobody /exports
oc project default
for i in $(seq 1 $COUNT); do
PV=$(cat <<EOF
@miticojo
miticojo / bench.sh
Created December 13, 2016 23:17
Benchmark script for VPS
#!/bin/bash
#####################################################################
# Benchmark Script 2 by Hidden Refuge from FreeVPS #
# Copyright(C) 2015 - Hidden Refuge #
# License: GNU General Public License 3.0 #
# Github: https://github.com/hidden-refuge/bench-sh-2 #
#####################################################################
# Original script by akamaras/camarg #
# Original: http://www.akamaras.com/linux/linux-server-info-script/ #
# Original Copyright (C) 2011 by akamaras/camarg #
@miticojo
miticojo / kimsufi.py
Last active December 24, 2016 00:06
Check Kimsufi availability
#!/usr/bin/env /usr/bin/python3
import sys
import requests
# doc https://core.telegram.org/bots/api
telegram_api="https://api.telegram.org"
telegram_token="XXXXXXXXX:XXXXXXXXXXXXXXXXXXX"
telegram_chatid="00000000"
def check_avail(results, model_reference):
#!/bin/bash -x
yum -y update --security
##########################
## ENABLE SSH RECORDING ##
##########################
# Create a new folder for the log files
mkdir /var/log/bastion
@miticojo
miticojo / ssh_config
Last active January 5, 2017 00:23
SSH jump through solaris bastion host
Host target
ProxyCommand ssh bastionhost.local "/bin/bash -c 'exec 3<>/dev/tcp/%h/%p; cat <&3 & cat >&3;kill $!'"
Host bastionhost.local
User root
ControlPath ~/.ssh/bastion-%r@%h:%p
ControlPersist 5m
@miticojo
miticojo / satellite_6.2_api_collection.md
Last active September 12, 2024 11:43
Satellite 6.2 API Resouce Collection
{
  "links": {
  "base": {},
  "api": {},
  "host_subscriptions": {
  "List a host's subscriptions": "/api/hosts/:host_id/subscriptions",
  "Trigger an auto-attach of subscriptions": "/api/hosts/:host_id/subscriptions/auto_attach",
  "List subscription events for the host": "/api/hosts/:host_id/subscriptions/events",
  "Unregister the host as a subscription consumer": "/api/hosts/:host_id/subscriptions",