Friday, February 16, 2018

How to BackUp from Android to Desktop using ADB via a Context Menu

Pre-Req's:



install sdk, make sure you know how to run adb from cmd prompt.
Run cmd  as Admin:




1. Figure out paths of your internal/external cards


  adb shell ls $EXTERNAL_STORAGE
  adb shell ls $SECONDARY_STORAGE

 2. Test commands to work with external/internal

  cd C:\Work\Tools\Misc\Android\sdk\platform-tools 
// INTERNAL
  adb pull /sdcard/Backups/ C:\Temp\Phone\Media\20180216\Backups
  // EXT SD CARD
  adb pull /storage/D02B-5AB9/backups/ C:\Temp\Phone\Media\20180216\Backups


  3. Create a bat file to backup all folders using those commands


   See Synch.Phone.BackUp.bat below
   Save to C:\temp (or ur own dir)
   Run bat file like so: Synch.Phone.Backup C:\Temp\Phone\20180216



  
  4. Add Reg file so we have a context menu


  




Windows Registry Editor Version 5.00
 
  [HKEY_CLASSES_ROOT\Directory\shell\Synch03_PUSHPhoneHere]
  @="Execute Synch03_PUSHPhoneHere"
 
  [HKEY_CLASSES_ROOT\Directory\shell\Synch03_PUSHPhoneHere\command]
  @="\"C:\\Temp\\Synch.Phone.BackUp.bat\" \"%1\""
  

Bat File    See Synch.Phone.BackUp.bat

*** note your External SD card may b different. Mine is D02B-5AB9



@ECHO OFF
SET dest=%1
setlocal
:PROMPT
SET /P AREYOUSURE=Are you sure U WANT TO %dest% BACKUP TO  (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO exitMe

 Echo START Synch.Phone.BackUp.bat
 cd %ANDROID_HOME%

 ECHO ****************dest: %dest%
 ECHO ****************START  %DATE% %TIME% synch

 ECHO ****************Current Folder Name: %foldername%

 ECHO ONE way copy phone to BU location
 ECHO synch excluding older file, This should preserve newer copy exist in both locations
 ECHO  ******* Start COPY Internal...

 mkdir %dest%\Backups\Test
 adb pull /sdcard/Backups/Test %dest%\Backups\Test
 mkdir %dest%\Backups
 adb pull /sdcard/Backups %dest%\Backups
 mkdir %dest%\Pictures
 adb pull /sdcard/Pictures %dest%\Pictures


 ECHO  ******* Start COPY External...


 mkdir %dest%\Backups\Test
 adb pull /storage/D02B-5AB9/Backups/Test %dest%\Backups\Test
 mkdir %dest%\Backups
 adb pull /storage/D02B-5AB9/Backups %dest%\Backups


 ECHO ****************DONE  %DATE% %TIME% synch

 cd C:\temp
 pause
:exitMe
 ECHO  ******* exiting...

Saturday, January 27, 2018

Setting Up RDP on Machine with Firewall, Proxies, AntiVirus, File Blockers and other Security Apps. How to RDP with minimal privs:


Using RDP Tools on highly secure laptop : Hosting Procedures for my Fav 2 Remote Tools on Machines with Strict VPN’s

DeskRoll

    Start
         1. Disonnect VPN
         2. Start CMD as Admin
         3. net start DeskRollUnattendedAccess
         4. UI Start: C:\Windows\system32>"C:\Program Files (x86)\DeskRoll Unattended Access\DeskRollU.exe"
         5. Verify is Connected
         6. Connect VPN
         7. Await UI,
         8. Set Proxy to http://prntscr.com/i6ao1n

    Stop
         0. kill DeskRollU.exe
         1. net stop DeskRollUnattendedAccess
         2. Drop VON

Any Connect


     Start
         1.Connect VPN
         2. Run cmd as Admin, enter smart card creds
         3. execute "C:\temp\SharePointAny\SharePointAny.exe"

    Stop
         1. Kill SharePointAny.exe
         2. Disconnect VPN

  

  Netstat for RDP Debug

     https://apttech.wordpress.com/2009/12/23/using-netstat-to-resolve-rdp-issues/
   
            

   Netstat:   


             Poll outgoing, poll every 1 sec for port listening
         netstat -an 1 | find "3333"
        
         Poll incoming
         netstat -an 1 | find "4444" | find "ESTABLISHED"
            

     Network Port Scan


         netstat -a -n
         Now you want to go into Start > Run > cmd > look for ESTABLISHED connections
         "netstat -ano"
        
        
        

     Firewall Check/ Commands


         Run:
         wf.msc
            
         netsh firewall show state
         netsh firewall show config
        
         Enable Port
         netsh firewall add portopening TCP 80 "Open Port 80"
        

     Port Usage:


         Check If Listening:


             >netstat -an |find "3306"

         Check any other firewalls are blocking any ports


             netstat -ano | findstr -i SYN_SENT
        

         Test Port


             to test all open ports:

            portqry.exe -n #.#.#.#  
             To test a specific port:

            portqry.exe -n #.#.#.# -e #
             For example to test the Web interface of a router at 192.168.1.1:

            portqry.exe -n 192.168.1.1 -e 80
             Which returns:

            TCP port 80 (http service): LISTENING
             Where as testing on a local machine with no HTTPD running returns:

            TCP port 80 (http service): NOT LISTENING
             Using a PortScan utility you will get one of 3 results.

            Listening means the server is listening on the specified port
             Filtered means it received a TCP acknowledgement packet with the Reset flag set which likely indicates a firewall or software issue
             Not Listening means it didn't receive a response at all
             telnet is another command line option that is usually installed on the OS by default. This command line utility can be used a quick way to see if a port responds to a network request.

            To use telnet you would simply issue the following command from a command prompt:

            telnet localhost 3306'

     Save Commands History


         doskey /history > commands.log
        

     difference between [::] 0.0.0.0 and 127.0.0.1


         0.0.0.0, in this context,  "all IP addresses on the local machine"
         127.0.0.1 the service is only bound to the loopback interface
         [::] IPv6
        

     Use NetStat for Remote


         https://apttech.wordpress.com/2009/12/23/using-netstat-to-resolve-rdp-issues/
        
 

Change Service Names:

Rename Service Image Path w/ sc

        https://stackoverflow.com/questions/3663331/when-creating-a-service-with-sc-exe-how-to-pass-in-context-parameters

    binPath= "\"PATH WITH SPACES \COMMAND.EXE\" --param-with-quotes=\"a b c\" --param2"
          ^ ^                 ^           ^                      ^       ^         ^
          | |                 |           |                      |       |         |
      opening     escaped      regular     escaped                    escaped       closing
        quote     quote       backslash    closing                    quotes          quote
          for     for            in         quote                      for              for
        whole     path          path       for path                  parameter        whole
      command                                                                       command

or
         Stop the service. You will probably confuse the service control manager if you do this on a running service. (You may confuse it anyhow, this is very hacky.)
         Open regedit.exe (Registry Editor).
         Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and find the subkey with your service's name.
         Right-click the key you found in step #3, and select Rename. Enter the new name for the service.
         Restart the computer. Services.exe, the process that hosts the service control manager, won't see the change unless you do; attempts to start the renamed process (or otherwise interact with it at all, actually) will fail.
        
         or
        
         sc config "Old service name" displayname= "New service name"
         To change the executable you can run:
        
         sc config "Service name" binpath= "C:\path\to\executable\here"
         For both of those commands, make sure you have a space between the = and the new name (ie. displayname= "New Name", NOT displayname="New Name")
        
         or
        
         sc config "Name of Service" start= disabled
         sc stop "Name of Service"
        

    Change File Properties


        Verpatch to change via cmd line


        Office file via code:


         OleDocumentPropertiesClass
              //creates new class of oledocumentproperties
                 var doc = new OleDocumentPropertiesClass();
            
                 //open your selected file
                 doc.Open(pathToFile, false, dsoFileOpenOptions.dsoOptionDefault);
            
                 //oyu can set properties with summaryproperties.nameOfProperty = value; for example
                 doc.SummaryProperties.Company = "lol";
                 doc.SummaryProperties.Author = "me";
            
                 //after making changes, you need to use this line to save them
                 doc.Save();



    

Some Browser Based Remote Tools

   

    http://www.ammyy.com/en/

    https://www.remotepc.com/rpcnew/home
     https://www.screenconnect.com/
         https://flasponge.screenconnect.com/host#Support/All%20Sessions

    https://www.cybelesoft.com/download/#trdp

    https://www.screenleap.com/?newSignUp=true

    https://www.mikogo.com/confirm-registration/

    http://www.aeroadmin.com/en/

Wednesday, December 20, 2017

Keep Email Inbox Organized: Alternative to unroll.me Using EmailPet (UNROLL.ME SUCKS!!)

Due to Unroll.me lying to users and selling info to uber which leads to MORE junk email, many users are dumping unroll.me like a hot potato and rightfully so. This product is a great tool however the “free” price tag comes with a cost to our privacy. With Unroll.me not looking like they will quit this “share your data” bad habit any time soon, privacy conscious users are left out in the cold looking for an alternative. After a good many hours seeking an alternative that can A) auto organize incoming emails and B) automate the unsubscribing or removal of spam for our clogged inboxes, I found 1 tool that rose to the top of my list and it looks like the best and cleanest competition to unroll.me and a great alternative to the biggest player in the email management space Sanebox. This tool is EmailPet! and below is some config settings I have used to start my use of EmailPet.

