Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ String comparison

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š String comparison


๐Ÿ’ก Newskategorie: Linux Tipps
๐Ÿ”— Quelle: reddit.com

I want to create a script that gets the hardware id and board id on a mac, then save them as variables:

hwModel=$( sysctl hw.model | awk '{ print $2 }' )boardID=$( ioreg -l | awk -F" '/board-id/ { print $4 }' )

I then want to use if else statements to check every available model and if one gets found, check all boardIDs for that specific hardware ID. But somehow i cannot get the strings to compare. it always skips over everything and goes to the bottom else error. I tried combinations of [, [[ and equal signs etc. but nothing seems to work.

Here's a shortened example part:

if [ $hwModel = "iMac4,1" ] then if [ "$boardID" == "3A103" ] then downloadCode="018-2392-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [ $hwModel = "iMac5,1" ] then if [ "$boardID" == "Mac-F4228EC8" ] then downloadCode="018-2534-A" parseDownloadCode elif [ "$boardID" == "Mac-F42786A9" ] then downloadCode="018-2533-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [ $hwModel = "iMac5,2" ] then if [ "$boardID" == "Mac-F4218EC8" ] then downloadCode="018-2535-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi else echo "We could not find a suitable download link." echo "You might have a computer that does not support AHT" fi 

I think the comma might mess with it. But i don't really know what to do now... Am i looking over something? I am quite new to bash scripting... Thank you in advance!

Edit: Here's the entire code. Though i think i might be onto something, will test my theory in a minute. I think the commands might be adding some blank spaces behind the hardware model and boardIDs

```

!/bin/bash

AHTFinder.sh

Created by Maxim Coppieters on 29/07/20.

Copyright 2020 Maxim Coppieters. All rights reserved.

Some prerequisite variables

hwModel=$( sysctl hw.model | awk '{ print $2 }' ) boardID=$( ioreg -l | awk -F\" '/board-id/ { print $4 }' ) cpuTemp=$( ./osx-cpu-temp ) ver="Version 00.00.00"

parseDownloadCode () { echo "Detected Hardware Model: $hwModel" echo "Detected Board ID: $boardID" echo echo "Your download code is: $downloadCode" echo "Your download link is: http://download.info.apple.com/Apple_Hardware_Test/$downloadCode.dmg/" echo echo "Click while holding CTRL to open the link." }

mainCheckPart2 () { clear echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" echo "@ Apple Hardware Test Finder @" echo "@ Made By Maxim Coppieters @" echo "@ $ver @" echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" echo if [[ $hwModel == "iMac4,1" ]] then if [[ "$boardID" == "3A103" ]] then downloadCode="018-2392-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac5,1" ]] then if [[ "$boardID" == "Mac-F4228EC8" ]] then downloadCode="018-2534-A" parseDownloadCode elif [[ "$boardID" == "Mac-F42786A9" ]] then downloadCode="018-2533-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac5,2" ]] then if [[ "$boardID" == "Mac-F4218EC8" ]] then downloadCode="018-2535-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac6,1" ]] then if [[ "$boardID" == "Mac-F4218FC8" ]] then downloadCode="018-2579-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac7,1" ]] then if [[ "$boardID" == "Mac-F42386C8" ]] then downloadCode="018-2845-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac8,1" ]] then if [[ "$boardID" == "Mac-F226BEC8" ]] then downloadCode="022-3936-A" parseDownloadCode elif [[ "$boardID" == "Mac-F227BEC8" ]] then downloadCode="022-3937-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac9,1" ]] then if [[ "$boardID" == "Mac-F2218EA9" ]] then downloadCode="022-4297-A" parseDownloadCode elif [[ "$boardID" == "Mac-F2218EC8" ]] then downloadCode="022-4293-A" parseDownloadCode elif [[ "$boardID" == "Mac-F2218FC8" ]] then downloadCode="022-4294-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac10,1" ]] then if [[ "$boardID" == "Mac-F2268CC8" ]] then echo "Detected Hardware Model: $hwModel" echo "Detected Board ID: $boardID" echo echo "Multiple download codes have been found for this board ID." echo "Please choose one of them and report if one of them do not work." echo "This way, we can keep the best one. Thank you!" echo "Available download codes are: 022-4451-A and 022-4647-A" echo "Download links are:" echo "http://download.info.apple.com/Apple_Hardware_Test/022-4451-A.dmg/" echo "http://download.info.apple.com/Apple_Hardware_Test/022-4647-A.dmg/" echo echo "Click while holding CTRL to open the link." elif [[ "$boardID" == "Mac-F2268DC8" ]] then echo "Detected Hardware Model: $hwModel" echo "Detected Board ID: $boardID" echo echo "Multiple download codes have been found for this board ID." echo "Please choose one of them and report if one of them do not work." echo "This way, we can keep the best one. Thank you!" echo "Available download codes are: 022-4452-A and 022-4644-A" echo "Download links are:" echo "http://download.info.apple.com/Apple_Hardware_Test/022-4452-A.dmg/" echo "http://download.info.apple.com/Apple_Hardware_Test/022-4644-A.dmg/" echo echo "Click while holding CTRL to open the link." else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac11,2" ]] then if [[ "$boardID" == "Mac-F2238AC8" ]] then downloadCode="022-4703-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac11,3" ]] then if [[ "$boardID" == "Mac-F2238BAE" ]] then downloadCode="022-4776-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac12,1" ]] then if [[ "$boardID" == "Mac-942B5BF58194151B" ]] then echo "Detected Hardware Model: $hwModel" echo "Detected Board ID: $boardID" echo echo "Multiple download codes have been found for this board ID." echo "Please choose one of them and report if one of them do not work." echo "This way, we can keep the best one. Thank you!" echo "Available download codes are: 022-5090-A and 022-5344-A" echo "Download links are:" echo "http://download.info.apple.com/Apple_Hardware_Test/022-5090-A.dmg/" echo "http://download.info.apple.com/Apple_Hardware_Test/022-5344-A.dmg/" echo echo "Click while holding CTRL to open the link." else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "iMac12,2" ]] then if [[ "$boardID" == "Mac-942B59F58194171B" ]] then downloadCode="022-5091-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "MacMini1,1" ]] then if [[ "$boardID" == "3A102" ]] then downloadCode="018-2342-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "MacMini2,1" ]] then if [[ "$boardID" == "Mac-F4208EAA" ]] then downloadCode="018-2886-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi elif [[ $hwModel == "MacMini3,1" ]] then if [[ "$boardID" == "Mac-F22C86C8" ]] then downloadCode="022-4292-A" parseDownloadCode else echo "We could not determine your computer. It might not be added yet" fi

elif [[ $hwModel == "MacMini4,1" ]] then if [[ "$boardID" == "Mac-F220BEC8" ]] then while true; do read -p "Do you have a server model? Server models have no optical drive." serv case $serv in [Yy]* ) downloadCode="022-4739-A" parseDownloadCode break ;; [Nn]* ) downloadCode="022-4706-A" parseDownloadCode break ;; * ) echo "Please enter Y or N";; esac done else echo "We could not determine your computer. It might not be added yet" fi

else echo "We could not find a suitable download link." echo "You might have a computer that does not support AHT" fi }

The main check and comparison

mainCheck () { echo "Current CPU temp: $cpuTemp" echo "Mac Hardware Model: $hwModel" echo "Mac Board ID: $boardID" echo while true; do read -p "Would you like to determine the AHT download link?" yn case $yn in [Yy]* ) mainCheckPart2; break;; [Nn]* ) echo "Thank you for using my script!"; exit;; * ) echo "Please enter Y or N" esac done }

Just show HW model and BoardID

justInfo () { clear echo "Your Hardware Model is: $hwModel" echo "Your Board ID is: $boardID" echo echo echo "Thank you for using my script! Have a great day!" exit }

Step by step guide on using the modern Apple Diagnostics

getHelp () { clear echo "Step by step guide on using the modern Apple Diagnostics" }

clear echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" echo "@ Apple Hardware Test Finder @" echo "@ Made By Maxim Coppieters @" echo "@ $ver @" echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" echo echo "Please Read!" echo "This script determines the AHT version for Macs with AHT. These Macs were" echo "introduced before June 2013." echo "If your Mac was made before June 2013, this script should work and you can" echo "continue" echo "Another Note: Some Mac models could not be tested properly and have not" echo "been implemented into the script. This is mostly the PowerMac, PowerBook," echo "iBook and early Intel models. You can find the download codes for those" echo "in the README.md file on GitHub." echo read -s -n 1 -p "Press [ENTER] to continue..." echo clear echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" echo "@ Apple Hardware Test Finder @" echo "@ Made By Maxim Coppieters @" echo "@ $ver @" echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" echo PS3='Choose an option:' options=("Determine machine and links" "Just show me my Mac" "Help me diagnosing a newer Mac" "Quit") COLUMNS=12 select opt in "${options[@]}"; do case $opt in "Determine machine and links") mainCheck break ;; "Just show me my Mac") justInfo break ;; "Help me diagnosing a newer Mac") echo "Get help" getHelp break ;; "Quit") clear echo "Thank you for using. Have a great day!" exit ;; *) echo "$REPLY is not a valid option. Please try again.";; esac done

```

submitted by /u/MaxTechnics
[link] [comments] ...



๐Ÿ“Œ secure-compare up to 3.0.0 on Node.js String Comparison Argument Format String


๐Ÿ“ˆ 34.34 Punkte

๐Ÿ“Œ Low CVE-2020-11499: Firmware analysis and comparison tool project Firmware analysis and comparison tool


๐Ÿ“ˆ 26.57 Punkte

๐Ÿ“Œ secure-compare bis 3.0.0 auf Node.js String Comparison Argument unbekannte Schwachstelle


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ String comparison


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ Wagtail up to 2.7.1/2.8.1 String Comparison information disclosure


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ django-basic-auth-ip-whitelist up to 0.3.4 String Comparison information disclosure


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ CVE-2022-31802 | CODESYS Gateway Server prior 2.3.9.38 partial string comparison


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ Python string comparison


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ โšก Levenshtein Distance: A Powerful Algorithm for String Comparison โšก


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ Diacritic-insensitive string comparison in JavaScript


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ Timing attack safe string comparison


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ Apache Mesos pre-1.4.2/1.5.0/1.5.1/1.6.0 on Executor HTTP API String Comparison validation JSON Web Token information disclosure


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ CVE-2021-4259 | phpRedisAdmin up to 1.16.1 includes/login.inc.php authHttpDigest response wrong operator in string comparison


๐Ÿ“ˆ 23.81 Punkte

๐Ÿ“Œ Ruby 1.9.3/2.0.0/2.1.0 string.c str_buf_cat Long String denial of service


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Hsbc app accepts a string prefixed with a random string and apparently is not case sensitive


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Microsoft Office 2000/2003/2004/Xp Undefined String Format String


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ SVGZ / XML replacing string with string


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Medium CVE-2019-16882: String-interner project String-interner


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ libxslt 1.1.33 numbers.c xsltNumberFormatInsertNumbers String Format String


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Netgear R6700 up to 1.0.4.84_10.0.58 String Table File Upload format string


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Bash Shell: Replace a String With Another String In All Files Using sed and Perl -pie Options


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Number of pairs of String whose concatenation leads to a Sorted string


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Return a Palindromic String after removing minimum length Prefix from given String


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Int to String in Java โ€“ How to Convert an Integer into a String


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Remove From String in Python โ€“ How to Remove Characters from a String


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ What is a String in JS? The JavaScript String Variable Explained


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ JavaScript String Tutorial โ€“ String Methods in JS


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ How to Remove Characters from a String in Arduino Using String.remove() Function


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Python Split String โ€“ How to Split a String into a List or Array in Python


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ Length of C String โ€“ How to Find the Size of a String in C


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ C Print String โ€“ How to Print a String in C


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ String Operations(Length,escape character,verbatim string)


๐Ÿ“ˆ 21.06 Punkte

๐Ÿ“Œ [webapps] - Price Comparison Script 2017.1.8 - SQL Injection


๐Ÿ“ˆ 13.29 Punkte

๐Ÿ“Œ Amazon Patents Measures to Prevent In-Store Comparison Shopping


๐Ÿ“ˆ 13.29 Punkte











matomo