Ihan Marroquin - 23108
1. Utilizando httpie, hagan una solicitud de HTTP al servidor
2025-02-13 00:33 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in .../log/nginx
○ → http http://localhost
HTTP/1.1 200 OK
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html
Date: Thu, 13 Feb 2025 00:34:31 GMT
ETag: W/"67ad3e06-2c85"
Last-Modified: Thu, 13 Feb 2025 00:34:14 GMT
Server: nginx/1.24.0 (Ubuntu)
Transfer-Encoding: chunked
Sistemas y Tecnologías Web | 10
2. Utilizando curl, hagan una solicitud de HTTP al servidor
2025-02-13 00:39 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /
○ → curl http://localhost
Sistemas y Tecnologías Web | 10
3. Utilizando tail dentro del servidor, obtengan las últimas 15 líneas del archivo /var/log/nginx/access.log
2025-02-13 00:29 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in .../log/nginx
○ → tail -n 15 access.log
172.70.54.91 - - [13/Feb/2025:00:28:09 +0000] "GET /payaso.html HTTP/1.1" 404 134 "https://nrywhite.lat/" "Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Mobile/15E148 Safari/604.1"
172.70.54.91 - - [13/Feb/2025:00:28:15 +0000] "GET /payaso.html HTTP/1.1" 404 134 "https://nrywhite.lat/" "Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Mobile/15E148 Safari/604.1"
162.158.11.151 - - [13/Feb/2025:00:28:19 +0000] "GET /favicon.ico HTTP/1.1" 404 196 "https://www.youtube.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
172.68.76.162 - - [13/Feb/2025:00:29:10 +0000] "GET / HTTP/1.1" 200 2639 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
172.68.76.136 - - [13/Feb/2025:00:29:18 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
172.68.76.131 - - [13/Feb/2025:00:29:20 +0000] "GET / HTTP/1.1" 200 2639 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
172.68.76.162 - - [13/Feb/2025:00:29:21 +0000] "GET / HTTP/1.1" 200 2639 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
172.68.76.161 - - [13/Feb/2025:00:29:24 +0000] "GET / HTTP/1.1" 200 2639 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Mobile/15E148 Safari/604.1"
172.68.76.131 - - [13/Feb/2025:00:29:30 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
172.68.76.131 - - [13/Feb/2025:00:29:31 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
172.68.76.131 - - [13/Feb/2025:00:29:32 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
172.68.76.131 - - [13/Feb/2025:00:29:32 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
172.68.76.131 - - [13/Feb/2025:00:29:40 +0000] "GET / HTTP/1.1" 200 2650 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
172.70.82.97 - - [13/Feb/2025:00:29:41 +0000] "GET / HTTP/1.1" 200 2650 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
172.68.76.131 - - [13/Feb/2025:00:29:43 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
5. Utilizando ps y grep identifiquen qué procesos está corriendo amazon dentro del servidor
2025-02-13 01:09 ⌚ njs v18.19.1|py |go 9% ip-172-31-31-175 (172.31.31.175) in /
○ → ps aux | grep amazon
root 542 0.0 1.2 1759116 12400 ? Ssl Feb12 0:02 /snap/amazon-ssm-agent/9881/amazon-ssm-agent
root 914 0.0 2.1 1850868 20924 ? Sl Feb12 0:09 /snap/amazon-ssm-agent/9881/ssm-agent-worker
ubuntu 72644 0.0 0.2 7076 2048 pts/0 S+ 01:10 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn amazon
6. Utilizando dig dentro del servidor, obtengan la ip que resuelve al hacer un dns lookup uvg.edu.gt
2025-02-13 00:29 ⌚ njs v18.19.1|py |go 9% ip-172-31-31-175 (172.31.31.175) in .../log/nginx
○ → dig uvg.edu.gt +short
45.223.155.41
45.223.56.41
7. Cuanta memoria RAM, total usada y libre, tiene el servidor? (su respuesta debe estar en MB)
Rll: Hay 957 MB totales, 570 ya están usados y 211 están libres
2025-02-13 01:10 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /
○ → free -m
total used free shared buff/cache available
Mem: 957 578 211 65 402 379
Swap: 0 0 0
8. Cuanta espacio de disco, total usado y disponible, tiene el servidor? (su respuesta debe estar en MB)
Rll: hay 28691 MB totales, usados son 8650 MB y libres son 20025 MB
2025-02-13 01:11 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /
○ → df -m /
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/root 28691 8650 20025 31% /
9. Utilizando el comando ip obtengan la ip del servidor
2025-02-13 01:14 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /
○ → ip a | grep 'inet ' | awk '{print $2}'
127.0.0.1/8
172.31.31.175/20
172.17.0.1/16
10. lsof lista los archivos abiertos. Identifiquen los archivos abiertos por el protocolo TCP en el puerto 80
2025-02-13 01:16 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /
○ → sudo lsof -iTCP:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 66702 root 5u IPv4 190481 0t0 TCP *:http (LISTEN)
nginx 66702 root 7u IPv6 190483 0t0 TCP *:http (LISTEN)
nginx 66704 www-data 5u IPv4 190481 0t0 TCP *:http (LISTEN)
nginx 66704 www-data 7u IPv6 190483 0t0 TCP *:http (LISTEN)
11. 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-13 01:17 ⌚ njs v18.19.1|py |go 9% ip-172-31-31-175 (172.31.31.175) in /
○ → 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 309/systemd-resolve
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 309/systemd-resolve
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 66702/nginx: master
tcp 0 0 0.0.0.0:90 0.0.0.0:* LISTEN 1136/docker-proxy
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 66702/nginx: master
tcp6 0 0 :::10 :::* LISTEN 1/init
tcp6 0 0 :::90 :::* LISTEN 1143/docker-proxy
tcp6 0 0 :::80 :::* LISTEN 66702/nginx: master
udp 0 0 127.0.0.1:323 0.0.0.0:* 613/chronyd
udp 0 0 127.0.0.54:53 0.0.0.0:* 309/systemd-resolve
udp 0 0 127.0.0.53:53 0.0.0.0:* 309/systemd-resolve
udp 0 0 172.31.31.175:68 0.0.0.0:* 480/systemd-network
udp6 0 0 ::1:323
12. 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-13 01:26 ⌚ njs v18.19.1|py |go 0% ip-172-31-31-175 (172.31.31.175) in /
○ → sudo ss -s -t -n -m -i -p state established
Total: 254
TCP: 23 (estab 13, closed 2, orphaned 0, timewait 1)
Transport Total IP IPv6
RAW 1 0 1
UDP 5 4 1
TCP 21 9 12
INET 27 13 14
FRAG 0 0 0
Recv-Q Send-Q Local Address:Port Peer Address:Port
Process
0 0 172.31.31.175:443 172.68.76.137:53138 users:(("nginx",pid=66704,fd=12))
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d2) cubic wscale:13,7 rto:231 rtt:30.315/6.606 ato:46 mss:1448 pmtu:9001 rcvmss:712 advmss:8949 cwnd:10 bytes_sent:5355 bytes_acked:5355 bytes_received:1309 segs_out:10 segs_in:10 data_segs_out:7 data_segs_in:3 send 3821211bps lastsnd:66635 lastrcv:66636 lastack:66605 pacing_rate 7642352bps delivery_rate 1855808bps delivered:8 app_limited busy:61ms rcv_space:56575 rcv_ssthresh:56575 minrtt:29.619 snd_wnd:65536 tcp-ulp-tls rxconf: none txconf: none
0 0 172.31.31.175:59150 67.220.251.145:443
users:(("ssm-agent-worke",pid=914,fd=14))
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d0) cubic wscale:6,7 rto:204 rtt:3.94/0.84 ato:40 mss:1460 pmtu:9001 rcvmss:1460 advmss:8961 cwnd:10 bytes_sent:17808 bytes_acked:17809 bytes_received:18805 segs_out:1970 segs_in:1587 data_segs_out:398 data_segs_in:402 send 29644670bps lastsnd:41452 lastrcv:41449 lastack:10968 pacing_rate 59285576bps delivery_rate 8118624bps delivered:399 app_limited busy:1571ms rcv_space:56575 rcv_ssthresh:56575 minrtt:1.685 snd_wnd:59776
0 0 172.31.31.175:443 162.158.11.157:50214 users:(("nginx",pid=66704,fd=8))
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d2) cubic wscale:13,7 rto:262 rtt:61.116/18.07 ato:40 mss:1448 pmtu:9001 rcvmss:1019 advmss:8949 cwnd:10 bytes_sent:2797 bytes_acked:2797 bytes_received:2579 segs_out:9 segs_in:12 data_segs_out:6 data_segs_in:4 send 1895412bps lastsnd:68604 lastrcv:68604 lastack:68547 pacing_rate 3790808bps delivery_rate 409872bps delivered:7 app_limited busy:213ms rcv_space:56575 rcv_ssthresh:56575 minrtt:56.524 snd_wnd:81920 tcp-ulp-tls rxconf: none txconf: none
0 0 172.31.31.175:443 172.70.54.160:52030 users:(("nginx",pid=66704,fd=13))
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d0) cubic wscale:13,7 rto:232 rtt:31.181/12.165 ato:44 mss:1448 pmtu:9001 rcvmss:768 advmss:8949 cwnd:10 bytes_sent:6252 bytes_acked:6252 bytes_received:2077 segs_out:9 segs_in:11 data_segs_out:8 data_segs_in:4 send 3715083bps lastsnd:16622 lastrcv:16623 lastack:16596 pacing_rate 7430136bps delivery_rate 1688504bps delivered:9 app_limited busy:120ms rcv_space:56575 rcv_ssthresh:56575 minrtt:26.599 snd_wnd:90112 tcp-ulp-tls rxconf: none txconf: none
0 0 [::ffff:172.31.31.175]:10 [::ffff:190.14.11.2]:53465 users:(("sshd",pid=52774,fd=4),("sshd",pid=52704,fd=4))
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d10) cubic wscale:6,7 rto:318 rtt:117.281/44.587 ato:42 mss:1448 pmtu:9001 rcvmss:1448 advmss:8949 cwnd:19 bytes_sent:114278 bytes_retrans:72 bytes_acked:114206 bytes_received:94773 segs_out:2644 segs_in:4936 data_segs_out:2542 data_segs_in:2538 send 1876655bps lastsnd:4952075 lastrcv:4952075 lastack:4951894 pacing_rate 3753296bps delivery_rate 2492136bps delivered:2543 app_limited busy:54876ms retrans:0/2 dsack_dups:2 rcv_rtt:58 rcv_space:56575 rcv_ssthresh:56575 minrtt:52.515 rcv_ooopack:52 snd_wnd:130944
0 0 [::ffff:172.31.31.175]:10 [::ffff:190.14.11.2]:53836 users:(("sshd",pid=65783,fd=4),("sshd",pid=65613,fd=4))
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d37) cubic wscale:6,7 rto:267 rtt:66.75/8.492 ato:41 mss:1448 pmtu:9001 rcvmss:1448 advmss:8949 cwnd:12 bytes_sent:183230 bytes_retrans:36 bytes_acked:183194 bytes_received:73801 segs_out:1861 segs_in:3185 data_segs_out:1718 data_segs_in:1678 send 2082517bps lastsnd:3216659 lastrcv:3216659 lastack:3216603 pacing_rate 4164976bps delivery_rate 4549800bps delivered:1719 app_limited busy:36549ms retrans:0/1 dsack_dups:1 rcv_rtt:62 rcv_space:56575 rcv_ssthresh:56575 minrtt:53.898 rcv_ooopack:102 snd_wnd:131008
0 0 [::ffff:172.31.31.175]:10 [::ffff:190.14.11.2]:51723 users:(("sshd",pid=51964,fd=4),("sshd",pid=51917,fd=4))
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d0) cubic wscale:8,7 rto:272 rtt:71.937/11.595 ato:66 mss:1460 pmtu:9001 rcvmss:1432 advmss:8961 cwnd:10 bytes_sent:39498 bytes_acked:39498 bytes_received:34985 segs_out:949 segs_in:1056 data_segs_out:945 data_segs_in:876 send 1623643bps lastsnd:5792676 lastrcv:5792676 lastack:5792623 pacing_rate 3247280bps delivery_rate 887624bps delivered:946 app_limited busy:31577ms rcv_space:56575 rcv_ssthresh:56575 minrtt:52.688 snd_wnd:64512
0 0 [::ffff:172.31.31.175]:10 [::ffff:200.119.170.148]:59753 users:(("sshd",pid=70964,fd=4),("sshd",pid=70917,fd=4))
skmem:(r0,rb131072,t0,tb184320,f0,w0,o0,bl0,d0) cubic wscale:8,7 rto:309 rtt:108.106/32.967 ato:40 mss:1400 pmtu:9001 rcvmss:1400 advmss:8961 cwnd:10 bytes_sent:111654 bytes_acked:111654 bytes_received:4472 segs_out:173 segs_in:79 data_segs_out:141 data_segs_in:47 send 1036020bps lastsnd:613188 lastrcv:585389 lastack:585389 pacing_rate 2072040bps delivery_rate 686944bps delivered:142 app_limited busy:3426ms rcv_space:56575 rcv_ssthresh:56575 minrtt:76.992 snd_wnd:130560
0 0 [::ffff:172.31.31.175]:10 [::ffff:190.56.194.12]:49226 users:(("sshd",pid=55146,fd=4),("sshd",pid=54988,fd=4))
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d0) cubic wscale:6,7 rto:256 rtt:55.891/1.107 ato:43 mss:1448 pmtu:9001 rcvmss:1448 advmss:8949 cwnd:26 bytes_sent:105610 bytes_acked:105610 bytes_received:81609 segs_out:2194 segs_in:4124 data_segs_out:2174 data_segs_in:2057 send 5388775bps lastsnd:4143074 lastrcv:4143074 lastack:4143016 pacing_rate 10777424bps delivery_rate 2452152bps delivered:2175 app_limited busy:45800ms rcv_rtt:60 rcv_space:56575 rcv_ssthresh:56575 minrtt:54.014 snd_wnd:131008
0 0 [::ffff:172.31.31.175]:10 [::ffff:190.56.194.12]:57568 users:(("sshd",pid=72892,fd=4),("sshd",pid=72836,fd=4))
skmem:(r0,rb131072,t0,tb87040,f0,w0,o0,bl0,d0) cubic wscale:7,7 rto:275 rtt:74.762/6.918 ato:40 mss:1448 pmtu:9001 rcvmss:752 advmss:8949 cwnd:12 bytes_sent:5802 bytes_acked:5802 bytes_received:2888 segs_out:42 segs_in:50 data_segs_out:34 data_segs_in:22 send 1859340bps lastsnd:733492 lastrcv:868779 lastack:733415 pacing_rate 3718648bps delivery_rate 891944bps delivered:35 app_limited busy:1693ms rcv_space:56575 rcv_ssthresh:56575 minrtt:56.443 snd_wnd:64000
0 332 [::ffff:172.31.31.175]:10 [::ffff:190.56.194.12]:51918 users:(("sshd",pid=61117,fd=4),("sshd",pid=60953,fd=4))
skmem:(r0,rb1133228,t0,tb87040,f3380,w4812,o0,bl0,d0) cubic wscale:7,7 rto:310 rtt:109.942/7.38 ato:40 mss:1448 pmtu:9001 rcvmss:1448 advmss:8949 cwnd:12 bytes_sent:674134 bytes_acked:673802 bytes_received:537794 segs_out:15013 segs_in:16022 data_segs_out:14936 data_segs_in:14735 send 1264376bps lastrcv:26 lastack:25 pacing_rate 2528736bps delivery_rate 4745920bps delivered:14932 app_limited busy:302704ms unacked:5 rcv_rtt:50226.9 rcv_space:62770 rcv_ssthresh:56575 minrtt:56.218 snd_wnd:91904
0 0 [::ffff:172.31.31.175]:10 [::ffff:190.56.194.12]:52844 users:(("sshd",pid=62056,fd=4),("sshd",pid=62009,fd=4))
skmem:(r0,rb131072,t0,tb243712,f0,w0,o0,bl0,d0) cubic wscale:8,7 rto:279 rtt:78.888/16.393 ato:40 mss:1460 pmtu:9001 rcvmss:1460 advmss:8961 cwnd:16 bytes_sent:231654 bytes_acked:231654 bytes_received:43292 segs_out:1994 segs_in:1611 data_segs_out:1945 data_segs_in:856 send 2368928bps lastsnd:2242472 lastrcv:1921727 lastack:1921727 pacing_rate 4737800bps delivery_rate 2585608bps delivered:1946 app_limited busy:38942ms rcv_space:56575 rcv_ssthresh:56575 minrtt:53.263 snd_wnd:130816
0 0 [::ffff:172.31.31.175]:10 [::ffff:190.56.51.34]:39007 users:(("sshd",pid=62539,fd=4),("sshd",pid=62469,fd=4))
skmem:(r0,rb131072,t0,tb46080,f0,w0,o0,bl0,d0) cubic wscale:7,7 rto:294 rtt:93.384/14.753 ato:46 mss:1388 pmtu:9001 rcvmss:1388 advmss:8949 cwnd:6 ssthresh:4 bytes_sent:937290 bytes_retrans:29532 bytes_acked:907758 bytes_received:683994 segs_out:19894 segs_in:23329 data_segs_out:17551 data_segs_in:18445 send 713441bps lastsnd:3133388 lastrcv:3133388 lastack:3133257 pacing_rate 856120bps delivery_rate 881904bps delivered:16976 app_limited busy:381737ms retrans:0/454 dsack_dups:5 rcv_rtt:85 rcv_space:56575 rcv_ssthresh:56575 minrtt:63.844 rcv_ooopack:4 snd_wnd:64128