Below are my beginer settings for EmaiPet, and with a price of 5$ per Month for 5 email addresses its a small price to pay when compared to SaneBox. Plus to be quite honest, EmailPet is more easy to use than SaneBox and from my point of view its is less intrusive to my gmail/pop3 email client. With a clean Dashboared to manage lists/filters and the ability to ala-carte  add custom lists/filters, EmailPet can be a great alternative to Unroll.me, SaneBox and almost any other Email management tool.

All of the below settings are OTB minus a Receipts List/Filter that I added. This is another awesome feature of this tool: extensibility allows users to create their own Filter/Lists. By following the configuration of the existing OTB BlackList Filter/Lists, I created my own custom Filter/Lists for Receipts. In my case I created a List first and then the Filter (made of 2 parts) this is then used by EmailPet to “Learn” over time. Its not really learning, it just uses a growing association construct meaning emails Senders added to my Receipts folder are added to a list and then when any NEW emails arrive that match an item in that list the NEW email gets auto moved to the Receipts folder. Very clean and cool!

BTW I tried some other alternatives, that ranged from Open Source Auto UnSubscription to a nice proprietary free (form now) UnSubscribe tool to some very lavish email clients/management frameworks like mailstrom ect which were over kill for my major requirements: 1) Replace the functionality of unroll.me with 2) low cost 3) across several email accounts.

Config of my email Account:

Create a standard folder structure, not required by EmailPet, just a good practice in my opinion, this is used by the various EmailPet ala-carte filters, I created a standard because I have 4 email accounts, so with a standard folder (label) layout I can easily port the emailpet config across all my email accounts:


image

Filters:

image

Custom Filter (made up of 2 parts)

Part 1

image


Part 2


image



Lists:

image

Wednesday, December 6, 2017

SetUp Limited Windows User Profile: Block, Lock & Restict Apps, Folder and Files

These procedures can be used to create a locked down enviornment, e.g:  Child Computer, Limited Admin, Adult Content Filter Protections and File Security

download and install:

1. Filtering Apps: K9 and Stop Filter

2. File Lock Utility

this is one of the only tools I found that locks folders, files and apps. It is simple, intuitive and stable. I have tried several others but none are as good as File Lock

3. Service Lock Utility:

Allows setting security DACL’s on Windows Services, prevents user from stopping services

4. MIsc Apps:

Keep Running Apps

ReStart Script


Configure:

1. Run Service Lock Utility: restrict User from stopping services:

image

2. Run File Lock Utility lock files

image

Lock
             pornFilter
             K9 files
             gpedit.msc

Set PWD

3. Local Policy Editor: gpedit.msc

Apps:
App Locker: Lock/Software Protections
                 "C:\Work\Tools\AntiVirus\KidFilter\Free\LockService\ServiceSecurityEditor.exe"
Lock System
                 Microsoft.UserAccounts
                 regedit

image


RESTRICT access to regedit!

image


4. Misc GPO

Disable Task Manager

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr 
Hide Policy Editor:
User Configuration\Administrative Templates\Windows Components\Microsoft Management Console\Restricted/Permitted snap-ins\Group Policy\Group Policy Object Editor
Disable Any Control Panel Applet
Disable Windows Services Applet

HKEY_CURRENT_USER\Software\Policies\Microsoft\MMC\{58221C66-EA27-11CF-ADCF-00AA00A80033} and locate Restrict_Run registry key


