I admire Microsoft’s honesty

A user was trying to record something in streams and share it with a vendor. Now this is all complicated anyway because Microsoft used to record directly to streams, then stopped for lower licensed but kept it for the upper ones last year, and now they are moving to onedrive entirely and not using streams (which I’m pretty sure is just a skin on sharepoint like onedrive is anyway but I digress…)

So I’m trying to find why the user can’t do this and find this article. To quote:

This error occurs because Stream can’t currently share to external users. This includes Azure Business to Business users.

What is the workaround, you may ask. I’m glad you did!

To work around this issue, store the video in another location. For example, add the video to a SharePoint Online or OneDrive for Library location that enables external sharing, and then share the video to the external users.

In short. Streams can’t share externally, and the workaround is not to use streams. Microsoft Video is still around and it looks like they are killing off streams too. At least they are moving to OneDrive.

External Emails warning

In short, you should have warnings on external emails. Yes in Outlook you can look at the address, but on other platforms (Apple for one) it just shows the ‘from’ name. Also if you spoof an internal email Outlook will ‘helpfully’ look up the photo of the person and add that for you making it look like the person actually sent the email!

As mentioned in the last post, I based all of this from this post on external email warnings. But I did create a second one for spoofed emails which matches:

If the message:
Sender's address domain portion belongs to any of these domains: 'company.com' or 'company.org'
and Is received from 'Outside the organization'

Take the following actions:

Prepend the message with the disclaimer 'WARNING: Please contact IT - this email appears to be a Phishing attempt'. If the disclaimer can't be applied, attach the message to a new disclaimer message.

Except if the message:
Is received from 'Partner company that sends emails as us'

Basically any emails from external that claims to be from an internal domain flag them. I highly recommend that you test this first, as there will be domains you will have to exclude from this. Like payroll companies and similar that email as your company. But it should help with phishing emails.

Security should be like olden castles. Not just one door to get in, but moats, multiple walls, towers etc. Multiple defenses to stop the bad guys. Assume they will get in, but then they have to avoid all your traps to remain undetected. This is just one of many things you can do to protect yourself.

Until next time, stay safe out there.

Bad password practices

I’m not talking about users picking bad passwords. Yes, we know. Use unique passwords and a password manager! I’m talking about sites that have terrible rules on new passwords. Passwords that really are great get rejected for stupid reasons. Things like this

hnhD9^mEG^%NU2u9UxSBRio^m2CSZ6%eTsa&Cg83Nxo7#C&[email protected]!A6HVfnjt^gYzjmqwX#2En!8bNQ*LBTNdasFQw!A!#acPQAwrV7^u&B4h%2 is a “bad” password because the number 2 repeats 4 times?

Again, so I can’t make a nice long password because you limit to 40 characters. I don’t care about the length of the password when I use a password manager. Also, this is the wrong way to do passwords.

One argument, is that if you allow a 1000 characters for your password, then that takes up a lot more space in the database than a 40 character password. Which if you were storing the password would be true (although given space being as cheap as it is really shouldn’t matter). But that isn’t how passwords are stored. So that argument is irrelevant.

So lets explain how passwords are stored using a really bad example. Passwords are hashed in a way that means you can’t decrypt them. So, for example when you were a kid and were learning division, you didn’t learn about fractions (yet). You just used ‘remainder’. 8 divided by 5 is 1 remainder 3. The official term for this is modulo or usually just mod. So 8 mod 5 is 3. However 13 mod 5 is also 3. As is 18, 23 etc.

If I told you that the result was 3, even if you knew we did mod 5, you have no idea what the original number was. However if I gave you 23, which you mod 5 to get 3, you know that the answers match. Now this is a horrible example, as there are only 5 possible answers (0, 1, 2, 3, and 4) but you get the idea. When you enter your password, it should be hashed to give some random (but repeatable) result. This means they can check your password, but don’t store your password.

Now obviously the real way passwords are hashed are entirely different. Lets use another bad example. Take a password (we’ll use numbers here for simplicity, to save converting one to the other) of 123
Then we need three prime numbers, which the first two when multiplied are larger than the third. So lets pick 2, 3, and 5 because the maths is easier. Why prime numbers? Because you can’t simplify the maths. If I asked you to divide 100 billion by 10 billion, or
100,000,000,000
10,000,000,000
You should quickly realise that almost all the zeros cancel, making the maths easier. Same thing for encryption. If you don’t use prime numbers you may be able to simplify it

OK so we have
Password: 123
Primes: 2, 3, 5

This next bit gets a little complicated. Lets split the password into single characters, and we want to add to the first prime, multiply the result to the second, then mod that result to the third. That is the first number of the output. Then add that output, to the second number of the password, and repeat (add, multiple, mod)

1 + 2 = 3. 3 * 3 = 9. 9 MOD 5 = 4
4 + 2 + 2 = 8. 8 * 3 = 24. 24 MOD 5 = 4
4 + 3 + 2 = 9. 9 * 3 = 27. 27 MOD 5 = 2

