Jump to content
Sign in to follow this  
andyvl

help requested

Recommended Posts

andyvl

I need to make a service, that constanly checks a few things

- white/blacklist of services, applications and windows (works fine)

- check all open networkconnections (regulary) (ftp, http and telnet need to be turned off/blocked)

- client for microsoft and file and print sharing need to be turned off on all NIC's

(reason for script: restrict rights on computer during examination)

I know there are other ways, but this need to be done via autoIt scripting

For the last two I have no idea how to start. (for the first one I needed a full day to complete. Major reason was that I wasn't able to kill all processes.

But I finally managed to do it via taskkill command.

So any help on turning off 'client for microsoft' and 'file and printersharing' on all NIC's

and

help on create the port monitor would be highly appreciated.

Share this post


Link to post
Share on other sites
erebus

- Instead of 'taskkill' which is an external command, try these native AU3 functions (check the helpfile): ProcessClose, WinClose, WinExists. You can achieve much better results with these. If you also want to check the state of Windows services, you can do so by reading some registry keys (I have somewhere such a code that I wrote in the past, I'll try to find it and paste an example for you).

- I didn't understand quite well what you want to do with the network services. If you want to check if a net service is listening (like HTTP in port 80), try the TCP/UDP functions in AU3 to see if they accept connection on their ports. To disable them, you have to close the service, or firewall the port.

- Try to google this - I'm sure you will find a way to do it via commands.

Hope these help,

Share this post


Link to post
Share on other sites
andyvl

- Instead of 'taskkill' which is an external command, try these native AU3 functions (check the helpfile): ProcessClose, WinClose, WinExists. You can achieve much better results with these. If you also want to check the state of Windows services, you can do so by reading some registry keys (I have somewhere such a code that I wrote in the past, I'll try to find it and paste an example for you).

- I didn't understand quite well what you want to do with the network services. If you want to check if a net service is listening (like HTTP in port 80), try the TCP/UDP functions in AU3 to see if they accept connection on their ports. To disable them, you have to close the service, or firewall the port.

- Try to google this - I'm sure you will find a way to do it via commands.

Hope these help,

I have used processclose. But problem was that a lot of processes didn't close. And keep in mind, this is to restrict the rights of students during their examinations. So the process is going to run as a service. But even then, a lot of the processes weren't killed. With the taskkill It worked great.

(although I need to keep in mind, that when a computer on wich this is being deployed not has this command available, the script don't work.

But, I have checked that, and all computers on which this is going to run have taskkill available :)

Windows I close indeed with winclose.

for the services I use the ServiceControl.au3 library I have found in one of the toppics here (_stopservice($servicename))

for the ports it is indeed listening. Just need to check all "standard" ports and log if they are open or not.

Students need to be able to access the LAN, but FTP, HTTP, telnet,... ports need to be closed at the beginning of a session

and being monitored (listening) periodicly during this session.

For the network settings.

You can check/uncheck "client for microsoft" and "file and printer sharing" on ALL nics of the computer.

So first I need to retrieve a list of all networkcard (all types[wired, wireless, 1394 connection,...)

then for each nic I need to see if those 2 'options' are available and if active, turn them off.

I'm going to have a look at the possibilities and functionalities of the tcp/udp functions as you said. (but help is still welcome)

For the last part (networksettings) I have no idea how to do this.

Share this post


Link to post
Share on other sites
andyvl

ok, the port listening and blocking I also managed to do :)

I based myself on firewall script of Jokke

But the last part (NIC settings)I don't heaven know how to start. So any help on this is appreciated.

How it's done doesn't mather (as long as it is via autoIt script)

It is important that user is not aware of this changes. (so opening the nic properties window checking/changing and closing the window is not an option I'm affraid.

So I need a way to check all options of a NIC and turn off the client for microsoft and print and file sharing.

any suggestions, examples, scripts,...?

I'm really stuck at this.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×