Search Results

Search found 100 results on 4 pages for 'netcat'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • [SOLVED] netcat/socat no response from other networking services

    - by jack
    Hi gurus First, I thought that this was Vmware problem : http://serverfault.com/questions/141838/vmware-problems-networking-no-packet-response But now, after testing on several physical machines, I realized certain services didn't return response data when using socat/netcat 1.1 which is supposed to the latest version since last updated. root@test3:~# netcat 192.168.1.2 25 220 762462a8c4d Microsoft ESMTP MAIL Service, Version: 6.0.2600.5949 ready at Fri, 12 May 2010 18:04:20 +0600 EHLO localhost sdfsafsd ^ root@test3:~# I've tested it on both windows and linuxes. I found no problem with telnet.

    Read the article

  • Socket left in TIME_WAIT after file transfer via netcat

    - by com
    Using Copying by NetCat I am trying to copy files throught network by NetCat. From console it work pretty well. First I run listening netcat on the destination machine and after I run sending on source machine. The problem is it's doen't work from script from the source machine: ssh -f user@$desthost 'nc -l 1234 | tar xvf - /dev/null &' #listening on destination host tar cv /tmp/file | nc $desthost 1234 #sending to destination host I saw that after running port 1234 is still was open and status of the socket was TIME_WAIT. If you know what's the problem, please, help me out. And by the way, after copying how can I validate that the content is identical? Thanks! Addendum: I found one very strange thing, the same implementation with screen on destination work works, but not stable, sometimes it doesn't copy a file. ssh user@$desthost screen -dm -S test 'nc -l 1234 | tar xvf - ' #listening on destination host Maybe there is an issue with timeout?

    Read the article

  • Unix bidirectional pipe on commandline

    - by John W
    I've been able to use this linux command to connect Netcat to a serial port: nc -l 80 <> /dev/ttyS0 I would like to be able to log this transaction. My backup plan is to use Wireshark to monitor the netcat stream, but ideally I'd like to do something like this: cat /dev/ttyS0 | tee upstream.bin | nc -l 80| tee downstream.bin | /dev/ttyS0 This tries to open ttyS0 twice and therefore throws a permissions error. Does anyone know a smarter way to do this?

    Read the article

  • Binding on a port with netpipes/netcat

    - by mindas
    I am trying to write a simple bash script that is listening on a port and responding with a trivial HTTP response. My specific issue is that I am not sure if the port is available and in case of bind failure I fall back to next port until bind succeeds. So far to me the easiest way to achieve this was something like: for (( i=$PORT_BASE; i < $(($PORT_BASE+$PORT_RANGE)); i++ )) do if [ $DEBUG -eq 1 ] ; then echo trying to bind on $i fi /usr/bin/faucet $i --out --daemon echo test 2>/dev/null if [ $? -eq 0 ] ; then #success? port=$i if [ $DEBUG -eq 1 ] ; then echo "bound on port $port" fi break fi done Here I am using faucet from netpipes Ubuntu package. The problem with this is that if I simply print "test" to the output, curl complains about non-standard HTTP response (error code 18). That's fair enough as I don't print HTTP-compatible response. If I replace echo test with echo -ne "HTTP/1.0 200 OK\r\n\r\ntest", curl still complains: user@server:$ faucet 10020 --out --daemon echo -ne "HTTP/1.0 200 OK\r\n\r\ntest" ... user@client:$ curl ip.of.the.server:10020 curl: (56) Failure when receiving data from the peer I think the problem lies in how faucet is printing the response and handling the connection. For example if I do the server side in netcat, curl works fine: user@server:$ echo -ne "HTTP/1.0 200 OK\r\n\r\ntest\r\n" | nc -l 10020 ... user@client:$ curl ip.of.the.server:10020 test user@client:$ I would be more than happy to replace faucet with netcat in my main script, but the problem is that I want to spawn independent server process to be able to run client from the same base shell. faucet has a very handy --daemon parameter as it forks to background and I can use $? (exit status code) to check if bind succeeded. If I was to use netcat for a similar purpose, I would have to fork it using & and $? would not work. Does anybody know why faucet isn't responding correctly in this particular case and/or can suggest a solution to this problem. I am not married neither to faucet nor netcat but would like the solution to be implemented using bash or it's utilities (as opposed to write something in yet another scripting language, such as Perl or Python).

    Read the article

  • apache vhost not working consistently

    - by petrus
    I have a vhost on my webserver whose sole and unique goal is to return the client IP adress: petrus@bzn:~$ cat /home/vhosts/domain.org/index.php <?php echo $_SERVER['REMOTE_ADDR']; echo "\n" ?> This helps me troubleshoot networking issues, especially when NAT is involved. As such, I don't always have domain name resolution and this service needs to work even if queried by its IP address. I'm using it this way: petrus@hive:~$ echo "GET /" | nc 88.191.124.41 80 191.51.4.55 petrus@hive:~$ echo "GET /" | nc domain.org 80 191.51.4.55 router#more http://88.191.124.41/index.php 88.191.124.254 However I found that it wasn't working from at least a computer: petrus@seth:~$ echo "GET /" | nc domain.org 80 petrus@seth:~$ petrus@seth:~$ echo "GET /" | nc 88.191.124.41 80 petrus@seth:~$ What I checked: This is not related to ipv6: petrus@seth:~$ echo "GET /" | nc -4 ydct.org 80 petrus@seth:~$ petrus@hive:~$ echo "GET /" | nc ydct.org 80 2a01:e35:ee8c:180:21c:77ff:fe30:9e36 netcat version is the same (except platform, i386 vs x64): petrus@seth:~$ type nc nc est haché (/bin/nc) petrus@seth:~$ file /bin/nc /bin/nc: symbolic link to `/etc/alternatives/nc' petrus@seth:~$ ls -l /etc/alternatives/nc lrwxrwxrwx 1 root root 15 2010-06-26 14:01 /etc/alternatives/nc -> /bin/nc.openbsd petrus@hive:~$ type nc nc est haché (/bin/nc) petrus@hive:~$ file /bin/nc /bin/nc: symbolic link to `/etc/alternatives/nc' petrus@hive:~$ ls -l /etc/alternatives/nc lrwxrwxrwx 1 root root 15 2011-05-26 01:23 /etc/alternatives/nc -> /bin/nc.openbsd It works when used without the pipe: petrus@seth:~$ nc domain.org 80 GET / 2a01:e35:ee8c:180:221:85ff:fe96:e485 And the piping works at least with a test service (netcat listening on 1234/tcp and output to stdout) petrus@bzn:~$ nc -l -p 1234 GET / petrus@bzn:~$ petrus@seth:~$ echo "GET /" | nc domain.org 1234 petrus@seth:~$ I don't know if this issue is more related to netcat or Apache, but I'd appreciate any pointers to troubleshoot this issue ! The IP addresses have been modified but kept consistent for easy reading. bzn is the server, hive is a working client and seth is the client on which I have the issue.

    Read the article

  • Require a very simple bash-based webserver for logging XML POST [on hold]

    - by Syffys
    As in title, it's for testing purpose and I need it to be extremely light (1 line to 1 single light file). Here is a XML query sample: XML_QUERY=$(cat <<EOF <?xml version='1.0' encoding='UTF-8'?> <Test></Test> EOF ) curl -H "Content-type: text/xml; charset=utf-8" -H "Soapaction: \"\"" -k -d "${XML_QUERY}" http://localhost:8088 Here are some of the tracks I have found so far even if I wasnt able to adapt them to work as I expect: Netcat minimal webserver: Problem is that my nc does not have the -q option, so the connection is closing before delivering the XML content Netcat Only webserver: Same as above Thanks in advance! EDIT: As it's been asked, I'm running Linux Redhat, even if the distro does not really matter and the OS implied since I'm asking a bash-based solution... Also about my topic being on hold: "Instead, describe your situation and the specific problem you're trying to solve" = I though this was exactly what I was doing, but ok I'll reword: My situation: bash environment (which can also include some standard linux tool: netcat, python or whatever) My specific problem: please see title: Require a very simple bash-based webserver for logging XML in HTTP POST for testing purpose

    Read the article

  • Proxying/Tunneling IPSec traffic via netcat or SOCKS?

    - by MattC
    I have a client that is using a SonicWall router as their VPN concentrator. I downloaded the client software and set up the router as a peer. My issue is that my company uses a dual DMZ setup, meaning we have an interior firewall, then a bunch of DMZ servers, then an external firewall, then finally the telco router. In this setup, the interior firewall has no way to communicate with the exterior firewall since they are on two totally separate subnets. The communication occurs through the servers that straddle the networks. In this case, I need some way to forward the ISAKMP/IPSec traffic from my desktop out to the Internet. My usual trick of using netcat on the intermediate proxy server doesn't work here since it's not TCP/UDP traffic as far as I can tell. All of my previous experience with VPN's have been using SSL-based VPN's which are clearly very easily proxy-able. Any help would be appreciated, thanks!

    Read the article

  • SSH multi-hop connections with netcat mode proxy

    - by aef
    Since OpenSSH 5.4 there is a new feature called natcat mode, which allows you to bind STDIN and STDOUT of local SSH client to a TCP port accessible through the remote SSH server. This mode is enabled by simply calling ssh -W [HOST]:[PORT] Theoretically this should be ideal for use in the ProxyCommand setting in per-host SSH configurations, which was previously often used with the nc (netcat) command. ProxyCommand allows you to configure a machine as proxy between you local machine and the target SSH server, for example if the target SSH server is hidden behind a firewall. The problem now is, that instead of working, it throws a cryptic error message in my face: Bad packet length 1397966893. Disconnecting: Packet corrupt Here is an excerpt from my ~/.ssh/config: Host * Protocol 2 ControlMaster auto ControlPath ~/.ssh/cm_socket/%r@%h:%p ControlPersist 4h Host proxy-host proxy-host.my-domain.tld HostName proxy-host.my-domain.tld ForwardAgent yes Host target-server target-server.my-domain.tld HostName target-server.my-domain.tld ProxyCommand ssh -W %h:%p proxy-host ForwardAgent yes As you can see here, I'm using the ControlMaster feature so I don't have to open more than one SSH connection per-host. The client machine I tested this with is an Ubuntu 11.10 (x86_64) and both proxy-host and target-server are Debian Wheezy Beta 3 (x86_64) machines. The error happens when I call ssh target-server. When I call it with the -v flag, here is what I get additionally: OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011 debug1: Reading configuration data /home/aef/.ssh/config debug1: Applying options for * debug1: Applying options for target-server.my-domain.tld debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: auto-mux: Trying existing master debug1: Control socket "/home/aef/.ssh/cm_socket/[email protected]:22" does not exist debug1: Executing proxy command: exec ssh -W target-server.my-domain.tld:22 proxy-host.my-domain.tld debug1: identity file /home/aef/.ssh/id_rsa type -1 debug1: identity file /home/aef/.ssh/id_rsa-cert type -1 debug1: identity file /home/aef/.ssh/id_dsa type -1 debug1: identity file /home/aef/.ssh/id_dsa-cert type -1 debug1: identity file /home/aef/.ssh/id_ecdsa type -1 debug1: identity file /home/aef/.ssh/id_ecdsa-cert type -1 debug1: permanently_drop_suid: 1000 debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-3 debug1: match: OpenSSH_6.0p1 Debian-3 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1 debug1: SSH2_MSG_KEXINIT sent Bad packet length 1397966893. Disconnecting: Packet corrupt

    Read the article

  • Getting a TTY in a Connectback Shell

    - by Asad R.
    I'm often asked by friends to help with small Linux problems, and more often than not I'm required to login to the remote system. Usually there are a lot of issues with making an account and logging in (sometimes the box is behind a NAT device, sometimes SSHD isn't installed, etc.) so I usually just ask them to make a connect-back shell using netcat (nc -e /bin/bash ). If they don't have netcat I can just ask them to grab a copy of a statically compiled binary which isn't that hard or time consuming to download and run. Though this works well enough for me to enter simple commands, I can't run any apps that require a tty (vi, for example) and can't use any job control functions. I managed to bypass this issue by running in.telnetd with a few arguments within the connect-back shell that would assign me a terminal and drop me to a shell. Unfortunately in.telnetd isn't usually installed by default on most systems. What's the easiest way to get a fully functional connect-back terminal shell without requiring any non-standard packages? (A small C program that does the job would be fine as well, I just can't seem to find much documentation on how a TTY is assigned/allocated. A solution that doesn't require me to plough through the source code for SSHD and TELNETD would be nice :))

    Read the article

  • How do I prevent a tar pipe from causing swapping?

    - by Jeff Shattock
    I have a rather large filesystem that I need to transfer from one Linux server to another. I figured the best way to do this was via a tar/netcat pipe arrangment, something like tar c . | pv | nc blah blah blah And it works great, the network stays fairly saturated, life is good. Until the source machine starts swapping. The files are on a raid on the source system, so the read speed is much faster than the write speed on the other end. Since the dest machine hasnt picked up the data yet, the source machine needs to stick it somewhere, so into RAM it goes, until there is no more free RAM. It then starts swapping, which is horribly painful since that machine has its OS installed on a somewhat slow CF card. Both machines have 4GB of physical ram, 64 bit Ubuntu 9.04 server. GigE link between them. How do I prevent this swapping? Can I put a "speed-limit" on the tar or netcat process so that the transfer speed doesn't overwhelm the write throughput on the destination end? The man pages didn't list anything, but there might be something I'm overlooking.

    Read the article

  • Logging network activity of LAMP server using BASH

    - by Yarin
    I've got a Fedora LAMP server on Amazon EC2 functioning as a HTTP pseudo-proxy (Sorry, don't know the terminology- It's not a true proxy where requests are relayed through apache, rather client requests are being translated by a PHP script, which then sends a new request.) I'd like to be able to fully log the HTTP cycle CLIENT - PROXY PROXY - SERVICE SERVICE - PROXY PROXY - CLIENT I'm hoping to do this using BASH tools- thinking netcat? Looking for advice and examples. Thanks!

    Read the article

  • Localhost service accessible from remote address

    - by dynback.com
    I have on my home Windows box - Cassini server with localhost:10000. And I want it be accessible in internet by my static IP. Tried netcat, "nc -l -p 10001 localhost 10000". But it results in "invalid connection to [IP] from [IP] 16074" Also before that it was working on Opera Unite properly, but now only writes a message: "An error occured. See error log for details". I dont know where to get that log.

    Read the article

  • NetCAT ou le lancement des tests des dernières builds de NetBeans 6.9 : Dernière ligne droite pour l

    NetCAT ou le lancement des tests des dernières build de NetBeans 6.9 Dernière ligne droite pour la nouvelle mouture de NetBeans Depuis le 15 Mars, NetCAT (NetBeans Community Acceptance Testing program), a débuté la série de tests des dernières versions builds de la plateforme NetBeans. Ainsi, une cinquantaine de membres ayant demandé leur intégration au projet vont tester et émettre des retours d'expérience afin d'améliorer le maximum de points dans l'objectif d'obtenir une version finale stable et sans bugs. Le programme va se dérouler pendant 3 mois autour des milestones de l'IDE Voici le planning prévu : [IMG]http://www.livesphere.fr/images/dvp/netc...

    Read the article

  • SNMPD timeout yet netcat shows port as open

    - by Kirill Gordeenko
    SNMPD config (I have this config working on a different server): com2sec readonly default public group MyROGroup v1 readonly group MyROGroup v2c readonly group MyROGroup usm readonly view all included .1 80 access MyROGroup "" any noauth exact all none none syslocation <LOCATION> syscontact <CONTACT> When I check the port from remote machine: » nc -zvu xx.xx.xx.xx 161 Connection to xx.xx.xx.xx 161 port [udp/snmp] succeeded! This also works locally (I get all the right stats): snmpwalk -v 2c -c public localhost Yet when I try same command locally or remotely with external IP: Timeout: No Response from xx.xx.xx.xx IPTables are disabled on both machines. /etc/sysconfig/snmpd looks like this: OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid" -a /etc/default/snmpd is empty.

    Read the article

  • Terminal command to send data (plain text string) to a port at a remote computer.

    - by Eddy
    I am trying to send data (plain text string) to a port at a remote computer using terminal utility. The string would be used to trigger something on the remote computer running a program that would listen to that specific port. I used netcat command and tried a few combination of the following but can't seem to get the parameter right. Can someone point me out where am I doing wrong? eddy-2:Desktop eddy$ nc IPADDRESS PORT woc.txt eddy-2:Desktop eddy$ nc IPADDRESS PORT < woc.txt P.S: woc.txt contains plain text string of the said command. Edit: I am trying to send a string from OSX to Windows XP where the specific port is open by default.

    Read the article

  • Simple secured SFTP tunnel?

    - by babonk
    I'd like to setup an sftp tunnel so that I can connect to an IP-secured SFTP server through a gateway computer from anywhere, and download the files to anywhere. I was thinking of using a combination with netcat, having it listen to either WinSCP or PuTTY sFTP (doesn't matter which). Not sure how I would download the files to the connecting computer though. I would like the tunnel to be secured, preferably, with a username/password. I'm open to using alternative software but I'm looking for unintrusive, simple command line stuff because I don't want to install a lot on this computer. Thanks

    Read the article

  • TCP Sessions and IP Changes

    - by Kyle Brandt
    What happens to a TCP session when the IP of a client changes? I did a simple test of having netcat listen on a port, and connecting to that port from a client machine. I then changed the IP of the client while that nc session was open and sent some data, no data was received by server after changing the IP. I know they are different layers, but does TCP use IPs for part of how it distinguishes sessions? Does my example not work because of how the application handles it, or is this not working because of something happening at TCP/IP/Ethernet layers? Does this depend on the OS implementation? ( I am most interested in Linux at the moment)

    Read the article

  • Packet Crafting on a Mac

    - by JayCrossler
    I think (based on searching the forums), that NetCat is the best option, but wanted to hear if others are preferable. Anyone have good success with a packet-crafting tool (specifically on Mac)? I've tried HPing, but had some issues. I'm looking into NetCat ('nc' on mac) now, but it's not working as I had thought. Basically, I captured some packets that a remote control sends over a wifi network to turn lights on and off (using X10 controllers), and am looking for a way to replay them by crafting a TCP packet from the command line. I used Wireshark to sniff the traffic, so I know the package is: DEVICE -sendplc-"C4 DIM 10" I'm trying: echo 'DEVICE -sendplc-"C4 DIM 10"' nc 192.168.2.196 6003 but there's no response from the receiving system. The exact bytestream is (if anyone wants to check that I got the right dataframe): 08004642f1b400260897ad6308004500004b08e240004006aaf5c0a802c1c0a802c4d8d7177399aab39 e57ff4753801880ae37ea00000101080a323353ce01b406424445564943457e73656e64706c637e2243 34204f4e220a Next step I'm going to check is to make sure the packet arrives exactly by sniffing and compare it to the original. [EDIT: Also at ServerFault now: Packet Crafting on a Mac, so this one becomes a duplicate across the two sites]

    Read the article

  • Need a very simple bash-based webserver for logging XML in HTTP POST

    - by Syffys
    As in title, it's for testing purpose and I need it to be extremely light (1 line to 1 single light file). Here is a XML query sample: XML_QUERY=$(cat <<EOF <?xml version='1.0' encoding='UTF-8'?> <Test></Test> EOF ) curl -H "Content-type: text/xml; charset=utf-8" -H "Soapaction: \"\"" -k -d "${XML_QUERY}" http://localhost:8088 Here are some of the tracks I have found so far even if I wasnt able to adapt them to work as I expect: Netcat minimal webserver: Problem is that my nc does not have the -q option, so the connection is closing before delivering the XML content Netcat Only webserver: Same as above Python based: But does not handle POST Thanks in advance!

    Read the article

  • How do I make ncat not send a line-feed?

    - by tladuke
    I'm on Windows 7 Powershell and have ncat from http://nmap.org/ncat/ I'm trying to send "foo" to some network device PS> ncat -u 192.168.1.255 6061 foo but it sends "foo\n" (66 6f 6f 0a) and the line-feed makes the device not recognize the command. there's a -C option to add a carriage return, but that's no help. I made a text file containing "foo" and did PS> cat .\test.txt | ncat -u 192.168.1.255 6061 but that also adds CRLF

    Read the article

  • nc or socat: How to read data from remote:/dev/ttyACM0 ?

    - by AndreasT
    I have a device running at a remote computer on /dev/ttyACM0 Now I want to read that data on my computer. I can connect to it over ssh. Unfortunately I am a nc/socat rookie and no howto covered this. Semantically like this: cat remote:/dev/ttyACM0 The remote system has a limited linux on it, and I can't install packages. (socat is not available there, nc is) Super cool would be to have some forwarded device: local:/dev/ttySOCK0 pointing to remote:/dev/ttyACM0 Thanks for any help.

    Read the article

  • Difference between sending data via UDP in Bash and with a Python script

    - by Kevin Burke
    I'm on a Centos box, trying to send a UDP packet to port 8125 on localhost. When I run this Python script: import socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.sendto('blah', ("127.0.0.1", 8125)) The data appears where it should on port 8125. However when I send the data like this: echo "blah" | nc -4u -w1 127.0.0.1 8125 Or like this: echo "blah" > /dev/udp/127.0.0.1/8125 The data does not appear in the backend. I know this is horribly vague but it's UDP and it's hard to determine why one packet is being sent and the other is not. Do you have any ideas about how to debug this issue further? I'm on a Centos machine.

    Read the article

  • quick check of open port

    - by shantanuo
    The following is working as expected. (do not want to use nmap) I need to use nc (or any other built-in centOS) command in shell script to check the port 6379 of a remote server. I want the script to exit quickly if no response received in less than 1 second. But it seems that nc will wait for too long before quitting with exit code of 1 How do I "quickly" check if the port is listening? # time nc -z 1.2.3.4 1234 real 0m21.001s user 0m0.000s sys 0m0.000s # echo $? 1 # time nc -z 1.2.3.4 6379 Connection to 1.2.3.4 6379 port [tcp/*] succeeded! real 0m0.272s user 0m0.000s sys 0m0.008s # echo $? 0

    Read the article

  • redirecting output from telnet / nc to file in script fails when cron'd

    - by qhartman
    So, I have device on my network which sits there listening on a port for a connection, and when a connection is made it dumps ascii data out. I need to capture that data to a file. I wrote a dead simple shell script that does this: #!/bin/bash #Config Variables. Age is in Days. DATA_ROOT=/root/data FILENAME=data_`date +%F`.dat HOST=device COMPRESS_AGE=3 #Sanity Checks if [ ! -e $DATA_ROOT ] then echo "The directory $DATA_ROOT seems to not exist. Please create it." exit 1 fi if [ -e $DATA_ROOT/$FILENAME ] then echo "You seem to have extracted data already today. Aborting" exit 1 fi #Get Data nc $HOST 2202 > $DATA_ROOT/$FILENAME #Compress old Data find $DATA_ROOT -type f -mtime +$COMPRESS_AGE -exec gzip {} \; exit 0 It works great when I run it by hand, but when I run it from cron, it doesn't capture any of the output. If I replace nc with telnet I see the initial telnet headers about escape sequences and whatnot, but not the data. Ideas? I've tried forcing bash to act like an interactive shell with -i. I've tried redirecting both stderr and stdout. I know it's got to be some silly simple thing, but I'm utterly failing. This is driving me nuts... EDIT I also just noticed that the nc processes from all my previous attempts at this have been siting sleeping, and when I killed them, cron sent me a bunch of non-sensical error messages. At least now I have something to dig into!

    Read the article

< Previous Page | 1 2 3 4  | Next Page >