Skip to content
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

403 Forbidden #135

Open
raptor235 opened this issue Dec 10, 2015 · 3 comments
Open

403 Forbidden #135

raptor235 opened this issue Dec 10, 2015 · 3 comments

Comments

@raptor235
Copy link

Hi guys, I'm seeing the following error.. any idea why the script might be failing?

Traceback (most recent call last):
  File "/usr/local/bin/bees", line 5, in <module>
    main.main()
  File "/Library/Python/2.7/site-packages/beeswithmachineguns/main.py", line 127, in main
    parse_options()
  File "/Library/Python/2.7/site-packages/beeswithmachineguns/main.py", line 119, in parse_options
    bees.attack(options.url, options.number, options.concurrent)
  File "/Library/Python/2.7/site-packages/beeswithmachineguns/bees.py", line 319, in attack
    urllib2.urlopen(url)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
@chanduusc
Copy link

Seeing same issue while trying to run against amazon ELB

@treyguinn
Copy link

I'm seeing the same issue. Fresh Centos 7.4 install. Followed the following steps:

  1. yum update
  2. yum install python
  3. yum install epel-release
  4. yum install python-pip
  5. pip install --upgrade pip
  6. pip install boto
  7. pip install paramiko
  8. pip install future
  9. yum install gcc
  10. yum install python-devel
  11. pip install beeswithmachineguns
  12. create my .boto
  13. create my local private SSH key (bees_east.pem)
  14. bees up -k bees_east -g bees -s 5

Strangly, bees attack -u http://www.domain.com/ creates the 403 error above, but bees attack -u http://subdomain.domain.com/ fails with a different error:

bees attack -u http://subdomain.domain.com/ Read 5 bees from the roster. Connecting to the hive. Assembling bees. Each of 5 bees will fire 200 rounds, 20 at a time. Stinging URL so it will be cached for the attack. Organizing the swarm. Bee 0 is joining the swarm. Bee 1 is joining the swarm. Bee 2 is joining the swarm. Bee 3 is joining the swarm. Bee 4 is joining the swarm. No handlers could be found for logger "paramiko.transport" Traceback (most recent call last): File "/usr/bin/bees", line 5, in <module> main.main() File "/usr/lib/python2.7/site-packages/beeswithmachineguns/main.py", line 127, in main parse_options() File "/usr/lib/python2.7/site-packages/beeswithmachineguns/main.py", line 119, in parse_options bees.attack(options.url, options.number, options.concurrent) File "/usr/lib/python2.7/site-packages/beeswithmachineguns/bees.py", line 325, in attack results = pool.map(_attack, params) File "/usr/lib64/python2.7/multiprocessing/pool.py", line 250, in map return self.map_async(func, iterable, chunksize).get() File "/usr/lib64/python2.7/multiprocessing/pool.py", line 554, in get raise self._value AssertionError: PID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()

@daytonpa
Copy link

I managed to get --hurl to work after adding in an additional header flag. My full command:

  sudo sh -c "./bees attack \
    --hurl \
    --long_output \
    --url='${url}' \
    --number=${attacks} \
    --concurrent=${connections} \
    --seconds=${seconds} \
    --cookies=${cookie} \
    --headers='User-Agent:Chrome/71.0.3578.98;' \
    --sting=0 \
    >> /var/log/bees/bees-test.log
  "

After reading SIGINT's comment, I just added in --headers='User-Agent:<browser/version> to the ./bees attack --hurl command and it ran just fine. Hopefully this helps.

Another thing to note is how the bees.py file parses the --headers or -H flag. As stated in the README, it parses the headers as header1:content1;header2:content2;, and so on. You can see your header by going here, but you'll see your full User Agent header may contain a few ; characters, which will cause problems. Simply shorten your User Agent header to a single browser/version, and it should run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants