plz Help with OpenNetwokConnection()

Just starting out? Need help? Post your questions and find answers here.
Z_Exploder
User
User
Posts: 20
Joined: Wed Jul 06, 2005 7:51 am
Location: Armenia
Contact:

plz Help with OpenNetwokConnection()

Post by Z_Exploder »

I want to try to write some client/server app.
I wanna to install client(or server?) program to one comp. (for example in Cyber Cafe) and run server app at home ("remote acess").It will be like troyan,but when i tried to write client.hmm some problem.
how to know server address to use it in OpenNetwokConnection(IP,PORT)
how to get ip address (i dont wanna do it manualy-not best way),and which port is recomended to use ? (second question).

Sorry for my very bad english,i'm just waiting for your help,if anyone can,
send me example code (if you have written any client/server app).
Have a nice day.
MadMax
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Oct 06, 2003 11:56 am

Post by MadMax »

The proper way to do it, is manualy. Of course it can be done other ways, but it's difficult to imagine why one would need to control a remote machine this way unless of course you don't want the PC owner to know his computer is being remotely used.

These kind of programs can be potencialy used for ilegal activities, so if you do write an aplication of this sort, it should be totaly clear to the users what this program does and include all posible security meassures.

I'm sorry but this kind of post is like asking 'How can I get someone's frontdoor key without asking?'. :evil:
Z_Exploder
User
User
Posts: 20
Joined: Wed Jul 06, 2005 7:51 am
Location: Armenia
Contact:

Post by Z_Exploder »

"Of course it can be done other ways, but ..."
I'm interested by other ways (anybody knows how to do it ???)
Yes,i'm agree,it can be used to write harmfull programs,BUT imagine that situation:you have wrotten online game ,and you don't know ip adresses of other players,how to connect them to play game ? Of course ,if you have your own server (like icq :icq client connects to "login.icq.com",with port 5190 and ),but problem bigger-to create server like that (i dont know how to make server "welcome.Z_Exploder.net" :( for example). But i know,there must be way to do it (for example client can send ip address of connection by e-mail,and then you can use it in server ,but it's not best and fastest way,ip changes every time you are connecting)
and is here anybody know howto send e-mail (if no other way)
do not affraid,i'm not trying to write viruses and send them to you,its only
interesting,no one else have same problem
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Have made many network tools (server administration) for my own, remote access (or information gathering) partial remote access, etc... And I wont share anything because theres always an evil mind out there, which should be stabbed to death but thats my opinion, anyway I hate lamers, I hate kiddies trying to act the "hackz0r" and what not. Even if you say you will just make this for personal use.. I dont care, I just wanted to say it, sorry.

Use your mind, think.. how would you send your ip to somewhere and later gather that information - thats all Im going to tell you, its a pointer. and dont be mad at me..

Sure you wont use anything for bads, but theres always a stupid retarded reading all this threads I bet (no offence.. but there is always that kind of guys.. I call stupid retarded those who thinks they are so "cool" by developing a lame virus or trojan... most of this kiddies cant even drink their milk with out dropping 45% of it on the floor, but anyway they try to..).

Yes I got something against lame kids..


Anyway Im softened a little now,

1) server-side, get server's ip
2) from server, send ip to a remote machine (ftp?)

3) client-side, gather the damned IP from (ftp?)
4) connect..

5) I wont post anymore... hope thats enough for you- Please, and please, yes again, people, use your mind! its so simple, I know most of you are just starting - so I am on some subjects - again, PLEASE its about common sense most of the times... !

"I want my car keys, how do I get them!?"
- Go to the place you stored the keys and get them

See? that applies for your problem.

If client doesnt know servers ip and/or server doesnt know clients ip, then you cant go on, thats why you must deal with a solid, stable, hosting place where you can host your txt with the ip, and later retrieve it.


Thats all there is to say..! bye.
(to the others: I doubt he would develop a serious trojan if he asks something like this).


I might sound rude but hey, get the good side out of my posts, the bad side, trash it if you want. To me, its all good side, because even if its rude to you (shy...) It will help you, believe it or not. how? I wont be explaining now, maybe on next chapter, stay tunned.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Z_Exploder
User
User
Posts: 20
Joined: Wed Jul 06, 2005 7:51 am
Location: Armenia
Contact:

Post by Z_Exploder »

I'm not "cool" programmer (there are some people calling me "cool troyan writer"),i'm only beginner ,and I'm not going to developt any cool troyan_j_v5.0 ,ok ?Just leave me alone,instead of saying "stupid lammer"
But if anyone WANTS (!!!!!) to help me-tell,how to send IP address from server to client using FTP (there was reply) or e-mail
Thank you very much (and for critics too)
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

No one called you a stupid lammer, I didnt.. read again, I PMed you back, telling to not write with your head in hot.. just cool down and read twice please.

Let me ask you a couple of questions, this are not for annoying you, but for us, to know which kind of "level" you're in. To help us help you better, okey.

1) Are you a programmer? how many experience in this subject do you have?

2) Do you have basic knowledge of the windows api?

3) Will you cool down so we can help you?

4) Will you take most of my words friendly and not as a critic or kick in your butt?

5) How old are you? (you can answer or not... its just to know)


Cheers
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

Hey All,
I just want to say that this could be interesting for a lot of application I for example am developing an Instant Messenger like ICQ its not that advanced yet but hey its working and one can chat, add people, search them and even remove them from ones list. I also wrote the code for handling all the message windows. And its working...
But let me come to the POINT I want to get to. I did all this without knowing anything at the start it is my second application in PB but hey I am learnig by doing it isn´t that hard just think about it and do it.

