Friday, July 2, 2021

How Cliff Stoll's Amazon sales were hijacked

Really interesting (and short) read.  Cliff Stoll sold Klein bottles on Amazon until a Chinese outfit managed to use Amazon's own rules to take over his storefront, leaving Cliff with no recourse.  Interesting and spooky.

https://kleinbottle.com/#AMAZON%20BRAND%20HIJACKING


Thursday, June 24, 2021

Get access to Redirected Folders

Ref: https://blogs.msmvps.com/bradley/2010/02/28/getting-access-to-the-my-documents-redirected-folders/

This post is a copy of the article referenced above.  Just read that if the link is still good.  Otherwise I include it here because it is so useful, and things disappear on the web.

Download pstools (part of the sysinternals package).

I suggest you create c:\sysinternals, unzip it there, and add that to your path.

Copy the below to a script named ChangePermissions.ps1.  

Change the two highlighted lines to suit your environment.

#ChangePermissions.ps1
# CACLS rights are usually
# F = FullControl
# C = Change
# R = Readonly
# W = Write

$StartingDir= "E:\Users\shares"

$Principal="INSERT_DOMAIN_NAME\ADMIN_USERNAME"

$Permission="F"

$Verify=Read-Host `n "You are about to change permissions on all" `
"files starting at"$StartingDir.ToUpper() `n "for security"`
"principal"$Principal.ToUpper() `
"with new right of"$Permission.ToUpper()"."`n `
"Do you want to continue? [Y,N]"

if ($Verify -eq "Y") {

foreach ($file in $(Get-ChildItem $StartingDir -recurse)) {
#display filename and old permissions
write-Host -foregroundcolor Yellow $file.FullName
#uncomment if you want to see old permissions
#CACLS $file.FullName

#ADD new permission with CACLS
CACLS $file.FullName /E /P "${Principal}:${Permission}" >$NULL

#display new permissions
Write-Host -foregroundcolor Green "New Permissions"
CACLS $file.FullName
}
}

 Run the script from an elevated cmd prompt with this command:

    psexec -s -i powershell -noexit "& 'C:\Path\To\ChangePermissions.ps1'"

It will recursively grant you access to everything in that path.

Monday, May 17, 2021

Powershell and Visual Basic logon scripts to map drives

On Error Resume Next 
' Ref: https://community.spiceworks.com/topic/1945685-gpo-drive-mapping-not-mapped-on-login-but-mapped-on-gpupdate
Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUserDN)
Set objNetwork = CreateObject("Wscript.Network")
Set objShell = CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")

'Map network share by group
arrGroups = objUser.GetEx("memberOf")
   For Each strGroup in arrGroups
        Set objGroup = GetObject("LDAP://" & strGroup)
        strGroupName = objGroup.CN

        Select Case strGroupName
 
        Case "N_share"
            objNetwork.MapNetworkDrive "Z:", "\\server\Network_share"

        'Case "Teachers"
            'objNetwork.MapNetworkDrive "K:", "\\fileserver\teachers$"

        End Select
Next



'Label the Network drives
Set WshNet = WScript.CreateObject("WScript.Network")
 Set oShell = CreateObject("Shell.Application")
 
Set nDrives = WshNet.EnumNetworkDrives
 
For i = 0 To nDrives.Count - 1 step 2
 path = nDrives.Item(i+1)
 drive = ndrives.Item(i)
 if drive <> "" then
 folders = Split(path,"\")
 foldername = folders(ubound(folders))
 oShell.NameSpace(drive & "\").Self.Name = foldername
 end if
 next
 
Set WshNet = Nothing
 Set oDrives = Nothing
 Set oShell = Nothing

Enable RDP, Ping, File sharing, remote registry and allow it through firewall from cmd line

REM
REM ENABLE RDP
REM
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group="remote desktop" new enable=yes
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TCP" /v UserAuthentication /t REG_DWORD /d "0" /f  
REM
REM SET REMOTEREGISTRY SERVICE TO AUTO START AND START IT
REM
sc config remoteregistry start=auto
wmic service where "name = 'remoteregistry'" call startservice

REM install Telnet client dism /online /Enable-Feature /FeatureName:TelnetClient
REM install WMIC (not installed by default on Windows 11)
DISM /Online /Add-Capability /CapabilityName:WMIC

REM
REM set local passwords to not expire.
REM wmic useraccount where name="sysadmin" set passwordexpires=false
net accounts /maxpwage:unlimited 
REM
REM ENABLE FIREWALL
REM
netsh Advfirewall set allprofiles state on

REM
REM ENABLE FILE SHARING
REM
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes

REM
REM ENABLE ICMP PING REPLY
REM
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
REM Disable 'Fast Boot'
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f

Wednesday, May 12, 2021

Tuesday, May 11, 2021

Henry's Post Tester

Henry's Post Tester is a service for developers testing clients that POST and GET things over HTTP. 

http://ptsv2.com/

 

 


Open Source NTP clients: Meinberg and Nettime

Meinberg NTP client.   https://www.meinbergglobal.com/english/sw/ntp.htm Nettime.  https://timesynctool.com/ Both are Windows GUI, open-sour...