Skip to main content

SMB disabling

  1. Start the registry editor (regedit.exe).
  2. Move to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters.
  3. From the Edit menu, select New, DWORD value.
  4. Enter a name of Smb2 and press Enter.
  5. Double-click the new value and set to 0 to disable SMB 2. Set to 1 to enable.
  6. Reboot the machine.

Comments

Popular posts from this blog

restart services remotely using power-shell script( restart.ps1)

FUNCTION Restart-Service { PARAM([STRING]$SERVERNAME=$env:COMPUTERNAME,[STRING]$SERVICENAME) #MSSQLSERVER FOR DEFAULT INSTANCE FOR NAMED INSTANCE MSSQL`$KAT $SERVICE = GET-SERVICE -COMPUTERNAME $SERVERNAME -NAME $SERVICENAME -ERRORACTION SILENTLYCONTINUE IF( $SERVICE.STATUS -EQ "RUNNING" ) { $DEPSERVICES = GET-SERVICE -COMPUTERNAME $SERVERNAME -Name $SERVICE.SERVICENAME -DEPENDENTSERVICES | WHERE-OBJECT {$_.STATUS -EQ "RUNNING"} IF( $DEPSERVICES -NE $NULL ) { FOREACH($DEPSERVICE IN $DEPSERVICES) { Stop-Service -InputObject (Get-Service -ComputerName $SERVERNAME -Name $DEPSERVICES.ServiceName) } }   Stop-Service -InputObject (Get-Service -ComputerName $SERVERNAME -Name $SERVICE.SERVICENAME) -Force    if($?)    {    Start-Service -InputObject (Get-Service -ComputerName $SERVERNAME -Name $SERVICE.SERVICENAME) $DEPSERVICES = GET-SERVICE -COMPUTERNAME $SERVERNAME -NAME $SERVICE.SERVICENAME -DEPENDENTSERVICES | WHERE-OBJECT ...

Java functions to run SSH commands from java

     public static void SSH(String Host,String username,String passwor,String cmd,String cmd1) {   byte[] tmp = new byte[1024]; String host =Host; String user =username; String password =passwor; String  command = cmd;                 String ou=null; try { Properties config = new Properties(); config.put("StrictHostKeyChecking", "no"); JSch jsch = new JSch(); // Create a JSch session to connect to the server Session session = jsch.getSession(user, host, 22); session.setPassword(password); session.setConfig(config); // Establish the connection session.connect(); System.out.println("Connected..."); ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(command); channel.setErrStream(System.err);                         channel.connect();       ...

Encryption and Decryption functions for Java

    public static String encrypt(String key, String initVector, String value) {         try {             IvParameterSpec iv = new IvParameterSpec(initVector.getBytes("UTF-8"));             SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");             Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");             cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);             byte[] encrypted = cipher.doFinal(value.getBytes());             System.out.println("encrypted string: "                     + Base64.encodeBase64String(encrypted));             return Base64.encodeBase64String(encrypted);         } catch (Exception ex) {   ...