Jump to content

Windows Firewall


Recommended Posts

i am a noob so just warning you. this is a simple program. i can get everything to work execpt my sleeps and sends. help please

;
; AutoIt Version: 3.0
; Language:    English
; Platform:    XP
; Author:        Rusty Shackleford (ake@hush.ai)
;
;
;
;



$answer = MsgBox(4, "Disable Windows Firewall", "Are you sure that you want to shut the Firewall off. This includes internet conection sharing")

If $answer = 7 Then
    MsgBox(0, "Disable Windows Firewall", "It was up to you. Have a Nice Day :)")
    Exit
EndIf

Run("cmd.exe")
WinWaitActive("cmd.exe")

Sleep(2000)
Send("net start{ENTER}")
Sleep(2000)
Send("net stop 'Windows Firewall/Internet Connection Sharing (ICS)'{ENTER}")
Sleep(5000)
Send( "exit{ENTER}")

; Finished!
Link to comment
Share on other sites

You can use ComSpec externally, rather then trying to automate it.

$answer = MsgBox(4, "Disable Windows Firewall", "Are you sure that you want to shut the Firewall off. This includes internet conection sharing")

If $answer = 7 Then
    MsgBox(0, "Disable Windows Firewall", "It was up to you. Have a Nice Day :)")
    Exit
EndIf

RunWait(@ComSpec & ' /c net stop SharedAccess', '', @SW_HIDE)

The service name is smaller also. Use SC Query at a command prompt to get service information.

:D

Link to comment
Share on other sites

You can use ComSpec externally, rather then trying to automate it.

$answer = MsgBox(4, "Disable Windows Firewall", "Are you sure that you want to shut the Firewall off. This includes internet conection sharing")

If $answer = 7 Then
    MsgBox(0, "Disable Windows Firewall", "It was up to you. Have a Nice Day :)")
    Exit
EndIf

RunWait(@ComSpec & ' /c net stop SharedAccess', '', @SW_HIDE)

The service name is smaller also. Use SC Query at a command prompt to get service information.

:D

i am noob and this doesn't help me because i don't understand it can you explain please

Link to comment
Share on other sites

The MsgBox code is yours.

The last line that I added is to just stop the Windows Firewall.

@ComSpec is the macro that has the fullpath to cmd.exe, Using the /c switch enables cmd.exe to enter commandline mode and will exit upon completion. SharedAccess is the service name for the Windows Firewall.

SC.exe could be used instead of Net Stop in the command and you could execute SC.exe directly without ComSpec.

What else do you want to know?

Link to comment
Share on other sites

The MsgBox code is yours.

The last line that I added is to just stop the Windows Firewall.

@ComSpec is the macro that has the fullpath to cmd.exe, Using the /c switch enables cmd.exe to enter commandline mode and will exit upon completion. SharedAccess is the service name for the Windows Firewall.

SC.exe could be used instead of Net Stop in the command and you could execute SC.exe directly without ComSpec.

What else do you want to know?

nuthing for this that is exactly what i needed to know
Link to comment
Share on other sites

Before anyone else offers help on this topic, you might want to look at the same poster's question in the IdeaLab forum:

http://www.autoitscript.com/forum/index.php?showtopic=27129

As you can see from this thread and that one, he wants to do two things: (1) turn off the Windows firewall and (2) change the user's password by directly accessing the registry.

The only possible purpose in doing this combination of things seems to be malicious - to gain full access to a user's system by turning off the firewall and changing the password.

The script posted above includes a "Do you want to turn off the firewall?" question, but that clearly could be removed in the actual script.

Perhaps the original poster would care to clarify what the purpose of his script might be?

Link to comment
Share on other sites

Before anyone else offers help on this topic, you might want to look at the same poster's question in the IdeaLab forum:

http://www.autoitscript.com/forum/index.php?showtopic=27129

As you can see from this thread and that one, he wants to do two things: (1) turn off the Windows firewall and (2) change the user's password by directly accessing the registry.

The only possible purpose in doing this combination of things seems to be malicious - to gain full access to a user's system by turning off the firewall and changing the password.

The script posted above includes a "Do you want to turn off the firewall?" question, but that clearly could be removed in the actual script.

