Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

disconnecting clients from a network using code?

Options
  • 05-03-2004 4:30pm
    #1
    Registered Users Posts: 4,946 ✭✭✭


    Hey, im doing some reserch for my end of year project (finals) and im wondering is it possible to disconnect a person from a network using code? Im writing my project in Visual Basic, and im looking at doing a program for an internetcafe to hand up.

    Basicly i want a button that when i click it, it will disconnect a client machine. There will be a server (at the desk) and a client program. If its not possible to disconnect a machine from the network, is it possible to lock a client machine with VB code?

    Any insight to this program or other methods i can use to help it come along is very much welcome.

    Cheers

    reD.


Comments

  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    I'll write your end of year exam code, for a small fee.

    Use of VB/Windows is not part of the deal.


  • Registered Users Posts: 1,562 ✭✭✭Snaga


    Reddy, theres no need to disconnect it from the network, take a look in most net cafes and the software used consists of a program which sits on each client pc and one controlling piece of software on the pc behind the counter.

    From the controlling pc you can send traps (over the network! if you kick it off the network how do you get it back on remotely eh?) to the client pc's to 'lock' and 'unlock' them, and all of the processing (time unlocked, cost per hour etc..) is all done by the controlling software.

    By 'lock', I mean is do something which makes the pc unusable to a customer, you can do anything you want here depending on time/creativity, simply stop the keyoard from working, pop up a 'computer locked' notice on the screen and bobs your uncle.

    The methods to do this you would need to figure out by your self (They ARE possible to do in VB (as are most things given enough sadistic will!).


  • Registered Users Posts: 4,946 ✭✭✭red_ice


    No thanks mate :) id prefare to earn my own stripes (with a lil help) :p


  • Registered Users Posts: 4,946 ✭✭✭red_ice


    lol snag, i just realised that after i posted it :p

    Kinda the chicken and the egg situation! Yer, i know its possible to lock a machine and unlock it using a code... but that means id have to be infront of the machine when its running, im really lookin at how to do it remotly.

    Im also looking into using something like REAL Vnc with the project, but id really not be gaining much by using other peoples programs in mine!

    Cheers

    keep em comin :D


  • Registered Users Posts: 1,562 ✭✭✭Snaga


    its handy enough to be honest and you dont have to be in front of the client pc, head on to google and do some searches for VB tutorials with network code, youll get to see how to have your client apps listen on certain ports for connections.

    Youll also find code to open connections to other hosts on certain ports and how to send traffic from one to the other.

    Its easy and thats all Im telling you and to be honest all you should need. Simply write your operating code around sending messages from the controlling machine to 'lock' and 'unlock' the pc's via this traffic. (for extra points you can secure it up a bit so its not so easily abused by joe Hacker on pc 14 whos been on for the last 4 hours and owes us 50cent.....)


  • Advertisement
  • Registered Users Posts: 1,391 ✭✭✭fatherdougalmag


    You could probably programmatically disable the network device (as if through Device Mangler). There's a sample application done by Microsoft called devcon. It's in C though so you'd need to do some work :)

    In a nutshell you tell the device manager API to change the state to DICS_DISABLE. Have a look at SetupDiChangeState, SetupDiSetClassInstallParams and SetupDiCallClassInstaller on MSDN.

    The only problem I foresee is to do with privileges. You'd probably need to be an admin to do that sort of stuff. Yep. Just tried it there. You need to be an admin (2000/XP) to doing anything.

    Well a rather interesting thing to do would be to run a process in the background and when time's up just pop up a full screen size, unsizable, unkillable dialog saying that time's up!


  • Registered Users Posts: 4,946 ✭✭✭red_ice


    excellent!

    cheers


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    NET SEND /DOMAIN:machinename "GET OFF THE GODDAM NETWORK YOU MONG!"


  • Registered Users Posts: 1,391 ✭✭✭fatherdougalmag


    Of course, if it was a Monty Python themed Internet cafe you could always just go over (dressed in armour of course) and hit them with a plastic (or real) dead chicken.


  • Registered Users Posts: 5,335 ✭✭✭Cake Fiend


    I think you're thinking about this the wrong way - as previously mentioned in the thread, assuming you'll need to re-enable the target computer later, you won't want to fully disconnect the machine from the network. You could possibly restrict all traffic to and from the machine bar on the particular port your client/server software used for communication, but the PC itself would still be usable (games, word processing, etc).
    Originally posted by fatherdougalmag
    Well a rather interesting thing to do would be to run a process in the background and when time's up just pop up a full screen size, unsizable, unkillable dialog saying that time's up!

    This is pretty much how any internet cafe management software I've seen works; this is more like what you should be aiming to do. Or, as Snaga mentioned, figure out a way to disable the keyboard and mouse on the target machine. One way or another, you're going to have to have client software running on the target.


  • Advertisement
  • Registered Users Posts: 32,417 ✭✭✭✭watty


    1) Remote Disconnect using code depends on:
    a) Having a remote client program running
    b) Actual programming depends on OS and Network type.

    2) Why would you want to?
    a) How would you remotely re-connect if truely disconnected.
    b) If using TCP/IP, then the Web proxy, mail proxy/server etc simply blocks all access from that workstation till you re-enable. The "server" end can be NT/XP/2000 or Linux or Sun or whatever the principle is the same. Even with NETBEUI and netbios names instead of TCP/IP the same idea applies.

    3) ANYTHING (security wise or costing or access) that requires ACTUAL remote client on the workstation is a brain dead concept. PC Anywhere, XP Remote help and MS System Management Server are examples of "remote control". If possible I always disable any remote control and don't install PC Anywhere / SMS as they create so many problems. Where PC Anywhre is needed on a office, it is installed on a dedicated PC not used by users. The only time I did MS SMS was for a network with 450 PCs that needed remote upgrade and install of software regularly (Not fun to do manually on that many PCs!). But even this can be avoided by a manadory logon script batch file that by default does nothing unless an upgrade is needed (You can have a install script for MS Office and many other applications that can be invoked by a simple command line).


  • Registered Users Posts: 1,562 ✭✭✭Snaga


    Erm he is talking about a net cafe software suite where he needs to be able to enable/disable access to each pc with a mouse click from his comfy central machine at the main desk.

    This is not about giving an admin access to a machine to fix faults/upgrade software.


  • Registered Users Posts: 32,417 ✭✭✭✭watty


    Exactly. So no client software is required. It can all be done on the server.


  • Registered Users Posts: 4,946 ✭✭✭red_ice


    Originally posted by LurkingIcon
    Exactly. So no client software is required. It can all be done on the server.

    but i have to make this happen with software im writing. If i was to hand up an essay on how to do it with windows server or what not - my software grades would be less than the score id get for putting my name on it :p


  • Registered Users Posts: 1,562 ✭✭✭Snaga


    Originally posted by LurkingIcon
    Exactly. So no client software is required. It can all be done on the server.

    So the person on the pc loads up a single player game of c&c generals instead and has a blast while his usage isnt monitored?

    The solution has to disable access to the client PC, not just the usual services that you use in a netcafe such as web/mail/whatever usage.


  • Registered Users Posts: 32,417 ✭✭✭✭watty


    Originally posted by Snaga
    So the person on the pc loads up a single player game of c&c generals instead and has a blast while his usage isnt monitored?

    The solution has to disable access to the client PC, not just the usual services that you use in a netcafe such as web/mail/whatever usage.

    Logon in NT3.x, NT4, Win2K, WinXp is controlled by Server if the PC is a Domain Controller member.

    You can do a screen saver (even in VB) that simply invokes Log Out. Or Schedule Log off in an AT command in a server based login script (then no client SW needed). I'd have a Screen Saver that logs off and the AT command.

    Policies can prevent user changing screen saver or killing AT tasks.

    Then the user has to login.

    Which accounts allowed login and when is a standard Windows server thing.

    If you REALLY clever with SMB/Samba on Linux server, you can do all this with out an NT/Win2K/Win2003 Server.


  • Registered Users Posts: 32,417 ✭✭✭✭watty


    Sideways thought:
    Simple coin op meter/timer (cheap S/H) wired to Mouse and Keyboard Data out lines. No mouse / keyboard till another euro put in!


  • Registered Users Posts: 4,946 ✭✭✭red_ice


    right, ill update you all on the situation so far.

    ive worked on the client software and managed to get the machine to lock up, with the exception of alt+tabbing (not even, alt+f4 or ctrl+alt+del unlocks it). The use of a keyboard and mouse is fine, and the program takes up the full screen with no edging on it - superb!

    Ive used netsend for the program, which sends a message to the server and

    User : name has logged on with Password : password at <time> comes up on the server machine - excellent!

    Now - heres the part which im working on. id prefare not to use netsend as it means the person at the desk has to do some work; putting in the username and pw. Is there any thing i can look up that will send the user name and pw as a variable over a network?

    This way i can make the server software check the access DB on its own thus making the software run on its own steam.

    Cheers for all the help bits so far lads, its not lookin half bad atm


  • Registered Users Posts: 1,562 ✭✭✭Snaga


    Check google for 'tutorials' in 'visual basic' using 'sockets'.

    *cough*

    http://www.google.ie/search?q=tutorial+visual+basic+sockets&ie=UTF-8&oe=UTF-8&hl=en&meta=

    Should sort out the basics.


  • Registered Users Posts: 4,946 ✭✭✭red_ice


    savage cabbage :D


  • Advertisement
Advertisement