Jump to content

Launching programs on remote computers


Micah C

Recommended Posts

Dear Hak5 Community,

I am looking for a way to execute and stop programs on a computer over my LAN. something really simple. I was hoping that I could execute it through a VB.NET 2008 program. I need to execute this batch file:

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

Any help is greatly appreciated.

Link to comment
Share on other sites

Dear Hak5 Community,

I am looking for a way to execute and stop programs on a computer over my LAN. something really simple. I was hoping that I could execute it through a VB.NET 2008 program. I need to execute this batch file:

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

Any help is greatly appreciated.

if you are on a windows domain you can pass the script through the group policy that computer belongs to... if you are not on a domain then your best bet is to copy the script to the computer and telnet or ssh into it and run the script.

another option is using one of the sysinternals tools like psexec to remotly run a command over the network. Sometimes what I will do is use psexec to spawn a remote command shell which is a little more secure then enabling telnet....

Link to comment
Share on other sites

Thanks X3N i have found psexce to be a very useful tool for executing and managing remote files. Is it possible to pass this command through VB.NET 2008 with a button control?

Command to be passed with VB.NET 2008:

psexec \\Work1 program "C:\Myprogram.exe"

Any Help is greatly appreciated,

Micah C

Link to comment
Share on other sites

Thanks X3N i have found psexce to be a very useful tool for executing and managing remote files. Is it possible to pass this command through VB.NET 2008 with a button control?

Command to be passed with VB.NET 2008:

psexec \\Work1 program "C:\Myprogram.exe"

Any Help is greatly appreciated,

Micah C

it might be possible but kind of redundant... what is the enviroment you are trying to use this in? you could just write a wrapper in vb for psexec i prefer autoIT to vb and theres a few wrappers on the forums for autoit...

Why do you want to use VB?

Link to comment
Share on other sites

The reason I would like to use vb.net 2008 1. because I know that language best 2. is because the users that will be using this program are not very computer savvy. I was hoping to have a nice GUI so that there is no confusion between the other users. The main goal of this program is to create a beeper so that a family member in one room can simply "beep" me indicating that that user needs assistance. Originally i tried using sockets in VB. I am not very experienced with this so i gave that idea up and moved on to something like we have here.

Any ideas?,

Micah C

Link to comment
Share on other sites

The reason I would like to use vb.net 2008 1. because I know that language best 2. is because the users that will be using this program are not very computer savvy. I was hoping to have a nice GUI so that there is no confusion between the other users. The main goal of this program is to create a beeper so that a family member in one room can simply "beep" me indicating that that user needs assistance. Originally i tried using sockets in VB. I am not very experienced with this so i gave that idea up and moved on to something like we have here.

Any ideas?,

Micah C

what exactly are you trying to do here? what was that script supposed to do?

Link to comment
Share on other sites

what exactly are you trying to do here? what was that script supposed to do?

The batch script simply creates a beeping sound. Try it out. All i wanted to do is allow one user to click a button on a vb.net form which would execute this script on my computer or vise versa alerting me that a user needs assistance. Does that make sense? ill try to re - explain if it doesn't. Any ideas? remember the users are not computer savvy so something with a GUI interface would be helpful. Thanks for your help so far. I know im a noob @ this sort of thing. Am i just making this harder than it needs to be?

Link to comment
Share on other sites

The batch script simply creates a beeping sound. Try it out. All i wanted to do is allow one user to click a button on a vb.net form which would execute this script on my computer or vise versa alerting me that a user needs assistance. Does that make sense? ill try to re - explain if it doesn't. Any ideas? remember the users are not computer savvy so something with a GUI interface would be helpful. Thanks for your help so far. I know im a noob @ this sort of thing. Am i just making this harder than it needs to be?

soudns like your better off using an instant messenger program... and if your in the same house you might as well use an intercom....

the problem i dont like with what your trying to do is that you really dont want people having access to your computer like that... remote command execution via a button sounds pretty insecure to me.

Link to comment
Share on other sites

soudns like your better off using an instant messenger program... and if your in the same house you might as well use an intercom....

