LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-06-2023, 11:51 PM   #1
des_a
Member
 
Registered: Sep 2006
Posts: 983
Blog Entries: 37

Rep: Reputation: 23
Man in the Middle Attack? And How to Stop It


Please help me ASAP. I think I'm sufferring from a man in the middle attack or some other network abuse. I don't think I configured the network wrong...

Here's the situation:

I have a server, with an IP. It's running Windows 10, and called filesrv. I also have a machine called rasperrypisvr, with a different IP. When I try to vnc to filesrv, I get rasperrypisvr, instead! All of rasperrypisrv's IPs, work fine, as expected.

I already tried to check the DHCP server, which looks OK, and then I checked the arp table. Looks like no issues there, either. I guess I'll try to reboot the machines as well, and let you know how it works.
 
Old 02-07-2023, 12:04 AM   #2
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
Nice! Rebooting both machines, solved the problem. Why??? Sorry to bother you guys, but at least, if it happens again, there's more documentation on it!
 
Old 02-07-2023, 12:12 AM   #3
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
I guess I DO need help. Because closing the lid, makes it happen again, and I bet the same solution will work. I told it now, though, not to fall asleep after some time. Maybe that will help?
 
Old 02-07-2023, 12:23 AM   #4
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
So, here's my workaround for now, make sure the server laptop has it's lid closed BEFORE raspberrypisvr is started. If I have to reopen the lid, shutdown raspberrypisvr, and then, after the lid is closed, start it. Yep folks! It really matters! It's weird! I've never seen a problem like this before!
 
Old 02-07-2023, 09:08 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,148
Blog Entries: 4

Rep: Reputation: 3686Reputation: 3686Reputation: 3686Reputation: 3686Reputation: 3686Reputation: 3686Reputation: 3686Reputation: 3686Reputation: 3686Reputation: 3686Reputation: 3686
How do you do name-resolution for names like "fileserv" and "raspberrypisrv?" Do you rely on hosts-files or do you rely on a name-resolution service?
 
Old 02-07-2023, 02:54 PM   #6
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 3,919
Blog Entries: 7

Rep: Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180
Check your hosts file. It's in /etc/.

For connecting to Windows, RDP > VNC, IME...
 
Old 02-09-2023, 03:30 PM   #7
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 292
Blog Entries: 2

Rep: Reputation: Disabled
Use the ip numbers. That will tell you if it is a DNS update problem.
 
Old 02-11-2023, 03:58 AM   #8
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
So I WAS connecting by IP number. I don't have them memorized, so I was looking that up in the DHCP server. I use DNS for name resolution, when it is able to be working. However, I'm working on some changes for my DHCP server, and then I can update DNS. Then, I can use DNS names for vnc, and it will be much easier.

Working on backup today, trying to see if most of my backup works or not. I'll know tomorrow. I'm likely going to replace my server 2019 machine with a Linux server, but it's running for now. I did this to learn for school. I learned both AD using Linux, and AD using server 2019.
 
Old 02-11-2023, 04:00 AM   #9
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
The names, are what I call them, but they are not too far off to the names that belong in DNS. DNS is just a little more formal and unambigous.
 
Old 03-07-2023, 05:33 PM   #10
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
I just realized something! There is a slight chance, that it's an ip conflict. I wonder if I'd set a static IP for raspberrypisvr? I'm not home, but I'll check it to see if it matches what filesvr's are. I don't think it's a DNS conflict, but I could check later, since I wasn't using DNS at that time, since it needs to be fixed. However, it would suddenly make some sense, if it's an ip conflict, because if there is one, it seems to randomly send packets to one or the other. Why didn't I think of that before? Why the lid behavior, I don't know though.

I had to modify configuration on the raspberry pi, so that it could run headless. Maybe in doing that, I set a static ip, and didn't change it when the dhcp reseveration changed?! Let me check when I get a chance.
 
Old 03-07-2023, 05:38 PM   #11
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 3,919
Blog Entries: 7

Rep: Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180Reputation: 2180
A haiku about DNS:

It’s not DNS
There’s no way it’s DNS
It was DNS
 
Old 03-08-2023, 11:19 AM   #12
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
I like that haiku. We'll see if it really applies here or not, with a little troubleshooting, when I get home today.
 
Old 03-11-2023, 12:51 AM   #13
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
Guess what? Definately an IP address conflict! I confirmed it for sure. When I had both filesvr and raspberrypisvr turned on, I clearly could look up what ip they had, and they both had the same IP. Now you'd "think" the solution is simple. But it seems, I have forgotten how I modified the raspberry pi, so I could get it to this point.

That was why the raspberry pi was acting strangely, and the issue did cause the lid to need to be closed at certain times. So folks... For those who don't know, if you have an ip conflict, when you try to send data to an ip, since two machines have the same one, it doesn't know where to go, so it randomly goes to each machine, so some packets may go to one, and some may end up at the other. There is no way of telling which will end up where. That's why the rule exists, that you are not supposed to do it.

As for how it happened, I didn't just assign them to the same ip statically. I'm pretty much past the point where I make that mistake, way past it. What happened, was that as part of my fix, making the raspberry pi work at all, I set it statically. I had the DHCP server tell me, to assign it to that same address. The fact that it never used the DHCP server, was irealivant.

So then, I needed to make a change to the IP addresses. I'd forgotten to change the static IP to match. Only, now I forgot what that initial setup was.

But this is where people can help. So that's why my forum service is critical. If I'd done as I'm supposed to, I could simply look up what question I'd asked, plus the solution to the problem, that caused me to need to modify files. However, it looks like I didn't link it there. Please help me locate that solution, starting to look on this site. I think I know how to start, I'm taking inititive and starting now.

The whys, is I was unable to even run headless, as I need to, without such modifcation. Starting from scratch is always an option, if need be.
 
Old 03-11-2023, 12:59 AM   #14
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
Doesn't look like I asked a question on linuxquestions.org. My next guess, is raspberry pi forums. I'll check there.
 
Old 03-11-2023, 01:02 AM   #15
des_a
Member
 
Registered: Sep 2006
Posts: 983

Original Poster
Blog Entries: 37

Rep: Reputation: 23
Doesn't look like I have an account there.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Debian and Ubuntu Fix Man-in-the-Middle Attack in APT Package Manager, Update Now LXer Syndicated Linux News 0 01-25-2019 03:11 AM
"Man in the middle attack" works against mix network? How to prevent? argh2xxx Linux - Security 6 09-28-2008 03:39 AM
man in the middle attack atul_mehrotra Programming 12 09-22-2004 11:48 AM
man in the middle attack atul_mehrotra Linux - Security 4 09-22-2004 09:02 AM
Man in the middle attack juanb Linux - Security 17 03-29-2004 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:22 PM.

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