Posts

Showing posts with the label cybersecurity

Send photo to email when entering wrong password

Step 1 : Prerequisites installation (Optional if available) ffmpeg (Photo app) s-nail  (Mail app) For more ways to take picture refer this article . $ sudo apt update $ sudo apt install ffmpeg s-nail Step 2 : Create App password from google account Check this to create app passwords. Step 3 : Change the email and password(App password) in the script Create file sudo nano /usr/local/bin/takepic filename=`date +%s` ffmpeg -f video4linux2 -s vga -i /dev/video0 -vframes 1 /tmp/$filename.jpg echo ' ALERT Usage detected:'  `date` `who` | s-nail -a /tmp/$filename -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp=smtp://smtp.gmail.com:587 -S from=" username @gmail.com" -S smtp-auth-user=username@gmail.com -S smtp-auth-password= ashalkshalkhsbzxn -S ssl-verify=ignore  -s "LOGIN ALERT" -v " tousername @gmail.com" exit 0  Save and close. $ sudo chmod +x /usr/local/bin/takepic Step 4 : Change the pam.d Backup the original file $ sudo cp...

Save photos when entering wrong password in Ubuntu

Step 1 : Installing App to take photo (optional if already exists) For more ways to take picture refer this article . $ sudo apt update $ sudo apt install ffmpeg Step 2 : Create script to save photos $ sudo gedit /usr/local/bin/takepic Paste the following #!/bin/bash filename=`date +%s` ffmpeg -f video4linux2 -s vga -i /dev/video0 -vframes 1 /tmp/$filename.jpg exit 0 Save and close. $ sudo chmod +x /usr/local/bin/takepic Step 3 : Configure PAM  Backup the original file $ sudo cp /etc/pam.d/common-auth /etc/pam.d/common-auth.orginal $ sudo gedit /etc/pam.d/common-auth Update auth    [success=1 default=ignore]    pam_unix.so nullok_secure To auth    [success=2 default=ignore]    pam_unix.so nullok_secure Add the following, next to the updated line auth    [default=ignore]               pam_exec.so seteuid /usr/local/bin/takepic Then save ...

How to create strong Passwords

Is your password exposed? To check your password is leaked in any event of data breach. Click here . What not to do Don't create easy passwords such as Name Mobile number Pet name Date of birth 123456 ,.. etc Avoid using words with any meaning to prevent dictionary attack. Avoid recycling password. How to create secure passwords No password is unbreakable, longer it takes to crack better it is. You can use song lyrics with upper and lower case mixing or first or second letter of the each word in the song. The club isn't the best place to find a lover tCiTbPtFaL  t1C2i3T4b5P6t7F8a9L  t3C4i4T3b4 ( starting letter with word count ) hLStElOi O( second letter ) You can use sentences or phrases or Quotes and convert it similar to song. You can use next letter in keyboard to the word you want for (G) to use it can be a key left(F) or right(H). But don't create left and right randomly, so u can memorize easily.  Use as much characters as possible Use combination of number, alph...

How to send email on user login in ubuntu

Image
Step 1: Go to your gmail account. Step 2: Click Manage your Google Account.   Step 3: Go to Security.  Step 4: Click App Passwords (Check 2 - step verification  is ON).   Step 5: Select App as Mail and Device as other(type anything) and click GENERATE. Step 6: Copy the generated key in the yellow box   Step 7: Update the following command with your details(frommail, tomail, copied passcode). echo ' ALERT - Root Shell Access on:'  `date` `who` | s-nail -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp=smtp://smtp.gmail.com:587 -S from="frommail" -S smtp-auth-user=frommail -S smtp-auth-password=passcode -S ssl-verify=ignore  -s "LOGIN ALERT" -v "tomail" Step 8: Open .bashrc nano .bashrc Step 9: Paste the command in step 7 in last line of the file and save it.  That's it!