-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
High memory usage #9626
Comments
Some comments while testing:
And the memory usage still increases.
|
Around 10 to 15 minutes depending on the site.
The memory usage has a linear increase until it reaches the maximum amount of memory.
Yes, the original configuration had grep all, infrastructure all, audit all and crawl with "find_dvcs, ghdb, google_spider, phpinfo, sitemap_xml, url_fuzzer, pykto" |
Thanks for your comments, it's aligned with what I'm seeing. |
TODO
|
Complete scan with different lxml versions (as sent by Juan)
|
At minute 5 we have ~ half the memory usage, which is very significant. I'm changing the version in |
The libxml upgrade, as seen above, considerably reduces the rate at which the memory usage increases. This indicates that there was a memory leak in lxml (since I didn't change any w3af code). The fix applied is in the But I'm still worried, since the memory usage keeps increasing over time (at a slower pace now, but it does increase). |
15 minutes of running with the latest lxml gives us 564mb memory usage. |
I got lucky by changing the lxml library to the latest version. I want to see if I can do the same again with:
If they don't work, replace them with their slower pure-python implementations (just for testing) |
Updates pybloomfiltermmap to 0.3.14 and run full scan as specified by Juan:
In the 15 minute mark there is 50% memory usage! Before:
Now with the latest pybloomfiltermmap: 216 MB ! Going to test again to verify. |
Once again with the new pybloomfiltermmap: 223 MB. Scan again with the old pybloomfiltermmap, also for 15 minutes, and I get: 228 MB. So, it seems that my previous excitement where I was comparing with 564mb was overrated, but also my previous belief that we still had a big problem with memory leaks. Will leave the scan running to see what happens. 25 min with old pybloomfiltermmap: 257 MB |
@89berner please run some tests with the latest develop (fixed the issues it had yesterday) and let me know if your scans still reach 2gb memory usage |
New pybloomfiltermmap has some false positives? |
Just tested the develop branch and had the same issue after 20 minutes. Is there any additional information that I can provide after testing? Before the system becomes unusable the memory is at 99% usage and cpu goes down from 100% to 2% Thanks! |
Strange! Did you install the latest lxml and bloom filter mmap libs? Completely sure you're running a7cfc19 ? |
I'm cloning develop (git clone -b develop https://github.com/andresriancho/w3af.git ) My Dockerfile is: FROM ubuntu:12.04
MAINTAINER Juan Berner <[email protected]>
# Initial setup
# Squash errors about "Falling back to ..." during package installation
ENV TERM linux
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Update before installing any package
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get dist-upgrade -y
# Install basic and GUI requirements, python-lxml because it doesn't compile correctly from pip
RUN apt-get install -y python-pip build-essential libxslt1-dev libxml2-dev libsqlite3-dev libyaml-dev openssh-server python-dev git python-lxml wget libssl-dev xdot ubuntu-artwork dmz-cursor-theme ca-certificates
RUN pip install --upgrade pip
RUN apt-get install -y libffi-dev curl
RUN pip install clamd==1.0.1 PyGithub==1.21.0 GitPython==0.3.2.RC1 pybloomfiltermmap==0.3.14 \
esmre==0.3.1 phply==0.9.1 stopit==1.1.0 nltk==2.0.5 chardet==2.1.1 pdfminer==20140328 \
futures==2.1.5 pyOpenSSL==0.13.1 scapy-real==2.2.0-dev guess-language==0.2 cluster==1.1.1b3 \
msgpack-python==0.4.4 python-ntlm==1.0.1 halberd==0.2.4 darts.util.lru==0.5 \
tblib==0.2.0 ndg-httpsclient==0.3.3 pyasn1==0.1.7 lxml==3.4.4
RUN pip install nltk==3.0.1 pyasn1==0.1.3 Jinja2==2.7.3 vulndb==0.0.17 markdown==2.6.1
EXPOSE 22
RUN cd /opt/ && git clone -b develop https://github.com/andresriancho/w3af.git && cd /opt/w3af/
#RUN echo "Y" | /opt/w3af/w3af_console
ADD ./start.sh /opt/start.sh
RUN chmod 777 /opt/start.sh && mkdir -p /var/run/sshd && chmod 0755 /var/run/sshd
CMD ["/usr/sbin/sshd", "-D"] |
Well, I'll have to investigate further then. I'm running my tests from my home workstation, which does have a slow connection (compared to an EC2 server). What might happen is that by running this on EC2 you get more HTTP request/responses in the same timeframe and thus you're able to reproduce the issue much faster ( |
Sadly I won't be able to help much during this week since I started a new engagement, so you'll have to wait (or fix it yourself 👍 ) |
Related work being done at https://github.com/andresriancho/collector/tree/master/examples/w3af , this will allow me to quickly test w3af's performance |
Experiment with slots (even if it's just for fun) for URL objects |
Solved in |
User story
As a user I'm scanning a site and after some time w3af uses so much memory that the whole system becomes unusable
Affected version
Master @ 1.6.51
de56135
https://github.com/andresriancho/w3af/releases/tag/1.6.51
How to reproduce
/opt/w3af/w3af_console -s /tmp/script.w3af
Docker container to reproduce the issue
Docker container at https://registry.hub.docker.com/u/89berner/w3af/ , reproduce the issue using:
Dockerfile used to create
89berner/w3af:v1
Reporter
@89berner reported this issue via email
Related issues
The text was updated successfully, but these errors were encountered: