Jump to content
Science Forums

How crazy do you get with your shell in one line?


Recommended Posts

Post random one liners and approximately describe what they do :)

 

Note: authors are not responsible for people who carelessly use their scripts... if you dont know what it does, chances are, you shouldnt be running it ;)

 

Today, I basically rewrote the scirpt in this article: Rule-based DoS attacks prevention shell script LG #137

 

tmp="iptables -F" && while ip in `cat /etc/sysconfig/iptables /var/log/secure | grep 'DROP|Invalid user|Maximum login|Did' | awk '{i=1; while ($i!=""){{print $i}; i++}}' | grep "^([0-9]{1,3}.){3}.[0-9]{1,3}$" | sort -u`; do tmp=`echo $tmp" && iptables -A INPUT -s "$ip" -j DROP"`; done

 

and to get it fully working you can add a " && echo $tmp | bash" at the end... but DONT, you should always examine the command line before running it :lol:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...