From 58cfb1c6884e96e21d4cfe51efaf688ae0bfd7fe Mon Sep 17 00:00:00 2001 From: Andres Hermosilla Date: Wed, 6 Sep 2017 16:40:11 -0700 Subject: [PATCH] Added security guides on openvas, php, recon & zap --- security-openvas.md | 52 +++++++++++++++++++++++++++++++++++++++++++++ security-php.md | 41 +++++++++++++++++++++++++++++++++++ security-recon.md | 8 +++++++ security-zap.md | 11 ++++++++++ 4 files changed, 112 insertions(+) create mode 100644 security-openvas.md create mode 100644 security-php.md create mode 100644 security-recon.md create mode 100644 security-zap.md diff --git a/security-openvas.md b/security-openvas.md new file mode 100644 index 0000000..a6028c6 --- /dev/null +++ b/security-openvas.md @@ -0,0 +1,52 @@ +# Security - OpenVAS + +### CLI +```shell +# XML handling utils to make life easier +apt-get install -y libxml2-utils + +# List all targets +omp -u admin -w admin --xml='' + +# Create a target +omp --xml='Docker - Local192.168.99.101' + +# Confirm target was added +omp --xml='' + +# Get tasks running +omp --xml='' + +# Get config listings of types of scans +omp --pretty-print --xml='' + +# Create a task +omp --xml='ScanWebserver' + +# Start the task +omp --pretty-print -xml='' + +# Get detailed info on the task +omp --pretty-print --xml='' + +# Get report formats +omp --xml='' | grep -i -A4 '[a-z]+)' + +# Output the report +omp --pretty-print --xml='' > report.xml +xmllint --xpath 'string(/get_reports_response/report)' report.xml | head -n -16 | base64 --decode > report.csv +``` + +## Links +- https://github.com/mikesplain/openvas-docker +- https://www.linuxquestions.org/questions/linux-networking-3/openvas-create-new-tasks-from-omp-4175511045/ +- https://elastic-security.com/2013/07/18/automation-of-vulnerability-assessments-with-openvas/ +- https://pypi.python.org/pypi/openvas.omplib +- https://github.com/hay/xml2json/new/master +- https://isc.sans.edu/forums/diary/Automating+Vulnerability+Scans/20685/ +- http://blog.identityautomation.com/managing-infrastructure-with-rapididentity-part-5-performing-openvas-vulnerability-scans +- https://www.digitalocean.com/community/tutorials/how-to-use-openvas-to-audit-the-security-of-remote-systems-on-ubuntu-12-04 +- https://www.nopsec.com/blog/docker-based-openvas-scanning-cluster-improve-scope-scalability/ +- https://www.linode.com/docs/security/install-openvas-on-ubuntu-16-04 +- https://joedsweb.wordpress.com/2017/02/11/openvas-nagiosplugin/ +- https://www.coveros.com/automating-security-with-devops-it-can-work/ \ No newline at end of file diff --git a/security-php.md b/security-php.md new file mode 100644 index 0000000..e26bd57 --- /dev/null +++ b/security-php.md @@ -0,0 +1,41 @@ +### Security - PHP + +## Timing Attacks +- https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy +- http://blog.ircmaxell.com/2014/11/its-all-about-time.html +- https://github.com/pentestmonkey/timing-attack-checker + +## Inclusion +- http://php.net/manual/en/function.include.php +- Don't forget about the null byte! `%00` +- https://websec.wordpress.com/2010/02/22/exploiting-php-file-inclusion-overview/ +- https://upshell.wordpress.com/2011/06/11/new-vulnerabilities-to-access-files-in-php/ + +Sometimes PHP is so terribly configured you can inject your code into the inclusion. +Here is an example of how you can pass a `sleep(10);` into a possible `include` which +would cause the page load to be delayed by ~10s if the page did indeed and a vulernable +input & include combo. + +`index.php?file=data://text/plain;base64,PD9waHAgc2xlZXAoMzApOw==%00` + +#### Recon +If you can inject your code into PHP includes, below is an example of a file system walker to list all files in the current directory. + +```php +