| View previous topic :: View next topic |
| Author |
Message |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Jun 14, 2004 6:28 pm Post subject: Forcing Windows reboot |
|
|
Hi,
I have a program that downloads a small file from my website.
If the download doesn't succeed I know my webserver is down and the program will reboot Windows.
Unfortunately the webserver (LanSuite) displays an error message after some hack-attempts and gets stuck. The only way to enable things is by maually clicking OK in the error message and rebooting Windows after that.
I cannot get my program to reboot Windows when this error message is on screen. I can see from my log that the program recognises the sutuation every 15 minutes and writes a line in the log file, but somehow the reboot will not succeed.
For the reboot I use EXITWIN FORCEREBOOT and before this I use KILLTASK to try and kill the Lansuite software and the RUN32DLL.EXE that (I think) is responsible for displaying the error message, but so far without any luck.
Does any of the VDS guru's has any tips on how I can force the error message out and reboot Windows? Unfortunately the error message window has the same title as the server softwares main screen so I don't think closing the error window will be easy, but I haven't tried that approach yet.
Jan Roza |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jun 14, 2004 6:45 pm Post subject: |
|
|
I would suggest that if you were forcing a restart of windows, to kill all
tasks and then try the restart command. Then this way there would be
nothing blocking the restart of windows.
Let me know if you want some example code. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Mon Jun 14, 2004 7:05 pm Post subject: |
|
|
The better option would be to reformat Windows to solve this problem - if possible.
Other than that you can check for the presence of the error dialog. Since you know the time when Windows is shutting down you can close all tasks open and then attempt a shutdown.
Your error message should then popup - since no other programs are open the error window should be the only one visible. Simply do a MOUSE click in VDS at the position of the button on their error message screen to force the reboot.
But again I'd say try to fix the problem with Windows first. It really sounds like a problem with the application rather than Windows - it sounds as if the program does not respond to the WM_QUERYENDSESSION api sent to it by Windows and is not shutting down - thus causing Windows to attempt a forced shutdown/termination of the app to complete the reboot cycle. |
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Jun 14, 2004 7:08 pm Post subject: |
|
|
Killing all tasks would be fine since the server needs to rebooted anyway.
I presume you'll use LIST TASKLIST for that but an example is always welcome.
I really hope this will work because it really looks as if the error message of Lansuite is blocking everything I try untill the message is answered by clicking OK.
Thanks for the speedy answer by the way....... this looks like instant replying. What a service  |
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Jun 14, 2004 7:24 pm Post subject: |
|
|
Hi Prakash
You are right it isn't a Windows problem but a problem with Lansuite.
When a hacker sends it some '<E:> DoHTTP-xxxxx' commands the Webprox.dll of that applications goes into the error message.
To make sure my website is never offline longer than 15 minutes I scheduled the VDS program to download the testfile every 15 minutes and take action when the download fails.
The MOUSECLICK option might be a good idea as well, but I will have to wait for a hacker to attack when I'm home so I can try and figure out the position of the OK button. Maybe sending an Enter keystroke to that window might have the same effect? The minute the error window is closed my vds program can reboot Windows (as I found out when I clicked the OK buton when the vds program was about to make a scheduled appaerance) |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jun 14, 2004 8:20 pm Post subject: |
|
|
Are you saying that your server crashes because it has a vulnerability
that hangs the server? If so, I would highly recommend upgrading to
the latest version.
P.S. I will post example code in a few minutes. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Jun 14, 2004 8:49 pm Post subject: |
|
|
That's the sad thing in the whole story ........ I have the latest version of Lansuite which in itself is a wonderful (5-users free) package that contains a webserver, faxserver, firewall, mailserver, proxyserver all in one program. It performs really well the only glitch I have had in the almost two years I use it now is the sometime failing webprox.dll. If they can solve that (as they promised) in the next update I'm a very happy user.
Lucky for me the form of attack that brings down the dll are not very common, but even once a week or every other week is too much. And I want to make sure the server is operatable 24 hours a day so that's why I made this test program that reboots the server if things get out of hand. |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Mon Jun 14, 2004 8:55 pm Post subject: |
|
|
| I think sending the keystroke ENTER more than likely should close the error message instantly. Otherise you can try to send a keystroke - TAB it selects the button, then send the keystroke ENTER or the SPACEBAR key to do the closing. |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jun 14, 2004 10:12 pm Post subject: |
|
|
Here's some code that should work - I'm writing it off the top of my head,
so I can't guarantee it will work.
| Code: | # kill all tasks
list create,1
list tasklist,1,I
%x = 0
repeat
killtask @item(1,%x)
%x = @succ(%x)
until @equal(%x,@count(1))
list close,1
info Done.
exit |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Jun 14, 2004 10:29 pm Post subject: |
|
|
Thanks FF!
I gamble on the ENTER keystroke solution first so I changed my program and put it on the server. So now I have to wait until some culprit strikes again until I know if the solution works. When not than your LIST KILLTASK solution will be implemented and tried.
Wouldn't life be heaven if all those idiots used internet as it was intended
I'll post any future developments as and when they occur.
Thanks for your time! |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jun 14, 2004 11:30 pm Post subject: |
|
|
Glad to help.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
|