Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Dear jo , this is my first attempt.
From the client side it seems to work, I can telnet , insert my user , then it request my password and it seems similar to original shell. But when trying from legitimate telnet client it does not.
Im also thinking the idea of creating a real linux server with telnet login and then redirect telnet daemon to a custom script (like a pseudo shell). I need to find out all pieces and make them work togheter.
This is my perl telnet server:
#!/usr/bin/perl -w use IO::Socket; use Net::hostent; # for OO version of gethostbyaddr $PORT = 9000; # pick something not in use $prompt="MA5680T>"; $server = IO::Socket::INET->new( Proto => 'tcp', LocalPort => $PORT, Listen => SOMAXCONN, Reuse => 1); die "can't setup server" unless $server; print "[Server $0 accepting clients]\n"; while ($client = $server->accept()) { $client->autoflush(1); #print $client "Welcome to $0; type help for command list.\n"; #$hostinfo = gethostbyaddr($client->peeraddr); #printf "[Connect from %s]\n", $hostinfo->name || $client->peerhost +; print $client "\n"; print $client "Warning: Telnet is not a secure protocol, and it is +recommended to use Stelnet."; print $client "\n"; print $client "\n"; print $client ">>User name:"; while ( <$client>) { next unless /\S/; # blank line print "\nlinea :$_"; if (/quit|exit/i) { last; + } elsif (/leo/i) { printf $client "\n>>User password:"; } elsif (/password/i) { printf $client "\n$prompt"; } else { print $client "\n$prompt"; } } continue { #print $client $prompt; } close $client; }
Regards, Leandro

In reply to Re^2: creating a fake telnet middleware by leostereo
in thread creating a fake telnet middleware by leostereo

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-26 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found