Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
| Següent revisió | Revisió prèvia | ||
| linux:seguridad:sadservers [15/05/2024 03:54] – creat mate | linux:seguridad:sadservers [28/05/2024 06:51] (actual) – ["Resumable Server": Linux Upskill Challenge] mate | ||
|---|---|---|---|
| Línia 19: | Línia 19: | ||
| (Open window once more to see the complete solution). | (Open window once more to see the complete solution). | ||
| + | </ | ||
| + | |||
| + | == " | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * -h: numérico humano | ||
| + | * -r: reverso | ||
| + | * -k[primer-campo], | ||
| + | * -t < | ||
| + | * '' | ||
| + | < | ||
| + | 1. To get the first field (IP) of the file, you can do awk ' | ||
| + | |||
| + | 2. After the previous step, you want to sort the IPs so they are together and can be counted: cat access.log | awk ' | ||
| + | |||
| + | 3. Now you want to do the count with "uniq -c", so we have so far: awk ' | ||
| + | |||
| + | 4. Finally you want to sort the results with " | ||
| + | |||
| + | (Open window once more to see the complete solution). | ||
| + | |||
| + | Solution: One posible way is awk ' | ||
| + | </ | ||
| + | |||
| + | == " | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | < | ||
| + | 1. Use grep recursively or use find and pass the results to grep via xargs | ||
| + | |||
| + | (Open window once more to see the solution to the first part). | ||
| + | |||
| + | 2. (Solution to 1) cd / | ||
| + | |||
| + | (Open window once more to see the solution to the second part). | ||
| + | |||
| + | 3. (Solution to 2) The file with exactly one Alice occurrence is 1342-0.txt :grep Alice -A 1 / | ||
| + | </ | ||
| + | |||
| + | == "The Command Line Murders" | ||
| + | * '' | ||
| + | * '' | ||
| + | < | ||
| + | 1. You can use the knock utility, for example to knock on port 3000: knock localhost 3000. Netcat (nc) and nmap are also available. Note than nmap has some options where you'd need to be root (not possible here) | ||
| + | |||
| + | 2. You can also write a BASH script that knocks sequentially on all ports. | ||
| + | |||
| + | 3. Solution.Probably the fastest is using nmap against all ports, for example: nmap -p- localhost. | ||
| + | </ | ||
| + | |||
| + | == " | ||
| + | < | ||
| + | |||
| + | == " | ||
| + | * '' | ||
| + | < | ||
| + | 1. The issue might be related to the configuration of the PostgreSQL server. (See the error message when attempting the tedt). The configuration files are usually located in the / | ||
| + | |||
| + | 2. The pg_hba.conf file controls client authentication. This file is read on start-up and when the main server process receives a SIGHUP signal. If you’re having trouble connecting to the database, this file could be a good place to look. (Click again "Next Clue/ | ||
| + | |||
| + | Solution: In the / | ||
| </ | </ | ||