Skip to content

Feature url #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ yarg.command({
demandOption: true,
type: 'string',
},
url:{
alias: 'u',
describe: "Url to start Crawling",
type: "string",
demandOption: false,
type: 'string',
},
output: {
alias: 'o',
describe: 'Output file for the list of URLs',
Expand All @@ -83,6 +90,12 @@ yarg.command({
fs.accessSync(argv.config, fs.constants.F_OK);
console.log(chalk.green(`[INFO] Config file "${argv.config}" exists.`));
const config = JSON.parse(fs.readFileSync(argv.config, 'utf-8'));
if(argv.url){
const urlObj = new URL(argv.url);
const domainRegex = `https?://${urlObj.hostname}(?:/.*|)`;
config.crawler.entryPoint = argv.url;
config.crawler.includeRegexes = [domainRegex];
}
const {error, value} = configModel.validate(config);
if (error) {
console.error(chalk.red(`[ERROR] ${error.message}`));
Expand Down
43 changes: 43 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"browser": {
"headless": false,
"maximize": true,
"proxy": {
"enabled": false,
"host": "127.0.0.1",
"port": 8080
},
"instances": 4
},
"crawler": {
"entryPoint": "https://security-crawl-maze.app/",
"eventTimeout": 10000,
"navigationTimeout": 30000,
"eventWait": 0,
"maxDuration": 0,
"elements": [
"a",
"button",
"input[type=\"submit\"]"
],
"maxChildren": 0,
"maxDepth": 10,
"authentication": {
"basicAuth": {
"enabled": false,
"username": "username",
"password": "password"
},
"recorderAuth": {
"enabled": false,
"pptrRecording": "/path/to/login/recording"
}
},
"includeRegexes": [
"https?://security-crawl-maze.app(?:/.*|)"
],
"excludeRegexes": [
".*logout.*"
]
}
}
41 changes: 23 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,27 @@
"name": "sasori-crawl",
"version": "1.0.0",
"description": "Sasori is a dynamic web crawler powered by Puppeteer, designed for lightning-fast endpoint discovery.",
"main": "bin/index.js",
"keywords": [
"crawler",
"crawling",
"scraping",
"endpoint-discovery",
"puppeteer",
"dynamic",
"automation",
"security",
"dast",
"infosec"
],
"homepage": "https://github.com/karthikuj/sasori#readme",
"bugs": {
"url": "https://github.com/karthikuj/sasori/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/karthikuj/sasori.git"
},
"license": "MIT",
"author": "Karthik UJ",
"contributors": [
{
Expand All @@ -11,30 +31,15 @@
"url": "https://www.5up3r541y4n.tech/"
}
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/karthikuj/sasori.git"
},
"type": "commonjs",
"main": "bin/index.js",
"bin": {
"sasori": "bin/index.js"
},
"scripts": {
"start": "node .",
"lint": "npx eslint . --fix"
},
"keywords": [
"crawler",
"crawling",
"scraping",
"endpoint-discovery",
"puppeteer",
"dynamic",
"automation",
"security",
"dast",
"infosec"
],
"dependencies": {
"@puppeteer/replay": "^2.13.4",
"chalk": "^4",
Expand Down