the problem i dont like with what your trying to do is that you really dont want people having access to your computer like that... remote command execution via a button sounds pretty insecure to me.

The people in my house can be trusted and wouldn't know where the heck to start with hacking me. I guess I could understand your concern with security. The problem with using an instant messenger program is that the user might not always be by his/ her computer but would be in the same room. Yeah, i suppose an intercom might be an idea but that's really not an option. Ill just try to figure it out on my own. I think you have given me a good start especially with the psexec tool. I might just give this idea up and try something else. Unless you know how to use sockets in VB.NET 2008 to create a messenger program...

Thanks for all of your help,

Micah C

Link to comment
Share on other sites

Hey everyone,

I am very excited that I have finished my program. I have used the psexec tool and VB.NET 2008 to create a GUI that allows a user in one room to get a hold of me by making my computer beep. I wanted to use a GUI interface because the users weren't very computer savvy and I thought a nice lite GUI would just make things simpler. When the user clicks the button provided on the form VB runs this file ( Shell("C:\Beeper\beepexecutor.bat") ) the beep file contains the psexec.exe file and the beepexecutorfile.bat file the beepexecutorfile.bat has this code which executes the beeping sound on a local computer.

Thanks for all of your help. As for sparda, I don't think its a very stupid idea.

C:\Beeper.bat

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE
help 
cls

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE
help 
cls

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE
help 
cls


::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE
help 
cls


::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 1000 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo 1
>> d.d echo 1
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

C:\Beeper\beepexecutor.bat

cd C:\Beeper
psexec \\Work1 -c C:\Beeper.bat

Visual Basic 2008 code for button click:

Shell("C:\Beeper\beepexecutor.bat")

Thanks again for all of your help.

Link to comment
Share on other sites

The people in my house can be trusted and wouldn't know where the heck to start with hacking me. I guess I could understand your concern with security. The problem with using an instant messenger program is that the user might not always be by his/ her computer but would be in the same room. Yeah, i suppose an intercom might be an idea but that's really not an option. Ill just try to figure it out on my own. I think you have given me a good start especially with the psexec tool. I might just give this idea up and try something else. Unless you know how to use sockets in VB.NET 2008 to create a messenger program...

Thanks for all of your help,

Micah C

first download autoIT then paste this into a txt file called beepstart.au3

$cmd = "psexec \\testmachine -u DOMAIN\USER -p PASSWORD -c beep.exe"
Run($cmd)

make sure to change the machine and password part to match your machine.

Then in another file called beep.au3 paste this

Beep()

Compile the beep.au3 to an exe

now all you have to do is double click the beep.au3 or you can compile it to an exe as well. either way you could just make a shortcut for whoeveer to click on in order to make your computer beep.

Link to comment
Share on other sites

I will defiantly check in to autoIT later on today. Thanks for the input. Doing something like this could lower down the amount of files laying around. It would also be easier to execute from VB. Although if i could compile the .au3 file there really would be no need to use Visual basic. Thanks again. Ill get back to ya tomorrow sometime to tell u if this worked or not.

Link to comment
Share on other sites

OK, so i downloaded autoIT and created these two files and compiled them: beep.exe and beepstart.exe It seemed to work fine on my machine but i realized that the command beep simply plays an audio file. My problem here is that the computer that i need to run this on doesnt have speakers. ( Will never have them. Broken :( ) The nice thing about my batch script is that it makes the computers internal system speaker beep. I like autoIT and I would like to use this in the development of my program. Is there a way for beep.exe to have this batch code in it?

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE
help
cls

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE
help
cls

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE
help
cls


::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE
help
cls


::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 100 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

::== beep.bat
@echo off

> d.d echo e 1000 07
>> d.d echo n 07.bin
>> d.d echo rcx
>> d.d echo 1
>> d.d echo 1
>> d.d echo 1
>> d.d echo 1
>> d.d echo w
>> d.d echo q
debug < d.d > nul
copy 07.bin con > nul
del d.d
del 07.bin
::== DONE

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...