-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sudev Barar writes:
> This may not be correct place but collective wisdom can perhaps point
> me to a good resource.

> I have a remote device that is generating data and is sending as a TCP
> packet to designated IP:Port. If I open and set a non standard port I
> am able to receive the packets using a listener. Problem is that the
> host where I have to move this project allows listening only on port
> 80 (apache) or port 25/110 (mail) or port 22 (ssh)

I'm a bit confused. Is your remote device say XYZ, sends TCP packets
to $IP:$PORT, and you want your listener app say ABC to listen on
$IP:$PORT to record all the data that XYZ is sending, hmm...? And your
listening app can only listen on 22,25,80,110 TCP ports, right ?

> How can I set up apache or iptables to log in incoming data packets
> while at the same time allow apache to serve web pages?

Do you care about payload of those TCP packets or packet headers also
? If former then you do that with netcat (listening on any of your
desired port).

- ---->8----->8-----
#!/bin/sh

while true ; do
CAPFILE=/capdir/$(date +%d%m%Y_%H%M%S)
nc -p $DESIRED_PORT -l $IP_ADDRESS_I_WANT_TO_LISTEN_ON >$CAPFILE
done
- ---->8----->8-----

And if you log packets headers also, you've two options: tcpdump (with
- -w switch) or iptables rule (with LOG target).

Happy logging :)
- -- 
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkiHD7oACgkQHy+EEHYuXnSm4gCgki2NiKqeduS2XmstyjvCAvrv
zHcAoNeTAW1nSfKrdfOtdWrmackIKv94
=bMAw
-----END PGP SIGNATURE-----

_______________________________________________
ilugd mailinglist -- ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
http://www.mail-archive.com/ilugd@lists.linux-delhi.org/

Reply via email to