firewall

Is it possible to write a firewall in python?

安稳与你 提交于 2019-11-30 05:09:06
Is it possible to write a firewall in python? Say it would block all traffic? Jerub Yes, yes it is. I have some Python code that interacts with Linux iptables to perform firewalling duties, using nfqueue. I can use a rule in iptables that looks like: iptables -A INPUT -j NFQUEUE --queue-num 1 And then have some Python code that looks like: import nfqueue from dpkt import ip q = None def cb(dummy, payload): # make decision about if the packet should be allowed. in this case, drop everything: payload.set_verdict(nfqueue.NF_DROP) q = nfqueue.queue() q.open() q.bind() q.set_callback(cb) q.create

what url should I authorize to use pip behind a firewall?

偶尔善良 提交于 2019-11-30 03:13:35
问题 I have a server, onto which I want to use Python, that is behind a company firewall. I do not want to mess with it and the only thing I can do is to make a firewall exception for specific URL/domains. I also want to access packages located on PYPI, using pip or easy_install. Therefore, do you know which URL should I ask to be listed in the exception rules for the firewall, except *.pypi.python.org? 回答1: You need to open up your firewall to the download locations of any package you need to

My firewall is blocking network connections from the docker container to outside

给你一囗甜甜゛ 提交于 2019-11-30 01:28:18
For me this is a very standard setup, I had a ubuntu machine running docker and ufw as my firewall. If my firewall is enable the docker instances is unable to connect to outside $ docker run -i -t ubuntu /bin/bash WARNING: Docker detected local DNS server on resolv.conf. Using default external servers: [8.8.8.8 8.8.4.4] root@d300c5f17207:/# apt-get update Err http://archive.ubuntu.com precise InRelease 0% [Connecting to archive.ubuntu.com] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/InRelease W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg

How to bypass firewall and NAT with reverse SSH Tunnel

天大地大妈咪最大 提交于 2019-11-29 21:57:37
I'm trying to generate an SSH server in a machine behind a router. First I tried to bind the SSH to my public IP address: ssh -R 10002:localhost:22 <ip_address> Then I'm prompted with a password request, however my username password doesn't seem to work. Obviously I know my username password, so it seems to me that it's trying to authenticate in another computer under the same network. Any suggestions how to fix this? It would also help me any alternative on how to create an SSH server behind a Router when you don't have access to the Router. The ports in iptables are all open. UPDATE As

How can I remove specific rules from iptables?

夙愿已清 提交于 2019-11-29 18:32:08
I am hosting special HTTP and HTTPS services on the ports 8006 and 8007 respectively. I use iptables to "activate" the server; i.e. to route the incoming HTTP and HTTPS ports: iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --dport 443 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --dport 8006 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --dport 8007 -j ACCEPT iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8006 iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8007 iptables -A OUTPUT -t nat -d 127.0.0

git push/pull times out

非 Y 不嫁゛ 提交于 2019-11-29 17:33:51
问题 I can't git push/pull to github from my corporate vpn: git push origin master ssh: connect to host github.com port 22: Connection timed out fatal: The remote end hung up unexpectedly I assume this is a firewall issue, b/c if I disconnect from the vpn it works. Is there anything I can do to work around it? Or am I stuck disconnecting from the vpn when I need to push/pull? 回答1: Not sure which type of VPN you're using, but this sort of effect is usually due to the VPN setup routing all your

Add firewall rule programmatically

扶醉桌前 提交于 2019-11-29 16:39:53
I am developing an application for Mac, and wants to add firewall rule when my application launches, would like to know the entry point, if anyone has any idea, I guess, i need to modify /Library/Preferences/com.apple.sharing.firewall.plist But this file is not present in my Machine and any info about structure of this file ? Requirement is something like this When it runs, then browser shouldn't allow to open some particulars website, so i believe, this is going to be a application level firewall. Thanks for looking at it, Finally i am using ipfw to do so, but still not yet clear about how to

How do I force an iOS app to use 3G instead of WiFi?

蹲街弑〆低调 提交于 2019-11-29 15:56:28
问题 I want to use a messaging protocol that works fine over 3G, but not over some corporate firewalls. How can my app force the use of the cellular network when it fails to connect over WiFi even in the case that the WiFi network is reachable? EDIT: After reading through the implementation of the Reachability class I remain unsure whether the two are indeed mutually exclusive. It could well be possible to discover both interfaces via gethostbyname() , which I might try just to see what comes out.

Genetic Algorithms for computer security [closed]

☆樱花仙子☆ 提交于 2019-11-29 15:14:12
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I am in the process of choosing project for uni. And I am really interested on combining genetic algorithms and computer security. Therefore my question, Is it possible to use GA on any aspect for computer security? For example? . I was thinking something like a evolutionary

Outbound port open on firewall, how to unblock for PHP?

痴心易碎 提交于 2019-11-29 12:56:50
The goal is to send outbound email from my shared host to Mandrill via SMTP using PHP and I have full cooperation with the host sys admins. Current situation: ✅ PHP can connect to smtp.mandrillapp.com port 443 (used for HTTPS) ❌ PHP cannot connect to smtp.mandrillapp.com port 587 (used for SMTP) ✅ PHP can connect to portquiz.net port 443 (used for HTTPS) ❌ PHP cannot connect to portquiz.net port 587 (used for SMTP) ✅ Telnet can connect to smtp.mandrillapp.com port 443 ✅ Telnet can connect to smtp.mandrillapp.com port 587 Telnet is tested by them logging in as root and running telnet HOST PORT