Perhaps the original poster would care to clarify what the purpose of his script might be?

netsh firewall set opmode disable

Will disable the firewall to. Netsh is a nice tool to adjust firewall settings like opening ports etc and many other things.

Link to comment
Share on other sites

For some reason, this string just gives me the creeps. Its like I've seen this user before, just under a different handle......Maybe I'm just being paronoid.... :D

I think you're right: he's been around before. He's got a very individual way of not being able to say what he means.

Link to comment
Share on other sites

@ all the above

i am completly noob with any program languge.

i needed to make this script because my computer would freeze when i would try to disable it the normal way.

and i anit no hacker. don't want to be. and any one who makes a virus has too much time on thier hands. if your wondering about the other post.

i am a a+ certified tech.

so i figure why pay hundreds of dollars when i can make a program for free

Link to comment
Share on other sites

...i am completly noob with any program languge...

I assume that you only want to disable the firewall for a little while... then using the info posted above:

make a new text file on your desktop (or somewhere)

add this info to it:

netsh firewall set opmode disable
pause
netsh firewall set opmode enable
save and rename the file something.bat

When you run the bat file (double click on it), it will disable the firewall and pause - when you want it back on, just hit enter in the CMD window.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

I assume that you only want to disable the firewall for a little while... then using the info posted above:

make a new text file on your desktop (or somewhere)

add this info to it:

netsh firewall set opmode disable
pause
netsh firewall set opmode enable
save and rename the file something.bat

When you run the bat file (double click on it), it will disable the firewall and pause - when you want it back on, just hit enter in the CMD window.

thank you mhz for defending my actions.

@herewasplato

thanks but i want to disable it because i am using a completly different firewall and the windows one doesn't detect it as a firewall. and i use programs that the windows one blocks but my other one is totaly configurible so

but thx anyways

Link to comment
Share on other sites

Well, if you want to disable so the firewall service remains disabled, then set it via the registry.

RegWrite('HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess', 'Start', 'Reg_Dword', '0x00000004')

or I remember that SC.exe can do it also.

:D

Link to comment
Share on other sites

Sorry dude. Did not mean to offend. I hope the code issue your having works out. It looks like Plato's code should do the trick.

But the guy's explanation makes no sense.

Just think about it for a moment. He posts two requests in different forums. One is for a way to turn off the Windows firewall; the other is for a way to change a Windows password by directly manipulating the registry - in other words without asking the user to enter the password first.

There may not be a fire here, but there sure is plenty of smoke.

Link to comment
Share on other sites

But the guy's explanation makes no sense.

Just think about it for a moment. He posts two requests in different forums. One is for a way to turn off the Windows firewall; the other is for a way to change a Windows password by directly manipulating the registry - in other words without asking the user to enter the password first.

There may not be a fire here, but there sure is plenty of smoke.

i am completly noob with any program languge.

i needed to make this script because my computer would freeze when i would try to disable it the normal way.

and i anit no hacker. don't want to be. and any one who makes a virus has too much time on thier hands. if your wondering about the other post.

i am a a+ certified tech.

so i figure why pay hundreds of dollars when i can make a program for free

i want to disable it because i am using a completly different firewall and the windows one doesn't detect it as a firewall. and i use programs that the windows one blocks but my other one is totaly configurible so

u said this

change a Windows password by directly manipulating the registry

i said that i could be possible to access it through the registry

but there is one thing that i have learned through training for A+

don't f*** with the registry if your not sure what will happen

what could happen if you mess with the registry you could imput the wrong key value and totaly lock your self out or you could get the wrong key it self

and personaly

if you want to say something to me say it to my face etaoinshrdlu

Link to comment
Share on other sites

Hi

disabling firewall is harmfull for your pc u can simple add program using regkey like

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List", @ScriptFullPath, "REG_SZ", @ScriptFullPath&":*:Enabled:"&@ScriptName)
Link to comment
Share on other sites

Hi

disabling firewall is harmfull for your pc u can simple add program using regkey like

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List", @ScriptFullPath, "REG_SZ", @ScriptFullPath&":*:Enabled:"&@ScriptName)
how is it hramful to the pc

please explain

or give the url to where you recieved the information please

Link to comment
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
 Share

  • Recently Browsing   0 members

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