Ok now let me say Something about the IP problem. One methjod which I think can´t be used for harmfull things is to go to dyndns.org get a dynamic dns for the server and that´s it.

@dagcrack: i think the biggest problem with the FTP method is to get the visible IP adress of the server its discussed in another thread too and I think they have no good solution for now.

www.komani.de home of KIM (german)
Z_Exploder
User
User
Posts: 20
Joined: Wed Jul 06, 2005 7:51 am
Location: Armenia
Contact:

Post by Z_Exploder »

I'm 16 years old.I dont know,can i be called programmer or not,but i have 2-3 (maybe 4) years
writed progs. (for teaching,not useful programs,sometimes for demonstrating in school ,no serios works).Yes i have some knowlages of win api.
But i have never worked with network,this is why i have so many questions.
Of course i can take your words friendly,i'm sorry,whole problem is my bad english-i have understood reply not right.
Now about main question.
Nobody answered me how to do that (send ip to mail or there are way better (what about FTP ,one said about this)).No i can't do it manualy every time (dynamic IP,it changes every time ).Maybe it will be
right to create web server (like login.icq.com),but i dont
know how .
Thanks,and one question too :maybe there are people speaking armenian (or russian),if yes,it will be easy to
me to speak those languages.
xgp
Enthusiast
Enthusiast
Posts: 128
Joined: Mon Jun 13, 2005 6:03 pm

Post by xgp »

Z_Exploder,
Some time ago, i managed to do a chat client to me and my friends, so we could talk in our own chat clients(we all love programming), our strategy was the following.
In a ftp i have 20 mb of space(my ISP, gave to any client). I use to download and send a file to there with my ip, so my friends, would only have to download it and, then they could know.
Of course this is not the best, way, but for us, i served.

Hope you understand.
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

Well my idea with dyndns.org is what you mean with a server like login.icq.com its just a dns (domain name (service)). Icq has a static domain which is linked to a static ip but the problem is that static IPs will cost you a few thousand dollars. So dyndns is the solution its a domain name like login.icq.com but its linked to a dynamic ip you have to get an acconunt (free) then you have to use a client programm or your router, it connects to a server which belongs to dyndns.org and tells your ip then any web client like a web browser or a chat can sue your dyndns domain name to connect to e.g. OpenNetworkConnection("myserver.dyndns.org",5565) its very easy to set up and works comfortable i also use it for my instant messenger server because we still not have a sponsor for the KIM so we haven´t got a real server (costs about 90 $ per month is always onlien and has a static ip)
bye Nik

hope i could help you if not i could ask a russian friend of mine to translate it.
Z_Exploder
User
User
Posts: 20
Joined: Wed Jul 06, 2005 7:51 am
Location: Armenia
Contact:

Post by Z_Exploder »

HI.Thanks for reply about dyndns.org,but I found armenian
site (visit it www.freenet.am),after registration (waiting 2 weeks!!! because registration does human operator)
i have 7mb of space there (to use FTP),and that is free (vithout any money)
After i tried to write program,which can connect to server (users.freenet.am ,port:21 (FTP))
Connectied succesfuly.After i tried to send commands:
USER username
PASS password
SYST
etc.
it's working,but there are problem with command PORT xxx,xxx,xxx,xxx,AAA,BBB
two upcased "AAA.BBB"-s is port ,lowcased- your ip.port is calculated this way :port=AAA*256+BBB
But i don't know,how server uses this ( without this LIST command is not working)
what i must to do ? connect second time with my ip and new port to server ?
What to do ?
And please,if you know other server commands,please give me the whole list of commands (with arguments and of course what action does everyone)
Thanks
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

I sent you an example by PM today morning... which sends a file to an FTP server, you can however send a string instead of a file too.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Z_Exploder
User
User
Posts: 20
Joined: Wed Jul 06, 2005 7:51 am
Location: Armenia
Contact:

Post by Z_Exploder »

Thanks,it's working fine,it's all i
needed.But i'm interested in server
commands (USER,PASS,SYST,LIST,..)
where can i find whole list with descriptions.
Thank you for example code.
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

Post by TerryHough »

problem with command PORT xxx,xxx,xxx,xxx,AAA,BBB
two upcased "AAA.BBB"-s is port ,lowcased- your ip.port is calculated this way :port=AAA*256+BBB
But i don't know,how server uses this
The PORT command tells the server the IP Address and port that the
client machine will be "listening" on to receive data from the server, ie.
the results of the LIST command (the desired directory listing) or a data
file that is to be "RETR"ieved.

If you do not issue the PORT command instructing the server, most
servers default to your connected IP address, port 20, and you are
responsible for "listening" on that port to receive data from the server.

Alternately, you may use the PASV command (which is really easier with
PB) to tell the server to enter the "passive mode". Then the server sends
you the IP Address and Port number that it will be "listening" on for you
to connect to and send/receive any data that results from the next
command you send on the servers's normal commuication channel
(usually Port 21).

I have recently posted code that handles both PASV and PORT methods in
the post "FTP for all PB OS's" in the Tips and Tricks section. See this post
viewtopic.php?t=12656
for lots of help. It is lengthy but has lots of good info on using PB to
handle FTP communications.

Or you can pick up the discussed FTP procedures and my example code at
http://elfecc.no-ip.info/purebasic#FTP_Library

That zip file also includes RFC959.txt which is a discussion of the FTP
protocol, commands, responses, etc.

Good luck,
Terry
Post Reply