Aaron Bloomfield (aaron@virginia.edu)
@github | ↑ |
Class A (#126) |<-- Host ID -->|
1. 0. 0. 0 = 00000001 00000000 00000000 00000000
126.255.255.255 = 01111110 11111111 11111111 11111111
Class B (#16,384) |<-- Host ID -->|
128. 0. 0. 0 = 10000000 00000000 00000000 00000000
191.255.255.255 = 10111111 11111111 11111111 11111111
Class C (#~2M) |HostID|
192. 0. 0. 0 = 11000000 00000000 00000000 00000000
223.255.255.255 = 11011111 11111111 11111111 11111111
Class D (#16) |<-- Address Range -->|
224. 0. 0. 0 = 11100000 00000000 00000000 00000000
239.255.255.255 = 11101111 11111111 11111111 11111111
Class E (#16) |<-- Address Range -->|
240. 0. 0. 0 = 11110000 00000000 00000000 00000000
255.255.255.255 = 11101111 11111111 11111111 11111111
asb2t@portal04:~$ ping6 -c 1 google.com
PING google.com(lga25s79-in-x0e.1e100.net (2607:f8b0:4006:81f::200e)) 56 data bytes
From fe80::a68c:dbff:fedd:9401%enp4s0 (fe80::a68c:dbff:fedd:9401%enp4s0) icmp_seq=1 Destination unreachable: No route
--- google.com ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
asb2t@portal04:~$
::
means enough :0000:
parts to fill to 8 bytesroot@gateway:/# ip route
default via 192.168.100.1 dev eth2
192.168.100.0/24 dev eth2 proto kernel scope link src 192.168.100.2
192.168.150.0/24 dev eth1 proto kernel scope link src 192.168.150.1
192.168.200.0/24 dev eth0 proto kernel scope link src 192.168.200.1
root@gateway:/#
nws-exec.sh
script run upon container startupasb2t@portal08:~$ traceroute www.google.com
traceroute to www.google.com (142.250.80.100), 64 hops max
1 128.143.63.1 2.643ms 3.459ms 0.964ms
2 128.143.221.17 0.283ms 0.200ms 0.192ms
3 128.143.236.90 0.290ms 0.265ms 0.266ms
4 128.143.236.5 0.397ms 0.289ms 0.281ms
5 192.35.48.30 3.450ms 3.340ms 3.402ms
6 72.14.197.96 5.553ms 4.860ms 4.946ms
7 * * *
8 108.170.246.33 4.463ms 4.338ms 4.288ms
9 108.170.246.2 7.250ms 33.738ms 9.570ms
10 216.239.63.235 4.696ms 4.410ms 4.414ms
11 142.251.227.117 9.620ms 9.707ms 9.602ms
12 209.85.255.37 29.699ms 16.033ms 13.441ms
13 108.170.248.97 8.618ms 8.606ms 8.573ms
14 142.251.65.115 8.881ms 8.902ms 8.872ms
15 142.250.80.100 8.763ms 8.733ms 8.745ms
asb2t@portal08:~$
File is traceroute.py (src)
import sys
from scapy.all import *
dest ='142.250.80.100' # google.com
for TTL in range(1,40):
response = sr1(IP(dst=dest,ttl=TTL)/ICMP(type=8),
timeout=2, verbose=0)
if response is None:
print("%2d * * *" % TTL)
else:
print("%2d %s" % (TTL,response.src))
if ( response is not None and response.src == dest ):
break;
$ sudo python3 traceroute.py
1 192.168.14.1
2 96.120.18.197
3 96.108.129.85
4 96.108.141.249
5 96.110.42.133
6 96.110.34.118
7 66.208.216.218
8 108.170.246.33
9 108.170.246.49
10 142.251.49.73
11 142.251.69.26
12 142.251.69.0
13 108.170.248.97
14 142.251.65.115
15 142.250.80.100
$
Note the sudo
$ sudo python3 traceroute.py
1 192.168.14.1
2 96.120.18.197
3 96.108.129.85
4 96.108.141.249
5 96.110.42.129
6 96.110.32.122
7 162.252.69.145
8 163.253.1.144
9 192.122.175.58
10 192.35.48.33
11 128.143.236.6
12 128.143.236.89
13 * * *
14 * * *
15 * * *
16 * * *
^C
$
* * *
output, as no response was receivedother
's default gateway is gateway
outer1
sent an update to other
that it was the new route?from scapy.all import *
ip = "128.143.67.11" # www.cs.virginia.edu
pkt = IP(dst=ip) / ICMP(type=8)
reply = sr1(pkt)
print ("Reply from", reply[IP].src, "with destination",
reply[IP].dst)
$ sudo python3 ping.py
Begin emission:
Finished sending 1 packets.
...........*
Received 12 packets, got 1 answers, remaining 0 packets
Reply from 128.143.67.11 with destination 128.143.67.84
$
vip = '...' # victim IP
# set broadcast ip in `bip` as victim's
# ip w/255 @ end
send (IP(src=vip, dst=bip) / ICMP(type=8))
from scapy.all import *
ip = "192.168.100.101" # outer1
pkt = IP(dst=ip) / ICMP(type=8) / \
b"the condor is in flight"
reply = sr1(pkt)
print ("Reply from", reply[IP].src, "with destination",
reply[IP].dst)
print ("Message:", reply.load)
root@outer2:~# python3 ping.py
Begin emission:
Finished sending 1 packets.
..*
Received 3 packets, got 1 answers, remaining 0 packets
Reply from 192.168.100.101 with destination 192.168.100.102
Message: b'the condor is in flight'
root@outer2:~#
from scapy.all import *
def icmp_cnc(pkt):
#print(pkt.show())
print("From",pkt[IP].src,"received:",pkt[Raw].load)
filter = "icmp"
pkt = sniff(iface='eth1', filter=filter, prn=icmp_cnc)
root@outer1:/mnt# python3 icmp_cnc.py
From 192.168.100.102 received: b'the condor is in flight'
From 192.168.100.101 received: b'the condor is in flight'
^C
root@outer1:/mnt#
$ ssh -L 8080:server:80 user@server