Skip to content

Instantly share code, notes, and snippets.

@rushipkar90
rushipkar90 / getBPS-rx.sh
Created September 25, 2015 16:37
getBPS-rx.sh
#!/bin/bash
for i in 1 2; do X=$Y; sleep 1; Y=$(/sbin/ifconfig eth0|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2); echo "$(( Y-X ))"; done | tail -1
@rushipkar90
rushipkar90 / generate_client_list.sh
Created September 25, 2015 16:37
generate_client_list.sh
#!/bin/bash
# Directory to store log files in
DST=/root/logs
# Any logs older than this will be deleted first
KEEPDAYS=5
# Create DST if it doesn't exist
@rushipkar90
rushipkar90 / ftplogcheck.pl
Created September 25, 2015 16:36
ftplogcheck.pl
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Long;
use Data::Dumper;
my $file = '';
my $csv = 0;
my $all = 0;
GetOptions(
@rushipkar90
rushipkar90 / forcepwchange.sh
Created September 25, 2015 16:35
forcepwchange.sh
#!/bin/sh
if [ $# -lt 1 ]; then
echo "No arguments supplied"
echo "usage: sh $0 <username>"
exit 1
fi
if [ ! -d /home/$1 ]; then
echo "User doesn't exist"
echo "usage: sh $0 <username>"
@rushipkar90
rushipkar90 / find_malicious_symlinks.sh
Created September 25, 2015 16:34
find_malicious_symlinks.sh
@rushipkar90
rushipkar90 / findextensions.sh
Created September 25, 2015 16:34
findextensions.sh
#!/bin/sh
# Directory to store log files in
DST=/root/logs
# Any logs older than this will be deleted first
KEEPDAYS=14
# Create DST if it doesn't exist
if [ ! -d "$DST" ]; then
@rushipkar90
rushipkar90 / find_dup_accts.sh
Created September 25, 2015 16:33
find_dup_accts.sh
#!/bin/bash
# Directory to store log files in
DST=/root/logs
# Any logs older than this will be deleted first
KEEPDAYS=5
# Create DST if it doesn't exist
if [ ! -d "$DST" ]; then
@rushipkar90
rushipkar90 / find-brute-force-logins.sh
Created September 25, 2015 16:33
find-brute-force-logins.sh
#!/bin/bash
BFDOMS=/root/.bf-doms
BFIPS=/root/.bf-ips
FINAL=/root/.bf-blacklist
DATE=$(date +%d/%b/%Y)
echo -n "Capturing for 30s.."
for S in {1..30}; do
service httpd fullstatus | grep POST | grep login | awk '{print $1}' >> $BFDOMS
sleep 1
echo -n "."
@rushipkar90
rushipkar90 / findBadOwners.pl
Created September 25, 2015 16:32
findBadOwners.pl
#!/usr/bin/perl
my $user;
for $user (`ls /var/cpanel/users/`) {
chomp($user);
my @userinfo = getpwnam($user);
my $homedir = $userinfo[7];
my $uid = $userinfo[2];
@rushipkar90
rushipkar90 / find150.sh
Created September 25, 2015 16:32
find150.sh
#!/bin/sh
# Directory to store log files in
DST=/root/logs
# Any logs older than this will be deleted first
KEEPDAYS=14
# Create DST if it doesn't exist
if [ ! -d "$DST" ]; then