Solved

telnet question

Posted on 2006-06-14
12
264 Views
Last Modified: 2010-04-05
Hi, is there a way to make a reverse telnet [i dont know if the name is correct] using delphi.... what i'm trying to do is establish a telnet connection but, instead of I connect with the server, the server connects to me and wait for the commands...
0
Comment
Question by:plinho
  • 5
  • 3
  • 2
12 Comments
 
LVL 4

Expert Comment

by:LMuadDIb
ID: 16908308
so you want a telent server that once started, will "call home" via telnet to inform you its running, and then act like a telnet server?

0
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 125 total points
ID: 16908407
That is not the nature of the telnet protocol.
you would have to use a telnet client at the "remote" end, and run a telnet server at your end.
Indy (which ships with with some Delphi versions) has a TIdTelnetServer and client
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16908585
I am guessing you are trying to get past a firewall that does not allow the telnet into the telnet server from outside the network.
You can bypass this only by having something on the server machine, or within its' network with access to the server.
1 ugly way I can think of, off the top of my head is using an intermediary program to relay the commands. The server will need to know what address to connect to, so if you want to talk to the server from many different places, you will need to let it know somehow. This is the tricky part. you could use 1 line in a webpage if it comes to it.. but I'll explain a method to do the actual communication, and you can ignore the rest if this is not suitable.

Nework A
======
Server A - the Telnet server

Relay Application "C" (running within Network A)

Application B (containing Server B) - running outside of Network A (where you are) this is what you want Server A to connect to.
---
Relay Application "C" - contains a telnet client for talking to Server, and another client (telnet or TCP) for talking to Application B (where you are)

Application B uses a Server (telnet or TCP). You start this when you want Server A to connect to you

The idea is that Relay Application "C" will periodically try to connect to the server on Application B (once it works out where you are)
If it can connect (ie you have started Project2, which has the server)
Relay Application "C" will then connect to the Server on network A, and relay what you type on Application B to Server A, and the responses back to Application B

like I said, it's ugly, but it does work
0
 
LVL 4

Expert Comment

by:LMuadDIb
ID: 16908616
to be honest I was thinking it was gonna be used for something illegal...a backdoor

thats why I didnt give much info in my first response...  =)
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16908646
hmm, maybe. I see he has asked this before on 01/15/2006 and the question got deleted
maybe I should be more careful in the future :-)
still, it might be a fair question, I had to do a similar thing for my dsl at home until i got a router that supported NAT (tcp tho, not telnet)
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:plinho
ID: 16913088
I'm just studying delphi and now i'm interested in server-clients programs.... I never made a course so thats why I'm here... I'd like to know what is possible and what's not... there's no "hacker" objectives on it, by the way, I got "hacked" too many times to know that this kind of behavior is totally stupid...
PS: I have a "fixed ip" [dont know if it's the right name in english, my ip is always the same)
0
 

Author Comment

by:plinho
ID: 16979257
so...
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16980396
well.. my example above still holds true.. have you tried it out?
0
 

Author Comment

by:plinho
ID: 17014956
I just didn't understand this part "you could use 1 line in a webpage if it comes to it".... What do you mean?
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17015148
it doesn't matter, since you have a fixed IP. if you didn't though, you could have potentially uploaded it to 1 of the free webservers around the place, so you could "download" the ip as a webpage from elsewhere. But not needed for you.

Typically, a client connects to a server, and then sends commands to the server. There are some implementations of a client-server relationship where the client connects, and the server issues the commands, but it would have to be a specific case and designed that way
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now