Sharing error OSE204 from OneDrive

If you’ve tried sharing a file outside of your organisation team share in OneDrive to anonymous parties, you might run in to a problem with sharing settings.

This is not easily solvable at first. There are a number of settings in Office 365 which can affect this, from:

  • Office Active users page, you can select individual users, select One Drive and see the sharing access they have
  • One Drive Admin: on the sharing page, there are a number of options here
  • SharePoint Admin: Again, there are a number of options here.

Make sure you check those above sections to ensure the correct settings are set. If you still cannot share the files, you will need to connect to SharePoint Online via power shell.

  1. Make sure the power shell command is installed:
    Install-Module -Name Microsoft.Online.SharePoint.PowerShell
  2. Connect to your instance
    $adminUPN="<the full email address of a SharePoint administrator account, example: jdoe@contoso.onmicrosoft.com>" $orgName="<name of your Office 365 organization, example: contosotoycompany>" $userCredential = Get-Credential -UserName $adminUPN -Message "Type the password." Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
  3. Set the permissions on your site
    set-sposite -identity 'https://contoso.sharepoint.com/sites/Sales' -sharingcapability ExternalUserAndGuestSharing

The above should do the trick. Just note that it does take some time to take affect.

See: Sharing Errors

Sopho: Patch your firewalls – zero day runs wild

Over the weekend, Sophos announce it had released a hotfix for Sophos XG firewalls. This hotfix patched an SQL injection attack which allowed attackers to download payloads to the device.

It looks like the hashed usernames and passwords have been stolen from the XG devices. This means all XG owners should reset the passwords for administration and any local VPN users as well.

It appears the attack was done either on the admin portal (port 4444) or the user portal (port 443). Normally the administration portal is closed on the WAN, however, it is normal practice to have the user portal exposed on the WAN.

If your firewall has been compromised, Sophos recommends these steps

  1. Reset device administrator accounts
  2. Reboot the XG device(s)
  3. Reset passwords for all local user accounts
  4. Although the passwords were hashed, it is recommended that passwords are reset for any accounts where the XG credentials might have been reused

We are awaiting further information from Sophos.

Block xmlrpc.php attacks with fail2ban + iptables wordpress

One of the issues I’ve faced on this server is xmlrpc.php attacks. These are normally bots trying to exploit old bugs in xmlrpc.php within WordPress. Many legit plugins use calls to this file such as Jetpack. So blocking it isn’t really an option.

In my case, I wanted to block these attacks with iptables. So I went about creating a rule using fail2ban.

To get started, get iptables and fail2ban installed:

apt-get install fail2ban iptables

Once installed, edit the default jail file. This won’t exist on a new install

nano /etc/fail2ban/jail.local

Add the following lines (make sure the path matches your own)

[xmlrpc]
enabled = true
filter = xmlrpc
action = iptables[name=xmlrpc, port=http, protocol=tcp]
logpath = /var/log/apache2/access.log
bantime = 43600
maxretry = 2

Now edit the following file (this won’t exist)

nano /etc/fail2ban/filter.d/xmlrpc.conf

Add the following lines

[Definition]
failregex = ^<HOST> .*POST .*xmlrpc\.php.*
ignoreregex =

Restart the fail2ban service

service fail2ban restart

You can watch the log in real-time to ensure it’s blocking correctly:

tail -f /var/log/fail2ban.log

putty_2016-08-12_13-25-33

Fosshub.com compromised – Malware on popular downloads

As discovered tonight, popular download website, Fosshub, has been compromised.

Hackers have targeted popular downloads such as Audacity, WinDirStat, qBittorrent, MKVToolNix, Spybot Search&Destroy, Calibre, SMPlayer, HWiNFO, MyPhoneExplorer, IrfanView and others.

https://twitter.com/CultOfRazer/status/760668803097296897

When installing these programs from Fosshub, you will be infected with malware. This malware will re-write your MBR and you will not longer be able to boot into your operating system.

https://twitter.com/CultOfRazer/status/760752941066313728

CultOfTheRazor has claimed responsibility.