LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-15-2017, 03:17 PM   #1
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Rep: Reputation: 53
How does a FireWall determine the type of attack?


I would like to see the code of the packets that my firewall blocks and wondered how FireStarter; or the like, determines what type of service the attack was. Is it just based on what ports they target or is there more?
Thanks for your expertise!
 
Old 10-15-2017, 08:31 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
This article is good primer as to how firewalls work: http://computer.howstuffworks.com/firewall.htm

A web search for "how firewalls work" will turn up many more tutorials.

Last edited by frankbell; 10-15-2017 at 08:52 PM.
 
Old 10-15-2017, 09:09 PM   #3
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Original Poster
Rep: Reputation: 53
So it's just the port they are using? If they target port 22, it HAS to be a SSH attack?

Last edited by theKbStockpiler; 10-15-2017 at 09:11 PM.
 
Old 10-15-2017, 09:23 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
Quote:
So it's just the port they are using? If they target port 22, it HAS to be a SSH attack?
Possible, or more likely a random port scan looking for a system with a vulnerable port. Random port scans are a fact of life on the internet and have been for years. Bad guys are always looking for easy marks.

If you are getting lots of them, you could install Fail2Ban.

It is possible to block specific ip addresses with iptables, but, if what you are getting is random port scans, it's likely not worth the effort.

Last edited by frankbell; 10-15-2017 at 09:25 PM.
 
Old 10-15-2017, 09:59 PM   #5
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Original Poster
Rep: Reputation: 53
Wink

I tried to get information on a phishing attack and investigated a few other attacks that FireStarter had blocked.They were from a French Server like the equivalent to 'Go Daddy' or something. I could not get a IP address on them,just a domain name and I could notify the administrator ,(the hacker) of malicious acts by their server, LOL. I suspect that France has weak hacking laws so the hackers tend to have proxy servers in that country.

Thank you for the link on Fail2ban. I will have some fun with it.

Last edited by theKbStockpiler; 10-16-2017 at 10:41 AM. Reason: learning to spell
 
Old 10-15-2017, 10:22 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
Or the ip address was spoofed. It happens. Or that particular address may have been commandeered by a bot.

That's more likely than that France's regulations are somehow lax.

Last edited by frankbell; 10-15-2017 at 10:23 PM.
 
Old 10-15-2017, 10:39 PM   #7
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,305
Blog Entries: 3

Rep: Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720
Quote:
Originally Posted by theKbStockpiler View Post
So it's just the port they are using? If they target port 22, it HAS to be a SSH attack?
Not necessarily. I see all kinds of HTTP-based attacks on ports running SSH. Some crackers just throw everything at the wall and then see what sticks. Check your logs, to see the failed attempts. Depending on your distro you may find the relevant data in /var/log/auth if you have an SSH server running.

My guess is that they build inventory lists so they know where to hit when a vulnerability becomes known.

As for automated blocking, fail2ban has the name recognition but I would say to also check sshguard. Despite the name it covers about the same use-cases as fail2ban but has several advantages over it including IPv6 support. Compare the two and then make a choice as to which one is the best fit for your case, if automated blocking is your thing.
 
1 members found this post helpful.
Old 10-15-2017, 10:49 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
sshguard is new to me. Thanks.
 
Old 10-17-2017, 04:19 PM   #9
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Original Poster
Rep: Reputation: 53
Quote:
Or the ip address was spoofed. I
I guess I will have to blame someone else then.

If the IP is spoofed then they can't get info back,correct? What good does this do them?
 
Old 10-18-2017, 08:59 AM   #10
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,657
Blog Entries: 4

Rep: Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938
A firewall is stupid. It sees an incoming packet and decides what to do with it. That's it. It does not look at the content of the packets.

Requests to connect to a TCP/IP service will always reference a "well-known port." So, if it's port #22, you know what the outsider must be trying to connect to.

If you want to actually protect your system, use OpenVPN with the tls-auth feature and one-of-a-kind digital certificates. Cause all other services to "listen" only to the virtual network adapter that represents an OpenVPN-connected client, and use firewalls to prevent direct access to-or-from the outside world.

When you do this, you create a secret(!) door that can only be discovered, let alone entered, by someone bearing the proper non-revoked credentials. All of the traffic passing in or out is securely encrypted, even though the users do not perceive the presence of encryption at all and need take no further special precautions. (The remote system simply appears to be "part of the local network.") The server and each client can securely identify each other, so you are certain who it is you're talking to.

There are no "open ports" to be scanned, and the presence of the OpenVPN server cannot be detected. (Some routers are capable of supporting OpenVPN "in the box.")

So if you like the sound of "number of unauthorized access attempts: Zero", this is the technology for you.

Last edited by sundialsvcs; 10-18-2017 at 09:06 AM.
 
1 members found this post helpful.
Old 10-18-2017, 04:04 PM   #11
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Original Poster
Rep: Reputation: 53
Thanks for all of the great advise. I'm working on Fail2ban right now just for the experience and plan on moving to OpenVPN as well.

I tried doing a web search on "How data gets back to a hacker with a spoofed address" and besides for a go-between it does not seem possible but than some suggest that it is possible.

Are the attacks a 'One Shot thing' with the hackers IP in the packet if my O.S gets infected?

Thanks for your expertise!

Last edited by theKbStockpiler; 10-18-2017 at 04:07 PM.
 
Old 10-20-2017, 11:37 AM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,657
Blog Entries: 4

Rep: Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938
Quote:
Originally Posted by theKbStockpiler View Post
Are the attacks a 'One Shot thing' with the hackers IP in the packet if my O.S gets infected?
Remember: "a digital computer is a machine, not a biological organism." Therefore, it cannot "get infected." (In spite of the advertising campaigns that refer to malicious software as "viruses.")

You can "catch a cold" if you walk into an elevator in which someone else with a cold just sneezed, and if your immune system does not successfully fight it off. But a digital computer is just not like that. It runs programming, that's it, that's all. Unfortunately, it might "run programming" that you didn't know had been introduced to it, and this "programming" might have malicious intent. But there are relatively simple and effective ways to prevent that.

Remember also that most computer exploits are simply "crimes of opportunity." Robots throw attempts at tens-of-thousands of IP addresses. They don't "know you," nor do they care about you, nor have they singled you out. They're basically looking for "doors that are unlocked," owned by users who aren't paying the slightest bit of attention.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Determine touchpad type malloc Slackware 9 01-19-2012 08:10 PM
how to determine input type? yyl_happy Linux - Server 2 11-22-2009 09:17 AM
Determine files type banajah Linux - Newbie 3 10-08-2007 06:00 PM
How to determine partition type? halturata Linux - General 2 08-11-2005 02:07 PM
How to determine partition type? halturata Linux - General 3 08-11-2005 03:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration