Skip to content

Instantly share code, notes, and snippets.

# /etc/sysconfig/iptables
# Generated by iptables-save v1.4.21 on Fri Jun 12 12:35:02 2015
*filter
:INPUT DROP [127:13754]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [50:6304]
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -i eno33554984 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i eno33554984 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
@godevnet
godevnet / msh.c
Created June 10, 2015 11:38
Mini-Shell
# include <stdio.h>
# include <unistd.h>
main() {
int status;
char cmd[256],arg[256];
for(;;) {
printf("===> Commande ? "); gets(cmd);
printf("---> Argument ? "); gets(arg);
if ( fork() == 0 ) {
execlp( cmd, cmd, arg, 0 );
/*
$Id: check_user.c,v 1.2 2000/12/04 19:02:33 baggins Exp $
This program was contributed by Shane Watts <shane@icarus.bofh.asn.au>
slight modifications by AGM.
You need to add the following (or equivalent) to the /etc/pam.conf file.
# check authorization
check auth required pam_unix_auth.so
check account required pam_unix_acct.so
*/
@godevnet
godevnet / jtrinstall.sh
Last active October 28, 2019 03:30
John the Ripper 1.8.0 Installation for Centos 7
#/bin/bash
# Centos 7 John the Ripper Installation
yum -y install wget gpgme
yum -y group install "Development Tools"
cd
wget http://www.openwall.com/john/j/john-1.8.0.tar.xz
wget http://www.openwall.com/john/j/john-1.8.0.tar.xz.sign
wget http://www.openwall.com/signatures/openwall-signatures.asc
gpg --import openwall-signatures.asc
gpg --verify john-1.8.0.tar.xz.sign
@godevnet
godevnet / rpmforge.sh
Created June 9, 2015 19:45
RPMForge repo installation on Centos 7
#!/bin/bash
yum -y install epel-release
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt
@godevnet
godevnet / testpwd.sh
Created June 9, 2015 19:42
Bash script to test shadow user (sha512) with awk and python crypt getpass modules
#/bin/bash
# testpwd.sh
user=$1
dic=$2
shadow=/etc/shadow
original=$(<$shadow awk -v user=$user -F : 'user == $1 {print $2}')
prefix=${original%"${original#\$*\$*\$}"}
for pass in $(cat $dic); do
echo "Password : $pass"
computed=$(python -c "import crypt, getpass, pwd; print crypt.crypt('$pass', '$prefix')")