#!/usr/bin/env python
import sys
from socket import *
usage = "Usage: ./clientChat.py <Listening Port>"
if (len(sys.argv) > 1):
LPORT = int(sys.argv[1])
else:
sys.exit(usage)
LOCALHOST = ''
BUFSIZE = 1024
ADDR = (LOCALHOST, LPORT)
serverID = ''
portNumb = ''
tcpChatSocket = socket(AF_INET, SOCK_STREAM)
tcpChatSocket.bind(ADDR)
tcpChatSocket.listen(5)
chatID = raw_input('Enter you chat ID: ')
chatConversation = raw_input('"W" to wait for a connection, or press "I" to initiate a conversation. ')
while True:
if chatConversation == "W":
if serverID == '':
print "Waiting for the connection..."
tcpMySocket, ADDR = tcpChatSocket.accept()
while True:
data = tcpMySocket.recv(BUFSIZE)
print data
if not data:
break
chatConversation = "I"
elif chatConversation == "I":
if serverID == '':
serverID = raw_input('Enter friends IP Address: ')
if portNumb == '':
portNumb = int(raw_input('Enter listening port for chat: '))
tcpFriendSocket = socket(AF_INET, SOCK_STREAM)
remoteADDR = (serverID, portNumb)
tcpFriendSocket.connect(remoteADDR)
chatData = raw_input('> ')
if not chatData:
break
tcpFriendSocket.send('[%s] %s' % (chatID, chatData))
tcpFriendSocket.close()
chatConversation = "W"
Twitter: @lokut
This blog is for educational purposes only. The opinions expressed in this blog are my own and do not reflect the views of my employers.
Sunday, December 23, 2012
Friday, December 21, 2012
Encode ASCII to Hex
#!/bin/bash
# Usage: ./script-name <ASCII FILE> | tr -d '\n' > <ENCODED FILE>
# Take a file as the input
testInput=$1
function encode {
case ${1} in
"") echo "%20" ;; "!") echo "%21" ;; "\"") echo "%22" ;;
"#") echo "%23" ;; "$") echo "%24" ;; "&") echo "%26" ;;
"%") echo "%25" ;; "'") echo "%27" ;; "(") echo "%28" ;;
")") echo "%29" ;; '*') echo '%2a' ;; '+') echo '%2b' ;;
',') echo '%2c' ;; '-') echo '%2d' ;; '.') echo '%2e' ;;
"/") echo '%2f' ;; '0') echo '%30' ;; '1') echo '%31' ;;
'2') echo '%32' ;; '3') echo '%33' ;; '4') echo '%34' ;;
'5') echo '%35' ;; '6') echo '%36' ;; '7') echo '%37' ;;
'8') echo '%38' ;; '9') echo '%39' ;; ':') echo '%3a' ;;
';') echo '%3b' ;; '<') echo '%3c' ;; '=') echo '%3d' ;;
'>') echo '%3e' ;; '?') echo '%3f' ;; '@') echo '%40' ;;
'A') echo '%41' ;; 'B') echo '%42' ;; 'C') echo '%43' ;;
'D') echo '%44' ;; 'E') echo '%45' ;; 'F') echo '%46' ;;
'G') echo '%47' ;; 'H') echo '%48' ;; 'I') echo '%49' ;;
'J') echo '%4a' ;; 'K') echo '%4b' ;; 'L') echo '%4c' ;;
'M') echo '%4d' ;; 'N') echo '%4e' ;; 'O') echo '%4f' ;;
'P') echo '%50' ;; 'Q') echo '%51' ;; 'R') echo '%52' ;;
'S') echo '%53' ;; 'T') echo '%54' ;; 'U') echo '%55' ;;
'V') echo '%56' ;; 'W') echo '%57' ;; 'X') echo '%58' ;;
'Y') echo '%59' ;; 'Z') echo '%5a' ;; '[') echo '%5b' ;;
'\\') echo '%5c' ;; ']') echo '%5d' ;; '^') echo '%5e' ;;
'_') echo '%5f' ;; '`') echo '%60' ;; 'a') echo '%61' ;;
'b') echo '%62' ;; 'c') echo '%63' ;; 'd') echo '%64' ;;
'e') echo '%65' ;; 'f') echo '%66' ;; 'g') echo '%67' ;;
'h') echo '%68' ;; 'i') echo '%69' ;; 'j') echo '%6a' ;;
'k') echo '%6b' ;; 'l') echo '%6c' ;; 'm') echo '%6d' ;;
'n') echo '%6e' ;; 'o') echo '%6f' ;; 'p') echo '%70' ;;
'q') echo '%71' ;; 'r') echo '%72' ;; 's') echo '%73' ;;
't') echo '%74' ;; 'u') echo '%75' ;; 'v') echo '%76' ;;
'w') echo '%77' ;; 'x') echo '%78' ;; 'y') echo '%79' ;;
'z') echo '%7a' ;; '{') echo '%7b' ;; '|') echo '%7c' ;;
'}') echo '%7d' ;; '~') echo '%7e' ;;
*) echo $1 ;;
esac
}
while read line
do
for (( c=0; c<${#line}; c++ ))
do
encode ${line:$c:1}
done
echo "%0a"
done < $testInput
echo "\n"
# Usage: ./script-name <ASCII FILE> | tr -d '\n' > <ENCODED FILE>
# Take a file as the input
testInput=$1
function encode {
case ${1} in
"") echo "%20" ;; "!") echo "%21" ;; "\"") echo "%22" ;;
"#") echo "%23" ;; "$") echo "%24" ;; "&") echo "%26" ;;
"%") echo "%25" ;; "'") echo "%27" ;; "(") echo "%28" ;;
")") echo "%29" ;; '*') echo '%2a' ;; '+') echo '%2b' ;;
',') echo '%2c' ;; '-') echo '%2d' ;; '.') echo '%2e' ;;
"/") echo '%2f' ;; '0') echo '%30' ;; '1') echo '%31' ;;
'2') echo '%32' ;; '3') echo '%33' ;; '4') echo '%34' ;;
'5') echo '%35' ;; '6') echo '%36' ;; '7') echo '%37' ;;
'8') echo '%38' ;; '9') echo '%39' ;; ':') echo '%3a' ;;
';') echo '%3b' ;; '<') echo '%3c' ;; '=') echo '%3d' ;;
'>') echo '%3e' ;; '?') echo '%3f' ;; '@') echo '%40' ;;
'A') echo '%41' ;; 'B') echo '%42' ;; 'C') echo '%43' ;;
'D') echo '%44' ;; 'E') echo '%45' ;; 'F') echo '%46' ;;
'G') echo '%47' ;; 'H') echo '%48' ;; 'I') echo '%49' ;;
'J') echo '%4a' ;; 'K') echo '%4b' ;; 'L') echo '%4c' ;;
'M') echo '%4d' ;; 'N') echo '%4e' ;; 'O') echo '%4f' ;;
'P') echo '%50' ;; 'Q') echo '%51' ;; 'R') echo '%52' ;;
'S') echo '%53' ;; 'T') echo '%54' ;; 'U') echo '%55' ;;
'V') echo '%56' ;; 'W') echo '%57' ;; 'X') echo '%58' ;;
'Y') echo '%59' ;; 'Z') echo '%5a' ;; '[') echo '%5b' ;;
'\\') echo '%5c' ;; ']') echo '%5d' ;; '^') echo '%5e' ;;
'_') echo '%5f' ;; '`') echo '%60' ;; 'a') echo '%61' ;;
'b') echo '%62' ;; 'c') echo '%63' ;; 'd') echo '%64' ;;
'e') echo '%65' ;; 'f') echo '%66' ;; 'g') echo '%67' ;;
'h') echo '%68' ;; 'i') echo '%69' ;; 'j') echo '%6a' ;;
'k') echo '%6b' ;; 'l') echo '%6c' ;; 'm') echo '%6d' ;;
'n') echo '%6e' ;; 'o') echo '%6f' ;; 'p') echo '%70' ;;
'q') echo '%71' ;; 'r') echo '%72' ;; 's') echo '%73' ;;
't') echo '%74' ;; 'u') echo '%75' ;; 'v') echo '%76' ;;
'w') echo '%77' ;; 'x') echo '%78' ;; 'y') echo '%79' ;;
'z') echo '%7a' ;; '{') echo '%7b' ;; '|') echo '%7c' ;;
'}') echo '%7d' ;; '~') echo '%7e' ;;
*) echo $1 ;;
esac
}
while read line
do
for (( c=0; c<${#line}; c++ ))
do
encode ${line:$c:1}
done
echo "%0a"
done < $testInput
echo "\n"
Tuesday, December 11, 2012
Decode Hex to ASCII
#!/bin/bash
# Written: December 2012
# This program is built to decode hex to ASCII text
# The program takes what it is given at the command line and then decodes it...
testInput=$1
# echo $testInput -- If you echo it will read the string from the command line
# cat $testInput -- Takes the filename and decodes it
cat $testInput | sed 's/%20/ /g' | \
sed 's/%21/!/g' | sed 's/%22/"/g' | sed 's/%23/#/g' | sed 's/%24/$/g' | \
sed 's/%25/%/g' | sed 's/%26/&/g' | sed "s/%27/'/g" | sed 's/%28/(/g' | \
sed 's/%29/)/g' | sed 's/%2a/*/g' | sed 's/%2b/+/g' | sed 's/%2c/,/g' | \
sed 's/%2d/-/g' | sed 's/%2e/./g' | sed 's/%2f/\//g' | sed 's/%30/0/g' | \
sed 's/%31/1/g' | sed 's/%32/2/g' | sed 's/%33/3/g' | sed 's/%34/4/g' | \
sed 's/%35/5/g' | sed 's/%36/6/g' | sed 's/%37/7/g' | sed 's/%38/8/g' | \
sed 's/%39/9/g' | sed 's/%3a/:/g' | sed 's/%3b/;/g' | sed 's/%3c/</g' | \
sed 's/%3d/=/g' | sed 's/%3e/>/g' | sed 's/%3f/?/g' | sed 's/%40/@/g' | \
sed 's/%41/A/g' | sed 's/%42/B/g' | sed 's/%43/C/g' | sed 's/%44/D/g' | \
sed 's/%45/E/g' | sed 's/%46/F/g' | sed 's/%47/G/g' | sed 's/%48/H/g' | \
sed 's/%49/I/g' | sed 's/%4a/J/g' | sed 's/%4b/K/g' | sed 's/%4c/L/g' | \
sed 's/%4d/M/g' | sed 's/%4e/N/g' | sed 's/%4f/O/g' | sed 's/%50/P/g' | \
sed 's/%51/Q/g' | sed 's/%52/R/g' | sed 's/%53/S/g' | sed 's/%54/T/g' | \
sed 's/%55/U/g' | sed 's/%56/V/g' | sed 's/%57/W/g' | sed 's/%58/X/g' | \
sed 's/%59/Y/g' | sed 's/%5a/Z/g' | sed 's/%5b/[/g' | sed 's/%5c/\\/g' | \
sed 's/%5d/]/g' | sed 's/%5e/^/g' | sed 's/%5f/_/g' | sed 's/%60/`/g' | \
sed 's/%61/a/g' | sed 's/%62/b/g' | sed 's/%63/c/g' | sed 's/%64/d/g' | \
sed 's/%65/e/g' | sed 's/%66/f/g' | sed 's/%67/g/g' | sed 's/%68/h/g' | \
sed 's/%69/i/g' | sed 's/%6a/j/g' | sed 's/%6b/k/g' | sed 's/%6c/l/g' | \
sed 's/%6d/m/g' | sed 's/%6e/n/g' | sed 's/%6f/o/g' | sed 's/%70/p/g' | \
sed 's/%71/q/g' | sed 's/%72/r/g' | sed 's/%73/s/g' | sed 's/%74/t/g' | \
sed 's/%75/u/g' | sed 's/%76/v/g' | sed 's/%77/w/g' | sed 's/%78/x/g' | \
sed 's/%79/y/g' | sed 's/%7a/z/g' | sed 's/%7b/{/g' | sed 's/%7c/|/g' | \
sed 's/%7d/}/g' | sed 's/%7e/~/g' | sed 's/%0a/\n/g'
# Written: December 2012
# This program is built to decode hex to ASCII text
# The program takes what it is given at the command line and then decodes it...
testInput=$1
# echo $testInput -- If you echo it will read the string from the command line
# cat $testInput -- Takes the filename and decodes it
cat $testInput | sed 's/%20/ /g' | \
sed 's/%21/!/g' | sed 's/%22/"/g' | sed 's/%23/#/g' | sed 's/%24/$/g' | \
sed 's/%25/%/g' | sed 's/%26/&/g' | sed "s/%27/'/g" | sed 's/%28/(/g' | \
sed 's/%29/)/g' | sed 's/%2a/*/g' | sed 's/%2b/+/g' | sed 's/%2c/,/g' | \
sed 's/%2d/-/g' | sed 's/%2e/./g' | sed 's/%2f/\//g' | sed 's/%30/0/g' | \
sed 's/%31/1/g' | sed 's/%32/2/g' | sed 's/%33/3/g' | sed 's/%34/4/g' | \
sed 's/%35/5/g' | sed 's/%36/6/g' | sed 's/%37/7/g' | sed 's/%38/8/g' | \
sed 's/%39/9/g' | sed 's/%3a/:/g' | sed 's/%3b/;/g' | sed 's/%3c/</g' | \
sed 's/%3d/=/g' | sed 's/%3e/>/g' | sed 's/%3f/?/g' | sed 's/%40/@/g' | \
sed 's/%41/A/g' | sed 's/%42/B/g' | sed 's/%43/C/g' | sed 's/%44/D/g' | \
sed 's/%45/E/g' | sed 's/%46/F/g' | sed 's/%47/G/g' | sed 's/%48/H/g' | \
sed 's/%49/I/g' | sed 's/%4a/J/g' | sed 's/%4b/K/g' | sed 's/%4c/L/g' | \
sed 's/%4d/M/g' | sed 's/%4e/N/g' | sed 's/%4f/O/g' | sed 's/%50/P/g' | \
sed 's/%51/Q/g' | sed 's/%52/R/g' | sed 's/%53/S/g' | sed 's/%54/T/g' | \
sed 's/%55/U/g' | sed 's/%56/V/g' | sed 's/%57/W/g' | sed 's/%58/X/g' | \
sed 's/%59/Y/g' | sed 's/%5a/Z/g' | sed 's/%5b/[/g' | sed 's/%5c/\\/g' | \
sed 's/%5d/]/g' | sed 's/%5e/^/g' | sed 's/%5f/_/g' | sed 's/%60/`/g' | \
sed 's/%61/a/g' | sed 's/%62/b/g' | sed 's/%63/c/g' | sed 's/%64/d/g' | \
sed 's/%65/e/g' | sed 's/%66/f/g' | sed 's/%67/g/g' | sed 's/%68/h/g' | \
sed 's/%69/i/g' | sed 's/%6a/j/g' | sed 's/%6b/k/g' | sed 's/%6c/l/g' | \
sed 's/%6d/m/g' | sed 's/%6e/n/g' | sed 's/%6f/o/g' | sed 's/%70/p/g' | \
sed 's/%71/q/g' | sed 's/%72/r/g' | sed 's/%73/s/g' | sed 's/%74/t/g' | \
sed 's/%75/u/g' | sed 's/%76/v/g' | sed 's/%77/w/g' | sed 's/%78/x/g' | \
sed 's/%79/y/g' | sed 's/%7a/z/g' | sed 's/%7b/{/g' | sed 's/%7c/|/g' | \
sed 's/%7d/}/g' | sed 's/%7e/~/g' | sed 's/%0a/\n/g'
Change syslog timestamp to Human Readable Date and Time
#!/bin/bash
#
# This script is designed to take the first column of the syslog and convert it to a time stamp...
# This is given if the 3 0's are removed from the end of the time stamp if they exist
while read syslogLine
do
timeRecreate=`echo $syslogLine | awk '{print "@"$1}'`
dateRecreate=`date -d $timeRecreate`
echo $dateRecreate" "$syslogLine
done < syslogFile.txt
#
# This script is designed to take the first column of the syslog and convert it to a time stamp...
# This is given if the 3 0's are removed from the end of the time stamp if they exist
while read syslogLine
do
timeRecreate=`echo $syslogLine | awk '{print "@"$1}'`
dateRecreate=`date -d $timeRecreate`
echo $dateRecreate" "$syslogLine
done < syslogFile.txt
Compare 2 Lists of IP Addresses
#!/bin/bash
# Written by: Leon Trappett
#
# This script will take 2 lists of IP addresses from text files and then list the IP addresses that are common amongst them
# For example from a firewall log and a list of known compromised hosts
countLoopA=0
countLoopB=0
while read unusualIP
do
while read firewallIP
do
if [[ $unusualIP == $firewallIP ]]; then
echo "***" $firewallIP
break
fi
let countLoopA=countLoopA+1
done < filename1.txt
let countLoopB=countLoopB+1
# echo $countLoopB " " $countLoopA
done < filename2.txt
# Written by: Leon Trappett
#
# This script will take 2 lists of IP addresses from text files and then list the IP addresses that are common amongst them
# For example from a firewall log and a list of known compromised hosts
countLoopA=0
countLoopB=0
while read unusualIP
do
while read firewallIP
do
if [[ $unusualIP == $firewallIP ]]; then
echo "***" $firewallIP
break
fi
let countLoopA=countLoopA+1
done < filename1.txt
let countLoopB=countLoopB+1
# echo $countLoopB " " $countLoopA
done < filename2.txt
Word Mangling a Word List to become a Password List
#!/bin/bash
# Written: December 2012
#
# This program was written to take as input a file that contains a wordlist and then transform it to make a password list.
# The password list is designed to be that of an 8 character password
# This is not meant to be used maliciously
function mangleWord {
echo $1 | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/1/'
echo $1 | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/!/'
echo $1 | sed 's/a/@/' | sed 's/e/3/'
echo $1 | sed 's/a/@/'
echo $1 | sed 's/e/3/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/e/3/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/e/3/' | sed 's/i/1/'
echo $1 | sed 's/e/3/' | sed 's/i/!/'
echo $1 | sed 's/e/3/'
echo $1 | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/i/1/'
echo $1 | sed 's/i/!/'
echo $1 | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/i/1/'
echo $1 | sed 's/a/@/' | sed 's/i/!/'
echo $1 | sed 's/a/@/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/'
echo $1 | sed 's/s/$/' | sed 's/e/3/'
echo $1 | sed 's/s/$/' | sed 's/i/1/'
echo $1 | sed 's/s/$/' | sed 's/1/!/'
echo $1 | sed 's/s/$/' | sed 's/o/0/'
echo $1 | sed 's/s/$/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/e/3/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/i/1/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/i/!/'
}
while read line
do
strLength=`expr length $line`
# echo $line length=`expr length $line`
# Conditions to manipulate the string if it is less than 5 characters long
# if [[ $strLength -lt 5 ]] ; then
# echo "Too Short"
# fi
case $strLength in
# Conditions to manipulate the string if it is 4 characters in length
4)
# echo $line length=`expr length $line`
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
fourLetterWord=`echo $firstLetter${lineToLower:1:3}`
for i in 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
do
echo ${fourLetterWord}$i
mangleWord ${fourLetterWord}$i
# mangleWord2 ${fourLetterWord}$i
done
;;
# Conditions to manipulate the string if it is 5 characters in length
5)
# echo $line length=`expr length $line`
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
fiveLetterWord=`echo $firstLetter${lineToLower:1:4}`
for i in 123 234 345 456 567 678 789 890
do
echo ${fiveLetterWord}$i
mangleWord ${fiveLetterWord}$i
# mangleWord2 ${fiveLetterWord}$i
done
;;
# Conditions to manipulate the string if it is 6 characters in length
6)
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
sixLetterWord=`echo $firstLetter${lineToLower:1:5}`
for i in 12 23 34 45 56 67 78 89 90 01 02 03 04 05 06 07 08 09 10 11 00 22 33 44 55 66 77 88 99 13 14
do
echo ${sixLetterWord}$i
mangleWord ${sixLetterWord}$i
# mangleWord2 ${sixLetterWord}$i
done
;;
7)
# echo $line length=`expr length $line`
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
sevenLetterWord=`echo $firstLetter${lineToLower:1:6}`
for i in 0 1 2 3 4 5 6 7 8 9 "?" "!" "#" "$"
do
echo ${sevenLetterWord}$i
mangleWord ${sevenLetterWord}$i
# mangleWord2 ${sevenLetterWord}$i
done
;;
8)
# echo $line length=`expr length $line`
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
eightLetterWord=`echo $firstLetter${lineToLower:1:7}`
echo ${eightLetterWord}
mangleWord ${eightLetterWord}
for i in 0 1 2 3 4 5 6 7 8 9 "?" "!" "#" "$"
do
echo ${eightLetterWord}$i
mangleWord ${eightLetterWord}$i
# mangleWord2 ${sevenLetterWord}$i
done
;;
esac
done < $1
# Written: December 2012
#
# This program was written to take as input a file that contains a wordlist and then transform it to make a password list.
# The password list is designed to be that of an 8 character password
# This is not meant to be used maliciously
function mangleWord {
echo $1 | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/1/'
echo $1 | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/!/'
echo $1 | sed 's/a/@/' | sed 's/e/3/'
echo $1 | sed 's/a/@/'
echo $1 | sed 's/e/3/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/e/3/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/e/3/' | sed 's/i/1/'
echo $1 | sed 's/e/3/' | sed 's/i/!/'
echo $1 | sed 's/e/3/'
echo $1 | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/i/1/'
echo $1 | sed 's/i/!/'
echo $1 | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/a/@/' | sed 's/i/1/'
echo $1 | sed 's/a/@/' | sed 's/i/!/'
echo $1 | sed 's/a/@/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/e/3/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/'
echo $1 | sed 's/s/$/' | sed 's/e/3/'
echo $1 | sed 's/s/$/' | sed 's/i/1/'
echo $1 | sed 's/s/$/' | sed 's/1/!/'
echo $1 | sed 's/s/$/' | sed 's/o/0/'
echo $1 | sed 's/s/$/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/i/1/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/i/!/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/a/@/' | sed 's/e/3/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/o/0/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/i/1/'
echo $1 | sed 's/s/$/' | sed 's/e/3/' | sed 's/i/!/'
}
while read line
do
strLength=`expr length $line`
# echo $line length=`expr length $line`
# Conditions to manipulate the string if it is less than 5 characters long
# if [[ $strLength -lt 5 ]] ; then
# echo "Too Short"
# fi
case $strLength in
# Conditions to manipulate the string if it is 4 characters in length
4)
# echo $line length=`expr length $line`
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
fourLetterWord=`echo $firstLetter${lineToLower:1:3}`
for i in 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
do
echo ${fourLetterWord}$i
mangleWord ${fourLetterWord}$i
# mangleWord2 ${fourLetterWord}$i
done
;;
# Conditions to manipulate the string if it is 5 characters in length
5)
# echo $line length=`expr length $line`
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
fiveLetterWord=`echo $firstLetter${lineToLower:1:4}`
for i in 123 234 345 456 567 678 789 890
do
echo ${fiveLetterWord}$i
mangleWord ${fiveLetterWord}$i
# mangleWord2 ${fiveLetterWord}$i
done
;;
# Conditions to manipulate the string if it is 6 characters in length
6)
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
sixLetterWord=`echo $firstLetter${lineToLower:1:5}`
for i in 12 23 34 45 56 67 78 89 90 01 02 03 04 05 06 07 08 09 10 11 00 22 33 44 55 66 77 88 99 13 14
do
echo ${sixLetterWord}$i
mangleWord ${sixLetterWord}$i
# mangleWord2 ${sixLetterWord}$i
done
;;
7)
# echo $line length=`expr length $line`
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
sevenLetterWord=`echo $firstLetter${lineToLower:1:6}`
for i in 0 1 2 3 4 5 6 7 8 9 "?" "!" "#" "$"
do
echo ${sevenLetterWord}$i
mangleWord ${sevenLetterWord}$i
# mangleWord2 ${sevenLetterWord}$i
done
;;
8)
# echo $line length=`expr length $line`
lineToLower=`echo $line | awk '{print tolower($0)}'`
firstLetter=`echo ${lineToLower:0:1} | tr '[a-z]' '[A-Z]'`
eightLetterWord=`echo $firstLetter${lineToLower:1:7}`
echo ${eightLetterWord}
mangleWord ${eightLetterWord}
for i in 0 1 2 3 4 5 6 7 8 9 "?" "!" "#" "$"
do
echo ${eightLetterWord}$i
mangleWord ${eightLetterWord}$i
# mangleWord2 ${sevenLetterWord}$i
done
;;
esac
done < $1
Subscribe to:
Posts (Atom)
Test Authentication from Linux Console using python3 pexpect
Working with the IT420 lab, you will discover that we need to discover a vulnerable user account. The following python3 script uses the pex...
-
Here is a quick walk through of GetBoo. The first item that I found was you can harvest the usernames of the existing users that are regist...
-
As I was glancing through the logs of my honeypots I spent some time to look at the following logs. In the past I have just overlooked them...
-
I thought I would work through a few of these web applications provided by OWASP on their broken web applications VM. The first one I th...
-
Today looking at the logs of the honeypots, I became curious based on the whois of the IP Addresses attempting to login to SSH which country...
-
Recently I was doing some scanning with a tool that is available on github called masscan. The tool allows you to configure a configuration...