中创信合的一个小程序,或许有用


大家好,好久没来了,SORRY,单位很忙,总下乡很少回家 。在下乡闲时,看了一个保卫的文件,针对关于佳木斯盗支存款的手段,编了一个限制非营业时间登录的程序并有注册记录,程序比较简单,但也能起到一定的计算机作案的防范作用,大家如果觉得有用就试一试,在业务程序用户newbank的.profile头加入如下语句 。
trap " " 1 2 3 5 15
clear
wkltime=`date%H%M`
wklym=`date%m`
if [ $wklym -ge 5 -a $wklym -lt 10 ]
then
if [ $wkltime -gt 730 -a $wkltime -lt 1730 ]
then
echo ""
else
checkmm
if [ $? -eq 8 ]
then
echo `date` >>loginerror
exit 0
fi
fi
else
if [ $wkltime -gt 730 -a $wkltime -lt 1630 ]
then
echo ""
else
checkmm
if [ $? -eq 8 ]
then
echo `date` >>loginerror
exit 0
fi
fi
fi
echo `date` >>loginok
以上是分5月1日与10月1日之间 7:30 ---17:30和在此之外时间7:30----16:30[营业时间,大家可以跟据实际情况改动 ]判断是否在营业时间内,如果不再,调用密码程序(这是个侧门程序,原因是如果网点必须在营业外时间必须要做一些工作的话,可由系统管理电话告诉运行密码,输入后就可以在非营业时间进入程序,这个密码是由时间和所号生成的,只能在这个所和这一天才能进入,过一天或换一个所都不能进入)密码程序源程序如下是ESQL/C编的,也可以用shell编,但容易留明码,编译方法esql -o checkmm checkmm.ec
源程序:
#include
#include
#include
$include sqlca;
wkl_mm(p)
short p;
{
short mdy_array[3],mm,dd,yy,ww;
$long cxsh;
int i,ookk;
long sysdate,lcxsh;
rtoday(&sysdate);
$database bankstar;
$select sh[4,7] into $cxsh from cxs ;
printf("cxsh=%d",cxsh);
rjulmdy(sysdate,mdy_array);
ww=rdayofweek(sysdate);
mm=mdy_array[0];
dd=mdy_array[1];
yy=mdy_array[2];
ookk=cxsh yy-10*(dd%p)-(mm*110*p) dd*p ww*p-((ww*7)%p);
return(ookk);
}【中创信合的一个小程序,或许有用】main()
{
long passw,passw1;
signal(SIGINT,SIG_IGN);
signal(SIGQUIT,SIG_IGN);
printf("警告!!!!n");
printf("已经超出营业时间,还要进入系统做什么?程序中有注册记录,不要以身试法n");
printf("如果真是工作需要,请输入电脑科给的授权密码:");
scanf("%d",&passw);
passw1=wkl_mm(10);
printf("input:%d",passw1);
if(passw1 == passw)
return 0;
else
return 8;
}另外,一时仓促,密码生成的算法比较简单,哪位高手能改写一下,有没有好的算法?
你这个程序做得不太好,只针对此用户,若别人知道其它的用户甚至root用户的口令
你这程序启不失效了 我这里做了一个小程序是针对所有用户的登录时间做限制,大家
可以试一试
由两个文件组成profile和loginfo
******profile文件内容 ,注意:先将/etc/profile做好备份,然后再将此文件拷入#!/bin/sh
# The following was generated from
# NLS/en/adm.gen
#
MF_ADM=adm.cat@Unix
#
MS_PROFILE=1
MSG_MAIL=1
:
#@(#) profile.sh 26.1 95/07/25
#
#Copyright (C) 1988-1995 The Santa Cruz Operation, Inc.
#All Rights Reserved.
#The information in this file is provided for the exclusive use of
#the licensees of The Santa Cruz Operation, Inc. Such users have the
#right to use, modify, and incorporate this code into other products
#for purposes authorized by the license agreement provided they include
#this notice and the associated copyright notice with any such product.
#The information in this file is provided "AS IS" without warranty.
##ident"@(#)adm:profile1.10"
trap "" 1 2 3
umask 022case "$0" in
-sh | -rsh | -ksh | -rksh)# if not doing a hushlogin, issue message of the day, if the file is out there
[ "X$HUSHLOGIN" != "XTRUE" ] && [ -s /etc/motd ] && {

推荐阅读