├── README.md ├── LICENSE ├── superinfo.sh └── super-info.sh /README.md: -------------------------------------------------------------------------------- 1 | # Super Info | BASH Script 2 | 3 | **Author:** Bocaletto Luca 4 | 5 | ## Overview 6 | 7 | **Super Info** is a comprehensive, command-line utility designed for system administrators working on Ubuntu and Debian-based distributions. Developed entirely in Bash, it provides essential functionality for security monitoring and system checks without relying on an external GUI library. Instead, the tool "draws" its text-based interfaces using ASCII borders and colorized output (if your terminal supports colors) to improve readability. 8 | 9 | This tool helps you quickly obtain critical system information and monitor various services. Its modular design includes the following features: 10 | 11 | - **System Info:** 12 | Displays basic system information such as the OS name, kernel version, architecture, hostname, date/time, and locale. 13 | 14 | - **Machine Info:** 15 | Shows detailed hardware specifications, including CPU details, memory usage, disk space, and network interfaces. 16 | 17 | - **User Info:** 18 | Provides details about the current user—username, UID, groups, home directory, and recent login history. 19 | 20 | - **Login & Service Monitoring:** 21 | Runs a loop that refreshes every 5 seconds to display current login sessions and the status of critical services (e.g., sshd, apache2/nginx, mysqld/mariadb, postgresql). You can press **m** during the update wait time to exit this monitoring loop and return to the main menu. 22 | 23 | - **Authentication Log Monitoring:** 24 | Continuously displays the latest 20 events from `/var/log/auth.log` to help you track authentication-related incidents. Press **m** to break the loop and return to the menu. 25 | 26 | - **Network & Ports Analysis:** 27 | Uses the `ss` command to scan and display all open ports on the system. 28 | 29 | - **File Integrity Check:** 30 | Runs an integrity check via `debsums`, comparing the current file checksums with the expected ones from the installed packages. It explains the process and displays any discrepancies (or a "system is intact" message if no errors are found). 31 | 32 | - **Advanced Dashboard:** 33 | Launches the real-time dashboard provided by Glances (if installed) for advanced system monitoring. Exit Glances by pressing **q** or **Ctrl+C** to return to the menu. 34 | 35 | - **Audit & Log Correlation:** 36 | Searches through the authentication logs for suspicious keywords (such as "failed," "invalid," or "error") and displays the last 30 matching entries. 37 | 38 | - **Suspicious Process Check:** 39 | Inspects the top 30 CPU-consuming processes and flags any processes that are not part of a predefined whitelist. 40 | 41 | - **Exit:** 42 | Terminates the utility. 43 | 44 | ## Features 45 | 46 | - **Clear, Text-Driven Interface:** 47 | Each area of the tool is rendered in a visually organized manner using ASCII borders and centered titles. Color codes (using `tput setaf` for universal compatibility) are applied if your terminal supports at least 8 colors. 48 | 49 | - **Universal Compatibility:** 50 | The tool uses only standard commands available on Ubuntu and all Debian-based systems, ensuring it runs on all these environments. 51 | 52 | - **Modular Design:** 53 | Each function—whether providing system info, hardware info, or live monitoring—is self-contained, making the tool easy to maintain and extend. 54 | 55 | - **Real-Time Monitoring:** 56 | Certain functions (like monitoring login sessions and authentication logs) update every 5 seconds and allow you to exit by pressing **m**. 57 | 58 | - **Automatic Dependency Checking:** 59 | At startup, the tool checks for required packages (Glances and Debsums) and prompts you to install any missing dependencies automatically via `apt-get`. 60 | 61 | ## Installation 62 | 63 | 1. **Requirements:** 64 | - Ubuntu or another Debian-based system 65 | - Bash shell 66 | - `sudo` privileges (to install missing dependencies) 67 | 68 | 2. **Clone the Repository:** 69 | 70 | ```bash 71 | git clone https://github.com/bocaletto-luca/super-info.git 72 | cd super-info 73 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /superinfo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Super Info – Admin Security Tool 3 | # Author: Bocaletto Luca 4 | # License: Apache 2.0 5 | # Language: English 6 | # 7 | # Super Info is a comprehensive, text-based utility for system administrators on 8 | # Ubuntu and other Debian-based distributions. It provides essential security 9 | # monitoring and system checks via a custom ASCII interface with colors. 10 | # 11 | # Features: 12 | # 1) System Info – Displays basic system information. 13 | # 2) Machine Info – Displays detailed hardware specifications. 14 | # 3) User Info – Shows details about the current user. 15 | # 4) Login & Service Monitoring – Monitors active sessions and status of critical services. 16 | # 5) Authentication Log Monitoring – Continuously displays the last 20 events from /var/log/auth.log. 17 | # 6) Network & Ports Analysis – Scans and displays open network ports (using ss). 18 | # 7) Advanced Dashboard – Launches the Glances real-time monitoring dashboard. 19 | # 8) Audit & Log Correlation – Searches auth logs for suspicious keywords. 20 | # 9) Suspicious Process Check – Analyzes the top 30 CPU-consuming processes and flags those not on a whitelist. 21 | # 0) Exit – Terminates the program. 22 | # 23 | ############################################################################### 24 | 25 | # --- Global Settings & Color Definitions --- 26 | export LANG="en_US.UTF-8" 27 | export NCURSES_NO_UTF8_ACS=1 28 | 29 | if [ "$(tput colors)" -ge 8 ]; then 30 | RED=$(tput setaf 1) 31 | GREEN=$(tput setaf 2) 32 | YELLOW=$(tput setaf 3) 33 | BLUE=$(tput setaf 4) 34 | MAGENTA=$(tput setaf 5) 35 | CYAN=$(tput setaf 6) 36 | NC=$(tput sgr0) 37 | else 38 | RED=""; GREEN=""; YELLOW=""; BLUE=""; MAGENTA=""; CYAN=""; NC=""; 39 | fi 40 | 41 | # --- Trap for clean exit on SIGINT and SIGTERM --- 42 | cleanup() { 43 | echo -e "\n${MAGENTA}Exiting Super Info...${NC}" 44 | exit 0 45 | } 46 | trap cleanup SIGINT SIGTERM 47 | 48 | # --- Logging function (estendibile) --- 49 | log_msg() { 50 | local level="$1" 51 | local msg="$2" 52 | # Puoi espandere questa funzione per scrivere su file se necessario. 53 | echo -e "[${level}] $(date +"%Y-%m-%d %T") : ${msg}" 54 | } 55 | 56 | # --- Utility Functions --- 57 | print_border() { 58 | local width=$(( $(tput cols) - 2 )) 59 | printf "+%0.s-" $(seq 1 "$width") 60 | echo "+" 61 | } 62 | 63 | print_title() { 64 | local title="$1" 65 | echo -e "$title" 66 | } 67 | 68 | # --- Dependency Checker --- 69 | check_install_dependencies() { 70 | local DEPS=(glances debsums) 71 | local missing=() 72 | for dep in "${DEPS[@]}"; do 73 | if ! command -v "$dep" &>/dev/null; then 74 | missing+=("$dep") 75 | fi 76 | done 77 | if [ ${#missing[@]} -gt 0 ]; then 78 | echo -e "${YELLOW}The following packages are missing and will be installed:${NC} ${missing[*]}" 79 | read -rp "Proceed with installation? [Y/n] " answer 80 | if [[ "$answer" =~ ^[Yy] || -z "$answer" ]]; then 81 | sudo apt-get update && sudo apt-get install -y "${missing[@]}" 82 | if [ $? -ne 0 ]; then 83 | echo -e "${RED}Error installing packages. Exiting.${NC}" 84 | exit 1 85 | fi 86 | else 87 | echo -e "${RED}Required dependencies missing. Exiting.${NC}" 88 | exit 1 89 | fi 90 | fi 91 | } 92 | check_install_dependencies 93 | 94 | set_dialog_dimensions() { 95 | TERM_HEIGHT=$(tput lines) 96 | TERM_WIDTH=$(tput cols) 97 | local MIN_HEIGHT=15 98 | local MIN_WIDTH=40 99 | if [ "$TERM_HEIGHT" -lt "$MIN_HEIGHT" ] || [ "$TERM_WIDTH" -lt "$MIN_WIDTH" ]; then 100 | echo -e "${RED}The terminal must be at least ${MIN_WIDTH} columns x ${MIN_HEIGHT} rows. Current size: ${TERM_WIDTH}x${TERM_HEIGHT}.${NC}" 101 | exit 1 102 | fi 103 | } 104 | set_dialog_dimensions 105 | 106 | # --- Feature Functions --- 107 | system_info() { 108 | clear 109 | print_border 110 | print_title "${YELLOW}SYSTEM INFO${NC}" 111 | print_border 112 | local os_info kernel arch host datetime lang 113 | if [ -f /etc/os-release ]; then 114 | os_info=$(grep PRETTY_NAME /etc/os-release | cut -d= -f2 | tr -d '"') 115 | else 116 | os_info="Unknown OS" 117 | fi 118 | kernel=$(uname -r) 119 | arch=$(uname -m) 120 | host=$(hostname) 121 | datetime=$(date +"%c") 122 | lang=$LANG 123 | 124 | echo -e "${CYAN}Description:${NC} This report displays basic system information." 125 | echo -e "${BLUE}OS:${NC} ${GREEN}${os_info}${NC}" 126 | echo -e "${BLUE}Kernel:${NC} ${GREEN}${kernel}${NC}" 127 | echo -e "${BLUE}Architecture:${NC} ${GREEN}${arch}${NC}" 128 | echo -e "${BLUE}Hostname:${NC} ${GREEN}${host}${NC}" 129 | echo -e "${BLUE}Date/Time:${NC} ${GREEN}${datetime}${NC}" 130 | echo -e "${BLUE}Locale:${NC} ${GREEN}${lang}${NC}" 131 | print_border 132 | read -rp "Press Enter to return to the menu..." dummy 133 | } 134 | 135 | machine_info() { 136 | clear 137 | print_border 138 | print_title "${YELLOW}MACHINE INFO${NC}" 139 | print_border 140 | local cpu mem disk net 141 | if command -v lscpu &>/dev/null; then 142 | cpu=$(lscpu | sed 's/^/ /') 143 | else 144 | cpu=$(cat /proc/cpuinfo | head -n 15 | sed 's/^/ /') 145 | fi 146 | mem=$(free -h | sed 's/^/ /') 147 | disk=$(df -h | sed 's/^/ /') 148 | net=$(ip -brief addr | sed 's/^/ /') 149 | 150 | echo -e "${CYAN}Description:${NC} This report displays the hardware specifications." 151 | echo -e "${MAGENTA}CPU:${NC}\n${GREEN}${cpu}${NC}" 152 | echo -e "${MAGENTA}Memory:${NC}\n${GREEN}${mem}${NC}" 153 | echo -e "${MAGENTA}Disk Usage:${NC}\n${GREEN}${disk}${NC}" 154 | echo -e "${MAGENTA}Network Interfaces:${NC}\n${GREEN}${net}${NC}" 155 | print_border 156 | read -rp "Press Enter to return to the menu..." dummy 157 | } 158 | 159 | user_info() { 160 | clear 161 | print_border 162 | print_title "${YELLOW}USER INFO${NC}" 163 | print_border 164 | local info last_logins 165 | info="${CYAN}User:${NC} ${GREEN}${USER}${NC}" 166 | info+="\n${CYAN}UID:${NC} ${GREEN}$(id -u)${NC}" 167 | info+="\n${CYAN}Groups:${NC} ${GREEN}$(id -Gn)${NC}" 168 | info+="\n${CYAN}Home Dir:${NC} ${GREEN}${HOME}${NC}" 169 | last_logins=$(last -n 3 | head -n 3 | sed 's/^/ /') 170 | 171 | echo -e "${CYAN}Description:${NC} This report shows details about the current user." 172 | echo -e "$info" 173 | echo -e "\n${MAGENTA}Recent Logins:${NC}\n${GREEN}${last_logins}${NC}" 174 | print_border 175 | read -rp "Press Enter to return to the menu..." dummy 176 | } 177 | 178 | login_service_monitor() { 179 | while true; do 180 | local ts sessions multi key output 181 | ts=$(date +"%c") 182 | sessions=$(who) 183 | output="${BLUE}Date/Time:${NC} ${GREEN}${ts}${NC}\n" 184 | output+="\n${MAGENTA}Active Sessions:${NC}\n${GREEN}${sessions}${NC}\n" 185 | multi="" 186 | while read -r user tty; do 187 | local count 188 | count=$(who | awk -v u="$user" '$1==u {print $2}' | sort -u | wc -l) 189 | if [ $count -gt 1 ]; then 190 | multi+="${RED}Warning:${NC} User ${YELLOW}$user${NC} has ${GREEN}$count${NC} simultaneous sessions.\n" 191 | fi 192 | done < <(who | awk '{print $1, $2}' | sort -u) 193 | [ -n "$multi" ] && output+="\n${RED}*** Multiple Login Warnings ***${NC}\n${multi}" 194 | output+="\n${MAGENTA}Service Status:${NC}\n" 195 | local SERVICES=("sshd" "apache2" "nginx" "mysqld" "mariadb" "postgresql") 196 | for svc in "${SERVICES[@]}"; do 197 | local status statustxt 198 | status=$(systemctl is-active "$svc" 2>/dev/null) 199 | if [ "$status" = "active" ]; then 200 | statustxt="${GREEN}Running${NC}" 201 | else 202 | statustxt="${RED}Not Running${NC}" 203 | fi 204 | output+="${CYAN}Service ${svc}:${NC} ${statustxt}\n" 205 | done 206 | clear 207 | echo -e "$output" 208 | echo -e "\nPress 'm' to return to the menu, or wait 5 seconds for an update..." 209 | read -t 5 -n 1 key 210 | [ "$key" = "m" ] && break 211 | done 212 | } 213 | 214 | auth_log_monitor() { 215 | while true; do 216 | local rep key 217 | rep=$(tail -n 20 /var/log/auth.log 2>/dev/null) 218 | clear 219 | if [ -z "$rep" ]; then 220 | echo -e "${RED}The file /var/log/auth.log is inaccessible or empty.${NC}" 221 | else 222 | echo -e "${YELLOW}*** Last 20 Events from Auth Log ***${NC}\n${GREEN}${rep}${NC}" 223 | fi 224 | echo -e "\nPress 'm' to return to the menu, or wait 5 seconds for an update..." 225 | read -t 5 -n 1 key 226 | [ "$key" = "m" ] && break 227 | done 228 | } 229 | 230 | network_ports_analysis() { 231 | clear 232 | print_border 233 | print_title "${YELLOW}NETWORK & PORTS ANALYSIS${NC}" 234 | print_border 235 | local rep 236 | rep=$(ss -tuln 2>/dev/null) 237 | if [ -z "$rep" ]; then 238 | echo -e "${RED}No output from ss.${NC}" 239 | else 240 | echo -e "${CYAN}Scan Results:${NC}\n${GREEN}${rep}${NC}" 241 | fi 242 | print_border 243 | read -rp "Press Enter to return to the menu..." dummy 244 | } 245 | 246 | paginate_output() { 247 | local output="$1" 248 | local lines_per_page=${2:-20} 249 | IFS=$'\n' read -rd '' -a lines <<< "$output" 250 | local total_lines=${#lines[@]} 251 | local i=0 252 | while [ $i -lt $total_lines ]; do 253 | clear 254 | for (( j=0; j/dev/null; then 271 | local tmpfile 272 | tmpfile=$(mktemp /tmp/debsums_output.XXXXXX) 273 | timeout 60s debsums -s 2>/dev/null > "$tmpfile" 274 | if [ ! -s "$tmpfile" ]; then 275 | echo -e "${GREEN}All system files are intact according to debsums.${NC}" 276 | read -rp "\nPress Enter to return to the menu..." dummy 277 | else 278 | echo -e "${RED}Integrity errors detected:${NC}\n" 279 | paginate_output "$(cat "$tmpfile")" 20 280 | read -rp "\nPress Enter to return to the menu..." dummy 281 | fi 282 | rm -f "$tmpfile" 283 | else 284 | echo -e "${RED}Debsums is not installed.${NC}" 285 | echo "Install debsums with: sudo apt-get install debsums" 286 | read -rp "\nPress Enter to return to the menu..." dummy 287 | fi 288 | } 289 | 290 | advanced_dashboard() { 291 | clear 292 | if command -v glances &>/dev/null; then 293 | echo -e "${YELLOW}Glances dashboard is now running.${NC}" 294 | echo -e "${CYAN}To return to the menu, press 'q' or Ctrl+C to exit Glances.${NC}" 295 | sleep 2 296 | glances 297 | echo -e "${YELLOW}Dashboard closed. Press Enter to return to the menu.${NC}" 298 | read -rp "" dummy 299 | else 300 | echo -e "${RED}Glances is not installed.${NC}" 301 | echo "Install Glances to use the advanced dashboard." 302 | read -rp "Press Enter to return to the menu..." dummy 303 | fi 304 | } 305 | 306 | audit_log() { 307 | clear 308 | print_border 309 | print_title "${YELLOW}AUDIT & LOG CORRELATION${NC}" 310 | print_border 311 | echo -e "${CYAN}Description:${NC} This function searches the authentication logs for keywords such as 'failed', 'invalid', and 'error'." 312 | echo -e "It displays the last 30 suspicious events (if any).\n" 313 | local rep 314 | rep=$(grep -Ei "failed|invalid|error" /var/log/auth.log 2>/dev/null | tail -n 30) 315 | if [ -z "$rep" ]; then 316 | echo -e "${GREEN}No suspicious events found in authentication logs.${NC}" 317 | else 318 | echo -e "${YELLOW}${rep}${NC}" 319 | fi 320 | print_border 321 | read -rp "Press Enter to return to the menu..." dummy 322 | } 323 | 324 | suspicious_process_check() { 325 | clear 326 | print_border 327 | print_title "${YELLOW}SUSPICIOUS PROCESS CHECK${NC}" 328 | print_border 329 | local WHITELIST=("bash" "sh" "init" "systemd" "kthreadd" "rcu_sched" "migration" "cron" "sshd" "apache2" "nginx" "mysqld" "mariadb" "postgres" "dbus-daemon" "rsyslogd" "glances") 330 | local suspicious="" 331 | while IFS= read -r line; do 332 | local cmd base found 333 | cmd=$(echo "$line" | awk '{print $11}') 334 | base=$(basename "$cmd") 335 | [ -z "$base" ] && continue 336 | found=0 337 | for proc in "${WHITELIST[@]}"; do 338 | if [[ "$base" == "$proc" ]]; then 339 | found=1 340 | break 341 | fi 342 | done 343 | if [ $found -eq 0 ]; then 344 | suspicious+="${RED}${line}${NC}\n" 345 | fi 346 | done < <(ps aux --sort=-%cpu | head -n 30) 347 | if [ -z "$suspicious" ]; then 348 | suspicious="${GREEN}No suspicious processes detected among the top 30 CPU consumers.${NC}" 349 | fi 350 | echo -e "${YELLOW}*** Suspicious Process Check ***${NC}\n" 351 | echo -e "${CYAN}${suspicious}${NC}" 352 | print_border 353 | read -rp "Press Enter to return to the menu..." dummy 354 | } 355 | 356 | main_menu() { 357 | while true; do 358 | clear 359 | print_border 360 | print_title "${MAGENTA}ADMIN SECURITY TOOL (Super Info)${NC}" 361 | print_border 362 | echo -e "${CYAN}Select an option by entering the corresponding number:${NC}\n" 363 | echo -e "${YELLOW}1) System Info" 364 | echo -e "2) Machine Info" 365 | echo -e "3) User Info" 366 | echo -e "4) Login & Service Monitoring" 367 | echo -e "5) Authentication Log Monitoring" 368 | echo -e "6) Network & Ports Analysis" 369 | #echo -e "7) File Integrity Check" 370 | echo -e "7) Advanced Dashboard" 371 | echo -e "8) Audit & Log Correlation" 372 | echo -e "9) Suspicious Process Check${NC}" 373 | echo -e "${RED}0) Exit${NC}\n" 374 | print_border 375 | read -rp "Enter your choice: " choice 376 | case $choice in 377 | 1) system_info ;; 378 | 2) machine_info ;; 379 | 3) user_info ;; 380 | 4) login_service_monitor ;; 381 | 5) auth_log_monitor ;; 382 | 6) network_ports_analysis ;; 383 | #7) file_integrity_check ;; 384 | 7) advanced_dashboard ;; 385 | 8) audit_log ;; 386 | 9) suspicious_process_check ;; 387 | 0) clear; echo -e "${MAGENTA}Exiting...${NC}"; exit 0 ;; 388 | *) echo -e "${RED}Invalid choice. Please try again.${NC}"; sleep 2 ;; 389 | esac 390 | done 391 | } 392 | 393 | # --- Initialization & Start --- 394 | clear 395 | echo -e "${MAGENTA}Starting Super Info – Admin Security Tool...${NC}" 396 | sleep 1 397 | main_menu 398 | -------------------------------------------------------------------------------- /super-info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Super Info 3 | # Author: Bocaletto Luca 4 | # License: Apache 2.0 5 | # Language: English 6 | # Super Info is a comprehensive, text-based utility for system administrators on 7 | # Ubuntu and other Debian-based distributions. It provides essential security 8 | # monitoring and system checks via a custom ASCII interface with colors (when supported). 9 | # 10 | # Features: 11 | # 1) System Info – Displays basic system information. 12 | # 2) Machine Info – Displays detailed hardware specifications. 13 | # 3) User Info – Shows details about the current user. 14 | # 4) Login & Service Monitoring – Monitors active sessions and the status of critical services. 15 | # 5) Authentication Log Monitoring – Continuously displays the last 20 events from /var/log/auth.log. 16 | # 6) Network & Ports Analysis – Scans and displays open network ports (using ss). 17 | # 7) File Integrity Check – Checks system file integrity using Debsums. 18 | # 8) Advanced Dashboard – Launches the Glances real-time monitoring dashboard (if installed). 19 | # 9) Audit & Log Correlation – Searches auth logs for suspicious keywords. 20 | # 10) Suspicious Process Check – Analyzes the top 30 CPU-consuming processes and flags those not on a whitelist. 21 | # 0) Exit – Terminates the program. 22 | # 23 | # At startup, the tool checks for required packages (Glances and Debsums) and 24 | # prompts the user to install them if missing. 25 | # 26 | # ----------------------------------------------------------------------------- # 27 | # Environment settings and portable color definitions 28 | 29 | export LANG="en_US.UTF-8" 30 | export NCURSES_NO_UTF8_ACS=1 31 | 32 | if [ "$(tput colors)" -ge 8 ]; then 33 | RED=$(tput setaf 1) 34 | GREEN=$(tput setaf 2) 35 | YELLOW=$(tput setaf 3) 36 | BLUE=$(tput setaf 4) 37 | MAGENTA=$(tput setaf 5) 38 | CYAN=$(tput setaf 6) 39 | NC=$(tput sgr0) 40 | else 41 | RED="" 42 | GREEN="" 43 | YELLOW="" 44 | BLUE="" 45 | MAGENTA="" 46 | CYAN="" 47 | NC="" 48 | fi 49 | 50 | # Function: print_border 51 | # Prints a horizontal border based on the terminal width. 52 | print_border() { 53 | local width=$(( $(tput cols) - 2 )) 54 | printf "+%0.s-" $(seq 1 "$width") 55 | echo "+" 56 | } 57 | 58 | # Function: print_title 59 | # Prints the title. 60 | print_title() { 61 | local title="$1" 62 | echo "$title" 63 | } 64 | 65 | ############################################################################### 66 | # Dependency Checker 67 | # Checks if the required packages (glances, debsums) are installed; 68 | # if missing, prompts the user to install them. 69 | ############################################################################### 70 | check_install_dependencies() { 71 | local DEPS=(glances debsums) 72 | local missing=() 73 | for dep in "${DEPS[@]}"; do 74 | if ! command -v "$dep" &>/dev/null; then 75 | missing+=("$dep") 76 | fi 77 | done 78 | if [ ${#missing[@]} -gt 0 ]; then 79 | echo -e "${YELLOW}The following packages are missing and will be installed:${NC} ${missing[*]}" 80 | read -rp "Proceed with installation? [Y/n] " answer 81 | if [[ "$answer" =~ ^[Yy] || -z "$answer" ]]; then 82 | sudo apt-get update 83 | sudo apt-get install -y "${missing[@]}" 84 | if [ $? -ne 0 ]; then 85 | echo -e "${RED}Error installing packages. Exiting.${NC}" 86 | exit 1 87 | fi 88 | else 89 | echo -e "${RED}Required dependencies missing. Exiting.${NC}" 90 | exit 1 91 | fi 92 | fi 93 | } 94 | check_install_dependencies 95 | 96 | ############################################################################### 97 | # set_dialog_dimensions 98 | # Checks terminal dimensions. 99 | ############################################################################### 100 | set_dialog_dimensions() { 101 | TERM_HEIGHT=$(tput lines) 102 | TERM_WIDTH=$(tput cols) 103 | MIN_HEIGHT=15 104 | MIN_WIDTH=40 105 | if [ "$TERM_HEIGHT" -lt "$MIN_HEIGHT" ] || [ "$TERM_WIDTH" -lt "$MIN_WIDTH" ]; then 106 | echo -e "${RED}The terminal must be at least ${MIN_WIDTH} columns x ${MIN_HEIGHT} rows. Current size: ${TERM_WIDTH}x${TERM_HEIGHT}.${NC}" 107 | exit 1 108 | fi 109 | } 110 | set_dialog_dimensions 111 | 112 | ############################################################################### 113 | # Function: system_info 114 | # Displays basic system information. 115 | ############################################################################### 116 | system_info() { 117 | clear 118 | print_border 119 | print_title "${YELLOW}SYSTEM INFO${NC}" 120 | print_border 121 | if [ -f /etc/os-release ]; then 122 | os_info=$(grep PRETTY_NAME /etc/os-release | cut -d= -f2 | tr -d '"') 123 | else 124 | os_info="Unknown OS" 125 | fi 126 | kernel=$(uname -r) 127 | arch=$(uname -m) 128 | host=$(hostname) 129 | datetime=$(date +"%c") 130 | lang=$LANG 131 | 132 | echo -e "${CYAN}Description:${NC} This report displays basic system information." 133 | echo -e "${BLUE}OS:${NC} ${GREEN}${os_info}${NC}" 134 | echo -e "${BLUE}Kernel:${NC} ${GREEN}${kernel}${NC}" 135 | echo -e "${BLUE}Architecture:${NC} ${GREEN}${arch}${NC}" 136 | echo -e "${BLUE}Hostname:${NC} ${GREEN}${host}${NC}" 137 | echo -e "${BLUE}Date/Time:${NC} ${GREEN}${datetime}${NC}" 138 | echo -e "${BLUE}Locale:${NC} ${GREEN}${lang}${NC}" 139 | print_border 140 | read -rp "Press Enter to return to the menu..." dummy 141 | } 142 | 143 | ############################################################################### 144 | # Function: machine_info 145 | # Displays detailed hardware specifications. 146 | ############################################################################### 147 | machine_info() { 148 | clear 149 | print_border 150 | print_title "${YELLOW}MACHINE INFO${NC}" 151 | print_border 152 | if command -v lscpu &>/dev/null; then 153 | cpu=$(lscpu | sed 's/^/ /') 154 | else 155 | cpu=$(cat /proc/cpuinfo | head -n 15 | sed 's/^/ /') 156 | fi 157 | mem=$(free -h | sed 's/^/ /') 158 | disk=$(df -h | sed 's/^/ /') 159 | net=$(ip -brief addr | sed 's/^/ /') 160 | 161 | echo -e "${CYAN}Description:${NC} This report displays the hardware specifications of the machine." 162 | echo -e "${MAGENTA}CPU:${NC}\n${GREEN}${cpu}${NC}" 163 | echo -e "${MAGENTA}Memory:${NC}\n${GREEN}${mem}${NC}" 164 | echo -e "${MAGENTA}Disk Usage:${NC}\n${GREEN}${disk}${NC}" 165 | echo -e "${MAGENTA}Network Interfaces:${NC}\n${GREEN}${net}${NC}" 166 | print_border 167 | read -rp "Press Enter to return to the menu..." dummy 168 | } 169 | 170 | ############################################################################### 171 | # Function: user_info 172 | # Displays details about the current user. 173 | ############################################################################### 174 | user_info() { 175 | clear 176 | print_border 177 | print_title "${YELLOW}USER INFO${NC}" 178 | print_border 179 | info="${CYAN}User:${NC} ${GREEN}${USER}${NC}" 180 | info+="\n${CYAN}UID:${NC} ${GREEN}$(id -u)${NC}" 181 | info+="\n${CYAN}Groups:${NC} ${GREEN}$(id -Gn)${NC}" 182 | info+="\n${CYAN}Home Dir:${NC} ${GREEN}${HOME}${NC}" 183 | last_logins=$(last -n 3 | head -n 3 | sed 's/^/ /') 184 | 185 | echo -e "${CYAN}Description:${NC} This report shows details about the current user." 186 | echo -e "$info" 187 | echo -e "\n${MAGENTA}Recent Logins:${NC}\n${GREEN}${last_logins}${NC}" 188 | print_border 189 | read -rp "Press Enter to return to the menu..." dummy 190 | } 191 | 192 | ############################################################################### 193 | # Function: login_service_monitor 194 | # Monitors active sessions and status of critical services. 195 | # At each update, the user may press 'm' during a brief timeout to return to the menu. 196 | ############################################################################### 197 | login_service_monitor() { 198 | while true; do 199 | ts=$(date +"%c") 200 | sessions=$(who) 201 | output="${BLUE}Date/Time:${NC} ${GREEN}${ts}${NC}\n" 202 | output+="\n${MAGENTA}Active Sessions:${NC}\n${GREEN}${sessions}${NC}\n" 203 | multi="" 204 | while read -r user tty; do 205 | count=$(who | awk -v u="$user" '$1==u {print $2}' | sort -u | wc -l) 206 | if [ $count -gt 1 ]; then 207 | multi+="${RED}Warning:${NC} User ${YELLOW}$user${NC} has ${GREEN}$count${NC} simultaneous sessions.\n" 208 | fi 209 | done < <(who | awk '{print $1, $2}' | sort -u) 210 | if [ -n "$multi" ]; then 211 | output+="\n${RED}*** Multiple Login Warnings ***${NC}\n${multi}" 212 | fi 213 | output+="\n${MAGENTA}Service Status:${NC}\n" 214 | SERVICES=("sshd" "apache2" "nginx" "mysqld" "mariadb" "postgresql") 215 | for svc in "${SERVICES[@]}"; do 216 | status=$(systemctl is-active "$svc" 2>/dev/null) 217 | if [ "$status" = "active" ]; then 218 | statustxt="${GREEN}Running${NC}" 219 | else 220 | statustxt="${RED}Not Running${NC}" 221 | fi 222 | output+="${CYAN}Service ${svc}:${NC} ${statustxt}\n" 223 | done 224 | clear 225 | echo -e "$output" 226 | echo -e "\nPress 'm' to return to the menu, or wait 5 seconds for an update..." 227 | read -t 5 -n 1 key 228 | if [ "$key" = "m" ]; then break; fi 229 | done 230 | } 231 | 232 | ############################################################################### 233 | # Function: auth_log_monitor 234 | # Continuously displays the last 20 events from /var/log/auth.log. 235 | # Press 'm' during a timeout to return to the menu. 236 | ############################################################################### 237 | auth_log_monitor() { 238 | while true; do 239 | rep=$(tail -n 20 /var/log/auth.log 2>/dev/null) 240 | clear 241 | if [ -z "$rep" ]; then 242 | echo -e "${RED}The file /var/log/auth.log is inaccessible or empty.${NC}" 243 | else 244 | echo -e "${YELLOW}*** Last 20 Events from Auth Log ***${NC}\n${GREEN}${rep}${NC}" 245 | fi 246 | echo -e "\nPress 'm' to return to the menu, or wait 5 seconds for an update..." 247 | read -t 5 -n 1 key 248 | if [ "$key" = "m" ]; then break; fi 249 | done 250 | } 251 | 252 | ############################################################################### 253 | # Function: network_ports_analysis 254 | # Scans and displays open network ports using the 'ss' command. 255 | ############################################################################### 256 | network_ports_analysis() { 257 | clear 258 | print_border 259 | print_title "${YELLOW}NETWORK & PORTS ANALYSIS${NC}" 260 | print_border 261 | rep=$(ss -tuln 2>/dev/null) 262 | if [ -z "$rep" ]; then 263 | echo -e "${RED}No output from ss.${NC}" 264 | else 265 | echo -e "${CYAN}Scan Results:${NC}\n${GREEN}${rep}${NC}" 266 | fi 267 | print_border 268 | read -rp "Press Enter to return to the menu..." dummy 269 | } 270 | 271 | ############################################################################### 272 | # Function: paginate_output 273 | # Paginates the provided output (default 20 lines per page). 274 | # At the end of each page, waits 5 seconds for input; if 'm' is pressed, returns. 275 | ############################################################################### 276 | paginate_output() { 277 | local output="$1" 278 | local lines_per_page=${2:-20} 279 | IFS=$'\n' read -rd '' -a lines <<< "$output" 280 | local total_lines=${#lines[@]} 281 | local i=0 282 | while [ $i -lt $total_lines ]; do 283 | clear 284 | for ((j=0; j/dev/null; then 308 | # Create a temporary file for debsums output 309 | tmpfile=$(mktemp /tmp/debsums_output.XXXXXX) 310 | # Use timeout to prevent hanging (60 seconds) 311 | timeout 60s debsums -s 2>/dev/null > "$tmpfile" 312 | if [ ! -s "$tmpfile" ]; then 313 | echo -e "${GREEN}All system files are intact according to debsums.${NC}" 314 | echo -e "\nPress Enter to return to the menu..." 315 | read -r 316 | else 317 | echo -e "${RED}Integrity errors detected:${NC}\n" 318 | # Paginate the output so the user can review it 319 | paginate_output "$(cat "$tmpfile")" 20 320 | echo -e "\nPress Enter to return to the menu..." 321 | read -r 322 | fi 323 | rm -f "$tmpfile" 324 | else 325 | echo -e "${RED}Debsums is not installed.${NC}" 326 | echo "Install debsums with: sudo apt-get install debsums" 327 | echo -e "\nPress Enter to return to the menu..." 328 | read -r 329 | fi 330 | } 331 | 332 | ############################################################################### 333 | # Function: advanced_dashboard 334 | # Launches the Glances dashboard for real-time monitoring. 335 | ############################################################################### 336 | advanced_dashboard() { 337 | clear 338 | if command -v glances &>/dev/null; then 339 | echo -e "${YELLOW}Glances dashboard is now running.${NC}" 340 | echo -e "${CYAN}To return to the menu, press 'q' or Ctrl+C to exit Glances.${NC}" 341 | sleep 2 342 | glances 343 | echo -e "${YELLOW}Dashboard closed. Press Enter to return to the menu.${NC}" 344 | read -rp "" dummy 345 | else 346 | echo -e "${RED}Glances is not installed.${NC}" 347 | echo "Install Glances to use the advanced dashboard." 348 | read -rp "Press Enter to return to the menu..." dummy 349 | fi 350 | } 351 | 352 | ############################################################################### 353 | # Function: audit_log 354 | # Searches the authentication logs for suspicious keywords. 355 | ############################################################################### 356 | audit_log() { 357 | clear 358 | print_border 359 | print_title "${YELLOW}AUDIT & LOG CORRELATION${NC}" 360 | print_border 361 | echo -e "${CYAN}Description:${NC} This function searches the authentication logs for keywords such as 'failed', 'invalid', and 'error'." 362 | echo -e "It displays the last 30 suspicious events (if any).\n" 363 | rep=$(grep -Ei "failed|invalid|error" /var/log/auth.log 2>/dev/null | tail -n 30) 364 | if [ -z "$rep" ]; then 365 | echo -e "${GREEN}No suspicious events found in authentication logs.${NC}" 366 | else 367 | echo -e "${YELLOW}${rep}${NC}" 368 | fi 369 | print_border 370 | read -rp "Press Enter to return to the menu..." dummy 371 | } 372 | 373 | ############################################################################### 374 | # Function: suspicious_process_check 375 | # Analyzes the top 30 CPU-consuming processes and flags those not in a whitelist. 376 | ############################################################################### 377 | suspicious_process_check() { 378 | clear 379 | print_border 380 | print_title "${YELLOW}SUSPICIOUS PROCESS CHECK${NC}" 381 | print_border 382 | local WHITELIST=("bash" "sh" "init" "systemd" "kthreadd" "rcu_sched" "migration" "cron" "sshd" "apache2" "nginx" "mysqld" "mariadb" "postgres" "dbus-daemon" "rsyslogd" "glances") 383 | local suspicious="" 384 | while IFS= read -r line; do 385 | local cmd=$(echo "$line" | awk '{print $11}') 386 | local base 387 | base=$(basename "$cmd") 388 | if [ -z "$base" ]; then 389 | continue 390 | fi 391 | local found=0 392 | for proc in "${WHITELIST[@]}"; do 393 | if [[ "$base" == "$proc" ]]; then 394 | found=1 395 | break 396 | fi 397 | done 398 | if [ $found -eq 0 ]; then 399 | suspicious+="${RED}${line}${NC}\n" 400 | fi 401 | done < <(ps aux --sort=-%cpu | head -n 30) 402 | if [ -z "$suspicious" ]; then 403 | suspicious="${GREEN}No suspicious processes detected among the top 30 CPU consumers.${NC}" 404 | fi 405 | echo -e "${YELLOW}*** Suspicious Process Check ***${NC}\n" 406 | echo -e "${CYAN}${suspicious}${NC}" 407 | print_border 408 | read -rp "Press Enter to return to the menu..." dummy 409 | } 410 | 411 | ############################################################################### 412 | # Main Menu: Displays the menu and routes user choices. 413 | ############################################################################### 414 | main_menu() { 415 | while true; do 416 | clear 417 | print_border 418 | print_title "${MAGENTA}ADMIN SECURITY TOOL (Super Info)${NC}" 419 | print_border 420 | echo -e "${CYAN}Select an option by entering the corresponding number:${NC}\n" 421 | echo -e "${YELLOW}1) System Info" 422 | echo -e "2) Machine Info" 423 | echo -e "3) User Info" 424 | echo -e "4) Login & Service Monitoring" 425 | echo -e "5) Authentication Log Monitoring" 426 | echo -e "6) Network & Ports Analysis" 427 | #echo -e "7) File Integrity Check" 428 | echo -e "7) Advanced Dashboard" 429 | echo -e "8) Audit & Log Correlation" 430 | echo -e "9) Suspicious Process Check${NC}" 431 | echo -e "${RED}0) Exit${NC}\n" 432 | print_border 433 | read -rp "Enter your choice: " choice 434 | case $choice in 435 | 1) system_info ;; 436 | 2) machine_info ;; 437 | 3) user_info ;; 438 | 4) login_service_monitor ;; 439 | 5) auth_log_monitor ;; 440 | 6) network_ports_analysis ;; 441 | #7) file_integrity_check ;; 442 | 7) advanced_dashboard ;; 443 | 8) audit_log ;; 444 | 9) suspicious_process_check ;; 445 | 0) clear; echo -e "${MAGENTA}Exiting...${NC}"; exit 0 ;; 446 | *) echo -e "${RED}Invalid choice. Please try again.${NC}"; sleep 2 ;; 447 | esac 448 | done 449 | } 450 | 451 | # Initialization and start 452 | clear 453 | echo -e "${MAGENTA}Starting Super Info – Admin Security Tool...${NC}" 454 | sleep 1 455 | main_menu 456 | --------------------------------------------------------------------------------