PDA

View Full Version : Connect to gateway



Tobias4444
2023-02-20, 21:15
Hi guys, I'm new to Linux, so it would be nice if you could explain your answers. :)
I want to use my virtual Linux machine for pentesting in my OWN network, but I don't get it to connect to it. It connects to the Wi-Fi, but if I run bettercap for example and scan my network it doesn't find anything.
My input:

net.probe on


[16:10:22] [sys.log] [inf] net.probe starting net.recon as a requirement for net.probe
10.0.2.0/24 > 10.0.2.15 ? [16:10:22] [sys.log] [inf] net.probe probing 256 addresses on 10.0.2.0/24
10.0.2.0/24 > 10.0.2.15 ? [16:10:23] [endpoint.new] endpoint 10.0.2.4 detected as 52:54:00:12:35:04 (Realtek (UpTech? also reported)).
10.0.2.0/24 > 10.0.2.15 ? [16:10:23] [endpoint.new] endpoint 10.0.2.3 detected as 52:54:00:12:35:03 (Realtek (UpTech? also reported)).

My router-ip is 192.168.2.1, but the routing table is following:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.0.2.2 0.0.0.0 UG 100 0 0 eth0
10.0.2.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
I don't know how to do it right. I have tried it for many hours now, but I get error messages or the Internet is completely gone after my tries.

Help would be nice.

Fred Sheehan
2023-03-02, 05:08
Your in a VM so your VM kali is using a virtual ethernet connection with an ip of 10.0.2.2

your home network router is on a 192.168.2.* so all your other network devices, including your host the VM is running on, will be on this other subnet!

Bettercap is an ARP scanner, so it uses MAC addresses and only works on a wired LAN

lets say we want to run a scan on your home network with nmap;

nmap 192.168.2.0/24

that means 'scan all IP's from 192.168.2.0 - 192.168.2.255

you need to understand networking, that /24 at the end is a CIDR mask, your IPv4 address is 32 bits long, 8 bits per 'octect' so that mask says 'only check the IP's after the first 24 bits have been ignored' so only last 8 bits are used.

https://www.packetcoders.io/a-beginners-guide-to-subnetting/

nmap has lots of scripts to help you find open ports and services on your home network, the nmap website is the best place to look, you can even get a free book!

Fred Sheehan
2023-03-02, 05:11
https://www.cbtnuggets.com/blog/technology/networking/networking-basics-what-is-ipv4-subnetting