Find the answer to your Linux question:
Results 1 to 6 of 6
Hey I was telneting whois.internic.com (GUIDE TO mostly HARMLESS HACKING Beginners Series #2, Section 3 ). But I get a "Connection closed by foreign host." message after every query. Even ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    5

    'Connection closed by foreign host' telnet error


    Hey

    I was telneting whois.internic.com (GUIDE TO mostly HARMLESS HACKING Beginners Series #2, Section 3 ). But I get a "Connection closed by foreign host." message after every query. Even after port scanning (nmap) and telneting to random servers, I get this error after some seconds pause; although I am able to connect to the servers.
    Telnet is enabled in guarddog and in the /etc/inetd.conf.
    Am I wishing some packages?

    Thanks

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    The servers are refusing to communicate with you.
    This is not unusual. If they are not running a telnet
    service, there is nothing you can do.

    One thing you might try is telnet to port 80 of a website.
    you can read the text of the web page.

    The best thing is to have more than one computer,
    and experiment with machines you own and have control of.

  3. #3
    Just Joined!
    Join Date
    Sep 2009
    Posts
    6
    the server is closing telnet session now,you must contact the admin.
    maybe the server firewall make a rule to deline you.

  4. #4
    Just Joined!
    Join Date
    Sep 2009
    Posts
    5
    But internic isnt going to be site which has telnet disabled, considering it is one of the most popular whois site.

    And when I telnet to google dot com at port 80...

    Code:
    alakh@ubuntu:~$ telnet www google co in 80
    Trying 209.85.231.147...
    Connected to www l google com.
    Escape character is '^]'.
    help
    HTTP/1.1 400 Bad Request
    Content-Type: text/html; charset=UTF-8
    Content-Length: 1350
    Date: Tue, 22 Sep 2009 09:46:57 GMT
    Server: GFE/2.0
    
    
    
    <html><head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>400 Bad Request</title>
    <style><!--
    body {font-family: arial,sans-serif}
    div.nav {margin-top: 1ex}
    div.nav A {font-size: 10pt; font-family: arial,sans-serif}
    span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold}
    div.nav A,span.big {font-size: 12pt; color: #0000cc}
    div.nav A {font-size: 10pt; color: black}
    A.l:link {color: #6f6f6f}
    A.u:link {color: green}
    //--></style>
    <script><!--
    var rc=400;
    //-->
    </script>
    </head>
    <body text=#000000 bgcolor=#ffffff>
    <table border=0 cellpadding=2 cellspacing=0 width=100%><tr><td rowspan=3 width=1% nowrap>
    <b><font face=times color=#0039b6 size=10>G</font><font face=times color=#c41200 size=10>o</font><font face=times color=#f3c518 size=10>o</font><font face=times color=#0039b6 size=10>g</font><font face=times color=#30a72f size=10>l</font><font face=times color=#c41200 size=10>e</font>&nbsp;&nbsp;</b>
    <td>&nbsp;</td></tr>
    <tr><td bgcolor="#3366cc"><font face=arial,sans-serif color="#ffffff"><b>Error</b></td></tr>
    <tr><td>&nbsp;</td></tr></table>
    <blockquote>
    <H1>Bad Request</H1>
    Your client has issued a malformed or illegal request.
    
    <p>
    </blockquote>
    <table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor="#3366cc"><img alt="" width=1 height=4></td></tr></table>
    </body></html>
    Connection closed by foreign host.
    Can anything be done? Or is it normal?
    Thanks..

  5. #5
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    Code:
    rcgreen@blue:~$ telnet www.google.com 80
    Trying 64.233.169.103...
    Connected to www.l.google.com.
    Escape character is '^]'.
    GET / HTTP/1.1
    
    HTTP/1.1 200 OK
    Date: Tue, 22 Sep 2009 17:04:35 GMT
    Expires: -1
    Cache-Control: private, max-age=0
    Content-Type: text/html; charset=ISO-8859-1
    Set-Cookie: PREF=ID=860f9b5ece311337:TM=1253639075:LM=1253639075:S=Xkqn5wxd1HOcNALL; expires=Thu, 22-Sep-2011 17:04:35 GMT; path=/; domain=.google.com
    Set-Cookie: NID=27=pNruvpNJuMD-NoAbzN19R216lXVovne3vsHfMOWnAkXXp0XHyXNUHSf1Z1a2lVVLUQxaeSIgrTICeKT1pgJ9o7V1YPtD0YwITq10GF_KrFM9w05HFRJ9Adq2C3aUFJpK; expires=Wed, 24-Mar-2010 17:04:35 GMT; path=/; domain=.google.com; HttpOnly
    Server: gws
    Transfer-Encoding: chunked
    
    fef
    <!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Google</title><script>window.google={kEI:"owO5SpSgHKGMefymiLsO",kEXPI:"17259,21766,21973",kCSIE:"17259,21766,21973",kCSI:{e:"17259,21766,21973",ei:"owO5SpSgHKGMefymiLsO"},kHL:"en"};
    
    window.google.sn="webhp";window.google.timers={load:{t:{start:(new Date).getTime()}}};try{}catch(b){}window.google.jsrt_kill=1;
    var _gjwl=location;function _gjuc(){var e=_gjwl.href.indexOf("#");if(e>=0){var a=_gjwl.href.substring(e);if(a.indexOf("&q=")>0||a.indexOf("#q=")>=0){a=a.substring(1);if(a.indexOf("#")==-1){for(var c=0;c<a.length;){var d=c;if(a.charAt(d)=="&")++d;var b=a.indexOf("&",d);if(b==-1)b=a.length;var f=a.substring(d,b);if(f.indexOf("fp=")==0){a=a.substring(0,c)+a.substring(b,a.length);b=c}else if(f=="cad=h")return 0;c=b}_gjwl.href="/search?"+a+"&cad=h";return 1}}}return 0}function _gjp(){!(window._gjwl.hash&&
    window._gjuc())&&setTimeout(_gjp,500)};
    window._gjp && _gjp()</script><style>td{line-height:.8em;}.gac_m td{line-height:17px;}form{margin-bottom:20px;}body,td,a,p,.h{font-family:arial,sans-serif}.h{color:#36c;font-size:20px}.q{color:#00c}.ts td{padding:0}.ts{border-collapse:collapse}em{font-weight:bold;font-style:normal}.lst{font-family:arial,sans-serif;font-size:17px;margin-bottom:0.2em;vertical-align:bottom; }.lsb{font-size:15px;height:28px;margin:0.2em;}#gbar{float:left;height:22px}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}#gbi,#gbg,#gbs,#gbm{background:#fff;left:0;position:absolute;text-align:left;visibility:hidden;z-index:1000}#gbi,#gbg,#gbm{border:1px solid;border-color:#c9d7f1 #36c #36c #a2bae7;z-index:1001}#guser{padding-bottom:7px !important;text-align:right}#gbar,#guser{font-size:13px;padding-top:1px !important}.gb1,.gb3{zoom:1;margin-right:.5em}.gb2{display:block;padding:.2em .5em}a.gb1,a.gb2,a.gb3{color:#00c !important}.gb2,.gb3{text-decoration:none}a.gb2:hover{background:#36c;color:#fff !important}</style><script>google.y={};google.x=function(e,g){google.y[e.id]=[e,g];return false};window.gbar={qs:function(){},tg:function(e){var o={id:'gbar'};for(i in e)o[i]=e[i];google.x(o,function(){gbar.tg(o)})}};</script></head><body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 onload="document.f.q.focus();if(document.images)new Image().src='/images/nav_logo7.png'" topmargin=3 marginheight=3><textarea id=csi style=display:none></textarea><iframe name=wgjf style=display:none></iframe><div id=xjsc></div><div id=gbar><nobr><b class=gb1>Web</b> <a href="http://images.google.com/imghp?hl=en&tab=wi" onclick=gbar.qs(this) class=gb1>Images</a> <a href="http://video.google.com/?hl=en&tab=wv" onclick=gbar.qs(this) class=gb1>Videos</a> <a href="http://maps.google.com/maps?hl=en&tab=wl" onclick=gbar.qs(this) class=gb1>Maps</a> <a href="http://news.google.com/nwshp?hl=en&tab=wn" onclick=gbar.qs(this) class=gb1>News</a> <a href="http://www.google.com/prdhp?hl=en&tab=wf" onclick=gbar.qs(this) class=gb1>Shopping</a> <a href="http://mail.google.com/mail/?hl=en&tab=wm" class=gb1>Gmail</a> <a href="http://www.google.com/intl/en/options/" onclick="this.blur();gbar.tg(event);return !1" aria-haspopup=true class=gb3><u>more</u> <small>▼</small></a><div id=gbi><a href="http://groups.google.com/grphp?hl=en&tab=wg" onclick=gbar.qs(this) class=gb2>Groups</a> <a href="http://books.google.com/bkshp?hl=en&tab=wp" onclick=gbar.qs(this) class=gb2>Books</a> <a href="http://scholar.google.com/schhp?hl=en&tab=ws" onclick=gbar.qs(this) class=gb2>Scholar</a> <a href="http://www.google.com/finance?hl=en&tab=we" onclick=gbar.qs(this) class=gb2>Finance</a> <a href="http://blogsearch.google.com/?hl=en&tab=wb" onclick=gbar.qs(this) class=gb2>Blogs</a> <div class=gb2><div class=gbd></div></div><a href="http://www.youtube.com/?hl=en&tab=w1" onclick=gbar.qs(this) class=gb2>YouTube</a> <a href="http://www.google.com/calendar/render?hl=en&tab=wc" class=gb2>Calendar</a> <a href="http://picasaweb.google.com/home?hl=en&tab=wq" onclick=gbar.qs(this) class=g
    ade
    b2>Photos</a> <a href="http://docs.google.com/?hl=en&tab=wo" class=gb2>Documents</a> <a href="http://www.google.com/reader/view/?hl=en&tab=wy" class=gb2>Reader</a> <a href="http://sites.google.com/?hl=en&tab=w3" class=gb2>Sites</a> <div class=gb2><div class=gbd></div></div><a href="http://www.google.com/intl/en/options/" class=gb2>even more &raquo;</a> </div></nobr></div><div id=guser width=100%><nobr><a href="/url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a> | <a href="/preferences?hl=en">Search settings</a> | <a href="https://www.google.com/accounts/Login?hl=en&continue=http://www.google.com/">Sign in</a><div id=gbg></div></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div><center><br clear=all id=lgpd><img alt="Google" height=110 src="/intl/en_ALL/images/logo.gif" width=276 id=logo onload="window.lol&&lol()"><br><br><form action="/search" name=f><table cellpadding=0 cellspacing=0><tr valign=top><td width=25%>&nbsp;</td><td align=center nowrap><input name=hl type=hidden value=en><input name=source type=hidden value=hp><input type=hidden name=ie value="ISO-8859-1"><input autocomplete="off" maxlength=2048 name=q size=55 class=lst title="Google Search" value=""><br><input name=btnG type=submit value="Google Search" class=lsb><input name=btnI type=submit value="I'm Feeling Lucky" class=lsb></td><td nowrap width=25% align=left><font size=-2>&nbsp;&nbsp;<a href=/advanced_search?hl=en>Advanced Search</a><br>&nbsp;&nbsp;<a href=/language_tools?hl=en>Language Tools</a></font></td></tr></table></form><br><br><font size=-1><a href="/intl/en/ads/">Advertising&nbsp;Programs</a> - <a href="/services/">Business Solutions</a> - <a href="/intl/en/about.html">About Google</a></font><p><font size=-2>&copy;2009 - <a href="/intl/en/privacy.html">Privacy</a></font></p></center><div id=xjsd></div><div id=xjsi><script>if(google.y)google.y.first=[];if(google.y)google.y.first=[];google.dstr=[];google.rein=[];window.setTimeout(function(){var a=document.createElement("script");a.src="/extern_js/f/CgJlbhICdXMgACswCjg5QAgsKzAOOAcsKzAWOBAsKzAXOAMsKzAYOAQsKzAZOAksKzAlOMmIASwrMCY4BSwrMCc4AiwrMDw4ACw/8XhMZEB-O-4.js";(document.getElementById("xjsd")||document.body).appendChild(a)},0);
    ;google.y.first.push(function(){google.ac.m=1;google.ac.i(document.f,document.f.q,'','')});google.xjs&&google.j&&google.j.xi&&google.j.xi()</script></div><script>(function(){
    function a(){google.timers.load.t.ol=(new Date).getTime();google.report&&google.report(google.timers.load,google.kCSI)}if(window.addEventListener)window.addEventListener("load",a,false);else if(window.attachEvent)window.attachEvent("onload",a);google.timers.load.t.prt=(new Date).getTime();
    })();
    </script>
    0

  6. #6
    Just Joined!
    Join Date
    Jun 2010
    Posts
    3
    Alright guys, I have a similar problem

    This is my script:



    echo "Please Enter The Transcation ID (TID)"
    echo "====================================="
    read tid
    cat /applogs/engine/clients/smpp/tyntec_S_root_20100628.log | grep -i "<requesttype>SENDSMS</requesttype>" | grep -i "$tid">ManualSending_$tid
    sed -n 's/^\(.*\)\(<mbanking>............................... .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. ...............................\)\(.*\)$/\2/p' ManualSending_$tid>ManualSending_$tid_buffer

    cat ManualSending_$tid_buffer | telnet localhost 6103

    ----------------------------------

    This what happens when I execute it :


    Please Enter The Transcation ID (TID)
    =====================================
    2013684
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    Connection closed by foreign host.


    Any help?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •