Kali update error in Windows 10 WSL: ‘sleep: cannot read realtime clock: Invalid argument’

After upgrading on WSL sleep doesn’t work with an error:

sleep: cannot read realtime clock: Invalid argument

Source: https://www.how2shout.com/how-to/how-to-upgrade-ubuntu-18-04-lts-to-20-04-lts-on-wsl-windows-10.html
I got it fixed using what it suggested there:

sudo -i 
sudo mv /bin/sleep /bin/sleep~ ; touch /bin/sleep ; chmod +x /bin/sleep

How do I make a connection private on Windows Server 2012 R2 ?

A GUI way of making this change:

  1. Hit Winkey + R to open Run prompt and type gpedit.msc
  2. Navigate to: Computer Configuration/Windows Settings/Security Setting /Network List Manager Policies.
  3. Choose your Network name in the right pane.
    Note: To show networks not currently connected, right-click Network List Manager Policies in the left pane and choose Show All Networks.
  4. Go to Network Location tab and change the Location type from Public to Private.

Or with Powershell (if network interface called Ethernet):

Set-NetConnectionProfile -InterfaceAlias Ethernet -NetworkCategory Private

Install Far Manager into Cmder

Download and  unpack Far Manager into cmder\vendor\farmanager directory.

Edit cmder\config\user_profile.cmdfile, add a line:

set "PATH=%CMDER_ROOT%\vendor\farmanager;%PATH%"

Rename cmder\vendor\farmanager\far.exe.example.inito cmder\vendor\farmanager\far.exe.ini, and change:

UseSystemProfiles=0
UserProfileDir=%CMDER_ROOT%\config\FAR\Profile

Create a empty dir: cmder\config\FAR\Profile.

Symantec Data Loss Prevention: Finest level logging on DLP agents (without server)

Only available on DLP 15.0 and below, and need Endpoint Agent Tools (download from MySymantec, and install on workstation):

Method 1 (with update_configuration.exe):

update_configuration.exe -name=Logging -setting=Obfuscate -type=int -value=0
update_configuration.exe -name=LoggerStatus -setting=IsDefaultLogLevelChanged -type=str -value=1
update_configuration.exe -name=LogLevel -setting=DefaultLevel -type=str -value=FINEST
update_configuration.exe -name=Logging -setting=MaxFileSizeBytes -type=int -value=10240000
update_configuration.exe -name=Logging -setting=MaxFiles -type=int -value=10​​

And restart edpa service (service_shutdown.exe then sc start edpa)

Method 2 (with vontu_sqlite3.exe):

vontu_sqlite3.exe -db=cg.ead -p=<agent_install_password>
Update CONFIGURATION set VALUE=0 where NAME="Logging" and SETTING="Obfuscate";
Update CONFIGURATION set VALUE="1" where NAME="LoggerStatus" and SETTING="IsDefaultLogLevelChanged";
Update CONFIGURATION set VALUE="FINEST" where NAME="LogLevel" and SETTING="DefaultLevel";
REPLACE INTO configuration VALUES('Logging','MaxFileSizeBytes','long','10240000');
REPLACE INTO configuration VALUES('Logging','MaxFiles','int','10');
.exit

And restart edpa service (service_shutdown.exe then sc start edpa)

When you’re done with the debug, don’t forget to restore it! (As a result of the above commands, the log file will not be obfuscated!)

Unable to Connect to Guest Console (Virtual Machine Connection) via Hyper-V Console

I have a 2 node HA Hyper-V cluster running the full OS (not Core).  While logged into the physical node with a domain admin account, i open the Hyper-V console and look at my Guest VMs i can see the status in the preview windows.  If i try to open a connection to the guest (Virtual Machine Connection) after about 1-2 min i get the following error messages:
“Cannot connect to the virtual machine.  Try to connect again.  If the problem persists, contact your systems administrator.”

Solution related to DNS & Hosts file. The host machine you are on must be able to resolve its host name to its own ip address.

Simpl add

127.0.0.1       [hostname]

to the c:\windows\system32\drivers\etc\hosts file of the host System.

 

Change MatterControl default data library dir

The MatterControl data folder location is not able to be changed; it is set to C:\Users\$USERNAME$\AppData\Local\MatterControl in Windows, ~/.local/share/MatterControl for Mac OS X and Linux.

Cross solution:
Adding custom folders from your hard drive
To do this, create a file called LibraryFolders.conf in the MatterControl data folder location directory. Add the full path to the folders you want to track on separate lines…

 

Enabling HTTPS on MikroTik self Web-server (generate root and HTTPS certificate)

Never use unencrypted protocol like HTTP or FTP toward your router!
Your password will travel plain-text and risk is not worth 5 minutes it takes to enable TLS encryption!

For HTTPS to work need to create two certificates (root and HTTPS certificate):

/certificate
add name=root-cert common-name=MikrotikRouter days-valid=3650 key-usage=key-cert-sign,crl-sign
sign root-cert
add name=https-cert common-name=MikrotikRouter days-valid=3650
sign ca=root-cert https-cert

The example is 10 years (3650 days). But this could be less, not a bad idea, changing the cert every year…
If there is a change in the affected package during the firmware upgrade, it is worth re-generating the certs.

With certificate signed, just need to assign it to www-ssl service and enable it, while disabling http:

/ip service
set www-ssl certificate=https-cert disabled=no
set www disabled=yes

Project done, now you can access your router via HTTPS…

Getting Chrome to accept self-signed localhost certificate

Click anywhere on the page and type a BYPASS_SEQUENCE:

thisisunsafe” is a BYPASS_SEQUENCE for Chrome version 65

badidea” Chrome version 62 – 64

danger” used to work in earlier versions of Chrome

If it not work, check if they changed it again, go to latest Chromium Source Code:

At the moment it looks like that:

var BYPASS_SEQUENCE = window.atob('dGhpc2lzdW5zYWZl');

You can run following line in a browser console:

console.log(window.atob('dGhpc2lzdW5zYWZl'));

How to change the language of the Cisco SPA5xx

  • Download SPA Phone Localization XML dictionaries (download both: english and your language)
  • Log into the web interface of your phone, switch over to Admin login: advanced (top right) /  [Voice] Regional -> Dictionary Server Script
  • Write: serv=tftp://192.168.0.2/;d0=English;x0=81692-spa50x_30x_en_v747.xml;d1=Magyar;x1=s81691-spa50x_30x_hu_v747.xml (192.168.0.2 is your tfpd server IP)

E-mail (gmail) configuration in a FreePBX Distro

append to /etc/postfix/main.cf:

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = secure
smtp_tls_mandatory_protocols = TLSv1
smtp_tls_mandatory_ciphers = high
smtp_tls_secure_cert_match = nexthop
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
relayhost = smtp.gmail.com:587

change /etc/postfix/sasl_passwd:

smtp.gmail.com:587 your-email-here@gmail.com:Password

Tell postfix:

chmod 400 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
chown postfix /etc/postfix/sasl_passwd
postfix reload

Install CrackMapExec On Windows

Download:

Install:

  • Pyton 2.7
    • standard install method
  • OpenSSL
    • standard install, and add OpenSSL \bin directory to path
  • Microsoft Visual C++ Compiler for Python 2.7
    • standars install method
  • CrackMapExec
    • simply unzip to a folder
    • run installer (python setup.py install) (do not get crushed with the errors you’ve returned)
    • pip install pywinrm
    • pip install pywerview
    • modify cm\first_run.py file to:
      • TMP_PATH = os.path.join(‘c:\\temp’, ‘cme_hosted’) (change c:\\temp to y Temp directory)
      • remove 77-88 lines (generate SSL cert)
    • in user .cme dir (ex: C:\Users\_username_\.cme) generate SSL cert
      • openssl req -new -x509 -keyout cme.pem -out cme.pem -days 365 -nodes -subj “/C=US”

Done 😉