From d686cc8b45ade204865ebd58b420c735b2721520 Mon Sep 17 00:00:00 2001 From: Mehedi Hasan Remon <54717234+mehedi1194@users.noreply.github.com> Date: Sat, 4 Apr 2020 20:50:52 +0600 Subject: [PATCH 1/5] urlparse to urllib.parse In python3 urlparse rename with urllib.parse --- handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.py b/handler.py index dbc2d26..7f3e62f 100644 --- a/handler.py +++ b/handler.py @@ -2,7 +2,7 @@ import tornado.ioloop, tornado.web, tornado.autoreload from tornado.escape import json_encode, json_decode -import safeurl, types, sys, re, mimetypes, glob, jsbeautifier, urlparse, pycurl +import safeurl, types, sys, re, mimetypes, glob, jsbeautifier, urllib.parse, pycurl import calendar, time, datetime from netaddr import * From 7595ca7e1ee996a1d1b8cee84d121596f362d457 Mon Sep 17 00:00:00 2001 From: Mehedi Hasan Remon <54717234+mehedi1194@users.noreply.github.com> Date: Sat, 4 Apr 2020 20:53:39 +0600 Subject: [PATCH 2/5] update safeurl.py replacing with some python3 staff --- safeurl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/safeurl.py b/safeurl.py index a9be918..0fe866c 100644 --- a/safeurl.py +++ b/safeurl.py @@ -15,7 +15,7 @@ import re import netaddr import pycurl -import StringIO +import io # Python 2.7/3 urlparse try: @@ -707,7 +707,7 @@ def execute(self, url): self._handle.setopt(pycurl.URL, url["cleanUrl"]) # Execute the cURL request - response = StringIO.StringIO() + response = io.BytesIO() self._handle.setopt(pycurl.WRITEFUNCTION, response.write) self._handle.perform() @@ -729,4 +729,4 @@ def execute(self, url): if not redirected: break - return response.getvalue() + return response.getvalue().decode('utf-8') From 482069ec99af25e9c5ccb886815495121ed9c268 Mon Sep 17 00:00:00 2001 From: Mehedi Hasan Remon <54717234+mehedi1194@users.noreply.github.com> Date: Sat, 4 Apr 2020 20:54:32 +0600 Subject: [PATCH 3/5] updated seteup.py tornado replaced with tornado<=5.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 87c8cbc..fd53ebd 100644 --- a/setup.py +++ b/setup.py @@ -9,6 +9,6 @@ long_description=open('README.md').read(), author='Ben Sadeghipour', url='https://github.com/nahamsec/JSParser', - install_requires=['safeurl', 'tornado', 'jsbeautifier', + install_requires=['safeurl', 'tornado<=5.1', 'jsbeautifier', 'netaddr', 'pycurl', 'BeautifulSoup4'], ) From 00bb8a2ca784b1d20fe3c3a8380c39e4762cec99 Mon Sep 17 00:00:00 2001 From: Mehedi Hasan Remon <54717234+mehedi1194@users.noreply.github.com> Date: Sat, 4 Apr 2020 20:55:14 +0600 Subject: [PATCH 4/5] Update README.md python2 to python3 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c95f37b..1063f6d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # JSParser -A python 2.7 script using Tornado and JSBeautifier to parse relative URLs from JavaScript files. Useful for easily discovering AJAX requests when performing security research or bug bounty hunting. +A python 3 script using Tornado and JSBeautifier to parse relative URLs from JavaScript files. Useful for easily discovering AJAX requests when performing security research or bug bounty hunting. # Dependencies @@ -38,4 +38,4 @@ $ python handler.py # Changelog -1.0 - Release \ No newline at end of file +1.0 - Release From 9a3a27a8a75eb67f381e943cc7056b6e5982a704 Mon Sep 17 00:00:00 2001 From: Mehedi Hasan Remon <54717234+mehedi1194@users.noreply.github.com> Date: Tue, 12 May 2020 23:45:39 +0600 Subject: [PATCH 5/5] Update handler.py replaced cgi with html --- handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.py b/handler.py index 7f3e62f..4b2ddc4 100644 --- a/handler.py +++ b/handler.py @@ -8,7 +8,7 @@ from netaddr import * from collections import defaultdict from bs4 import BeautifulSoup -from cgi import escape +from html import escape #------------------------------------------------------------ # Base / Status Code Handlers