Skip to content

Instantly share code, notes, and snippets.

View todmephis's full-sized avatar

Ivan Sanchez todmephis

  • MX
View GitHub Profile
@todmephis
todmephis / autotag_v1.0.py
Created February 22, 2017 19:15
Tag automatically your friends on Facebook post using python. | Etiqueta automaticamente a tus amigos en un post de Facebook usando python.
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Autotag Facebook V 1.0
Copyright (C) 2017 todmephis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@todmephis
todmephis / analyze_bp_seclog.sh
Created July 12, 2018 03:48
BulletProof plugin Log Analyzer. Takes security log and output all blocked requests showing them by date and blocked requests per month.
#!/bin/bash
#by @todmephis
#BulletProof WordPress Plugin Log Analyzer.
#Takes bulletproof's security log and output all blocked requests showing them by date and bloked requests per month.
usage() { echo "Usage: $0 [-f <log_file>] " 1>&2; exit 1; }
while getopts ":f:" o; do
case "${o}" in
f)
FILE=${OPTARG}
;;
@todmephis
todmephis / brew-update-notifier.sh
Last active September 19, 2024 14:01 — forked from streeter/brew-update-notifier.sh
Homebrew Package Update Notifications on macOS Mojave
#!/bin/bash
#
# Notify of Homebrew updates via Notification Center on macOS
# Forked from: https://gist.github.com/streeter/3254906
# https://github.com/julienXX/terminal-notifier
# https://github.com/vjeantet/alerter
# Author: Ivan Sanchez https://todmephis.cf/
# Twetter: https://twitter.com/todmephis
# Requires: terminal-notifier, alerter. Install with:
# brew install terminal-notifier
@todmephis
todmephis / cis_centos7_hardening.sh
Last active March 30, 2024 23:51
Hardening CentOS 7 CIS script
#!/bin/bash
MODPROBEFILE="/etc/modprobe.d/CIS.conf"
#MODPROBEFILE="/tmp/CIS.conf"
ANSWER=0
analyze_part () {
if [ "$#" != "1" ]; then
options="$(echo $@ | awk 'BEGIN{FS="[()]"}{print $2}')"
echo "[+]$@"
apply_part_rule $1
#include <stdio.h>
#include <pthread.h>
void* f_hilo(void* params){
int *int_params=(int *)params;
printf("\n valor %d", *int_params);
//pthread_exit(NULL); Se elimina debido a:
/* If the
start_routine returns, the effect is as if there was an implicit call to pthread_exit() using
the return value of start_routine as the exit status.*/
#!/usr/bin/perl
##############
# udp flood.
##############
use Socket;
use strict;
if ($#ARGV != 3) {
print "${0} <ip> <port> <size> <time>\n\n";
print " Port=0: use random ports\n";
@todmephis
todmephis / getipfromxml.py
Created July 8, 2019 17:52
Script para obtener una lista de IP a partir del XML resultante de un escaneo con nmap. (-oX)
#!/usr/local/bin/python
import xml.etree.ElementTree as etree
import sys
#Usage: getipfromxml.py <filename.xml>
def parse_xml(filename):
"""Given an XML filename, reads and parses the XML file and passes the
the root node of type xml.etree.ElementTree.Element to the get_host_data
function, which will futher parse the data and return a list of lists
containing the scan data for a host or hosts."""
try:
@todmephis
todmephis / hilo.c
Last active July 9, 2019 00:15
Ejemplo 2 de hilos en C
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <pthread.h>
typedef struct mamadas{
int theadID;
char somerandombytes[1024];
}SACA;
/*Otro ejemplo de hilos en C*/
@todmephis
todmephis / setupmykl.sh
Last active January 20, 2021 21:14
Script to setup my kl installation. (deprecated)
#!/bin/bash
#LAST UPDATE: 30/03/2020
#LAS CHANGE: added pkg-config.
RED='\033[0;31m'
GRN='\033[0;32m'
YLL='\033[1;33m'
NC='\033[0m' # No Color
#FILE NAMES
PTROOTDIR="pentestTools"
PTDIRS="{lists,tools,shells/{klbuiltin,}}"
@todmephis
todmephis / Automating scanning with fish shell
Last active August 12, 2020 07:46
Automating scanning with fish shell
=======================HOST DISCOVERY===========================================
Host discovery con PING:
$ for octect in (seq 0 254)
echo "Pinging [X.X.X.$octect]"
ping -c 2 10.150.150.$octect | grep "bytes from" | awk '{print $4}' | uniq -d | cut -d ":" -f 1 | tee -a targets.list
end
Host discovery con NMAP IMCP o ARP
$sudo nmap -vv -sn -PE 10.150.150.0/24 -oG HOSTDISCOVERY_ICMP.gnmap