Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Well, 333networks.com resolves to 54.236.6.225 here, but I get no responses, not even to ping, from that address. I have tried connecting with TCP to port 27900 with no response to the connection attempt. I have tried sending UDP packets with both "status\n" and "status\r\n" with no response, not even an ICMP error.

Of course I have all the terminals I want here... but if that server refuses to talk to me, that is a bit of a problem... wait a minute...

You keep putting backslashes around "status"... (echo -ne '\status\'; sleep 1) | socat STDIO UDP4:333networks.com:27900 produces

\gamename\333networks\gamever\MS-perl 2.4.3\location\0\queryid\41.1\ho +stname\master.errorist.tk (The Errorist Network Master Server)\hostpo +rt\28900\gametype\MasterServer\mapname\333networks\numplayers\14\maxp +layers\2965\gamemode\openplaying\queryid\41.2\mutators\333networks sy +nchronization, UCC Master applet synchronization, Server Status Check +er\AdminName\Syntax-Error\AdminEMail\syntax@errorist.tk\queryid\41.3\ +final\

It is using UDP. And the first thing you need to study is "quoting".

The server is firewalled: an incorrect packet or a packet sent to the wrong port elicits no response at all, while '\status\' sent to the correct port produces that response. I have a bone to pick with whomever designed that atrocity of a protocol, but I think I can make a simple "shotgun query" tool. As a proof of concept, here is a simple solution at the shell:

(for port in `seq 27895 1 27905`; do (echo -ne '\status\'; sleep 1) | socat STDIO UDP4:333networks.com:${port} & done; sleep 1; echo '')

Paste that into a terminal and observe the results. That one does not tell you which port responded, only the response that was received, but the returned "hostport" happens to be 1000 higher than the port that produces the response. Writing this in Perl will be a fun exercise.

Note that I am deliberately designing this in a way that will set off alarms and get you caught if you try to use it as a system cracking tool.

2019-08-12 Athanasius fixed long line.

2019-08-12 jcb concurs with this edit to his node and thanks Athanasius. Let us see if I remember how to fix this the next time I need it...


In reply to Re^7: Querying program port by jcb
in thread Querying program port by CougarXR7

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (3)
    As of 2020-01-18 16:49 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Notices?