How to: Restore Mac OS from Time Machine over Ethernet easily (Works for Time Machine on Open Media Vault (OMV) as well)

Before starting, make sure you have a working backup of the current system!!!

1 Refer to this guide “Mac OS how to Enter Recovery Mode” to enter recovery mode and clean/reset the Mac OS to factory default

2 When finished, the migration assistant should appear if it doesn’t, we can create a user, login then start the migration assistant manually.

3 Within the migration assistant, we can select “From a Mac, Time Machine backup, or startup disk” option, then click on continue.

Mac OS, Migration Assistant
Older Mac OS, Migration Assistant
Newer macOS, (Catalina in this screenshot), Transfer Information to This Mac
Newer macOS, (Catalina in this screenshot), Transfer Information to This Mac
Time Machine from Open Media Vault (OMV) discovered and listed automatically
Time Machine from Open Media Vault (OMV) discovered and listed automatically

4 It will allow us to enter the address of the time machine volume and it will ask us for the password, in case we have used an encrypted backup.

5 Now we can choose what to recover. (Warning: If the user we have created after the installation has the same name as the one we have used in the backup, there will be a conflict). Then we need to choose, whether we want to keep or delete the user or keep the data.

Mac OS how to Enter Recovery Mode

Restore/Recover Mac OS with – “Recovery Mode”

What can I do with recovery mode? What is recovery mode?

  • Use backup from “Time Machine” to Restore the Mac
  • Use “Disk Utility” from recovery mode to Scan, verify and repair the connected drives
  • Re-install stock version of Mac OS or Erase, Install.
  • Use Safari to browse the internet or diagnose connection

How to Enter Recovery Mode?

(This only works if your hard drive is not completely damaged, if it is, we need to use internet recovery mode which is the next section)

1 Make sure Mac is powered off.

2 Press the power button then immediately hold the Command ⌘ + R keys till the Apple logo appears. After awhile, the Mac OS utility window should appear, which means we have successfully entered recovery mode.

(If not, we might need to try several times to get the timing right)

How to Exit Recovery Mode?

To Exit the recovery mode, we simply just need to restart the Mac OS. If it keeps getting into recovery mode, just select the normal boot disk, we can try to restart the Mac OS again, now it should boot into normal system as expected.

How to Enter Recovery Mode over Internet connection?

If the hard drive is damaged (You might want to replace the hard drive first in this case) or volume is damaged, we need to Enter recovery mode via internet, here is how.

1 Power off the Mac

2 Press the power button then hold Command ⌘ + Option + R keys after you hear the start-up sound. Release the keys when you see the animated globe on the screen.

3 The loading speed depend on your internet connection speed, it’s a good idea to plug the power cord for your Mac.

4 When the loading is done, we should see the macOS utility window.

5 Now we have successfully entered recovery mode via internet.

How to Enter Recovery Mode with Pre-Made USB/Bootable Installer

Again, if the hard drive is damaged (You might want to replace the hard drive first in this case) or volume is damaged, we need to Enter recovery mode via internet, here is how.

1 If you don’t have an bootable USB yet, follow this guide (https://support.apple.com/en-us/HT201372) to create a bootable USB first (You will need a working Mac for this task)

2 Power off the Mac

3 Press the power button to power on the Mac, when you hear the startup sound, press and hold the Option key. You will see the Startup Manager. Once the Startup Manager screen appears, release the Option key. The utility will look for any available drives that include bootable content including the bootable USB

4 Now select the bootable USB to boot from it, then you should be able to see the disk utility again.

How to Restore from directly connected Time Machine

1 Power off the Mac

2 Connect your Time Machine to the Mac, power on the Mac while holding the Option key

3 Select the Recovery Drive to boot Mac then click on “Use Disk to update the system storage”

Mac OS Software update Download Stuck x.xx GB – x.xx GB

The Mac OS software update might get stuck at downloading x.xx GB – x.xx GB

To resolve this issue try to download the update .dmg image directly from Apple then update the Mac OS manually.

Download links

USA – https://support.apple.com/downloads/macos

If you are not live in USA, you can select different country/language, the downloading speed might be faster for you: https://support.apple.com/choose-country-region/downloads

Windows Server Storage Space/Storage Pool Reattach straightway after physical disk retired

Only reattach if you are sure the physical is in good working condition, if not, you really should replace the physical disk for the Storage Pool

See this guide for replacing disk: How to fix: Windows Storage Space/Storage Pool physical disk lost communication, replace dead physical disk

1 Launch PowerShell in admin mode

2 Use “Get-PhysicalDisk” to list all physical disks

Get-PhysicalDisk

3 Use “Get-PhysicalDisk | Select-Object SerialNumber,UniqueID” to get serial number of the physical disk (It’s very useful when you have multiple physical disks with same name)

Get-PhysicalDisk | Select-Object SerialNumber,UniqueID

4 Use “Set-PhysicalDisk -UniqueID “{SerialNumber}” -Usage AutoSelect” to reattach the physical disk

Set-PhysicalDisk -UniqueID "{4a5bbag5-cc77-01ab-a8ba-520c1af8885b}" -Usage AutoSelect

5 Use “Repair-VirtualDisk -FriendlyName ‘Name of the virtual disk within the pool'” to repair the virtual disk

Repair-VirtualDisk -FriendlyName 'Name of the virtual disk within the pool'

6 Use “Optimize-StoragePool -FriendlyName “Pool Name”” to optimize the storage pool

Optimize-StoragePool -FriendlyName "Pool Name"

List of Free Temporary email, Disposable email

There are times when we want to have a temporary email address for us to send and receive email. So that we can block further spam emails end up in our real email address, to register a website without using our real email address. etc. Here are some receiving only disposable email and receiving + sending disposable email services.

Receiving Only

1 mailcatch.com/en/disposable-email

mailcatch
mailcatch

2 10minutemail.net

  • Language: Multilingual
10 Minute Mail
10 Minute Mail

3 maildrop.cc

Maildrop
Maildrop

4 getnada.com

getnada
getnada

5 www.dispostable.com

Dispostable
Dispostable

6 temp-mail.org

  • Language: Multilingual
TEMPMAIL
TEMPMAIL

7 www.throwawaymail.com

ThrowAwayMail
ThrowAwayMail

8 tempail.com

TEMPMAIL
TEMPMAIL

9 tempmail.altmails.com

TempMail.altmails
TempMail.altmails

10 10minemail.com

  • Language: Multilingual
10MINEMAIL
10MINEMAIL

11 generator.email

Email Generator
Email Generator

12 tempmailo.com

TEMPEMAILO
TEMPEMAILO

13 emailfake.com

  • Language: Multilingual
EMAILFAKE
EMAILFAKE

14 temp-mail.io

  • Language: English and 3 other languages available
tempmail
tempmail

15 tempmail.net

  • Language: English and 5 other languages available
TEMMAIL
TEMMAIL

16 instant-email.org

Instant-email
Instant-email

17 http://www.fakemailgenerator.com

FAKE MAIL GENERATOR
FAKE MAIL GENERATOR

Receiving and Sending

1 www.guerrillamail.com/compose

  • Free
  • Size limit 150MB per email
  • Can have attachments
  • Single email address at a time, no CC and BCC
  • IP address recorded for security reasons
  • No What You See Is What You Get (WYSIWYG) editor
  • Language: Multilingual
GUERRILLAMAIL
GUERRILLAMAIL

2 www.trash-mail.com/compose-mail

  • Free
  • Can have attachments
  • Provide easy and simple WYSIWYG editor
  • Language: English and German
TRASH-MAIL
TRASH-MAIL

3 www.sharklasers.com/compose

  • Free
  • Single email address at a time, no CC and BCC
  • Can have attachments
  • IP address recorded for security reasons
  • No What You See Is What You Get (WYSIWYG) editor
Share Lasers
Share Lasers

Warning: Do not use these services for important emails, e.g. high confidential email. They can be exposed to other users who is using the same service. Unless you know what you are doing.

Open source and Free Gif Maker – ScreenToGif

SreenToGif
SreenToGif
  • Open source and completely free
  • Multilingual
  • Easy to use
  • Builtin editor
  • Builtin Screen Recorder
  • Builtin Webcam Recorder
  • Builtin Board Recorder (For recording drawings)
  • Single file mode (No installation required, download and use)
  • Standard setup mode

ScreenToGif - Editor
ScreenToGif – Editor
ScreenToGif - Options
ScreenToGif – Options
ScreenToGif -> Option -> Language
ScreenToGif -> Option -> Language

Why use ScreenToGif?

Why use ScreenToGif?
Why use ScreenToGif?

Useful links

One-Lin3r – Penetration test with one line (Installation on Kali Linux)

One-Lin3r is simple modular and light-weight framework gives you all the one-liners that you will need while penetration testing (Windows, Linux, macOS or even BSD systems) or hacking generally with a lot of new features to make all of this fully automated (ex: you won’t even need to copy the one-liners).

One-liner functionWhat this function refers to
Reverse ShellVarious methods and commands to give you a reverse shell.
PrivEscMany commands to help in Enumeration and Privilege Escalation
Bind ShellVarious methods and commands to give you a bind shell.
DropperMany ways to download and execute various payload types with various methods.

Install on Kali Linux

1 Launch terminal

2 Install One-Lin3r

~# pip3 install one-lin3r
Install One-Lin3r
Install One-Lin3r

3 Force reinstall “prompt-toolkit”

~# pip3 install prompt-toolkit --force-reinstall
Kali Linux - pip3 install prompt-toolkit --force-reinstall
Kali Linux – pip3 install prompt-toolkit –force-reinstall

Or we will get following error by launch “one-lin3r -h” straight way without reinstalling “prompt-toolkit”

Traceback (most recent call last):
   File "/usr/local/bin/one-lin3r", line 6, in 
     from one_lin3r.main import main
   File "/usr/local/lib/python3.7/dist-packages/one_lin3r/main.py", line 3, in 
     from .core import Cli
   File "/usr/local/lib/python3.7/dist-packages/one_lin3r/core/Cli.py", line 6, in 
     from . import utils,db
   File "/usr/local/lib/python3.7/dist-packages/one_lin3r/core/utils.py", line 5, in 
     from prompt_toolkit.shortcuts import CompleteStyle, prompt
 ImportError: cannot import name 'CompleteStyle' from 'prompt_toolkit.shortcuts' (/usr/lib/python3/dist-packages/prompt_toolkit/shortcuts.py)
Kali Linux, one-lin3r -h error
Kali Linux, one-lin3r -h error

4 Try launch one-lin3r -h

~# one-lin3r -h
Kali Linux - one-lin3r -h
Kali Linux – one-lin3r -h

5 Now we can close terminal window then launch from terminal or menu

one-lin3r from menu
one-lin3r from menu
one-lin3r from terminal
one-lin3r from terminal

Usage

Launch

~# one-lin3r
one-lin3r from terminal
one-lin3r from terminal
One-Lin3r
One-Lin3r

Other commands

One-Lin3r  -> list
One-Lin3r -> list
usage: one-lin3r [-h] [-r R] [-x X] [-q]
 optional arguments:
   -h, --help  show this help message and exit
   -r          Execute a resource file (history file).
   -x          Execute a specific command (use ; for multiples).
   -q          Quiet mode (no banner).

More on: github.com/D4Vinci/One-Lin3r

Bonus

Next we can use nc to listen on the port from the reverse connection (reverse shell)

~# nc -lvp 1500
listening on [any] 1500 …
 nc -lvp 1500
nc -lvp 1500

Once we have connected to the victim then we need to think about privilege escalation, which One-Lin3r also contains some handy privesc commands for us to generate and use

one-lin3r -> search windows privesc
one-lin3r -> search windows privesc

Configure Squid proxy with php redirector

Squid proxy can be used with different redirectors and rewriters, in this guide we will be using a redirector written with php.

This guide is using Ubuntu 18.04 LTS, your configuration file maybe located differently if using different version or Linux distribution etc.

Note: Before starting following this guide, you have to make sure your squid proxy is configured properly and running without any issue.

Squid configuration

1 Open squid configuration file from

/etc/squid/squid.conf

or

/etc/squid3/squid.conf

For following steps, make sure you are using right path/configuration file (either /squid/ or /squid3/), I will be using /squid/

2 Add following line

url_rewrite_program /usr/bin/php /etc/squid/redirect.php

This indicates that we will be using an redirector/ url write program written in php so that we will need php binary to run the script thus “/usr/bin/php” the redorector file path is “/etc/squid/redirect.php” which means will be putting the “redirect.php” file under “/etc/squid”

PHP url rewrite program/redirector

1 We create a “redirect.php” file under “/etc/squid/”

2 We write necessary script

#!/usr/bin/php
<?php
//By https://dannyda.com
//Modified based on
//http://wiki.squid-cache.org/ConfigExamples/PhpRedirectors
//Using PHP for Redirects
 
//and
 
//https://aacable.wordpress.com/tag/squid-url-redirection/
//------------------------------------------------------------------------------
$temp = array();
// Extend stream timeout to 24 hours
stream_set_timeout(STDIN, 86400);
while ( $input = fgets(STDIN) ) {
  // Split the output (space delimited) from squid into an array.
  $temp = explode(' ', $input);
  // Set the URL from squid to a temporary holder.
  $output = $temp[0] . "\n";
	if(preg_match("/(.*[0-9])\/ABCD\/.*/i", $input)){
		//Replace any url matching xxx.xxx.xxx.xxx/ABCD/aaaaaaaaaaaaaaaaaaaaaa and change to to my.blocked.com/ABCD/aaaaaaaaaaaaaaaaaaaaaa
		$output = "308:".str_replace(parse_url($input,PHP_URL_HOST),'my.blocked.com',strtok($input, ' '))."\n"; //Outout intended modified url (308 Permanent Redirect)
		//file_put_contents("/etc/squid/a.txt", $input,FILE_APPEND); //For debugging we can enable this line, output will be found at /etc/squid/a.txt
		//$output = "302:"."http://www.google.com/"."\n"; //(302 Found, Moved Temporarily)
		
		//We can either output modified url based on ip address, partial url matching, domain matching and modify partialy as well or we can redirect to another url completely
		//Following by more examples
	}
	
	if(preg_match("/(.*[0-9])\/forum\/.*\/sign\=.*\.jpg/i", $input)){
		$output = "308:".str_replace(parse_url($input,PHP_URL_HOST),'mytestforum.com',strtok($input, ' '))."\n";
		// /forum/*/sign
	}
	
	if(preg_match("/(.*[0-9])\/forum\/pic\/item\/.*\.jpg/i", $input)){
		$output = "308:".str_replace(parse_url($input,PHP_URL_HOST),'mytestforum.com',strtok($input, ' '))."\n";
		// /forum/pic/item
	}
	//---------------------------------------------------------------------------
	//Temporarily block URLs based on partial url match with regular expression
	if(preg_match("/ad\.m\.domain\.com(\/.*|$)/i", $input)){
		$output = "308:"."http://255.255.255.255"."\n";
		//adash.m.taobao.com
	}
	if(preg_match("/.*admaster\.com.*/i", $input)){
		$output = "308:"."http://255.255.255.255"."\n";
		//*.admaster.com.cn
	}
	
	if(preg_match("/.*\/AdvertiseInterface\//i", $input)){
		$output = "308:"."http://255.255.255.255"."\n";
		//ad
		//http://albatrosscn.buddylync.com:8080/AdvertiseInterface/
	}
	
	if(preg_match("/.*\/advertise\//i", $input)){
		$output = "308:"."http://255.255.255.255"."\n";
		//ad
		//http://*/advertise/
	}
	
  echo $output;
}

3 We add execute permission

chmod +x /etc/squid/redirect.php

4 We restart squid

~# systemctl restart squid

5 Now we should be able to see the redirector in action

Extended reading

Bonus

Online regular expression testers

Which can help you craft desired regular expression for use within redirector

How to fix: Windows Storage Space/Storage Pool, Virtual Disk not attaching automatically on reboot

1 Launch PowerShell from start menu or “Run” window with admin privilege

2 Use following command to check “-IsManualAttach” attribute

Get-VirtualDisk | Select-Object IsManualAttach

Or use following command to show all virtual disks with “IsManualAttach” attributes

Get-VirtualDisk | Where-Object {$_.IsManualAttach –eq $True}
Windows PowerShell -  Get-VirtualDisk | Select-Object IsManualAttach
Windows PowerShell – Get-VirtualDisk | Select-Object IsManualAttach

3 Use following command to set “IsManualAttach” to false, so that it will attach on reboot

Set-VirtualDisk -FriendlyName "virtual disk name" -IsManualAttach 0

e.g.

Set-VirtualDisk -FriendlyName "my virtual disk" -IsManualAttach 0

Or to use following command to change all virtual disks to auto attach on reboot

Get-VirtualDisk | Where-Object {$_.IsManualAttach –eq $True} | Set-VirtualDisk –IsManualAttach $False

How to: Check Windows Storage Space, Storage pool virtual disk Columns

Using PowerShell

Get-VirtualDisk "name of the virtual disk" | Select-Object *

To get general information, use following command instead

Get-VirtualDisk "name of the virtual disk"

Using Server Manager

1 Launch Windows “Server Manager”

2 In Windows Server 2019, navigate to “Server Manager -> File and Storage Services -> Storage Pools -> Virtual Disks”

3 Right click on the virtual disk, select “Property”

4 Click on “Details”

5 Select “NumberOfColumns” from “Property:”

6 The number of columns will be displayed underneath.

Note

If after rebooting, virtual disks are not attaching automatically, follow this guide to make them auto attach on reboot.