Bootcamp MBR GPT Mismatch

Boot into Recovery Mode (Reboot and press cmd+R).
  1. Utilities menu > Terminal > Type:
    # csrutil disable
  2. Reboot normally
Download and install GPT fdisk from
Find Bootcamp partition location
# diskutil list
Run gdisk
# sudo gdisk /dev/disk0
# Command (? for help): v
Warning! Mismatched GPT and MBR partition! MBR partition 4, of type 0x07, has no corresponding GPT partition! You may continue, but this condition might cause data loss in the future!
Identified 1 problems!
Next, display the MBR partition table and make note of the start and end sectors for your BOOTCAMP partition.
  • Command (? for help): r
  • Recovery/transformation command (? for help): o
This should be partition 4 unless you’ve added additional partition(s), which is not officially supported by Boot Camp. It should show something like this:
Disk size is 1953525168 sectors (931.5 GiB)
MBR disk identifier: 0x7C170CB2
MBR partitions:
Number  Boot  Start Sector  End Sector  Status      Code
  1                    1      409639  primary    0xEE
  2                409640    975693095  primary    0xAF
  3            975693096    976962631  primary    0xAB
  4      *      976963584  1952806911  primary    0x07
Next, display the GPT partition table information:
  • Recovery/transformation command (? for help): m
  • Command (? for help): p
Number  Start (sector)    End (sector)  Size      Code  Name
  1              40          409639  200.0 MiB  EF00  EFI System Partition
  2          409640      975693095  465.1 GiB  AF00  Customer
  3      975693096      976962631  619.9 MiB  AB00  Recovery HD
  4      976963584      1953523711  465.7 GiB  0700  BOOTCAMP
Compare the start and end sectors for partition 4 to the MBR partition 4 start and end sectors. Most likely the start sectors will match, but the end sectors will be different.
The correct one should be 1952806911 but not 1953523711 
Next, delete the GPT partition 4. (Note: this does not delete the actual partition from disk. It only deletes gdisk’s in-memory representation of the GPT).
  • Command (? for help): d
  • Partition number (1-4): 4
Now, create a new partition 4 using the start and end sector values from the MBR partition 4:
  • Command (? for help): n
  • Partition number (4-128, default 4): 4
  • First sector (34-1953525134, default = 976962632) or {+-}size{KMGTP}: 976963584
  • Last sector (976963584-1953525134, default = 1953525134) or {+-}size{KMGTP}: 1952806911
  • Hex code or GUID (L to show codes, Enter = AF00): 0700
  • Changed type of partition to ‘Microsoft basic data’
Now, change the name of the new partition 4 to BOOTCAMP:
  • Command (? for help): c
  • Partition number (1-4): 4
  • Enter name: BOOTCAMP
Run the verify command. It should report no problems. If it still reports a problem, quit (q command) and start over.
  • Command (? for help): v
If everything checks out, write new partition table to disk and exit.
  • Command (? for help): w
Reboot and test your dual boot setup to verify all is working correctly.
Boot back into Recovery Mode (cmd+R).
  1. Utilities menu > Terminal > Type:
    # csrutil enable
  2. Reboot normally

Installing MacOS X High Sierra on VMware Workstation 14

-MacOS Sierra 10.12 ISO from
-VMware Unlocker 2.1.1 from
If you already have dmg file of MacOS X Sierra. You can try to convert it to ISO using PowerISO
-download PowerISO from
  • Run PowerISO.
  • Choose “Tools > Convert” Menu.
  • PowerISO shows Image Converter dialog.
  • Choose the source DMG file you want to convert.
  • Set the output file format to iso file.
  • Choose the output file name.
Extract Unlocker 2.1.1
-run as Administrator win-install.cmd
That will patch VMware to allow it to have Mac OS X on the OS menu
Install MacOS X High Sierra on VMware Workstation

Creating High Sierra Bootable Flash Disk

-login to your AppleStore and leave it connected
-Download macOS High Sierra Patcher Tool from
run it
click Tools/Download macOS High Sierra and save it to Applications
when Download Complete, click Not Now

-insert 16GB flash disk
# sudo /Applications/Install\ macOS\ High\ –volume /Volumes/YourUSBStick –applicationpath /Applications/Install\ macOS\ High\
Reboot and hold Option key then choose “Install macOS High Sierra” disk

Must format target disk with GPT
After boot from USB, run Terminal from Utilities menu
Why I need to use Terminal because sometime DiskUtil GUI can’t change Partition type
# diskutil list
note target disk
# diskutil partitionDisk /dev/disk1 GPT JHFS+ TARGETDISK 0b

error “The recovery server could not be contacted”
open Terminal
# ntpdate -u

error “This copy of the Install macOS High application is damaged, and can‘t be used to install macOS.”
# rm /Volumes/Install\ macOS\ Sierra/Install\ macOS\ High\

  1. Find the installer in USB.
  2. Right click on the installer and click “Show Package Contents”.
  3. Click on the folder named “Contents”.
  4. Click on the folder named “SharedSupport”.
  5. Delete the file named “InstallInfo.plist”.
  6. Enter your administer password to confirm.
  7. Now open the installer.
-By default High Sierra hiding drive icon on Desktop
open Finder Preferences
click General
tick Hard disks

-System Extension Blocked
click Open Security Preferences
click General. click Allow

-Modify or creating any files or folders on a disk, it will asks Admin password
  1. From the Finder menu bar, choose Go > Home. Your home folder opens.
  2. Choose File > Get Info. An Info window for your home folder opens.
  3. If the Sharing & Permissions section at the bottom of the window isn’t open, click the triangle  in that section to open it.
  4. If the Lock button at the bottom of the window shows a closed lock  , click the lock and enter an administrator name and password.
  5. Click the Action menu  in the bottom corner of the window, then choose “Apply to enclosed items.” Click OK to confirm the action. A progress bar appears at the top of the window.
Right click disk and choose Get Info
Scroll all the way down and click Lock icon, type Admin password
Tick Ignore ownership on this volume

Merge splitted disk into a single disk


Sometime you got OVA with multiple splitted disk. But I still prefer one big disk because easier to backup.

Here how to do that with VMware Workstation

-cd to your target vm disk location
c:\>cd C:\Users\user1\Documents\Virtual Machines\OWASP
07-Apr-17  11:28 AM    <DIR>          .
07-Apr-17  11:28 AM    <DIR>          ..
03-Aug-15  10:58 AM     1,774,780,416 OWASP Broken Web Apps-cl1-s001.vmdk
03-Aug-15  10:58 AM     1,603,600,384 OWASP Broken Web Apps-cl1-s002.vmdk
03-Aug-15  10:58 AM     1,806,696,448 OWASP Broken Web Apps-cl1-s003.vmdk
03-Aug-15  10:58 AM     1,135,149,056 OWASP Broken Web Apps-cl1-s004.vmdk
03-Aug-15  10:58 AM            65,536 OWASP Broken Web Apps-cl1-s005.vmdk
03-Aug-15  08:47 AM               780 OWASP Broken Web Apps-cl1.vmdk
03-Aug-15  10:54 AM             8,684 OWASP Broken Web Apps.nvram
31-Jul-15  10:25 AM                79 OWASP Broken Web Apps.vmsd
03-Aug-15  10:54 AM             1,582 OWASP Broken Web Apps.vmx
06-May-15  09:30 AM               276 OWASP Broken Web Apps.vmxf
03-Aug-15  10:44 AM             8,306 owaspbwa-release-notes.txt
              11 File(s)  6,320,311,547 bytes
               2 Dir(s)  385,078,714,368 bytes free

>”C:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe” -r “OWASP Broken Web Apps-cl1.vmdk” -t 0 OWASP.vmdk
Creating disk ‘OWASP.vmdk’

TeamViewer installation on Kali

-install sddm as default X windows because default X windows in Kali didn’t allow remote TeamViewer without login GUI first

# apt-get install sddm

# dpkg –add-architecture i386
# apt-get update
# dpkg -i –force-depends teamviewer_i386.deb
# apt-get install -f

# teamviewer –daemon start

-get current TeamViewer id either from GUI or CLI
# teamviewer –info print version, status, id
 TeamViewer                           12.0.71510  (DEB)
 teamviewerd status                   ● teamviewerd.service – TeamViewer remote control daemon
   Loaded: loaded (/etc/systemd/system/teamviewerd.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2017-03-19 09:02:02 PDT; 9min ago
  Process: 1140 ExecStart=/opt/teamviewer/tv_bin/teamviewerd -d (code=exited, status=0/SUCCESS)
 Main PID: 1162 (teamviewerd)
    Tasks: 12 (limit: 4915)
   CGroup: /system.slice/teamviewerd.service
           └─1162 /opt/teamviewer/tv_bin/teamviewerd -d
Mar 19 09:02:00 kali2 systemd[1]: Starting TeamViewer remote control daemon…
Mar 19 09:02:02 kali2 systemd[1]: Started TeamViewer remote control daemon.

 TeamViewer ID:                        798024234

-run teamviewer gui
# teamviewer
click Connection/Setup Unattended Access
click Next

click Finish

Now you can remotely connect to your Linux TeamViewer
-every time you adding device or login to new device while login to your TeamViewer a/c. TeamViewer will ask your permission by sending an email with title “Device authorization needed”
Just click a link in that email to add your device into your TV a/c

screen root privillege escalation

-this exploit will make normal user become root
-tried working with Ubuntu 13.x with old patches but not with Debian 8 or Parrot with latest patches

If you don’t have screen 4.05 then you need to install or compile yourself
# apt-get install screen
# cd /root
# cd screen-4.5.0
# apt-get install libncurses5-dev
# ./configure;make;make install

# screen -v
Screen version 4.05.00 (GNU) 10-Dec-16

# su – user1
$ ./
~ gnu/screenroot ~
[+] First, we create our shell and library…
[+] Now we create our /etc/ file…
[+] Triggering…
‘ from /etc/ cannot be preloaded: ignored.
[+] done!
No Sockets found in /tmp/screens/S-user1.

# whoami

Installing FireFox on Debian

# echo “deb jessie-backports firefox-release” >> /etc/apt/sources.list.d/mozilla-firefox.list
# cat /etc/apt/preferences.d/mozilla-firefox
Package: *
Pin: origin
Pin-Priority: 501

# apt-get update
# apt-cache policy firefox
  Installed: 51.0.1-3
  Candidate: 51.0.1-3
  Version table:
 *** 51.0.1-3 1001
       1001 stable/main amd64 Packages
        100 /var/lib/dpkg/status
     51.0.1-3~bpo80+1 501
        501 jessie-backports/firefox-release amd64 Packages

# apt-get install firefox -y