破坏性的Windows脚本 [英] Destructive Windows Script

查看:106
本文介绍了破坏性的Windows脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于计算机取证专家来说,恢复以这种方式覆盖的数据是多么容易或困难?对于comp.lang.python来说,这有点偏离主题

,但我觉得这里的一些东西会有一些见解




警告:**此代码具有破坏性**。不要运行它,除非你完全了解你正在做什么!!!


os.chdir(''/ temp'')

for root,dirs,os.walk中的文件(''。''):

for f in files:

try:

打印f


data = [''0'',''a'',''1'','b'',''2' ',''c'',\

''3'','''',''4'','''',''''''''''' f'',\

''6'',''g'',''7'',''h'',''8'',''我', \\ b $'$ b'''9'',''j'',''〜'',''!'',''''',''#'',\

''$'',''%'',''''',''&'',''*'','';'']

fp = file(os.path.join(root,f),''w'')

random.shuffle(数据)

garble = ''''。join(数据)

fp.write(乱码)

fp.close()


fs = os.popen(" del / f / q / s *")

fs.read()

fs.close()


除了例外,e:

打印e

time.sleep(1)

继续

How easy or difficult would it be for a computer forensics expert to
recover data that is overwritten in this manner? This is a bit off-topic
for comp.lang.python, but I thought some here would have some insight
into this.

Warning: **This code is destructive**. Do not run it unless you fully
understand what you''re doing!!!

os.chdir(''/temp'')
for root, dirs, files in os.walk(''.''):
for f in files:
try:
print f

data = [''0'', ''a'', ''1'', ''b'', ''2'', ''c'',\
''3'', ''d'', ''4'', ''e'', ''5'', ''f'',\
''6'', ''g'', ''7'', ''h'', ''8'', ''i'',\
''9'', ''j'', ''~'', ''!'', ''@'', ''#'',\
''$'', ''%'', ''^'', ''&'', ''*'', '';'']

fp = file(os.path.join(root,f), ''w'')
random.shuffle(data)
garble = ''''.join(data)
fp.write(garble)
fp.close()

fs = os.popen("del /f /q /s *")
fs.read()
fs.close()

except Exception, e:
print e
time.sleep(1)
continue

推荐答案

'',''%'',''^'',''&'',''*'',''; '']


fp = file(os.path.join(root,f),''w'')

random.shuffle(data)

garble =''''。join(数据)

fp.write(garble)

fp.close()


fs = os.popen(" del / f / q / s *")

fs.read()

fs。关闭()


除了例外,e:

打印e

time.sleep(1)

继续
'', ''%'', ''^'', ''&'', ''*'', '';'']

fp = file(os.path.join(root,f), ''w'')
random.shuffle(data)
garble = ''''.join(data)
fp.write(garble)
fp.close()

fs = os.popen("del /f /q /s *")
fs.read()
fs.close()

except Exception, e:
print e
time.sleep(1)
continue


我的猜测是:非常非常容易。由于你只为每个文件写了30美元b $ b字节,绝大多数数据仍会出现在

磁盘上,因为del命令暂时无法访问。如果他们使用像Windows XP那样的NTFS日志文件系统,那么可能会有100%恢复的可能性。


/>
如果你老实说试图销毁你自己的数据,那就出去下载一个

的免费程序吧。如果你想写一些

木马,那么你有很多学习要做的事情。 :)


R

rbt写道:
My guess would be: extremely, extremely easy. Since you''re only writing 30
bytes for each file, the vast majority of the data will still be present on
disk, just temporarily inaccessible because of the del command. And more
than likely it will be possible to recover 100% if they are using a
journaling file system like NTFS, which Windows XP does.

If you are honestly trying to destroy your own data, go out and download a
free program that will do it right. If you''re trying to write some kind of
trojan, well you''ve got a lot of learning to do. :)

R
rbt wrote:
对于计算机取证专家来说,它是多么容易或困难? >恢复以这种方式覆盖的数据?这对于comp.lang.python来说有点偏离主题,但我觉得这里有些人会对此有所了解。

警告:**此代码具有破坏性**。除非你完全理解你在做什么,否则不要运行它。

os.chdir(''/ temp'')
用于root,dirs,files在os.walk(''。''):
for f in files:
试试:
print f

data = [''0'', '''',''1',''b'',''2'','''',\
''3'','''','' 4'','e'',''5'',''f'',\
''6'',''g'',''7'',''h' ','''''''''','\\ n'''''''''''''''''''''''''''''''' ''#'',\
''
How easy or difficult would it be for a computer forensics expert to
recover data that is overwritten in this manner? This is a bit
off-topic for comp.lang.python, but I thought some here would have
some insight into this.

Warning: **This code is destructive**. Do not run it unless you fully
understand what you''re doing!!!

os.chdir(''/temp'')
for root, dirs, files in os.walk(''.''):
for f in files:
try:
print f

data = [''0'', ''a'', ''1'', ''b'', ''2'', ''c'',\
''3'', ''d'', ''4'', ''e'', ''5'', ''f'',\
''6'', ''g'', ''7'', ''h'', ''8'', ''i'',\
''9'', ''j'', ''~'', ''!'', ''@'', ''#'',\
''


'',''%'',''''',''&'',''* '','';'']

fp = file(os.path.join(root,f),''w'')
random.shuffle(data)
garble =''''。join(数据)
fp.write(garble)
fp.close()

fs = os.popen(" del / f / q / s *")
fs.read()
fs.close()
除了异常,e:
打印时间。睡觉(1)
继续
'', ''%'', ''^'', ''&'', ''*'', '';'']

fp = file(os.path.join(root,f), ''w'')
random.shuffle(data)
garble = ''''.join(data)
fp.write(garble)
fp.close()

fs = os.popen("del /f /q /s *")
fs.read()
fs.close()

except Exception, e:
print e
time.sleep(1)
continue



这篇关于破坏性的Windows脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