Clicky

20160425

'Mail to me' for Outlook clients


The next VBscript sends a file from the command line or dragged to the shortcut of this script to your Outlook email account:

if wscript.arguments.count<>1 then wscript.quit

AttachmentName=wscript.arguments.item(0)

set fso=CreateObject("scripting.filesystemobject")
if not fso.FileExists(AttachmentName) then wscript.quit

Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
objMail.To = "{here the email address to send to@email.nn}"
objMail.Subject = "Received attachement"
objMail.Body = "Attached file: """ & fso.GetFileName(AttachmentName) & """"
objMail.Attachments.Add(AttachmentName)
objMail.Send  
if Err=0 then MsgBox "Successfully sent: "& vbCrLF & "- """ &
fso.GetFileName(AttachmentName) & """"

See also this post.

20160418

Holy sh*t!

From the Intel (McAfee) Privacy Notice of True Key software (some kind of password manager):
 
 Source

Maybe NOT a good idea to use...






20160417

One-click send attachement to email

Yeah, yeah, VBscript is boo, boo and should be banned from the earth. However you can create and use handy scripts without 2 or more academic titles that you need for PowerShell programming or Visual Studio. Also this script does not require any .NET library or Visual Studio runtime installed. It should run from Windows 98 to Windows 10 (W7, W8.1 and W10 were tested).

Sometimes you need to send a file to your own email account. E.g. for the file to be used on another computer, Operating System of even Smartphone. Of course you can start your email program, create a new email to yourself, attach the file and send it. Easier would it be if you just can drag-and-drop the file on an application shortcut or use the Explorer context menu for that.

This post describes a script that using the Collaboration Data Object (CDO) and Gmail to send an attachment to your own email address. I suggest you create a new "VeryComplexNeverUsedBeforeHardToGuess@gmail.com" account for this purpose.

First the script. Edit the lines with your Gmail name, password and your own email address:


    Option Explicit
    dim arg,fso, i, s, objEmail, Subject


    set arg=WScript.Arguments
    set fso=CreateObject("scripting.filesystemobject")

    const GoogleAccount    = "{here your Gmail email name}@gmail.com"
    const GooglePassword   = "{here your Gmail email password}"
    const eMailTo          = "{here you own email address"

'--- Prepare email object variables...

    Set objEmail = CreateObject("CDO.Message")
 objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")      = GoogleAccount

    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")      = GooglePassword
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")        = "smtp.gmail.com"
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")        = 1
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")  = 1
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")         = 2
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")    = 465

'--- Add attachement(s)...
    s=vbCrLf
    for i=0 to arg.count-1
        objEmail.AddAttachment arg.item(i)
        s=s & "- " & fso.GetFileName(arg.item(i)) & vbCrLf
    next

'--- Alternative subject field?  
    Subject=InputBox("Enter subject","Alternative Subject","Attachement received " & s)
    if s="" then wscript.quit
      
'--- Populate other email fields...
    objEmail.From         = GoogleAccount
    objEmail.To           = eMailTo
    objEmail.Subject      = Subject
    objEmail.TextBody     = "Attached you find the next attachements: " & s
    objEmail.Configuration.Fields.Update

'---- Send the email...
    objEmail.Send
    if Err=0 then
        MsgBox "Successful sent attachment(s): " & s
    else
        MsgBox "Something went wrong sending attachment(s): " & s
    end if


You can use the script in different ways:
  1.     From the command line (nah...)
  2.     Drag-and-Drop a file to the shortcut of the script (nice)
  3.     With the Explorer context menu (best!)


Command line (assuming the script's name is SendAttachment-google.vbs and is in the c:\scripts folder):

    C:\> wscript c:\scripts\SendAttachment-google.vbs {path to whatever file you want to send}


Application shortcut:
Create a shortcut on the desktop to the  SendAttachment-google.vbs script. Maybe change the icon picture for better reading. Now just drag-and-drop the file you want to email to the icon.




Explorer context menu:
Create a registry file like this:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Send to email]
[HKEY_CLASSES_ROOT\*\shell\Send to email\command]
@="wscript c:\\scripts\\SendAttachement-google.vbs \"%1\""

Apply this file to the registry. Now you can right-click the file you want to email and select "Send to email":




A success/failure message is shown when done:



Notes:
  •     There is almost no error checking in the script. Most common errors are:
    •  Wrong/typo in email address or password;
    • Sending a not-allowed file type through Gmail;
    • Wrong path of the script vs. configured path in shortcut or registry.
  •     The Gmail password is in clear text. To mitigate that you can encrypt the script to a VBE file with this method. Remember to change the references from VBS to VBE.
  •     Of course you can configure your own SMTP server. When using port 25 change also objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") to 0.
  • You do not need some "Cloud Service" and client that is a available for a shorter or longer period or not available at all for your purpose.
  • You can send a maximum of 2000 emails per day, so spammers, go home!
    
    
    
    
    
    

20160131

Don't use special characters in a password (for your security...)


The SAI Computing Conference 2016 has a registration page where presenters can register. BTW, one of the tracks is "Security". Registering for the conference will display this error when you try to enter a password with 'special' characters:



"For security reasons..." it is not allowed to use special characters (...). I am not sure if this limitation is recommended by security specialists or even this guy.

20151222

Trusted Boot for Linux using Trusted Platform Module

Grub (GNU GRand Unified Bootloader) is a popular bootloader for Linux systems (e.g. Debian, Ubuntu and Arch). A bootloader is needed to load the Operating System from the hard disk (or CD or bootable USB or any other bootable media).

Grub 2 is a newer version of the original Grub and Trusted Grub 2 stems from Grub 2. It is used to startup Linux from encrypted disks using the Trusted Platform Module (TPM). The TPM is used to detect changes to the computer hardware and boot software. An unauthorized change will be detected and the computer will not startup (protecting the data on the encrypted disk).

We tinkered around with Trusted Grub 2 and the TPM and this is what we have working today:
  • Password authentication (the user must enter a password before the computer starts up).
  • Detection of (unauthorized) modification of the BIOS, disk partitions, boot loader, kernel etc.
  • Hard disk platform binding (the hard disk will not work in another computer preventing Evil Maid attacks).
  • Key escrow and recovery.
  • Full Disk Encryption using Linux standard dm-crypt with AES-NI support (when your CPU supports AES-NI there is virtually no performance loss).
These are screenshots from a client of one of our running configurations:

Trusted Grub 2 boot screen
User authentication (all OK)
Error during boot (TPM detected breach) and recovery

All is working now on the client side. We are looking into enterprise class key management but we lack the resources for that now. Please standby for more progress for this.



20151124

Capacitor Plague

Condensatoren zijn passieve electronische componenten die gebruikt worden om fluctuaties on de voedingsspanning op te vangen. Eigenlijk een soort mini-batterij die razendsnel oplaadt en dus ook razendsnel ontlaadt. Ze worden in alle elektronische apparaten gebruikt, van Apple Watch tot de voeding van je versterker. Condensatoren zorgen er dus voor dat je apparaat stabiel blijft werken zelfs als er opeens wat meer stroom wordt gevraagd of als je vriendin de magnetron aanzet (waardoor de 230V even een dipje krijgt).

Nu is er een probleem met een bepaald type condensator. De levensduur is korter dan verwacht. Hierdoor kan je apparaat al snel stuk gaan. Het probleem heet:"Capacitor Plague" en Wikipedia heeft er een uitgebreid artikel over.

Ik kwam (voor een prikkie natuurlijk) in het bezit van een Edimax ES-524G+ switch. De switch werkte prima maar voor de zekerheid toch even de kast opengeschroefd. Bij inspectie bleek dat er condensatoren op exploderen stonden en electroliet lekte:

Een lekkende en een 'bolle' condensator (gedemonteerd uit de switch)


De switch stond dus op het punt defect te raken. Dus bij een internet elektronicaboer 8 nieuwe condensatoren met dezelfde eigenschappen (1000µF/10V) gekocht. De oude condensatoren verwijderd en de nieuwe gesoldeerd en voila, deze switch kan weer jaren mee!

De nieuwe condensatoren zijn rood dus steken mooi af bij de rest:





20151104

Choose your favorite new Lenovo logo


New Lenovo logo
Alternative logo (inspired by Google)

Alternative logo (inspired by Heineken)


Note that the "smiling e" is an invention by Freddy Heineken himself when he created the new Heineken logo in 1949 (!). Still going strong:

Real Time Web Analytics