Not Your Average Web Crawler
N.Y.A.W.C is a Python library that enables you to test your payload against all requests of a certain domain. It crawls all requests (e.g. GET, POST or PUT) in the specified scope and keeps track of the request and response data. During the crawling process the callbacks enable you to insert your payload at specific places and test if they worked.
Table of contents
Installation
First make sure you’re on Python 2.7/3.3 or higher. Then run the command below to install N.Y.A.W.C.
$ pip install --upgrade nyawc
Crawling flow
You can define your startpoint (a request) and the crawling scope and then start the crawler.
The crawler repeatedly starts the first request in the queue until max threads is reached.
The crawler adds all requests found in the response to the end of the queue (except duplicates).
The crawler goes back to step #2 to spawn new requests repeatedly until max threads is reached.
Please note that if the queue is empty and all crawler threads are finished, the crawler will stop.
Documentation
Please refer to the documentation or the API for all the information about N.Y.A.W.C.
Minimal implementation
You can use the callbacks in example_minimal.py to run your own exploit against the requests. If you want an example of automated exploit scanning, please take a look at ACSTIS (it uses N.Y.A.W.C to scan for AngularJS client-side template injection vulnerabilities).
You can also use the kitchen sink (which contains all the functionalities from N.Y.A.W.C.) instead of the example below. The code below is a minimal implementation of N.Y.A.W.C.
$ python example_minimal.py
$ python -u example_minimal.py > output.log
# example_minimal.py
from nyawc.Options import Options
from nyawc.QueueItem import QueueItem
from nyawc.Crawler import Crawler
from nyawc.CrawlerActions import CrawlerActions
from nyawc.http.Request import Request
def cb_crawler_before_start():
print("Crawler started.")
def cb_crawler_after_finish(queue):
print("Crawler finished.")
print("Found " + str(len(queue.get_all(QueueItem.STATUS_FINISHED))) + " requests.")
def cb_request_before_start(queue, queue_item):
print("Starting: {}".format(queue_item.request.url))
return CrawlerActions.DO_CONTINUE_CRAWLING
def cb_request_after_finish(queue, queue_item, new_queue_items):
print("Finished: {}".format(queue_item.request.url))
return CrawlerActions.DO_CONTINUE_CRAWLING
options = Options()
options.callbacks.crawler_before_start = cb_crawler_before_start # Called before the crawler starts crawling. Default is a null route.
options.callbacks.crawler_after_finish = cb_crawler_after_finish # Called after the crawler finished crawling. Default is a null route.
options.callbacks.request_before_start = cb_request_before_start # Called before the crawler starts a new request. Default is a null route.
options.callbacks.request_after_finish = cb_request_after_finish # Called after the crawler finishes a request. Default is a null route.
crawler = Crawler(options)
crawler.start_with(Request("https://finnwea.com/"))
Testing
The testing can and will automatically be done by Travis CI on every push to the master branch. If you want to manually run the unit tests, use the command below.
$ python -m unittest discover
Issues
Issues or new features can be reported via the GitHub issue tracker. Please make sure your issue or feature has not yet been reported by anyone else before submitting a new one.
License
Not Your Average Web Crawler (N.Y.A.W.C) is open-sourced software licensed under the MIT license.
Metadata
Release files for nyawc 1.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nyawc-1.8.2.tar.gz | 28.3 kB | Without provenance | Details for nyawc-1.8.2.tar.gz |
Release files / nyawc-1.8.2.tar.gz
| Download URL | nyawc-1.8.2.tar.gz |
|---|---|
| Size | 28.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f40accb78bd2108312753e82e11beb356413dda9d7dd00ebb79f645418583e13
|
|
BLAKE2b-256 checksum How to use checksums |
301dc3450607bb047b2566f280628904ce456d57f45e2e1733f028755a9d4a18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.2
|
Security for nyawc 1.8.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.