[问题]如何禁止一个程序访问网络

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
回复
Joshua_Zhan
帖子: 155
注册时间: 2008-01-04 20:57

[问题]如何禁止一个程序访问网络

#1

帖子 Joshua_Zhan » 2008-01-28 17:34

rt
Joshua_Zhan
帖子: 155
注册时间: 2008-01-04 20:57

#2

帖子 Joshua_Zhan » 2008-02-20 20:31

自己顶一下,难道真的没有办法吗
头像
iblicf
帖子: 3766
注册时间: 2007-01-15 17:15

#3

帖子 iblicf » 2008-02-20 20:35

好问题,值得讨论,^^ , 封锁端口倒是可以实现,。。。 我想,可以设一个单独的用户/组,,用户禁止访问 (不属于netdev 组 ) , 程序以这个用户的 id 执行
Joshua_Zhan
帖子: 155
注册时间: 2008-01-04 20:57

#4

帖子 Joshua_Zhan » 2008-02-21 18:47

好复杂,ubuntu下要是有一些专业一些的防火墙就好了 ,这些功能在win下的很多防火墙都能实现
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#5

帖子 BigSnake.NET » 2008-02-21 19:18

Joshua_Zhan 写了:好复杂,ubuntu下要是有一些专业一些的防火墙就好了 ,这些功能在win下的很多防火墙都能实现
两个防火墙不同概念..
Linux下的防火墙是控制通信的, 例如Linux做网关, 控制两边的通信
Win下的是控制本机程序访问网络的
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
Joshua_Zhan
帖子: 155
注册时间: 2008-01-04 20:57

#6

帖子 Joshua_Zhan » 2008-02-24 16:37

原来是这样,一直没有注意到两者的差别

但是到底有没有办法禁止一个程序访问网络呢
头像
iblicf
帖子: 3766
注册时间: 2007-01-15 17:15

#7

帖子 iblicf » 2008-02-24 17:15

反过来想,可以允许开几个端口,80/21 之类的,这样同样达到阻止其他程序访问的效果 , iptables 可以实现,linux 下也有很多防火墙,应该也有基于 application forbid 而不是 socked ... 比如

TuxGuardian
http://tuxguardian.sourceforge.net/
----------------------------------------------------------
Features

* Detects unauthorized applications trying to act like a client or a server;
* Operates with or without user intervention;
* Verifies the applications' integrity so that maliciously modified software won't be able to send or receive data through the network;
* Uses a three-layered architecture of independent modules, which eases the task of addings new features and functionality;


没试过, apt-cache search firewall 挨个试试 .. 还有这些

[iblicf@myarch ben]$ sudo pacman -Ss firewall
extra/firestarter 1.0.3-7
A frontend for the ip-tables netfilter, a kernel based firewall.
extra/fwbuilder 2.1.14-2
Object-oriented GUI and set of compilers for various firewall platforms
extra/fwlogwatch 1.1-1
A packet filter/firewall/IDS log analyzer
extra/kmyfirewall 1.0.1-2
A (almost) complete graphical interface to the IPTables command line program
that configures the fire walling functionality
extra/xorg-xfwp 1.0.1-2
X FireWall Proxy
community/cutter 1.03-1
TCP/IP Connection cutting on Linux Firewalls and Routers
community/guarddog 2.6.0-2
Guarddog is a firewall configuration utility for Linux systems.
community/shorewall 4.0.6-1
An iptables-based firewall for Linux systems
community/shorewall-perl 4.0.5-1
perl compiler for shorewall firewall
community/your-freedom 20071031-1
Your Freedom is a service to do two things: Bypass Firewalls, Proxies and
content Filters and stay anonymous while surfing, playing and downloading
Joshua_Zhan
帖子: 155
注册时间: 2008-01-04 20:57

#8

帖子 Joshua_Zhan » 2008-02-25 21:58

谢谢了,有空我试一下
ak74
帖子: 82
注册时间: 2006-05-20 0:41

#9

帖子 ak74 » 2008-03-09 3:20

楼主这样的问题根本就无法回答!
你是要禁止本机程序访问网络?禁止LAN中的程序通过Linux Box访问网络?还是禁止某个引用程序通过Linux Box访问你的LAN?!……等等。
提问都如此漫不经心,回答问题的人该如何对待?!

假设你要阻止LAN中的某些程序访问网络。例如屏蔽QQ或者p2p软件。你可以实用含有layer 7功能的防火墙。比如iptables+layer7。
基本上是3个步骤:
1、为kernel打补丁
2、为iptables打补丁
3、配置规则和写控制协议脚本
相关代码可在www.kernel.org和netfilter.org找到。值得注意的是,控制并非100%可靠。有工作的非常好的,也有工作的非常差的。取决于你需要控制的软件本身的情况。
Joshua_Zhan
帖子: 155
注册时间: 2008-01-04 20:57

#10

帖子 Joshua_Zhan » 2008-03-12 13:02

谢谢九楼的ak74,当时我只是想禁止自己电脑里面的一个应用程序访问网络,不知道该怎么弄所以才发帖问大伙的,对于你说的那几种情况的差别我当时真的没有注意到,下次发帖时我会注意把情况说清楚的,以免引起误解,同时也谢谢大家的回答。
上次由 Joshua_Zhan 在 2008-03-12 13:10,总共编辑 1 次。
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#11

帖子 BigSnake.NET » 2008-03-12 13:06

LZ 就是7楼那意思
不过那个软件貌似很旧了
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
回复