Sign in to follow this  
Followers 0
Erik.

Block A Port

13 posts in this topic

Hello,

1)How can i make a program that can see what program what port use.

so i can see for example:

msn: port 5000

firefox:8080

How can i see what program uses what port

2) how to block a port so no data can be send?

and how to check if the ports realy blocked?


I little problem, hard to find and fix

Share this post


Link to post
Share on other sites



For #1, I'd use something like this

#include <Constants.au3>
    $netstat = Run(@ComSpec & " /c netstat -n -b", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    $line = StdoutRead($netstat)
$line = StringSplit($line, @LF)

Then do a bunch of String* Functions on it to retrieve the right values. To see the output just run cmd and type "netstat -n -b". I know this Isn't the best way, but it could work. Dont know about blocking a port... maybe just change firewall settings.

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

Hi,

The code you post does not work:(

A firewall is no option.

Does someone know a few lines that can block a port?


I little problem, hard to find and fix

Share this post


Link to post
Share on other sites

what os is this on jsut out of curiosity?


_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

i use Windows XP

Always:P

a simple program that can block a port from a pc.

Edited by Erik.

I little problem, hard to find and fix

Share this post


Link to post
Share on other sites

On the command line you should be able to block a port using

netsh firewall set portopening ALL 500 DISABLE

or something like that.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

The program is for school so i do not have any acess:P

i hope you will still help me:P

i want when i open the program and then a port get blocked.

When i close it the port will be open.

Does no one has a simple script to do i?


I little problem, hard to find and fix

Share this post


Link to post
Share on other sites

why not jsut do this

http://support.microsoft.com/kb/813878#E0RB0ACAAA

one time and then write a script to start and stop the service? Thatd propbably be easiest.


_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I will try i do not know if i have so many access

Do not understand that.

i will try but i do not know if it will work

i need to install something first

Edited by Erik.

I little problem, hard to find and fix

Share this post


Link to post
Share on other sites

The only script example in this entire thread will help you to see what is being used, but you have to output the data. He said as far as closing ports he doesnt know.

He didnt write an entire script for you, just a snippet to give you something to build on.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

CDkids script is cool, I added this if you don;t understand it:

#include <Constants.au3>
#include <array.au3>
$netstat = Run(@ComSpec & " /c netstat -n -b", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    $line = StdoutRead($netstat)
    ConsoleWrite($line)
$line = StringSplit($line, @LF)
_ArrayDisplay( $line, "Connections")

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Hi,

Is it possible to look at a port?

Can i make something that look at a port and when some data is comming in my keybord and mouse will be disabled?

The program will run when you start the pc.

The can see what you are doing at your pc so i can not check my mail anymore:(

The problem is that there always data send at that port to your pc and to the server

Is there a way that when there is nore data send ore comming in that my keybord and mouse will be blocked??

EDIT:

What means Warnngs at my profil at the site??

i see something that i do not see at other poeple

i see warning 0% but after it i see some bleu lines.

What does that means?

Edited by Erik.

I little problem, hard to find and fix

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  
Followers 0