View Mode: Normal | Article List

VBS应用

[ 2004-09-09 02:07:05 | Author: zhenhua ]
VBS脚本病毒的大量流行使我们对VBS的功能有了一个全新的认识,现在大家对它也开始重视起来。VBS代码在本地是通过Windows Script Host(WSH)解释执行的。VBS脚本的执行离不开WSH,WSH是微软提供的一种基于32位Windows平台的、与语言无关的脚本解释机制,它使得脚本能够直接在Windows桌面或命令提示符下运行。利用WSH,用户能够操纵WSH对象、ActiveX对象、注册表和文件系统。在Windows 2000下,还可用WSH来访问Windows NT活动目录服务。
  用VBS编写的脚本程序在窗口界面是由wscript.exe文件解释执行的,在字符界面由cscript.exe文件解释执行。wscript.exe是一个脚本语言解释器,正是它使得脚本可以被执行,就象执行批处理一样。关于VBS大家一定比我熟悉多了,所以再不废话,直接进入主题,看看我总结的VBS在系统安全中的八则妙用吧。

  一、给注册表编辑器解锁

  用记事本编辑如下内容:

DIM WSH
SET WSH=WSCRIPT.CreateObject("WSCRIPT.SHELL") '击活WScript.Shell对象
...

Read More...

Apache2+php4

[ 2004-09-09 02:06:26 | Author: zhenhua ]
Windows:
C:\Php\Dlls --> copy --> %windir%\System32
C:\Php\Php4ts.dll --> copy --> %windir%\System32

Php.ini
doc_root = c:\apache\apache2\htdocs
extension_dir = c:\php\extensions
session.save_path = c:/temp

LoadModule php4_module c:/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php3 .php .php3
or:
ScriptAlias /php/ "c:/php/"
Action application/x-httpd-php "/php/php.exe"

Test:
<? phpinfo(); ?>


Linux:

Apache2防盗链

[ 2004-09-09 02:05:05 | Author: zhenhua ]
首先要确认你的服务器或空间的服务器解译引擎为Apache2,还有支持.htaccess客户设置文件,
如果你有自己的服务器就请先对./conf/httpd.conf 文件做以下修改
找到:#LoadModule rewrite_module modules/mod_rewrite.so
把前面的 # 给去丢
找到等一个 AllowOverride None 改为 AllowOverride All
重启Apache2服务器接下就是做一个 .htaccess 文件了,其 .htaccess 文件内容为

RewriteEngine on
RewriteCond % !^http://yoyo.com.ru/.*$ [NC]
RewriteCond % !^http://yoyo.com.ru$ [NC]
RewriteCond % !^http://www.yoyo.com.ru/.*$ [NC]
RewriteCond ...

Read More...

IIS监控--自动重启脚本工具

[ 2004-09-09 02:04:29 | Author: zhenhua ]
功能:可以在IIS意外终止时自动重启IIS,无须登陆系统,无人职守
条件:
1.服务器安装过Windows Script 5.6,可以正常运行.vbs脚本。
2.确保系统服务Windows Management Instrumentation 正常启动。

将以下代码复制为 fu.vbs,放至系统盘WINNT/System32/下,注意重命名时要和“cscript //h:cscript&&cscript fu.vbs” 中的fu.vbs保持一至,否则计划任务启动时报找不到文件的错误。

然后做计划任务,让其在系统启动时运行监控
vbs代码:
strFullName = WScript.FullName
strWshHost = Right(strFullName, 11)
'WScript.Echo "Default script host: " & strWshHost
If strWshHost = "WScript.exe" Then
 Set objShell = CreateObject("WScript.Shell")
 objShell.Run _
...

Read More...

Resin优化

[ 2004-09-09 02:04:00 | Author: zhenhua ]
Resin优化:

The allocation of memory for the JVM is specified using -X options when starting Resin

(the exact options may depend upon the JVM that you are using, the examples here are for the Sun JVM).

JVM option passed to Resin Meaning
-Xms initial java heap size
-Xmx maximum java heap size
-Xmn the size of the heap for the young generation

Resin startup with heap memory options unix> bin/httpd.sh -Xmn100M -Xms500M -Xmx500M win> bin/httpd.exe -Xmn100M -Xms500M -Xmx500M install win ...

Read More...

同步IIS IWAM账号

[ 2004-09-09 02:00:52 | Author: zhenhua ]
IWAM账号是安装IIS5时系统自动建立的一个内置账号,主要用于启动进程之外的应用程序的Internet信息服务。IWAM账号的名字会根据每台计算机NETBIOS名字的不同而有所不同,通用的格式是IWAM_MACHINE,即由“IWAM”前缀、连接线“_”加上计算机的NETBIOS名字组成。我的计算机的NETBIOS名字是MYSERVER,因此我的计算机上IWAM账号的名字就是IWAM_MYSERVER,这一点与IIS匿名账号ISUR_MACHINE的命名方式非常相似。

IWAM账号建立后被Active Directory、IIS metabase数据库和COM+应用程序三方共同使用,账号密码被三方分别保存,并由操作系统负责这三方保存的IWAM密码的同步工作。按常理说,由操作系统负责的工作我们大可放心,不必担心出错,但不知是BUG还是其它什么原因,系统的对IWAM账号的密码同步工作有时会失败,使三方IWAM账号所用密码不统一。当IIS或COM+应用程序使用错误IWAM的密码登录系统,启动IIS Out-Of-Process Pooled Applications时,系统会因密码错误而拒绝这一请求,导致IIS ...

Read More...

Apache1/httpd.conf

[ 2004-09-09 02:00:13 | Author: zhenhua ]
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://www.apache.org/docs/> for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
...

Read More...

Resin.conf

[ 2004-09-09 01:59:41 | Author: zhenhua ]
<!--
 - The Resin configuration file.
 -
 - This example file is more complicated than is needs to be because
 - it makes several configurations explicit that can be simplified and
 - because it needs to configure the examples.
 -
 - Look in conf/samples for more realistic sample configurations.
 - conf/samples/simple.conf - a simple, basic configuration
 - conf/samples/deploy.conf - a simple configuration for deployment
 -
 - The configuration is based on
...

Read More...