[PROJECT 1]Errors running PhoneyC

16 views
Skip to first unread message

Neha Jain

unread,
Jun 12, 2010, 2:01:14 PM6/12/10
to pho...@googlegroups.com


Hello everyone,

Experimenting with phoneyc today I came across two sites twitter.com and sina.com.cn that gave following errors.

Errors with www.twitter.com:

1. Error executing:

//<![CDATA[
if (window.top !== window.self) {document.write = "";window.top.location = window.self.location; setTimeout(function(){document.body.innerHTML='';},1);window.self.onload=function(evt){document.body.innerHTML='';};}
//]]>

TypeError: window.top has no properties(JSError)

2. Traceback (most recent call last):
  File "/home/neha/phoneyc/DOM/DOMObject.py", line 77, in __setattr__
    self.__parser.html = self.__parser.html[:self.begin] + val + self.__parser.html[self.end:]
AttributeError: 'NoneType' object has no attribute 'html'

Errors with www.sina.com.cn:

1. Traceback (most recent call last):
  File "/home/neha/phoneyc/DOM/PageParser.py", line 188, in end_script
    self.__last_try(traceback.format_exc())
  File "/home/neha/phoneyc/DOM/PageParser.py", line 182, in end_script
    self.__dict__['__window'].__dict__['__cx'].execute(catch_script) # execute script here
  File "<JavaScript>", line 296, in SyntaxError: unterminated string literal
  File "<JavaScript>", line 296, in invalid property id
JSError: Error executing JavaScript.

2. Another error: list index out of range
File "/home/neha/phoneyc/DOM/PageParser.py", line 193, in end_script
    if isinstance(self.__dict__['__window'].__dict__['__sl'][-1].src, str):
IndexError: list index out of range

At present I do not have any idea how to fix these errors. I would be anyhow looking into it and try to figure out, with my limited knowledge, the fix for these. I appreciate suggestions or guidance in advance.

--
njain (IRC nick)



--
Smiles
Neha )))))

njain

unread,
Jun 13, 2010, 1:22:01 PM6/13/10
to phoneyc
Similar Javascript errors were encountered today while I ran phoneyc
on www.invisionboard.com. Some of the errors I found are here...
http://pastebin.com/b2CCLy8c

Joyan

unread,
Jun 13, 2010, 2:17:10 PM6/13/10
to pho...@googlegroups.com
hi neha,




Hello everyone,

Experimenting with phoneyc today I came across two sites twitter.com and sina.com.cn that gave following errors.

Errors with www.twitter.com:

1. Error executing:

//<![CDATA[
if (window.top !== window.self) {document.write = ""; window.top.location = window.self.location; setTimeout(function(){document.body.innerHTML='';},1);window.self.onload=function(evt){document.body.innerHTML='';};}
//]]>

TypeError: window.top has no properties(JSError)


this is related to the limited emulation of DOM objects in phoneyc. 'window' don't have 'top' property.

phoneyc doesn't aim to have a full emulation of all aspects in a real browser, because it will cost too much time to implement that.

i think if a feature is not heavily used in malware obfuscation, we can just report it as an issue and deal with it later when necessary. so currently you can just ignore such errors.

or you can add this property to 'window' for practise~

2. Traceback (most recent call last):
  File "/home/neha/phoneyc/DOM/DOMObject.py", line 77, in __setattr__
    self.__parser.html = self.__parser.html[:self.begin] + val + self.__parser.html[self.end:]
AttributeError: 'NoneType' object has no attribute 'html'


this is a real bug in phoneyc and we haven't find it. could you make simpler html file to reproduce this bug? i'm not able to access twitter easily in china...(f* gfw)


Errors with www.sina.com.cn:

1. Traceback (most recent call last):
  File "/home/neha/phoneyc/DOM/PageParser.py", line 188, in end_script
    self.__last_try(traceback.format_exc())
  File "/home/neha/phoneyc/DOM/PageParser.py", line 182, in end_script
    self.__dict__['__window'].__dict__['__cx'].execute(catch_script) # execute script here
  File "<JavaScript>", line 296, in SyntaxError: unterminated string literal
  File "<JavaScript>", line 296, in invalid property id
JSError: Error executing JavaScript.


this may be caused by the non-ascii characters in the site. please try -n option.


2. Another error: list index out of range
File "/home/neha/phoneyc/DOM/PageParser.py", line 193, in end_script
    if isinstance(self.__dict__['__window'].__dict__['__sl'][-1].src, str):
IndexError: list index out of range


i don't know how this happens. maybe another bug...


At present I do not have any idea how to fix these errors. I would be anyhow looking into it and try to figure out, with my limited knowledge, the fix for these. I appreciate suggestions or guidance in advance.

--
njain (IRC nick)



--
Smiles
Neha )))))


regards,
zhijie

njain

unread,
Jun 14, 2010, 8:14:05 AM6/14/10
to phoneyc
HI,

On Jun 13, 11:17 pm, Joyan <joya...@gmail.com> wrote:
> hi neha,
>
>
>
> > Hello everyone,
>
> > Experimenting with phoneyc today I came across two sites twitter.com
> > <http://twitter.com> and sina.com.cn <http://sina.com.cn> that gave
> > following errors.
>
> > Errors withwww.twitter.com<http://www.twitter.com>:
>
> > 1. Error executing:
>
> > //<![CDATA[
> > if (window.top !== window.self) {document.write = "";
> > window.top.location = window.self.location;
> > setTimeout(function(){document.body.innerHTML='';},1);window.self.onload=function(evt){document.body.innerHTML='';};}
> > //]]>
>
> > TypeError: window.top has no properties(JSError)
>
> this is related to the limited emulation of DOM objects in phoneyc.
> 'window' don't have 'top' property.
>
> phoneyc doesn't aim to have a full emulation of all aspects in a real
> browser, because it will cost too much time to implement that.
>
> i think if a feature is not heavily used in malware obfuscation, we can
> just report it as an issue and deal with it later when necessary. so
> currently you can just ignore such errors.
>
> or you can add this property to 'window' for practise~
Yeah, I would try to.
>
> > 2. Traceback (most recent call last):
> >   File "/home/neha/phoneyc/DOM/DOMObject.py", line 77, in __setattr__
> >     self.__parser.html = self.__parser.html[:self.begin] + val +
> > self.__parser.html[self.end:]
> > AttributeError: 'NoneType' object has no attribute 'html'
>
> this is a real bug in phoneyc and we haven't find it. could you make
> simpler html file to reproduce this bug? i'm not able to access twitter
> easily in china...(f* gfw)
No probs. I faced the same error yesterday with another site...
www.invisionboard.com I posted the error in paste bin. Same error in
same line 77. I was trying to figure out the reason. self.__parser is
initialised properly in the first line self.__parser = parser, but the
later updates point to none type object. I would look into it. I
appreciate your guidance into this.
>
> > Errors withwww.sina.com.cn<http://www.sina.com.cn>:
Thanks
Njain.
Reply all
Reply to author
Forward
0 new messages