Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # |---------------------------------------------|
- # | Welcome to "Server-Spy" |
- # |---------------------------------------------|
- # | This is for finding out where attackers |
- # | are trying to bruteforce or just simply |
- # | trying to attack your server. If you're |
- # | intrested in a version two show support |
- # |---------------------------------------------|
- # | Normal execution |
- # |---------------------------------------------|
- # | python server-spy.py |
- # |---------------------------------------------|
- # |---------------------------------------------|
- # | Note: This has only been tested on Centos |
- # |---------------------------------------------|
- import time, sys, os
- print "\x1b[31m|---------------------------------------------|\x1b[0m"
- print "\x1b[31m| Welcome to ''Server-Spy'' |\x1b[0m"
- print "\x1b[31m|---------------------------------------------|\x1b[0m"
- print "\x1b[31m| This is for finding out where attackers |\x1b[0m"
- print "\x1b[31m| are trying to bruteforce or just simply |\x1b[0m"
- print "\x1b[31m| trying to attack your server. If you're |\x1b[0m"
- print "\x1b[31m| intrested in a version two show support |\x1b[0m"
- print "\x1b[31m|---------------------------------------------|\x1b[0m"
- print "\x1b[31m| D I S C L A I M E R |\x1b[0m"
- print "\x1b[31m|---------------------------------------------|\x1b[0m"
- print "\x1b[31m| Please keep eyes on the screen and read |\x1b[0m"
- print "\x1b[31m| everything that's displayed for InfoSec |\x1b[0m"
- print "\x1b[31m| on your security system! |\x1b[0m"
- print "\x1b[31m|---------------------------------------------|\x1b[0m"
- time.sleep(20)
- print "\x1b[31m __ __ \x1b[0m"
- print "\x1b[31m/ _\ ___ _ ____ _____ _ __ / _\_ __ _ _ \x1b[0m"
- print "\x1b[31m\ \ / _ \ __\ \ / / _ \ __|____\ \| _ \| | | |\x1b[0m"
- print "\x1b[31m_\ \ __/ | \ / __/ | |_____|\ \ |_) | |_| |\x1b[0m"
- print "\x1b[31m\__/\___|_| \_/ \___|_| \__/ __/ \__ |\x1b[0m"
- print "\x1b[31m |_| |___/ \x1b[0m"
- print "\x1b[31m \x1b[0m"
- print "\x1b[31m /!\ Lets see who's all on your server shall we? /!\ \x1b[0m"
- os.system('who')
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m If you see more than one login then your server has someone else logged in\x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(10)
- print "\x1b[31m __ __ \x1b[0m"
- print "\x1b[31m/ _\ ___ _ ____ _____ _ __ / _\_ __ _ _ \x1b[0m"
- print "\x1b[31m\ \ / _ \ __\ \ / / _ \ __|____\ \| _ \| | | |\x1b[0m"
- print "\x1b[31m_\ \ __/ | \ / __/ | |_____|\ \ |_) | |_| |\x1b[0m"
- print "\x1b[31m\__/\___|_| \_/ \___|_| \__/ __/ \__ |\x1b[0m"
- print "\x1b[31m |_| |___/ \x1b[0m"
- print "\x1b[31m \x1b[0m"
- print "\x1b[31m /!\ Lets see who's all logged in as usernames shall we? /!\ \x1b[0m"
- os.system('users')
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m If you see more than one root ID then someone else is logged in\x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(10)
- print "\x1b[31m __ __ \x1b[0m"
- print "\x1b[31m/ _\ ___ _ ____ _____ _ __ / _\_ __ _ _ \x1b[0m"
- print "\x1b[31m\ \ / _ \ __\ \ / / _ \ __|____\ \| _ \| | | |\x1b[0m"
- print "\x1b[31m_\ \ __/ | \ / __/ | |_____|\ \ |_) | |_| |\x1b[0m"
- print "\x1b[31m\__/\___|_| \_/ \___|_| \__/ __/ \__ |\x1b[0m"
- print "\x1b[31m |_| |___/ \x1b[0m"
- print "\x1b[31m \x1b[0m"
- print "\x1b[31m /!\ Lets see who we are shall we? /!\ \x1b[0m"
- os.system('whoami')
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m This is the ID of your username connected\x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(10)
- print "\x1b[31m __ __ \x1b[0m"
- print "\x1b[31m/ _\ ___ _ ____ _____ _ __ / _\_ __ _ _ \x1b[0m"
- print "\x1b[31m\ \ / _ \ __\ \ / / _ \ __|____\ \| _ \| | | |\x1b[0m"
- print "\x1b[31m_\ \ __/ | \ / __/ | |_____|\ \ |_) | |_| |\x1b[0m"
- print "\x1b[31m\__/\___|_| \_/ \___|_| \__/ __/ \__ |\x1b[0m"
- print "\x1b[31m |_| |___/ \x1b[0m"
- print "\x1b[31m \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m ! THIS WILL TAKE A FEW MINUTES TO CAT THE SECURE.LOG ! \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(15)
- os.system('cat /var/log/secure')
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m Look through and you can find failed login attempts \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(10)
- print "\x1b[31m __ __ \x1b[0m"
- print "\x1b[31m/ _\ ___ _ ____ _____ _ __ / _\_ __ _ _ \x1b[0m"
- print "\x1b[31m\ \ / _ \ __\ \ / / _ \ __|____\ \| _ \| | | |\x1b[0m"
- print "\x1b[31m_\ \ __/ | \ / __/ | |_____|\ \ |_) | |_| |\x1b[0m"
- print "\x1b[31m\__/\___|_| \_/ \___|_| \__/ __/ \__ |\x1b[0m"
- print "\x1b[31m |_| |___/ \x1b[0m"
- print "\x1b[31m \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m ! THIS WILL TAKE A FEW MINUTES TO CAT THE MESSAGES.LOG ! \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(15)
- os.system('cat /var/log/messages')
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m You can see new modules installed and new sessions of root \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(10)
- print "\x1b[31m __ __ \x1b[0m"
- print "\x1b[31m/ _\ ___ _ ____ _____ _ __ / _\_ __ _ _ \x1b[0m"
- print "\x1b[31m\ \ / _ \ __\ \ / / _ \ __|____\ \| _ \| | | |\x1b[0m"
- print "\x1b[31m_\ \ __/ | \ / __/ | |_____|\ \ |_) | |_| |\x1b[0m"
- print "\x1b[31m\__/\___|_| \_/ \___|_| \__/ __/ \__ |\x1b[0m"
- print "\x1b[31m |_| |___/ \x1b[0m"
- print "\x1b[31m \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m ! THIS WILL TAKE A FEW MINUTES TO CAT THE BASH_HISTORY ! \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(15)
- os.system('cat .bash_history')
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m Check and see if you see any commands outputted that wasn't you \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(10)
- print "\x1b[31m __ __ \x1b[0m"
- print "\x1b[31m/ _\ ___ _ ____ _____ _ __ / _\_ __ _ _ \x1b[0m"
- print "\x1b[31m\ \ / _ \ __\ \ / / _ \ __|____\ \| _ \| | | |\x1b[0m"
- print "\x1b[31m_\ \ __/ | \ / __/ | |_____|\ \ |_) | |_| |\x1b[0m"
- print "\x1b[31m\__/\___|_| \_/ \___|_| \__/ __/ \__ |\x1b[0m"
- print "\x1b[31m |_| |___/ \x1b[0m"
- print "\x1b[31m \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m Lets find out how many failed login attempts there is \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(15)
- os.system('grep "authentication failure" /var/log/secure')
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m This will show all faliured authentication attempts in SSH \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(10)
- print "\x1b[31m __ __ \x1b[0m"
- print "\x1b[31m/ _\ ___ _ ____ _____ _ __ / _\_ __ _ _ \x1b[0m"
- print "\x1b[31m\ \ / _ \ __\ \ / / _ \ __|____\ \| _ \| | | |\x1b[0m"
- print "\x1b[31m_\ \ __/ | \ / __/ | |_____|\ \ |_) | |_| |\x1b[0m"
- print "\x1b[31m\__/\___|_| \_/ \___|_| \__/ __/ \__ |\x1b[0m"
- print "\x1b[31m |_| |___/ \x1b[0m"
- print "\x1b[31m \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m Lets find out how many seccuessful login attempts there is \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(15)
- os.system('cat /var/log/secure | grep sshd.*opened')
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m This will show all seccuessful authentication in SSH \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- time.sleep(10)
- print "\x1b[31m ______ _ _ _ _ \x1b[0m"
- print "\x1b[31m | ____(_) (_) | | | |\x1b[0m"
- print "\x1b[31m | |__ _ _ __ _ ___| |__ ___ __| |\x1b[0m"
- print "\x1b[31m | __| | | _ \| / __| _ \ / _ \/ _ |\x1b[0m"
- print "\x1b[31m | | | | | | | \__ \ | | | __/ (_| |\x1b[0m"
- print "\x1b[31m |_| |_|_| |_|_|___/_| |_|\___|\____|\x1b[0m"
- time.sleep(10)
- print "|-----------------------------------------------------------------------------|"
- print "\x1b[31m Thank you for using Server-Spy \x1b[0m"
- print "|-----------------------------------------------------------------------------|"
- print "| All credits goes to Chris Poole | @codingplanets via Twitter |"
- print "|-----------------------------------------------------------------------------|"
- print "| Any bugs? Report them to me via Twitter! |"
- print "|-----------------------------------------------------------------------------|"
- print "|-----------------------------------------------------------------------------|"
- print "|-----------------------------------------------------------------------------|"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement