Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Querying program port

by jcb (Deacon)
on Aug 11, 2019 at 00:39 UTC ( #11104268=note: print w/replies, xml ) Need Help??


in reply to Querying program port

This is very possible, and I could probably adapt some code from one of my (currently untested) hobby projects for this, but first I have some questions:

  • What, exactly, is the purpose of this program you ask of the Monastery?

    Are you trying to determine which "random" port a known program has chosen for a particular session? What program are we trying to extract information from? If this is a protocol that several programs use, does it have a name? What is at least one program using this?

    Why is there not some directory we can query for these ephemeral servers? Why do we have to search like this?

  • What, exactly, do you need done?

    Does this need to send a string "$addr:$port status\n" to multiple ports until one answers? Do we expect all other ports to be closed entirely? Is this using TCP or UDP or something else? Are they all on the same host or are we gathering status information from some kind of cluster? Or is a single host "fronting" for some kind of cluster?

This sounds very much like a common system cracker tool, although there are legitimate uses for this type of functionality as well. I want to be sure that you have a legitimate use before I even think about giving you code for this.

Answering all of these questions will go a long way towards establishing your legitimacy. Having worked in systems administration at a small Internet-dependent business, where kicking script kiddies out of the aging PHP-heavy infrastructure that management did not want to upgrade was a large part of my job, I have no desire to help that kind of nonsense along.

Replies are listed 'Best First'.
Re^2: Querying program port
by CougarXR7 (Acolyte) on Aug 11, 2019 at 06:00 UTC

    My friend is a game server admin. He is trying to get player stats from his game server, "Deaths, Kills, ect., ect..., but cannot because the ports he has tried does not query his game server.

    All I am trying to do is help my friend discover which port will return his game's server player stats.

    Protocol is UDP

    example: 12.345.67.890:25000

    Ip Address:port /enter

    \status\ enter

    Returned reply, YES, exit script, log return player stats

    Returned reply, NO, continue with script

    ip address stays the same. The port inc by 1

    now its 12.345.67.890:25001/enter

    \status\ enter

    Script keeps running until there is a return. With printing info on terminal, to make sure script is still running.

    Sir, I have no idea what "kiddie scripts or even PHP is about, You lost me at kiddie scripts!

    If I failed to answer you, please let me know!

    I have a dislike for hackers, they can ruin it for everyone!

      Has your friend tried the netstat command, probably as netstat -a to check listening ports, to confirm that the game server is listening at all? (Run that on the same machine as the server.) It has been a long time since I have used Windows, so you may want to check the output of netstat /? or netstat -? for other hints on using that command.

      Your descriptions sound suspiciously like a series of keystrokes entered at some prompt. What are you typing those keystrokes into? The best solution here may involve Expect rather than Perl if you are trying to automate interacting with a simple shell program. Perl will work much better if you are wanting to actually send network packets directly.

        My friend and others have tried everything. That is why I am asking if this script can be done.

        This script will be ran on a terminal on a Ubuntu system.

        I can do this manually, changing the port each time, but to automate it with a script would be gold!

        I could run this auto script until it returns player stats.

        Sir, thank you for your time. However it seems that you are not comfortable with doing this.

        I will never ask anyone to do anything they are uncomfortable with.

        Thank you so very much for your replies!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11104268]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2019-12-11 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?