Git Product home page Git Product logo

jsparser's People

Contributors

0xibram avatar 1lastbr3ath avatar csmali avatar edoverflow avatar jhaddix avatar libraryax avatar nahamsec avatar ziot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsparser's Issues

Error execution handler.py

Hello,

When I execute handler I have this error:

ImportError: /root/.cache/Python-Eggs/pycurl-7.43.0.6-py2.7-linux-x86_64.egg-tmp/pycurl.so: undefined symbol: PyUnicode_DecodeLocale

Any recomendation ?

A greeting and thanks

Solution for all JSParser problems

Hey there,
Dont try to change the source code and follow these steps
Step 1: Use only Python 2.7 to run handler.py python handler.py
It turned out fine after a long struggle for me
Step 2: pip uninstall tornado and install pip install tornado==5.1.1

No module named javascript.options

The installation did not succeed. I have got this error once I issue the installation command (python setup.py install)

File "/tmp/easy_install-DlECku/jsbeautifier-1.7.0/jsbeautifier/__init__.py", line 11, in <module>
ImportError: No module named javascript.options

JS Parser error in handler.py

Shivas-MacBook-Pro:JSParser shivakatravath$ python3 handler.py
Traceback (most recent call last):
File "/Users/shivakatravath/recon/JSParser/handler.py", line 5, in
import safeurl, types, sys, re, mimetypes, glob, jsbeautifier, urlparse, pycurl
File "/Users/shivakatravath/recon/JSParser/safeurl.py", line 17, in
import pycurl
ImportError: pycurl: libcurl link-time ssl backends (secure-transport, openssl) do not include compile-time ssl backend (none/other)

solution to ImportError: No module named setuptools

Running JSParser on Parrot OS pops up this error

python setup.py install
Traceback (most recent call last):
File "setup.py", line 2, in
from setuptools import setup, find_packages
ImportError: No module named setuptools

The solution to the error is run it with python3

Type object '_io.StringIO' has no attribute 'StringIO'

Hi, Any Solution for the below error?

ERROR:tornado.application:Uncaught exception POST /parse/ajax (127.0.0.1)
HTTPServerRequest(protocol='http', host='127.0.0.1:8008', method='POST', uri='/parse/ajax', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/Users/Local/.local/share/virtualenvs/JSParser-yC77UK_z/lib/python3.7/site-packages/tornado/web.py", line 1697, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "handler.py", line 197, in post
    data = self.parseLinks(url, headers)
  File "handler.py", line 183, in parseLinks
    file = self.fetchURL(url, headers)
  File "handler.py", line 178, in fetchURL
    res = sc.execute(url)
  File "/Users/Local/Downloads/JSParser/safeurl.py", line 713, in execute
    response = StringIO.StringIO()
AttributeError: type object '_io.StringIO' has no attribute 'StringIO'
ERROR:tornado.access:500 POST /parse/ajax (127.0.0.1) 118.48ms

Solution for All error in JSParser

Not sure how it happened, but I had "tornado 6.0.1" on my system.

I uninstalled it
pip uninstall tornado
and then installed it again
pip install tornado==5.1.1

And now I have "tornado 5.1.1", JSPARSER is running now well!
use pyhon2 not python3 .

AttributeError: 'module' object has no attribute '_base'

Any help?

$ py -2 handler.py
Traceback (most recent call last):
File "handler.py", line 10, in
from bs4 import BeautifulSoup
File "C:\Python27\lib\site-packages\bs4_init_.py", line 30, in
from .builder import builder_registry, ParserRejectedMarkup
File "C:\Python27\lib\site-packages\bs4\builder_init_.py", line 314, in
from . import _html5lib
File "C:\Python27\lib\site-packages\bs4\builder_html5lib.py", line 70, in
class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: 'module' object has no attribute '_base'

Error in handler.py

Traceback (most recent call last):
  File "C:\Tools\JSParser-master\JSParser-master\handler.py", line 2, in <module>
    import tornado.ioloop, tornado.web, tornado.autoreload
ImportError: No module named tornado.ioloop

No module named 'StringIO'

Traceback (most recent call last):
File "/root/tools/JSParser/handler.py", line 5, in
import safeurl, types, sys, re, mimetypes, glob, jsbeautifier, urlparse, pycurl
File "/root/tools/JSParser/safeurl.py", line 18, in
import StringIO
ModuleNotFoundError: No module named 'StringIO'

Pls help me to solve this issues

Complete Solution for JSparser StrinIO issue and handler.py issue

solution for StringIO issue in safeurl.py

  • open safeurl.py and change
    import StringIO
    to
    import io

Now open handler.py and do following

  • go to line 11 and change
    from cgi import escape
    to
    from html import escape

  • Add this below line 11
    import html

  • Go to line 4 in handler.py and change
    urlparse
    to
    urlib.parse

Problem at the time to Parse JS in by providing URL

Hi There!
I was trying to use JS Parser, everything worked fine until i tried to provide the url to parse

Screen Shot 2020-05-15 at 12 40 42 PM

Then, Checking my terminal I got the following error.

Screen Shot 2020-05-15 at 12 43 05 PM

I tried the same process on my VPS running debian, and my macbook. I'd appreciate if somebody can help me here. My googling skills didn't work this time :(

zipp error in JSparser

$ python2 handler.py

Error:

Traceback (most recent call last):
  File "handler.py", line 5, in <module>
    import safeurl, types, sys, re, mimetypes, glob, jsbeautifier, urlparse, pycurl
  File "/home/hassankhan/tools/JSParser/safeurl.py", line 16, in <module>
    import netaddr
  File "/usr/local/lib/python2.7/dist-packages/netaddr-0.8.0-py2.7.egg/netaddr/__init__.py", line 18, in <module>
    from netaddr.core import (AddrConversionError, AddrFormatError,
  File "/usr/local/lib/python2.7/dist-packages/netaddr-0.8.0-py2.7.egg/netaddr/core.py", line 11, in <module>
    from netaddr.compat import _callable, _iter_dict_keys
  File "/usr/local/lib/python2.7/dist-packages/netaddr-0.8.0-py2.7.egg/netaddr/compat.py", line 93, in <module>
    import importlib_resources as _importlib_resources
  File "/usr/local/lib/python2.7/dist-packages/importlib_resources-3.3.0-py2.7.egg/importlib_resources/__init__.py", line 5, in <module>
    from ._common import (
  File "/usr/local/lib/python2.7/dist-packages/importlib_resources-3.3.0-py2.7.egg/importlib_resources/_common.py", line 9, in <module>
    from ._compat import (
  File "/usr/local/lib/python2.7/dist-packages/importlib_resources-3.3.0-py2.7.egg/importlib_resources/_compat.py", line 48, in <module>
    from zipp import Path as ZipPath  # type: ignore
  File "/usr/local/lib/python2.7/dist-packages/zipp-3.4.0-py2.7.egg/zipp.py", line 240
    def open(self, mode='r', *args, pwd=None, **kwargs):
                                      ^
SyntaxError: invalid syntax

SSL Certificate problem

ERROR:tornado.application:Uncaught exception POST /parse/ajax (::1)
HTTPServerRequest(protocol='http', host='localhost:8008', method='POST', uri='/parse/ajax', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\tornado\web.py", line 1590, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File ".\handler.py", line 199, in post
    data = self.parseLinks(url, headers)
  File ".\handler.py", line 185, in parseLinks
    file = self.fetchURL(url, headers)
  File ".\handler.py", line 180, in fetchURL
    res = sc.execute(url)
  File "D:\tools\src\JSParser\safeurl.py", line 712, in execute
    self._handle.perform()
error: (60, 'SSL certificate problem: unable to get local issuer certificate')
ERROR:tornado.access:500 POST /parse/ajax (::1) 1242.00ms

I run it on Windows, any solution? I tried on https website.

ModuleNotFoundError: No module named 'StringIO'

python3 handler.py

Traceback (most recent call last):
File "handler.py", line 5, in
import safeurl, types, sys, re, mimetypes, glob, jsbeautifier, urlparse, pycurl
File "/root/JSParser/safeurl.py", line 18, in
import StringIO
ModuleNotFoundError: No module named 'StringIO'

was hoping someone has found a fix for this issue

Enhancement: Json + XML parsing

I love the idea of better parsing in files like this. I run into the same problems with unstructured JSON and XML, that Burp doesn't parse out the links that it should, leaving me with incomplete spider coverage ='( There are several libs that can parse JSON and XML. Would be great if I could just export all links with those extensions or content types in Burp and have JSParse do the intelligent link parsing for me in all those.

Syntax Error Py2.7

Hello

I have an issue concerning JSParser
1 - I Cloned the repo
2 - python setup.py install
3 - pip install -r -requirements.txt
4 - python handler.py
The error

Traceback (most recent call last):
  File "handler.py", line 2, in <module>
    import tornado.ioloop, tornado.web, tornado.autoreload
  File "/usr/lib/python2.7/dist-packages/tornado/ioloop.py", line 52, in <module>
    from tornado.concurrent import Future, is_future, chain_future, future_set_exc_info, future_add_done_callback  # noqa: E501
  File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 48, in <module>
    import asyncio
  File "/usr/local/lib/python2.7/dist-packages/asyncio/__init__.py", line 9, in <module>
    from . import selectors
  File "/usr/local/lib/python2.7/dist-packages/asyncio/selectors.py", line 39
    "{!r}".format(fileobj)) from None
                               ^
SyntaxError: invalid syntax

What I Tried

sudo pip install --upgrade {packages} ...

Same issue

I'm using

Kali2-amd64 4.18.0
Python version 2.7.16

Tornado & StringIO error

I have solved two issue by reading the issue list

  1. By adding this code EdOverflow gave earlier
try:
    from StringIO import StringIO
except ImportError:
    from io import StringIO
  1. By changing torando with tornado<=5.1

But still i am facing an error mention below
Please help me to get rid out of this

image

Add pycurl to one of dependencies in README.md

I tried installing the JSParser straight out of the box as per README.md's requirements. Although I am met with problems, I still managed to fix them.

The (main) problem was that in the box that I was using, pycurl had not been included yet. Whether this is a side-effect of Python2.7's deprecation in 2020 is out of my reach, however, simply installing pycurl managed to do the job.

The syntax for this hotfix is

pip install pycurl

In the event that one is met with more errors, a significant help would be to install libgnutls* packages from one's repository. In that case, the fix would be dependent on your default-installation and what you can get from your repo.

Tl;dr
Add pycurl as a dependency in the Readme file.

jsparser installation problem

python handler.py
Traceback (most recent call last):
File "/home/kalki/Desktop/bug_bounty/JSParser/handler.py", line 5, in
import safeurl, types, sys, re, mimetypes, glob, jsbeautifier, urlparse, pycurl
File "/home/kalki/Desktop/bug_bounty/JSParser/safeurl.py", line 18, in
import StringIO
ModuleNotFoundError: No module named 'StringIO'

please help me fix this problem

error

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting safeurl
Using cached safeurl-0.0.7.tar.gz (2.0 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qwsjiy/safeurl/setup.py'"'"'; file='"'"'/tmp/pip-install-qwsjiy/safeurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-39JQmf
cwd: /tmp/pip-install-qwsjiy/safeurl/
Complete output (10 lines):
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'egg_info'
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

SyntaxError: invalid syntax

Hi , here are the steps i tried to install this :
1- cloned the repo
2- python2 setup.py install
3- pip2 install -r requirements.txt
4- pip2 uninstall tornado
5- pip3 uninstall tornado
6- pip2 install tornado=5.1.1
7- pip3 install tornado=5.1.1
8- python2 handler.py

Traceback (most recent call last):
File "handler.py", line 2, in
import tornado.ioloop, tornado.web, tornado.autoreload
File "/usr/local/lib/python2.7/dist-packages/tornado-6.1b1-py2.7-linux-x86_64.egg/tornado/ioloop.py", line 67
def fileno(self) -> int:
^
SyntaxError: invalid syntax

( the arrow is under "->" )

Add the option for detecting urls with parameters

It'll be awesome if an option is added such as "detect with parameters", so different sets of urls are found with their parameters combination. i.e.:

"/resource?a=1"

"/resource?a=1" + "b=" + e.value

So at the end of the analysis, you'll end up with a list of all the paths and all the parameters that can be sent to those resources:

/resource?a=1
/resource?a=1&b=

Traceback (most recent call last):

When I running script I M getting below error.

Traceback (most recent call last):
File "handler.py", line 10, in
from bs4 import BeautifulSoup
File "/usr/local/lib/python2.7/dist-packages/bs4/init.py", line 30, in
from .builder import builder_registry, ParserRejectedMarkup
File "/usr/local/lib/python2.7/dist-packages/bs4/builder/init.py", line 314, in
from . import _html5lib
File "/usr/local/lib/python2.7/dist-packages/bs4/builder/_html5lib.py", line 70, in
class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: 'module' object has no attribute '_base'

Error execution handler

Hello,

When I execute handler I have this error:

ImportError: /root/.cache/Python-Eggs/pycurl-7.43.0.6-py2.7-linux-x86_64.egg-tmp/pycurl.so: undefined symbol: PyUnicode_DecodeLocale

Any recomendation ?

A greeting and thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.