I want to check if I get any incoming telnet request. After doing google, I found out that
tcpdump can be used for this purpose. This is the
tcpdump command I would use.
$ tcpdump -i wlan0 -w telReqCapt.pcap 'dest host <myIpAddress> and port 23'
However I am not able to think of a way so that this monitoring is ALWAYS done. How do I do this ?
I have thought of few approach.
After everytime I log-in, I will run the
tcpdumpcommand. However this has to be done manually everytime.
I will add the
tcpdumpcommand in me
~/.bashrcso that everytime I open the terminal, the
tcpdumpcommand will run. But I dont know what will happen if I open two terminals (or two bash session) at same time. I feel there will be an issue because both the
tcpdumpwill try to write to same file.
Write a bash script containing the
tcpdumpcommand and make it run everytime system boots using
/etc/init/)(I use ubuntu) or by putting the script in
I think approach 3 is best suited for my needs, because I want to monitor if I get incoming telnet requests for the entire time (since my machine boots, untill it is powered off).
However please let me know if this approach has any problem with it ? Can I start
tcpdump everytime my system boots ? Is there anyuthing I need to take care of while following this approach. Any performance issues ?
Finally, is there ANY OTHER way I can use
tcpdump to capture incoming
telnet requests all the time (since the time the machine boots up untill it is powered off).