PDA

View Full Version : Bloccare internet alle applicazioni?


Braccop
25-06-2007, 18:37
sto usando ubuntu 7.04 da un po', e ora che ci penso, come si puo' fare sotto linux a bloccare l'accesso ad internet a determinate applicazioni?

anche app win32 che girano sotto wine...

su windows e' facilissimo, basta usare un personal firewall e via, ma su linux non ne ho davvero la piu' pallida idea

BlSabbatH
25-06-2007, 19:13
sto usando ubuntu 7.04 da un po', e ora che ci penso, come si puo' fare sotto linux a bloccare l'accesso ad internet a determinate applicazioni?

anche app win32 che girano sotto wine...

su windows e' facilissimo, basta usare un personal firewall e via, ma su linux non ne ho davvero la piu' pallida idea

usa firestarter.. non è un firewall ma è una gui che setta le impostazioni di iptables (il vero firewall) e non è come un firewall di winzozz che "blocca i programmi"... qui vedi le porte reali che si aprono

Braccop
25-06-2007, 19:21
si ho visto firestarter, ma a me serve un modo per bloccare la tale applicazione, non interi domini/indirizzi

Mr.Bano
25-06-2007, 23:48
Puoi sempre emulare un firewall windows :D
Comunque se è un applicazione di quelle standard blocchi solo la porta in base all' ip ed il gioco è fatto senza problemi.
Se poi non è così devi usare qualche regola un po' più specifica che sarà qualcosa tipo (molto tipo diciamo):
iptables -A OUTPUT -m owner --cmd-owner <NOME_PROGRAMMA> -j DROP (e blocchi la connessione ad un programma)
iptables -A OUTPUT -m owner --uid-owner <UTENTE> -j DROP (e dovresti segare giù tutta la roba di quell' utente)
Comunque per sicurezza è meglio che ti controlli il manuale di iptables...

W.S.
26-06-2007, 08:52
da man:

owner
This module attempts to match various characteristics of the packet
creator, for locally-generated packets. It is only valid in the OUTPUT
chain, and even this some packets (such as ICMP ping responses) may
have no owner, and hence never match.

--uid-owner userid
Matches if the packet was created by a process with the given
effective user id.

--gid-owner groupid
Matches if the packet was created by a process with the given
effective group id.

--pid-owner processid
Matches if the packet was created by a process with the given
process id.

(Please note: This option requires kernel support that might not
be available in official Linux kernel sources or Debian’s pack‐
aged Linux kernel sources. And if support for this option is
available for the specific Linux kernel source version, that
support might not be enabled in the current Linux kernel
binary.)

--sid-owner sessionid
Matches if the packet was created by a process in the given ses‐
sion group.

(Please note: This option requires kernel support that might not
be available in official Linux kernel sources or Debian’s pack‐
aged Linux kernel sources. And if support for this option is
available for the specific Linux kernel source version, that
support might not be enabled in the current Linux kernel
binary.)

--cmd-owner name
Matches if the packet was created by a process with the given
command name.

(Please note: This option requires kernel support that might not
be available in official Linux kernel sources or Debian’s pack‐
aged Linux kernel sources. And if support for this option is
available for the specific Linux kernel source version, that
support might not be enabled in the current Linux kernel
binary.)

NOTE: pid, sid and command matching are broken on SMP


La cosa migliore sarebbe usare le regole insieme a NFQUEUE per poter controllare i pacchetti come vogliamo in userspace (via netlink), in modo da non essere limitati dai parametri di owner.

Non conosco programmi che implementano questa cosa, me lo son scritto come test tempo fa ma è restato molto in test (al solito, una volta che vedo come funziona una cosa la pianto lì ;))