[Openvas-commits] r3247 - in trunk/winslad: . john nsis

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed May 6 06:19:01 CEST 2009


Author: doj
Date: 2009-05-06 06:18:55 +0200 (Wed, 06 May 2009)
New Revision: 3247

Added:
   trunk/winslad/nsis/profile
Removed:
   trunk/winslad/nsis/banner.txt
   trunk/winslad/shell.bat
   trunk/winslad/shell.vbs
Modified:
   trunk/winslad/INSTALL.txt
   trunk/winslad/Makefile
   trunk/winslad/TODO.txt
   trunk/winslad/john/cygwin1.dll
   trunk/winslad/nsis/sshd_config
   trunk/winslad/winslad.nsi
Log:
this NSIS works in silent mode and installs CopSSH

Modified: trunk/winslad/INSTALL.txt
===================================================================
--- trunk/winslad/INSTALL.txt	2009-05-06 01:41:12 UTC (rev 3246)
+++ trunk/winslad/INSTALL.txt	2009-05-06 04:18:55 UTC (rev 3247)
@@ -13,3 +13,7 @@
   tested with NSIS 2.44) and install "Full".
 
 The installer uses CopSSH from http://www.itefix.no/i2/taxonomy/term/33
+
+- You can then either use ssh to log into a restricted shell, or use
+  'ssh slad at 192.168.21.74 "/opt/slad/bin/sladd -s jobs"' to query the
+  winslad program directly.

Modified: trunk/winslad/Makefile
===================================================================
--- trunk/winslad/Makefile	2009-05-06 01:41:12 UTC (rev 3246)
+++ trunk/winslad/Makefile	2009-05-06 04:18:55 UTC (rev 3247)
@@ -21,11 +21,12 @@
 libexpat.a:
 	$(MAKE) -C expat $@
 
-install:	all
+$(INSTALLER):	$(EXE) winslad.nsi
+	$(MAKENSIS) /v4 /onsis\nsis.log /DSLADD_VERSION=$(VERSION) winslad.nsi
+
+install:	$(EXE)
 	-$(MKDIR) $(PREFIX)
 	$(CP) $(EXE) $(PREFIX)
-	$(CP) shell.vbs $(PREFIX)
-	$(CP) shell.bat $(PREFIX)
 	$(MAKE) -C john $@
 	$(MAKE) -C oval $@
 
@@ -36,9 +37,6 @@
 	$(MAKE) -C john $@
 	$(MAKE) -C oval $@
 
-$(INSTALLER):	$(EXE) winslad.nsi
-	$(MAKENSIS) /v4 /onsis\nsis.log /DSLADD_VERSION=$(VERSION) winslad.nsi
-
 # Generates basic code documentation (placed in doc/generated)
 doc :
 	doxygen doc/Doxyfile

Modified: trunk/winslad/TODO.txt
===================================================================
--- trunk/winslad/TODO.txt	2009-05-06 01:41:12 UTC (rev 3246)
+++ trunk/winslad/TODO.txt	2009-05-06 04:18:55 UTC (rev 3247)
@@ -1,9 +1,6 @@
 # -*- mode: org; -*-
 #+STARTUP: showall
 
-- fix background process in SSH
-- support SSH command from command line
-
 - test on 32bit XP
 - test on 32bit Vista
 - test on 32bit Server 2003
@@ -13,9 +10,10 @@
 - test on 64bit Server 2008
 
 - installer
+ + check for password-less login of slad?
  + add some pages with license etc.
- + test silent (un)install
- + hide slad account from Windows Login Screen
+ + hide slad account from Windows Login Screen, maybe also SvcCOPSSH
+  * does this work with the SeServiceLogonRight privilege?
  + supply a special slad user picture
 
 - cross compile

Modified: trunk/winslad/john/cygwin1.dll
===================================================================
(Binary files differ)

Deleted: trunk/winslad/nsis/banner.txt
===================================================================
--- trunk/winslad/nsis/banner.txt	2009-05-06 01:41:12 UTC (rev 3246)
+++ trunk/winslad/nsis/banner.txt	2009-05-06 04:18:55 UTC (rev 3247)
@@ -1,2 +0,0 @@
-This service can only be used by WinSLAD.
-

Added: trunk/winslad/nsis/profile
===================================================================
--- trunk/winslad/nsis/profile	2009-05-06 01:41:12 UTC (rev 3246)
+++ trunk/winslad/nsis/profile	2009-05-06 04:18:55 UTC (rev 3247)
@@ -0,0 +1,7 @@
+export PATH="$HOME"
+alias sladd="sladd.exe"
+echo
+echo "This is a restricted shell for WinSLAD."
+echo "You can only start 'sladd'."
+echo
+exec /bin/bash -r


Property changes on: trunk/winslad/nsis/profile
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/winslad/nsis/sshd_config
===================================================================
--- trunk/winslad/nsis/sshd_config	2009-05-06 01:41:12 UTC (rev 3246)
+++ trunk/winslad/nsis/sshd_config	2009-05-06 04:18:55 UTC (rev 3247)
@@ -100,7 +100,7 @@
 #PermitTunnel no
 
 # no default banner path
-Banner /etc/banner.txt
+#Banner /etc/banner.txt
 
 # override default of no subsystems
 #Subsystem	sftp	/bin/sftp-server

Deleted: trunk/winslad/shell.bat
===================================================================
--- trunk/winslad/shell.bat	2009-05-06 01:41:12 UTC (rev 3246)
+++ trunk/winslad/shell.bat	2009-05-06 04:18:55 UTC (rev 3247)
@@ -1,3 +0,0 @@
- at echo off
-cd c:\winslad
-c:\windows\system32\cscript.exe /nologo c:\winslad\shell.vbs

Deleted: trunk/winslad/shell.vbs
===================================================================
--- trunk/winslad/shell.vbs	2009-05-06 01:41:12 UTC (rev 3246)
+++ trunk/winslad/shell.vbs	2009-05-06 04:18:55 UTC (rev 3247)
@@ -1,65 +0,0 @@
-' use this Visual Basic Restricted Shell with
-' c:\windows\system32\cscript.exe /nologo shell.vbs
-
-' Description: simple restricted shell for WinSLAD
-' Authors: Dirk Jagdmann <d.jagdmann at dn-systems.de>
-
-' Copyright (C) 2009  DN-Systems Enterprise Internet Solutions GmbH
-' Hornemannstr. 11-13, 31137 Hildesheim, Germany
-
-' This program is free software; you can redistribute it and/or modify
-' it under the terms of the GNU General Public License version 2 or later,
-' as published by the Free Software Foundation
-
-' This program is distributed in the hope that it will be useful,
-' but WITHOUT ANY WARRANTY; without even the implied warranty of
-' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-' GNU General Public License for more details.
-
-' You should have received a copy of the GNU General Public License
-' along with this program; if not, write to the Free Software
-' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Option Explicit
-Dim WshShell
-Set WshShell = CreateObject("WScript.Shell")
-
-Dim WshNetwork
-Set WshNetwork = WScript.CreateObject("WScript.Network")
-
-Do While true
-        ' write prompt
-        WScript.StdOut.Write "[" + WshNetwork.UserName + "@" + WshNetwork.ComputerName + "\\" + WshNetwork.UserDomain + "] " + WshShell.CurrentDirectory + ">"
-
-        ' read command line
-        Dim cmdLine
-        cmdLine = Trim(WScript.StdIn.ReadLine())
-
-        ' check command line
-        If UCase(Left(cmdLine, 6)) = "SLADD " Or UCase(Left(cmdLine, 10)) = "SLADD.EXE " Then
-                ' run command
-                Dim sladd
-                Set sladd = WshShell.Exec(cmdLine)
-                Do While sladd.Status = 0
-                        WScript.Sleep 100
-                Loop
-                ' check for STDOUT
-                If Not sladd.StdOut.AtEndOfStream Then
-                        WScript.StdOut.Write sladd.StdOut.ReadAll
-                End If
-                ' check for STDERR
-                If Not sladd.StdErr.AtEndOfStream Then
-                        WScript.Echo "STDERR:"
-                        WScript.StdOut.Write sladd.StdErr.ReadAll
-                End If
-        ElseIf UCase(cmdLine) = "EXIT" Then
-                WScript.quit
-        ElseIf UCase(cmdLine) = "HELP" Then
-                WScript.Echo "you can only start the WinSLAD program via 'sladd' or 'sladd.exe' and"
-                WScript.Echo "at least one argument. Use 'exit' to exit from the restricted Shell."
-        ElseIf cmdLine = "" Then
-                ' do nothing for empty command
-        Else
-                WScript.Echo "command forbidden"
-        End if
-Loop

