Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ad8090

Browse files
committed
fix for a google bug reported by Brandon E.
1 parent 49915f3 commit 0ad8090

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

doc/THANKS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ Dan Guido <[email protected]>
6868
Vulnerability Analysis class at the Polytechnic University of New York,
6969
http://isisblogs.poly.edu/courses/pentest/
7070

71+
Brandon E. <[email protected]>
72+
for reporting a bug
73+
7174
Adam Faheem <[email protected]>
7275
for reporting a few bugs
7376

lib/core/convert.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def sha1hash(string):
7979

8080
def urldecode(string):
8181
result = None
82-
82+
8383
if string:
8484
result = urllib.unquote_plus(string)
8585

@@ -106,3 +106,9 @@ def utf8encode(string):
106106

107107
def utf8decode(string):
108108
return string.decode("utf-8")
109+
110+
def htmlescape(string):
111+
return string.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;').replace("'", '&#39;')
112+
113+
def htmlunescape(string):
114+
return string.replace('&amp;', '&').replace('&lt;', '<').replace('&gt;', '>').replace('&quot;', '"').replace('&#39;', "'")

lib/utils/google.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import urllib2
2929

3030
from lib.core.common import getUnicode
31+
from lib.core.convert import htmlunescape
3132
from lib.core.convert import urlencode
3233
from lib.core.data import conf
3334
from lib.core.data import kb
@@ -71,7 +72,7 @@ def getTargetUrls(self):
7172

7273
for match in self.__matches:
7374
if re.search("(.*?)\?(.+)", match, re.I):
74-
kb.targetUrls.add(( match, None, None, None ))
75+
kb.targetUrls.add(( htmlunescape(match), None, None, None ))
7576

7677
def getCookie(self):
7778
"""

0 commit comments

Comments
 (0)