Jump to content

Ports


Recommended Posts

I'm working on making a server package similar to xampp, and I need to open ports, without having to tell them how to do it, Im gonna offer a option that opens the ports for them. Does anyone know how to open ports?(and what I mean is, do you know how to open ports with autoit)

Edited by CyberAssassin
Link to comment
Share on other sites

Hi.

I'm working on making a server package similar to xampp, and I need to open ports, without having to tell them how to do it, Im gonna offer a option that opens the ports for them. Does anyone know how to open ports?(and what I mean is, do you know how to open ports with autoit)

I assume, your question is about how to put in a firewall exception to allow INbound traffic for a certain TCP port?

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

@all

MAybe this can get you going.

;Enable Port
Dim $objPort

$objPort = ObjCreate("HNetCfg.FwOpenPort")

$objPort.Name = "DCOM"
$objPort.Port = 888
$objPort.Scope = "NET_FW_SCOPE_LOCAL_SUBNET"
$objPort.Protocol = "NET_FW_IP_PROTOCOL_TCP"
$objPort.Enabled = True

$objProfile.GloballyOpenPorts.Add ($objPort)

regards

ptrex

Link to comment
Share on other sites

@SkinnyWhiteGuy

I was to quickly forgot to copy some lines ?!

Const $NET_FW_SCOPE_LOCAL_SUBNET = 1
Const $NET_FW_IP_PROTOCOL_TCP = 6
;Enable Port
Dim $objPort
$objFirewall = ObjCreate("HNetCfg.FwMgr")
$objProfile = $objFirewall.LocalPolicy.CurrentProfile
$objPort = ObjCreate("HNetCfg.FwOpenPort")

$objPort.Name = "DCOM"
$objPort.Port = 888
$objPort.Scope = $NET_FW_SCOPE_LOCAL_SUBNET
$objPort.Protocol = $NET_FW_IP_PROTOCOL_TCP
$objPort.Enabled = True

$objProfile.GloballyOpenPorts.Add ($objPort)

regards,

ptrex

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...