Skip to content

Commit

Permalink
Merge branch 'dev' into github
Browse files Browse the repository at this point in the history
  • Loading branch information
ignis-sec committed Jun 28, 2020
2 parents 2086b08 + 5397f0d commit 46c7aa5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you dont have chromium:
npm install -g puff-fuzz
```

**If you have chromium: (Don't forget to set its path in config.json)**
**If you have chromium: (Don't forget to set path via puff -c "path/to/chromium/"

windows:
```
Expand Down Expand Up @@ -57,6 +57,7 @@ Options:
-s, --status Show requests with unusual response codes
-oA, --outputAll Output all the responses
-k, --ignoreSSL Ignore ssl errors
-c, --chromePath <path> Set chromium path permenantly
-h, --help display help for command
```

Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"chromium_path":"D:\\Repositories\\puff\\node_modules\\puppeteer\\.local-chromium\\win64-737027\\chrome-win\\chrome.exe"
"chromium_path":"node_modules/puppeteer/.local-chromium/*/*/chrome.exe"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puff-fuzz",
"version": "0.0.1",
"version": "0.0.2",
"description": "",
"main": "puff.js",
"scripts": {
Expand Down
27 changes: 24 additions & 3 deletions puff.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const puppeteer = require('puppeteer');
const { program } = require('commander');
const fs = require('fs')
const path = require('path')
var config = require('./config.json')

var glob = require('glob')

//pretty colors
var fail="[\033[91m+\033[0m]"
Expand All @@ -28,6 +27,7 @@ program
.option('-s, --status', 'Show requests with unusual response codes')
.option('-oA, --outputAll', 'Output all the responses')
.option('-k, --ignoreSSL', 'Ignore ssl errors')
.option('-c, --chromePath <path>', 'Set chromium path permenantly')
program.parse(process.argv);

var pendingOutput=[]
Expand Down Expand Up @@ -133,6 +133,19 @@ var bLastOutputImportant=true
var remoteAddr = false
var remotePort = false

if(program.chromePath){
var conf_temp = require('./config.json')
console.log("Chrome path changing from '" + conf_temp.chromium_path + "' to '" + program.chromePath + "'")
conf_temp.chromium_path = program.chromePath
fs.writeFileSync('./config.json', JSON.stringify(conf_temp), 'utf8');
}






var config = require('./config.json')

//create new thread, in this context, create new chromium tab
var threadIDCounter = 0
Expand Down Expand Up @@ -309,6 +322,14 @@ function catchNormal(thread){
}


//resolve chromium path
var chromium_path = glob.sync(config.chromium_path, {});
if(chromium_path.length) chromium_path=chromium_path[0]
else{
console.log("Could not resolve the directory in the config.json file.")
process.exit(1)
}

//init tool
(async () => {
//if its demo mode, clear commandline, and remove the actual command (so it hides the url in cli)
Expand All @@ -319,7 +340,7 @@ function catchNormal(thread){
process.stdout.cursorTo(0,0)
}

browser = await puppeteer.launch({executablePath:config.chromium_path,args: ['--no-sandbox', '--disable-setuid-sandbox'], ignoreHTTPSErrors: sslIgnore});
browser = await puppeteer.launch({executablePath:chromium_path,args: ['--no-sandbox', '--disable-setuid-sandbox'], ignoreHTTPSErrors: sslIgnore});

//preload our junk to browser
preloadFile = await fs.readFileSync(__dirname + '/preload.js', 'utf8');
Expand Down

0 comments on commit 46c7aa5

Please sign in to comment.