Modified: trunk/winslad/winslad.nsi
===================================================================
--- trunk/winslad/winslad.nsi	2009-05-06 01:41:12 UTC (rev 3246)
+++ trunk/winslad/winslad.nsi	2009-05-06 04:18:55 UTC (rev 3247)
@@ -30,8 +30,7 @@
 
     # files which need to be copied
     file sladd.exe
-    file shell.vbs
-    file shell.bat
+    File /oname=.profile nsis\profile
 
     # John the Ripper plugin
     SetOutPath $INSTDIR\plugins\john
@@ -68,16 +67,25 @@
     UserMgr::SetUserInfo "${sladuser}" "HOMEDIR" "$\"$INSTDIR$\""
 
     # install SSH
+    IfSilent +3
     MessageBox MB_YESNO "Would you like to install the SSH Service now?" IDYES true IDNO false
     true:
         DetailPrint "installing CopSSH"
+        # copy, execute and delete CopSSH installer
         File /oname=s-i.exe nsis\Copssh_2.1.0_Installer.exe
         ExecWait "$INSTDIR\s-i.exe /S"
         Delete "$INSTDIR\s-i.exe"
-        Exec "$\"$PROGRAMFILES\ICW\Bin\copsshadm.exe$\" -c activateuser -u ${sladuser} --shell /cygdrive/c/winslad/shell.bat --nohomelink"
+        ExecWait "$\"$PROGRAMFILES\ICW\Bin\copsshadm.exe$\" -c activateuser -u ${sladuser}"
+        # /home/slad -> c:\winslad
+        ExecWait "$\"$PROGRAMFILES\ICW\Bin\rm.exe$\" -rf /home/${sladuser}"
+        ExecWait "$\"$PROGRAMFILES\ICW\Bin\ln.exe$\" -s /cygdrive/c/winslad /home/${sladuser}"
+        # /opt/slad/bin/sladd -> c:\winslad\sladd.exe
+        ExecWait "$\"$PROGRAMFILES\ICW\Bin\mkdir.exe$\" -p /opt/slad/bin/"
+        ExecWait "$\"$PROGRAMFILES\ICW\Bin\ln.exe$\" -s /home/${sladuser}/sladd.exe /opt/slad/bin/sladd"
+        # copy CopSSH configuration
         SetOutPath "$PROGRAMFILES\ICW\etc"
-        File /oname=banner.txt nsis\banner.txt
         File /oname=sshd_config nsis\sshd_config
+        #File /oname=banner.txt nsis\banner.txt
         setOutPath $INSTDIR
         false:
 
@@ -86,10 +94,13 @@
 section "uninstall"
 
     # uninstall SSH
+    IfSilent +3
     MessageBox MB_YESNO "Would you like to uninstall the SSH Service now?" IDYES true IDNO false
     true:
         DetailPrint "uninstalling CopSSH"
         ExecWait "$\"$PROGRAMFILES\ICW\uninstall_Copssh.exe$\" /S"
+        UserMgr::DeleteAccount SvcCOPSSH
+        RMDir /r /REBOOTOK "$PROGRAMFILES\ICW"
         false:
 
     # delete the slad user
@@ -104,7 +115,7 @@
     delete "$INSTDIR\uninstall.exe"
 
     # then delete the installation directory
-    RMDir /r $INSTDIR
+    RMDir /r /REBOOTOK $INSTDIR
 
     # second, remove the link from the start menu
     #delete "$SMPROGRAMS\new shortcut.lnk"



More information about the Openvas-commits mailing list