(20 puntos) Utilizando httpie, hagan una solicitud de HTTP al servidor:
user@LAPTOP-BBJPVM9E:/mnt/c/Users/kevin$ http https://nrywhite.lat
HTTP/1.1 200 OK
CF-RAY: 910770e4bc25a55e-MIA
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html
Date: Tue, 11 Feb 2025 21:30:35 GMT
Last-Modified: Tue, 11 Feb 2025 18:32:02 GMT
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=eNCvO1hrEcjs1HaO2%2BedBcq8LR8fWSKh5KWtDZAKaJiwSZbmoasAoL4MiX9zzLnHmYFzLX8PuDsqU3Px3w7%2FqUFhL8Rcj9KnPNDiXPtX72fDPXV0HhCmTwYDJk%2FgmGE%3D"}],"group":"cf-nel","max_age":604800}
Server: cloudflare
Transfer-Encoding: chunked
alt-svc: h3=":443"; ma=86400
cf-cache-status: DYNAMIC
server-timing: cfL4;desc="?proto=TCP&rtt=38343&min_rtt=35825&rtt_var=15233&sent=5&recv=6&lost=0&retrans=0&sent_bytes=3054&recv_bytes=752&delivery_rate=121256&cwnd=104&unsent_bytes=0&cid=cd3f3914fd602fbe&ts=149&x=0"
vary: accept-encoding
Te Imaginas?
(10 puntos) Utilizando curl, hagan una solicitud de HTTP al servidor
user@LAPTOP-BBJPVM9E:/mnt/c/Users/kevin$ curl https://nrywhite.lat
Te Imaginas?
- (5 puntos) Que pasa si tratan de hacer una solicitud de HTTP desde el servidor hacia su computadora?
2025-02-11 21:37 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /
○ → curl http://192.168.11.85
curl: (28) Failed to connect to 192.168.11.85 port 80 after 134681 ms: Couldn't connect to server
(10 puntos) Utilizando tail dentro del servidor, obtengan las últimas 15 líneas del archivo /var/log/nginx/access.log
2025-02-11 21:44 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in .../nginx/sites-available
○ → tail -n 15 /var/log/nginx/access.log
108.162.210.120 - - [11/Feb/2025:21:43:35 +0000] "GET / HTTP/1.1" 200 12 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
172.70.54.8 - - [11/Feb/2025:21:43:35 +0000] "GET /favicon.ico HTTP/1.1" 404 196 "https://23009.nrywhite.lat/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
108.162.212.118 - - [11/Feb/2025:21:43:44 +0000] "GET / HTTP/1.1" 200 71 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
172.68.76.167 - - [11/Feb/2025:21:43:44 +0000] "GET /favicon.ico HTTP/1.1" 404 196 "https://23065.nrywhite.lat/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
108.162.212.128 - - [11/Feb/2025:21:43:51 +0000] "GET / HTTP/1.1" 200 233 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
172.68.76.162 - - [11/Feb/2025:21:43:51 +0000] "GET /favicon.ico HTTP/1.1" 404 196 "https://23391.nrywhite.lat/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
108.162.210.113 - - [11/Feb/2025:21:43:59 +0000] "GET / HTTP/1.1" 200 211 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
172.68.76.163 - - [11/Feb/2025:21:43:59 +0000] "GET /favicon.ico HTTP/1.1" 404 196 "https://23556.nrywhite.lat/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
108.162.212.82 - - [11/Feb/2025:21:44:08 +0000] "GET / HTTP/1.1" 200 221 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
172.68.76.137 - - [11/Feb/2025:21:44:08 +0000] "GET /favicon.ico HTTP/1.1" 404 196 "https://23645.nrywhite.lat/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0"
185.142.236.40 - - [11/Feb/2025:21:44:49 +0000] "GET / HTTP/1.1" 200 673 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
185.142.236.40 - - [11/Feb/2025:21:44:50 +0000] "GET /robots.txt HTTP/1.1" 404 162 "-" "-"
185.142.236.40 - - [11/Feb/2025:21:44:51 +0000] "GET /sitemap.xml HTTP/1.1" 404 162 "-" "-"
185.142.236.40 - - [11/Feb/2025:21:44:51 +0000] "GET /.well-known/security.txt HTTP/1.1" 404 162 "-" "-"
185.142.236.40 - - [11/Feb/2025:21:44:53 +0000] "GET /vite.svg HTTP/1.1" 200 1497 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36"
(10 puntos) Utilizando ps y grep identifiquen qué procesos está corriendo amazon dentro del servidor
2025-02-11 21:46 ⌚ njs v18.19.1|py |go 9% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → ps aux | grep -i amazon
root 126554 0.0 1.4 1759116 14280 ? Ssl Feb10 0:05 /snap/amazon-ssm-agent/9881/amazon-ssm-agent
root 126579 0.0 2.0 1850868 20344 ? Sl Feb10 0:21 /snap/amazon-ssm-agent/9881/ssm-agent-worker
ubuntu 209503 0.0 0.2 6944 2176 pts/8 S+ 21:47 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn -i amazon
2025-02-11 21:47 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → ps aux | grep -i aws
ubuntu 209549 0.0 0.2 6944 2176 pts/8 S+ 21:48 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn -i aws
(10 puntos) Utilizando dig dentro del servidor, obtengan la ip que resuelve al hacer un dns lookup uvg.edu.gt
2025-02-11 21:48 ⌚ njs v18.19.1|py |go 9% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → dig +short uvg.edu.gt
45.223.56.41
45.223.155.41
2025-02-11 21:49 ⌚ njs v18.19.1|py |go 16% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → nslookup uvg.edu.gt
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: uvg.edu.gt
Address: 45.223.155.41
Name: uvg.edu.gt
Address: 45.223.56.41
(5 puntos) Cuanta memoria RAM, total usada y libre, tiene el servidor? (su respuesta debe estar en MB)
2025-02-11 21:50 ⌚ njs v18.19.1|py |go 9% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → free -m
total used free shared buff/cache available
Mem: 957 572 71 43 548 385
Swap:
Tiene 957 MB en total, de los cuales 572 MB son usados y 71 MB están libres.
(5 puntos) Cuanto espacio de disco, total usado y disponible, tiene el servidor? (su respuesta debe estar en MB)
2025-02-11 21:52 ⌚ njs v18.19.1|py |go 16% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → df -m
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/root 28691 8498 20177 30% /
tmpfs 479 43 437 9% /dev/shm
tmpfs 192 2 191 1% /run
tmpfs 5 0 5 0% /run/lock
/dev/xvda16 881 76 744 10% /boot
/dev/xvda15 105 7 99 6% /boot/efi
tmpfs 96 1 96 1% /run/user/1000
Tiene 28,691 MB en total, de los cuales 8,498 MB son usados y 20,177 MB están libres.
(5 puntos) Utilizando el comando ip obtengan la ip del servidor
2025-02-11 22:02 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → ip -4 addr show | grep "inet " | awk '{print $2}'
127.0.0.1/8
172.31.31.175/20
172.17.0.1/16
(10 puntos) lsof lista los archivos abiertos. Identifiquen los archivos abiertos por el protocolo TCP en el puerto 80
2025-02-11 22:04 ⌚ njs v18.19.1|py |go 9% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → sudo lsof -i TCP:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 152272 root 5u IPv4 528166 0t0 TCP *:http (LISTEN)
nginx 152272 root 7u IPv6 528168 0t0 TCP *:http (LISTEN)
nginx 152273 www-data 5u IPv4 528166 0t0 TCP *:http (LISTEN)
nginx 152273 www-data 7u IPv6 528168 0t0 TCP *:http (LISTEN)
(20 puntos) Utilizando netstat, listen los puertos por los que está escuchando el servidor. Deben filtrar usando las siguientes opciones de netstat (esto es un solo comando con estas opciones):
-tcp
-udp
-numeric (muestra los puertos por número)
-program (muestra qué programa es el que está escuchando)
2025-02-11 22:05 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → sudo netstat -tulnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 301/systemd-resolve
tcp 0 0 0.0.0.0:90 0.0.0.0:* LISTEN 1107/docker-proxy
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 152272/nginx: maste
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 152272/nginx: maste
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 301/systemd-resolve
tcp6 0 0 :::10 :::* LISTEN 1/init
tcp6 0 0 :::90 :::* LISTEN 1117/docker-proxy
tcp6 0 0 :::80 :::* LISTEN 152272/nginx: maste
udp 0 0 127.0.0.54:53 0.0.0.0:* 301/systemd-resolve
udp 0 0 127.0.0.53:53 0.0.0.0:* 301/systemd-resolve
udp 0 0 172.31.31.175:68 0.0.0.0:* 465/systemd-network
udp 0 0 127.0.0.1:323 0.0.0.0:* 594/chronyd
udp6 0 0 ::1:323 :::* 594/chronyd
(30 puntos) Utilizando ss, listen los puertos por los que está escuchando el servidor. Deben filtrar usando las siguientes opciones de ss (esto es un solo comando con estas opciones):
-summary
-tcp
-conexiones establecidas
-resuelvan los puertos numericos
-uso de memoria
-información interna de tcp
-proceso que usa el socket
2025-02-11 22:06 ⌚ njs v18.19.1|py |go 9% ip-172-31-31-175 (172.31.31.175) in /var/www
○ → sudo ss -sntmoi
Total: 264
TCP: 19 (estab 8, closed 3, orphaned 0, timewait 2)
Transport Total IP IPv6
RAW 1 0 1
UDP 5 4 1
TCP 16 7 9
INET 22 11 11
FRAG 0 0 0
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
ESTAB 0 0 172.31.31.175:50896 209.54.182.39:443 timer:(keepalive,,0)
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d0) sack cubic wscale:6,7 rto:204 rtt:3.182/0.219 ato:40 mss:1460 pmtu:9001 rcvmss:1460 advmss:8961 cwnd:10 bytes_sent:7559 bytes_acked:7560 bytes_received:9664 segs_out:585 segs_in:480 data_segs_out:121 data_segs_in:125 send 36706474bps lastsnd:45825 lastrcv:45821 lastack:15212 pacing_rate 73404296bps delivery_rate 21313864bps delivered:122 app_limited busy:411ms rcv_space:56575 rcv_ssthresh:56575 minrtt:1.484 snd_wnd:59776
ESTAB 0 0 172.31.31.175:443 162.158.11.150:54900
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d1) ts sack cubic wscale:13,7 rto:258 rtt:57.062/8.148 ato:40 mss:1448 pmtu:9001 rcvmss:1097 advmss:8949 cwnd:10 bytes_sent:4276 bytes_acked:4276 bytes_received:6607 segs_out:12 segs_in:19 data_segs_out:10 data_segs_in:8 send 2030073bps lastsnd:45965 lastrcv:45965 lastack:45911 pacing_rate 4060144bps delivery_rate 426376bps delivered:11 app_limited busy:422ms rcv_space:56575 rcv_ssthresh:56575 minrtt:54.104 snd_wnd:98304 tcp-ulp-tls rxconf: none txconf: none
ESTAB 0 724 [::ffff:172.31.31.175]:10 [::ffff:190.148.213.41]:50536 timer:(on,144ms,0)
skmem:(r0,rb131072,t2056,tb348160,f1196,w6996,o0,bl0,d0) ts sack cubic wscale:7,7 rto:271 rtt:70.848/16.128 ato:40 mss:1448 pmtu:9001 rcvmss:1448 advmss:8949 cwnd:10 bytes_sent:313790 bytes_acked:313066 bytes_received:32128 segs_out:1294 segs_in:1643 data_segs_out:1265 data_segs_in:780 send 1635050bps lastrcv:21 lastack:21 pacing_rate 3270064bps delivery_rate 8409720bps delivered:1259 busy:50493ms rwnd_limited:41ms(0.1%) unacked:7 rcv_space:56575 rcv_ssthresh:56575 minrtt:54.681 snd_wnd:374144
ESTAB 0 0 [::ffff:172.31.31.175]:10 [::ffff:181.209.179.43]:50671 timer:(keepalive,98min,0)
skmem:(r0,rb1759561,t0,tb87040,f0,w0,o0,bl0,d3) sack cubic wscale:8,7 rto:284 rtt:83.946/9.157 ato:53 mss:1460 pmtu:9001 rcvmss:1432 advmss:8961 cwnd:18 bytes_sent:221698 bytes_retrans:628 bytes_acked:221070 bytes_received:193073 segs_out:5425 segs_in:6563 data_segs_out:5414 data_segs_in:5055 send 2504467bps lastsnd:70849 lastrcv:70849 lastack:70743 pacing_rate 5008904bps delivery_rate 1635752bps delivered:5415 app_limited busy:178655ms retrans:0/9 dsack_dups:9 rcv_rtt:345480 rcv_space:82604 rcv_ssthresh:56575 minrtt:56.386 snd_wnd:64512
ESTAB 0 0 [::ffff:172.31.31.175]:10 [::ffff:190.56.194.12]:51137 timer:(keepalive,56min,0)
skmem:(r0,rb131072,t0,tb304640,f0,w0,o0,bl0,d0) sack cubic wscale:8,7 rto:273 rtt:72.279/13.26 ato:40 mss:1460 pmtu:9001 rcvmss:1460 advmss:8961 cwnd:114 bytes_sent:135062 bytes_acked:135062 bytes_received:6312 segs_out:196 segs_in:98 data_segs_out:125 data_segs_in:83 send 18421948bps lastsnd:3833267 lastrcv:54048 lastack:54048 pacing_rate 36843704bps delivery_rate 7014904bps delivered:126 busy:1132ms rwnd_limited:6ms(0.5%) rcv_space:56575 rcv_ssthresh:56575 minrtt:52.846 snd_wnd:130560
ESTAB 0 268 [::ffff:172.31.31.175]:10 [::ffff:190.14.11.2]:50299 timer:(on,108ms,0)
skmem:(r0,rb131072,t0,tb1427456,f1140,w2956,o0,bl0,d0) ts sack cubic wscale:6,7 rto:261 rtt:60.005/0.332 ato:41 mss:1448 pmtu:9001 rcvmss:1448 advmss:8949 cwnd:20 bytes_sent:2336570 bytes_retrans:36 bytes_acked:2336266 bytes_received:425849 segs_out:12595 segs_in:21598 data_segs_out:12441 data_segs_in:10687 send 3861012bps lastsnd:15 lastrcv:15 lastack:15 pacing_rate 7721904bps delivery_rate 6049584bps delivered:12439 app_limited busy:222185ms rwnd_limited:41ms(0.0%) unacked:3 retrans:0/1 dsack_dups:1 rcv_rtt:75 rcv_space:56575 rcv_ssthresh:56575 minrtt:58.842 snd_wnd:1900480
ESTAB 0 0 [::ffff:172.31.31.175]:10 [::ffff:181.174.106.63]:37301 timer:(keepalive,94min,0)
skmem:(r0,rb1133228,t0,tb87040,f0,w0,o0,bl0,d2) ts sack cubic wscale:7,7 rto:586 rtt:235.862/87.403 ato:41 mss:1448 pmtu:9001 rcvmss:1448 advmss:8949 cwnd:8 ssthresh:4 bytes_sent:114118 bytes_retrans:8004 bytes_acked:106114 bytes_received:96466 segs_out:2053 segs_in:3032 data_segs_out:1393 data_segs_in:2587 send 392908bps lastsnd:930993 lastrcv:930993 lastack:930682 pacing_rate 471488bps delivery_rate 644736bps delivered:1295 app_limited busy:55872ms retrans:0/81 dsack_dups:2 rcv_rtt:109059 rcv_space:62770 rcv_ssthresh:56575 minrtt:73.57 snd_wnd:64128
ESTAB 0 0 [::ffff:172.31.31.175]:10 [::ffff:186.151.221.4]:34829 timer:(keepalive,17min,0)
skmem:(r0,rb131072,t0,tb208896,f0,w0,o0,bl0,d0) sack cubic wscale:8,7 rto:266 rtt:65.292/10.806 ato:40 mss:1436 pmtu:9001 rcvmss:1436 advmss:8961 cwnd:10 bytes_sent:145070 bytes_acked:145070 bytes_received:6652 segs_out:236 segs_in:210 data_segs_out:189 data_segs_in:104 send 1759480bps lastsnd:8188850 lastrcv:6162253 lastack:6162253 pacing_rate 3518912bps delivery_rate 10523424bps delivered:190 busy:5543ms rwnd_limited:48ms(0.9%) rcv_space:56575 rcv_ssthresh:56575 minrtt:49.088 snd_wnd:261632