{"id":1049,"date":"2011-12-21T11:17:35","date_gmt":"2011-12-21T09:17:35","guid":{"rendered":"http:\/\/blog.sfsoft.it\/?p=1049"},"modified":"2011-12-21T11:17:35","modified_gmt":"2011-12-21T09:17:35","slug":"chiudere-una-connessione-tcp-aperta-su-ubuntu","status":"publish","type":"post","link":"http:\/\/www.sfsoft.it\/blog\/2011\/12\/21\/chiudere-una-connessione-tcp-aperta-su-ubuntu\/","title":{"rendered":"Chiudere una connessione TCP aperta su Ubuntu"},"content":{"rendered":"<p>Nel caso volessimo chiudere o buttare gi\u00f9 una connessione esistente <em>TCP<\/em> alla nostra macchina possiamo usare due strade.<\/p>\n<p>La prima \u00e8 l&#8217;utility <em>tcpkill<\/em> presente nel pacchetto <em>dsniff<\/em> la seconda l&#8217;utility <em>cutter<\/em> che per\u00f2 \u00e8 usata principalmente su macchina che fanno da <em>router<\/em> tramite <em>iptables<\/em>.<\/p>\n<p>Nel caso di <em>tcpkill<\/em>, installiamo il pacchetto se non lo abbiamo gi\u00e0:<\/p>\n<pre lang=\"bash\">sudo apt-get install dsniff<\/pre>\n<p>Ad esempio vogliamo chiudere tutte le connessioni sulla porta 443:<\/p>\n<pre lang=\"bash\">sudo tcpkill port 443<\/pre>\n<p>O provenienti da un <em>IP<\/em> specifico:<\/p>\n<pre lang=\"bash\">sudo tcpkill host 192.168.1.110<\/pre>\n<p>Altre informazioni su <em>tcpkill<\/em> le trovate su questo articolo: <a href=\"http:\/\/www.cyberciti.biz\/howto\/question\/linux\/kill-tcp-connection-using-linux-netstat.php\" target=\"_blank\">http:\/\/www.cyberciti.biz\/howto\/question\/linux\/kill-tcp-connection-using-linux-netstat.php<\/a><\/p>\n<p>Il secondo caso \u00e8 usando <em>cutter<\/em>, anche qui installiamolo prima:<\/p>\n<pre lang=\"bash\">sudo apt-get install cutter<\/pre>\n<p>Ad esempio per chiudere tutte le connessioni sulla porta 22 da un <em>IP<\/em> specifico:<\/p>\n<pre lang=\"bash\">sudo cutter 192.168.1.110 22<\/pre>\n<p>Altre informazioni su <em>cutter<\/em> le trovate su questo articolo: <a href=\"http:\/\/www.cyberciti.biz\/tips\/cutting-the-tcpip-network-connection-with-cutter.html\" target=\"_blank\">http:\/\/www.cyberciti.biz\/tips\/cutting-the-tcpip-network-connection-with-cutter.html<\/a><\/p>\n<p>Per sapere l&#8217;elenco delle connessioni attive da chiudere basta usare <em>netstat<\/em> o <em>tcpdump<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nel caso volessimo chiudere o buttare gi\u00f9 una connessione esistente TCP alla nostra macchina possiamo usare due strade. La prima \u00e8 l&#8217;utility tcpkill presente nel pacchetto dsniff la seconda l&#8217;utility cutter che per\u00f2 \u00e8 usata principalmente su macchina che fanno da router tramite iptables. Nel caso di tcpkill, installiamo il pacchetto se non lo abbiamo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[15,3,23],"tags":[16,8,20,70,5],"_links":{"self":[{"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/posts\/1049"}],"collection":[{"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/comments?post=1049"}],"version-history":[{"count":1,"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/posts\/1049\/revisions"}],"predecessor-version":[{"id":1050,"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/posts\/1049\/revisions\/1050"}],"wp:attachment":[{"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/media?parent=1049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/categories?post=1049"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sfsoft.it\/blog\/wp-json\/wp\/v2\/tags?post=1049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}