LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 10-23-2006, 06:12 AM   #1
pcmilhouse
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Rep: Reputation: 0
Script listening on TCP port


Can someone post a simple bash script listening on a TCP port?

How can I read tcp packet in bash?

Thanks
 
Old 10-23-2006, 09:02 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,675
Blog Entries: 54

Rep: Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954
// This should be in the Programming forum IMHO.
Can someone post a simple bash script listening on a TCP port?
"GET", OK, "listen", no. At least I can't in pure shell. I know there's some toolkits to do server-client things in Bash but they're *way ancient*: look for Socketd (wzk@quietsche-entchen.de) or Socket (mark@eskimo.com). For both this and the question below explaining why you need it would be cool. Verbosity may lead to us giving suggestions or solutions that better match your task or situation.


How can I read tcp packet in bash?
Bash has no concept of "packets" or how to "read" them.
You want to resort to using a legitimate sniffer.
 
Old 10-24-2006, 01:15 PM   #3
basileus
Member
 
Registered: Nov 2004
Location: Turku, Finland
Distribution: Debian, Ubuntu, Gentoo
Posts: 388

Rep: Reputation: 30
Try writing a bash script that uses "tcpdump" to capture the packet(s) you want. Google for "Bash for beginners" and "Advanced bash scripting guide". Also check out "man tcpdump" and you're set to go.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP Port not listening Craig Cox Linux - Security 1 10-10-2006 12:08 PM
tcp listening port help pbaxter Linux - Networking 4 07-11-2006 04:38 PM
AMaViS not listening on tcp port nutcake Linux - Software 1 09-13-2005 09:44 AM
What is busboy ??? Listening on TCP port 998 tallship Linux - Security 3 12-17-2004 08:59 PM
MySQL on Debian 3.0: TCP listening Hko Linux - Software 3 09-04-2002 03:28 PM


All times are GMT -5. The time now is 12:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration