Bash ShellShock bug – Find out if you’ve been “tested”

Rob —  September 26, 2014 — 3 Comments

We’ve seen the articles about how to find out if you’re vulnerable to the bash shellshock bug, we’ve also seen the articles on how to patch your system.  What I’ll show you is how to find out if people are testing your system.

First, ssh into your server and find your http access logs. Some common places are:
cPanel: /usr/local/apache/domlogs/
Debian/Apache: /var/log/apache2/
CentOS: /var/log/httpd/

Once you find them, you can cat them, grepping for this pattern:

You can make it prettier by using awk…
This will show me the IP addresses that have tried it..

(print $1 means print the first column. Your access log might have the IP in a different column.. try $3 if $1 doesn’t work)

This will show me how many times each IP hit me:

Then, i can take it further by using csf to block anyone who’s tried it:

Related posts from Linux Brigade!

  • Add time and date to your bash historyAdd time and date to your bash history Often, you’ll go looking for a shell command that you used in the past – you can remember around when you did it but of course that won’t help you because by default the bash history won’t […]
  • Check, repair, optimize all databases with one commandCheck, repair, optimize all databases with one command My server had some tables marked as ‘crashed’ in one of the databases.. the server had recently gone down pretty harshly so I wanted to go through and check, repair and optimize all of the […]
  • Can’t afford a full time Linux admin?Can’t afford a full time Linux admin? If you’re just starting out, it’s tough being able to afford full time Linux support.  Why not employ Hosting Support Services instead?  We’re Red Hat certified, fluent with Red […]
  • Install Ubuntu / Xubuntu from USBInstall Ubuntu / Xubuntu from USB Installing via USB is much better/easier than via cd/dvd simply because it’s not going to get scratched up, you can easily carry it around with you to loan to friends, etc..

    Let’s set […]

  • Block account from sending mail WHM/cPanelBlock account from sending mail WHM/cPanel There may come a time when you’d like to block an account / domain on your WHM/cPanel server from being able to send mail. Here’s how you’d get it done!

    We’re going to set up a […]

Trackbacks and Pingbacks:

  1. How to patch your Linux system for shell shockLinux News Pro - September 26, 2014

    […] LinuxBrigade has a nice tutorial explaining how to find out of you’ve been ‘tested’ yet by the community.. also, how to auto block them with CSF! Article here: http://www.linuxbrigade.com/bash-shellshock-bug-find-youve-tested/ […]

  2. Bonus bash thoughts but no change on my view, | Bananas in the Falklands - September 27, 2014

    […] from here [not this blog] The scan looks […]

  3. How to patch bash for shell shock in CentOS, Ubuntu, etc.. | PCFlex T.I. - October 7, 2014

    […] LinuxBrigade has a nice tutorial explaining how to find out of you’ve been ‘tested’ yet by the community.. also, how to auto block them with CSF! Article here: http://www.linuxbrigade.com/bash-shellshock-bug-find-youve-tested/ […]

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url=""> 

*