The password 123 encrypts to 442. Note that the order of the password matters. 321 would encrypt to 311
4 + 2 = 6. 6 * 3 = 18. 18 MOD 5 = 3
3 + 2 + 2 = 7. 7 * 3 = 21. 21 MOD 5 = 1
1 + 1 + 2 = 4. 4 * 3 = 12. 12 MOD 5 = 1

This is why you add the output back in, so you can’t crack each number on its own. You should also add some salt in too, but I won’t cover that here (basically think cooking – adding more or less salt changes the taste of the meal even if you follow the recipe. The same password with a different salt gives a difference result).

It should go without saying but please DO NOT use that method for storing passwords. There are many standard libraries for doing this in various languages. For example Argon2 won the Password Hashing Competition in 2015. Do not try to roll your own encryption it will never work

In short, if you are encrypting a password, you really don’t care how long it will be as you will get a long string out anyway so limiting the input field means you are doing it wrong. And if you have this wrong, what else is wrong? I’m always wary of sites that get this wrong.

Finally, Microsoft, really?

That seems fine until you realise how it calculates the ‘weak’. Spring21 is strong?

However creation thursday thievish fraying android slander empathy capsize composed aspect symphonic domestic (which is 12 random words) is weak because it doesn’t have capitals or symbols

In conclusion: Lets not blame the users for making bad passwords. We’re teaching them to use crappy ones, so why are we shocked they are listening to us?

2021-05-13 Phishing

Another phishing email. I’ll explain the boxes at the top later – that is me, not the email. Blurred regions are emails

Again, links go to some website. WordPress again. People, you need to update your WordPress! And stop using all the plugins
No, I’m not saying WordPress is terrible. I’m using it for this site. I’m saying (as with all things) you need to patch early, and patch often! Too many times people spin up a WordPress site then basically ignore it for update, and then it gets hacked.

The link (once I changed the email address) goes to a fake login page. Interestingly not a fake Microsoft, just a random one. It pulls the name after the @ to put it in the blurred regions. So lets say it was ‘[email protected]’ you were using, it says ‘Whitehouse Online Webmail App’. Also, Copyright 2019?

Then the usual trick of saying your password is wrong, to make people re-enter to confirm they were entering it correctly

Then the ‘you fixed it’ message (and now copyright 2018?)

And it redirects you to the domain for your email.

Now to explain the boxes on the email. Microsoft Rules, basically. The red one triggers on any email from external, that doesn’t match our domain. Then you have to whitelist anything that legitimately spoofs your domain. The yellow one is just triggered on any external emails. Not 100% but works pretty well. I should do another post explaining it, but in short I used this and made a second one based off of that.

Stay safe out there

Please don’t

Quick one here. Outlook is ‘trying’ to be helpful

Yes it wanted to junk all emails from myself. Of course the obvious question is “why on earth are you emailing yourself”, but I was emailing the company something, and so BCCd everyone

Phishing Email – 2021-04-27

I’ve had several users reporting phishing emails. Lets look at one of them.

A user received an email that just said “You’ve recieved [sic] a document on Onedrive.” It had an attached HTML document. They correctly reported it (yay!) and I looked at it. And it looks like a lazy scammer, because it should probably say “You’ve received a voicemail“. But more on that later.

First of all, I have HTML files opening by default in VSCodium (so I can’t accidentally run any of this), but if you open the file it looks… well horrible.

And this goes on and on and on

Now, as I’m not Neo, I don’t know what that means. But the cyberchef tool from GCHQ will tell you. Just run the URL decode function, which should be right here. Copy and paste the bits between unescape(‘THE BITS HERE’) and drop it in to cyberchef to see the HTML code created

Looks like making a fake Microsoft login page there. You can quickly look at the URLs it tries to load to have a quick look and what is going on

Nothing particularly odd here (yet). Using bootstrap and cloudflare, which makes sense as that would look ‘normal’ if you are checking. But that was just the first of three encoded bits. The second looks more interesting (email highlighted edited to a nonsense one)

CyberChef again to the rescue to see

And there is the fake login

Now let’s look at the third section and any http links

Well that looks interesting. Looks like it sends the email address there (I’m sure to autopopulate to make it look more legitimate). There are two more links that are interesting. Lets look at the first one

This time sending the username and password to that website for attempting to log in to Microsoft. That website doesn’t appear to be working right. Now lets look at the other interesting link

This one is the most interesting, and why I think it should have said voicemail and not document. If you go there, it plays an archive.org file of a voicemail saying “Hi, please give me a call, thank you, bye“. This might actually possibly the cleverest bit of this as you just think it’s a wrong number and move on. If you click something and nothing happens, you start to question it. If you click something and something opens, you don’t.

Now this is as far as I’m taking it. The website is down, my user didn’t click the link, and the email was spoofed from the user, so there isn’t really much more I can do. If the website was up, it wouldn’t be too hard to set up a python script to make up random email addresses and passwords, but in my mind that crosses the line unless you can guarantee that only email addresses you control are used. While it’s astronomically unlikely you will get a valid username and password, you might end up locking a valid email account out.

Until next time, stay safe out there.