Skip to content

Commit

Permalink
Clearer argument handling, pep8, import order, less unused vars (#123)
Browse files Browse the repository at this point in the history
* Proposal for less redundant argument handling, autopep8, sorted imports, etc.
* dest labels in sync with local target vars and safe names
* only one special handling before transfer of values to local vars (headers prompt)
* some initial comments - there was a quest for help on documentation ;-)
* few oneliners from if else variable setters
* left the simple script style as is (might be a preference for author and users)
* Adapted code for static checks and removed unused mports sys and requests, many unused  variables remain
  • Loading branch information
sthagen authored and s0md3v committed Nov 15, 2018
1 parent 02938d3 commit 15bc638
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 126 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ before_script:
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
- python xsstrike.py -u "https://public-firing-range.appspot.com/reflected/index.html" --crawl
- echo "No" > input.txt && python xsstrike.py -u https://public-firing-range.appspot.com/reflected/parameter/body?q=query < input.txt
5 changes: 2 additions & 3 deletions core/checker.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import re
import copy
from fuzzywuzzy import fuzz
from core.encoders import base64
from core.config import xsschecker
from core.requester import requester
from core.utils import replacer, fillHoles
from urllib.parse import quote_plus, unquote
from urllib.parse import unquote

def checker(url, params, headers, GET, delay, payload, positions, timeout, encoding):
checkString = 'st4r7s' + payload + '3nd'
Expand Down Expand Up @@ -40,4 +39,4 @@ def checker(url, params, headers, GET, delay, payload, positions, timeout, encod
else:
efficiencies.append(0)
num += 1
return list(filter(None, efficiencies))
return list(filter(None, efficiencies))
5 changes: 1 addition & 4 deletions core/filterChecker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from core.utils import replacer
from core.checker import checker
from core.config import xsschecker
from core.requester import requester

def filterChecker(url, params, headers, GET, delay, occurences, timeout, encoding):
positions = {}
Expand Down Expand Up @@ -37,4 +34,4 @@ def filterChecker(url, params, headers, GET, delay, occurences, timeout, encodin
sortedEfficiencies[i][environment] = efficiency
for efficiency, occurence in zip(sortedEfficiencies.values(), occurences.values()):
occurence['score'] = efficiency
return occurences
return occurences
5 changes: 2 additions & 3 deletions core/fuzzer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import copy
import requests
from time import sleep
from random import randint
from core.utils import replacer
from core.requester import requester
from core.config import fuzzes, xsschecker
from urllib.parse import quote_plus, unquote
from core.colors import end, red, white, green, yellow, run, bad, good, info, que
from urllib.parse import unquote
from core.colors import end, red, green, yellow, bad, good, info

def counter(string):
special = '\'"=/:*&)(}{][><'
Expand Down
1 change: 0 additions & 1 deletion core/htmlParser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import re
from core.config import badTags
from core.encoders import base64
from core.config import xsschecker

def htmlParser(response, encoding):
Expand Down
Loading

0 comments on commit 15bc638

Please sign in to comment.