5. If User is not Administrator:
Configuring Windows 7 for a Limited User Account
else
6. If User is Admin but want to limit some apps:
a) Create 2nd Admin User Admin2
b) Set ServiceLock user “Manage Service” DACL  to this user.  Set everyone else Deny “Stop Service”

7.  Assign revoke Terminate_Process DACL  Refs:
         https://stackoverflow.com/questions/5380018/deny-access-to-kiosk-program-process
         https://stackoverflow.com/questions/3121746/prevent-c-sharp-app-from-process-kill
         http://csharptest.net/1043/how-to-prevent-users-from-killing-your-service-process/index.html
         http://ethertubes.com/make-a-program-run-as-a-windows-service-on-boot/
         https://security.stackexchange.com/questions/30985/create-a-unterminable-process-in-windows
         https://msdn.microsoft.com/en-us/library/windows/desktop/ms684880(v=vs.85).aspx
         https://www.experts-exchange.com/questions/27858649/Protect-An-Application-From-Being-Killed-With-Task-Manager-Delphi.html
        
     Options to implement Process to Keep Filters running:
    
         1) Un-Killable Process: Set ACE to AccessDenied for ProcessAccessRights PROCESS_TERMINATE,
             http://csharptest.net/1043/how-to-prevent-users-from-killing-your-service-process/index.html
             K9filter.exe to
             hlth.ex
             movie.exe
            
         2) Create Boot process:
             a) Service that is a Service Driver
             b) kernel hacking, as mdm said, or diving into rootkit territory. Which I would suggest you avoid.
             c) Winlogon notification package.
            
         2) Create watcher proess:
             a) create app to run at boot
             b) Set to un-killable
             c) Process will watch K9filter.exe , hlth.exe ect
             d) for each process:
                 if process is dead: restart
                 else do nothing
        


Send Email Messages in the Future

Use these tools to setup future emails or coorespondances on a schedule:

https://sendrecurring.appspot.com/
https://www.futureme.org/
http://www.lettermelater.com/
http://whensend.com/
http://futureemailer.com/
http://lettertomyfutureself.net/
http://www.rightinbox.com/

Monday, November 20, 2017

Check if Directory or Path Exists using Powershell and Windows Command (bat)

1. Via Powershell:

$DIRE = "C:\Temp"

if ( Test-Path $DIRE ) {
    echo "Directory Exists"
} else {
    md $DIRE 
}

Check 2 paths:

$source="C:\Temp"
$dest="K:\Temp"

if ( ( Test-Path $source ) -and ( Test-Path $dest ) ) {
     Write-Host "START Write to $dest";
}
else
{
     Write-Host "CAN NOT ACCESS Source or Dest: $dest";
}


2. Via Cmd:


IF EXIST C:\NUL ECHO C: Drive is availablae
IF EXIST C:\Temp\NUL ECHO C:\Temp is availablae

Saturday, November 4, 2017

Tune Chrome

From : Tune Android Chrome settings:

1. Turn on Data Saver

2. Turn Off Share Reports with Google

3. Turn on Dont Track Me


image

Screenshot_2017-10-26-00-23-37

Screenshot_2017-10-26-00-15-58


4.  Flusg DNS/Disable Async DNS

chrome://net-internals/#dns then image

uncheck: image


5. Chrome Flags

#1 Enhance Image Loading Time (Number of raster threads) : 4

#2 Enhance Page Loading Time (Experimental canvas features) : Enable


#3 Enhance tab/window close speed (Fast tab/window close) : ENable


#4 Avoid auto-reloading of Tabs (Only Auto-Reload Visible Tabs)  ENable


#5 Password Generation (Password generation)  ENable


#6 TCP Fast Open (TCP Fast Open)  ENable

 
#7 Automatic Tab Discarding (Automatic tab discarding)  ENable

6: Get rid of unwanted plugins

Type chrome://plugins into the address bar and disable any unwanted plugins. Just click the link to disable.

7: Smoother scrolling

Type chrome://flags into the address bar and find Enable fast tab/windows close. This

8. Experimental Canvas Features: Enable for a decent performance boost.

Read more: https://www.tweaktown.com/guides/7370/google-chrome-performance-tweak-guide-make-browser-great-again/index3.html