Re: ftp giving url but i want the IP address
On Mon, 05 Apr 2010 13:10:37 -0500 Walter wrote: > On 4/5/10 10:08 AM -0500, Walter wrote: > >If, by "host-specific url" you mean the name associated with > >the IP address, you should be able to get the IP address by > >using the "host" command. > > > > > "host xxx" does the trick. FWIW dig is a little cleaner for scripts $ dig +short freebsd.org 69.147.83.40 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: ftp giving url but i want the IP address
Greg Larkin wrote: Instead of standard ftpd, give lukemftpd a try. I tested it briefly, and failures are reported like so: : FTP LOGIN FAILED FROM 192.168.xxx.yyy Finally, instead of writing your own parsing script, sshguard monitors your FTP logs, SSH logs and other services that you want to protect with pf auto-blocking: http://www.freshports.org/security/sshguard/ Hope that helps, Greg sshguard sounds like what I'm building! Their's isn't as simple as mine is, but that's natural for a mature product. I'll give it a look and maybe pick it up. Thanks! Walter ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: ftp giving url but i want the IP address
On 4/5/10 10:08 AM -0500, Walter wrote: Walter, I do some similar sounding things for my gateway just to keep the logs from filling up with attack drivel. But it's not quite the same problem as your question, so I don't do what I'm about to recommend - it's more complex, involving several formats, IPv4 and IPv6. If, by "host-specific url" you mean the name associated with the IP address, you should be able to get the IP address by using the "host" command. "host xxx" does the trick. Thanks. But another user has suggested a ready-built package, which I'll look into before coding it to work in my program. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: ftp giving url but i want the IP address
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Walter wrote: > Greg Larkin wrote: > >> Hi Walter, >> >> Did you send a HUP signal to inetd so it rereads the config file? >> >> kill -HUP `cat /var/run/inetd.pid` >> >> Hope that helps, >> Greg >> >> > I actually rebooted (after a boo-boo). So, Yes, inetd was > restarted. Ok, just wanted to make sure. After quickly reviewing the ftpd code, I didn't see a way to disable hostname lookups. Instead of standard ftpd, give lukemftpd a try. I tested it briefly, and failures are reported like so: : FTP LOGIN FAILED FROM 192.168.xxx.yyy Finally, instead of writing your own parsing script, sshguard monitors your FTP logs, SSH logs and other services that you want to protect with pf auto-blocking: http://www.freshports.org/security/sshguard/ Hope that helps, Greg - -- Greg Larkin http://www.FreeBSD.org/ - The Power To Serve http://www.sourcehosting.net/ - Ready. Set. Code. http://twitter.com/sourcehosting/ - Follow me, follow you -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFLuiKI0sRouByUApARAsr8AJ9ga+GSfIYzIU0+v6tDx9OIIHzkhQCdH5bY Sv/zbtezw0kL/EYGmWmbmFk= =6RL/ -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: ftp giving url but i want the IP address
Greg Larkin wrote: Hi Walter, Did you send a HUP signal to inetd so it rereads the config file? kill -HUP `cat /var/run/inetd.pid` Hope that helps, Greg I actually rebooted (after a boo-boo). So, Yes, inetd was restarted. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: ftp giving url but i want the IP address
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Walter wrote: > I want to parse ftp error messages in auth.log and use the > ip address in inserting a block into ipfw. It works, except > when ftpd spits out the host-specific url rather than the ip. > Adding "-h" to the ftpd command in inet.conf didn't help. > Can someone tell me how to do this, or point me to code > (C) to convert it? > > Thanks. I'm off-list so please reply directly. > > Walter > ___ Hi Walter, Did you send a HUP signal to inetd so it rereads the config file? kill -HUP `cat /var/run/inetd.pid` Hope that helps, Greg - -- Greg Larkin http://www.FreeBSD.org/ - The Power To Serve http://www.sourcehosting.net/ - Ready. Set. Code. http://twitter.com/sourcehosting/ - Follow me, follow you -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFLugXR0sRouByUApARAv00AJ9Ci0rwzG4cMBTQr9d50Lk4T6iXwwCgrtoJ p8rszot7YctmhKv0B2QpraE= =E9/c -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: ftp giving url but i want the IP address
On 04/05/10 10:08, Walter wrote: > I want to parse ftp error messages in auth.log and use the > ip address in inserting a block into ipfw. It works, except > when ftpd spits out the host-specific url rather than the ip. > Adding "-h" to the ftpd command in inet.conf didn't help. > Can someone tell me how to do this, or point me to code > (C) to convert it? > > Thanks. I'm off-list so please reply directly. > > Walter Would it be possible to wrapper everything in a script that uses a single ping (ping -c 1) to pull the resulting IP address from the output? For example: ping -c 1 google.com PING google.com (74.125.47.103): 56 data bytes 64 bytes from 74.125.47.103: icmp_seq=0 ttl=53 time=111.391 ms --- google.com ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 111.391/111.391/111.391/0.000 ms seeing how that's the standard output for ping, couldn't you use grep and a regex to grab the IP either from the parenthesis or that first line? Of course there might be an easier way and/or better tool than ping to do this. CCing the list to get a discussion going as I imagine such a script could have other uses. -- Yours In Christ, PIT Emails are not formal business letters, whatever businesses may want. Original content copyright under the OWL http://owl.apotheon.org Please do not CC me. If I'm posting to a list it is because I am subscribed. signature.asc Description: OpenPGP digital signature
ftp giving url but i want the IP address
I want to parse ftp error messages in auth.log and use the ip address in inserting a block into ipfw. It works, except when ftpd spits out the host-specific url rather than the ip. Adding "-h" to the ftpd command in inet.conf didn't help. Can someone tell me how to do this, or point me to code (C) to convert it? Thanks. I'm off-list so please reply directly. Walter ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"