Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have an IPCop box that has been working flawlessly, until today, when I came in to work to discover that an electrical storm had fried one of the routers ethernet cards.
After I had (5 hours later) finally figured out how to get IPCOP on the internet again (stupid thing refused to connect via PPPOE).
Everything seemed to be working fine - emails and URIs were being filtered.
But, when trying to connect to any site that is HTTPS, or even just SSH or FTP - it refuses to connect.
I'm positive that its an IPTABLES issue, but I can't figure out where.
How is it that you are positive? Like, for example, are your log files showing packets getting filtered when you try and start an HTTPS connection? BTW, if you could post the output of -nvL instead of -L it might make things a lot clearer.
Thanks for your reply win32sux, below is the output from `iptables -nvL`:
Code:
Chain BADTCP (2 references)
pkts bytes target prot opt in out source destination
0 0 PSCAN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x3F/0x29
0 0 PSCAN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x3F/0x00
0 0 PSCAN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x3F/0x01
0 0 PSCAN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x06
0 0 PSCAN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x03/0x03
1236 97823 NEWNOTSYN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:!0x17/0x02 state NEW
Chain CUSTOMFORWARD (1 references)
pkts bytes target prot opt in out source destination
Chain CUSTOMINPUT (1 references)
pkts bytes target prot opt in out source destination
546K 307M SCAN_SMTP_INPUT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain CUSTOMOUTPUT (1 references)
pkts bytes target prot opt in out source destination
Chain DHCPBLUEINPUT (1 references)
pkts bytes target prot opt in out source destination
Chain DMZHOLES (0 references)
pkts bytes target prot opt in out source destination
Chain GUIINPUT (1 references)
pkts bytes target prot opt in out source destination
18 594 ACCEPT icmp -- !ppp0 * 0.0.0.0/0 0.0.0.0/0 icmp type 8
Chain INPUT (policy DROP 1463 packets, 80376 bytes)
pkts bytes target prot opt in out source destination
415K 222M ipac~o all -- * * 0.0.0.0/0 0.0.0.0/0
692K 397M BADTCP all -- * * 0.0.0.0/0 0.0.0.0/0
690K 397M CUSTOMINPUT all -- * * 0.0.0.0/0 0.0.0.0/0
624K 353M GUIINPUT all -- * * 0.0.0.0/0 0.0.0.0/0
579K 348M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
44834 4429K IPSECVIRTUAL all -- * * 0.0.0.0/0 0.0.0.0/0
44834 4429K OPENSSLVIRTUAL all -- * * 0.0.0.0/0 0.0.0.0/0
21131 1591K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 state NEW
0 0 DROP all -- * * 127.0.0.0/8 0.0.0.0/0 state NEW
0 0 DROP all -- * * 0.0.0.0/0 127.0.0.0/8 state NEW
22240 2758K ACCEPT !icmp -- eth0 * 0.0.0.0/0 0.0.0.0/0 state NEW
1463 80376 DHCPBLUEINPUT all -- * * 0.0.0.0/0 0.0.0.0/0
1463 80376 IPSECPHYSICAL all -- * * 0.0.0.0/0 0.0.0.0/0
1463 80376 OPENSSLPHYSICAL all -- * * 0.0.0.0/0 0.0.0.0/0
1463 80376 WIRELESSINPUT all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW
1463 80376 REDINPUT all -- * * 0.0.0.0/0 0.0.0.0/0
1463 80376 XTACCESS all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW
1219 67329 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4 prefix `INPUT '
Chain FORWARD (policy DROP 187 packets, 11615 bytes)
pkts bytes target prot opt in out source destination
123K 34M ipac~fi all -- * * 0.0.0.0/0 0.0.0.0/0
123K 34M ipac~fo all -- * * 0.0.0.0/0 0.0.0.0/0
289K 169M BADTCP all -- * * 0.0.0.0/0 0.0.0.0/0
13958 682K TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 TCPMSS clamp to PMTU
289K 169M CUSTOMFORWARD all -- * * 0.0.0.0/0 0.0.0.0/0
205K 163M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
83552 6513K IPSECVIRTUAL all -- * * 0.0.0.0/0 0.0.0.0/0
83552 6513K OPENSSLVIRTUAL all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 state NEW
0 0 DROP all -- * * 127.0.0.0/8 0.0.0.0/0 state NEW
0 0 DROP all -- * * 0.0.0.0/0 127.0.0.0/8 state NEW
83274 6497K ACCEPT all -- eth0 * 0.0.0.0/0 0.0.0.0/0 state NEW
278 16003 WIRELESSFORWARD all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW
278 16003 REDFORWARD all -- * * 0.0.0.0/0 0.0.0.0/0
278 16003 PORTFWACCESS all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW
187 11615 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4 prefix `OUTPUT '
Chain IPSECPHYSICAL (1 references)
pkts bytes target prot opt in out source destination
Chain IPSECVIRTUAL (2 references)
pkts bytes target prot opt in out source destination
Chain LOG_DROP (0 references)
pkts bytes target prot opt in out source destination
0 0 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
Chain LOG_REJECT (0 references)
pkts bytes target prot opt in out source destination
0 0 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain NEWNOTSYN (1 references)
pkts bytes target prot opt in out source destination
603 49776 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4 prefix `NEW not SYN? '
1236 97823 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
Chain OPENSSLPHYSICAL (1 references)
pkts bytes target prot opt in out source destination
Chain OPENSSLVIRTUAL (2 references)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 750K packets, 401M bytes)
pkts bytes target prot opt in out source destination
438K 207M ipac~i all -- * * 0.0.0.0/0 0.0.0.0/0
750K 401M CUSTOMOUTPUT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain PORTFWACCESS (1 references)
pkts bytes target prot opt in out source destination
1 48 ACCEPT tcp -- ppp0 * 0.0.0.0/0 192.168.1.253 tcp dpt:80
2 92 ACCEPT tcp -- ppp0 * 0.0.0.0/0 192.168.1.254 tcp dpt:80
21 1008 ACCEPT tcp -- ppp0 * 0.0.0.0/0 192.168.1.254 tcp dpt:443
63 3048 ACCEPT tcp -- ppp0 * 0.0.0.0/0 192.168.1.253 tcp dpt:443
4 192 ACCEPT tcp -- ppp0 * 0.0.0.0/0 192.168.1.254 tcp dpt:1723
0 0 ACCEPT 47 -- ppp0 * 0.0.0.0/0 192.168.1.254
0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 192.168.1.250 tcp dpt:443
Chain PSCAN (5 references)
pkts bytes target prot opt in out source destination
0 0 LOG tcp -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4 prefix `TCP Scan? '
0 0 LOG udp -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4 prefix `UDP Scan? '
0 0 LOG icmp -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4 prefix `ICMP Scan? '
0 0 LOG all -f * * 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4 prefix `FRAG Scan? '
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
Chain REDFORWARD (1 references)
pkts bytes target prot opt in out source destination
Chain REDINPUT (1 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- eth1 * 0.0.0.0/0 0.0.0.0/0
Chain SCAN_SMTP_INPUT (1 references)
pkts bytes target prot opt in out source destination
45548 17M ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:10025
Chain WIRELESSFORWARD (1 references)
pkts bytes target prot opt in out source destination
Chain WIRELESSINPUT (1 references)
pkts bytes target prot opt in out source destination
Chain XTACCESS (1 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 165.xxx.xxx.xx0 tcp dpt:113
0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 203.xxx.xxx.xx2 tcp dpt:113
Chain ipac~fi (1 references)
pkts bytes target prot opt in out source destination
244 19467 all -- eth0 * 0.0.0.0/0 0.0.0.0/0
20 2275 all -- ppp0 * 0.0.0.0/0 0.0.0.0/0
Chain ipac~fo (1 references)
pkts bytes target prot opt in out source destination
17 2103 all -- * eth0 0.0.0.0/0 0.0.0.0/0
244 19467 all -- * ppp0 0.0.0.0/0 0.0.0.0/0
Chain ipac~i (1 references)
pkts bytes target prot opt in out source destination
962 757K all -- * eth0 0.0.0.0/0 0.0.0.0/0
1116 149K all -- * ppp0 0.0.0.0/0 0.0.0.0/0
Chain ipac~o (1 references)
pkts bytes target prot opt in out source destination
1106 188K all -- eth0 * 0.0.0.0/0 0.0.0.0/0
1121 768K all -- ppp0 * 0.0.0.0/0 0.0.0.0/0
The reason I think its a firewall rule is because HTTP sites work fine. Any other services are blocked. I've checked over my urlfilter and proxy settings and cannot find any reason why they'd be blocking it. Is it possible that these applications have failed to load needed rules into iptables?
In IPCOP's firewall connections log I can see that clients are trying to access HTTPS (443) on sites but there is no reply from the server. It almost sounds like a NAT issue.
In the NAT table of iptables, under the REDNAT chain, there was a missing rule:
Code:
Chain REDNAT (1 references)
pkts bytes target prot opt in out source destination
1607 108K MASQUERADE all -- * ppp0 0.0.0.0/0 0.0.0.0/0
This meant that all my traffic from inside the network that wasn't on port 80 was not being properly NATed. This applied not just to HTTPS, but all other protocols.
Why then wasn't this being added by IPCOP on boot? Well, the offending addon was SNATGUI, its custom firewall script failed to load this rule on startup. Needless to say, I've uninstalled it and set up my IP Address aliases manually.
Thanks for your help guys.
Last edited by socceroos; 08-17-2009 at 11:36 PM.
Reason: Clarification
In the NAT table of iptables, under the REDNAT chain, there was a missing rule:
Code:
Chain REDNAT (1 references)
pkts bytes target prot opt in out source destination
1607 108K MASQUERADE all -- * ppp0 0.0.0.0/0 0.0.0.0/0
This meant that all my traffic from inside the network that wasn't on port 80 was not being properly NATed. This applied not just to HTTPS, but all other protocols.
Why then wasn't this being added by IPCOP on boot? Well, the offending addon was SNATGUI, its custom firewall script failed to load this rule on startup. Needless to say, I've uninstalled it and set up my IP Address aliases manually.
Thanks for your help guys.
On the contrary, thank you for taking the time to let us know how you resolved this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.