Giter Club home page Giter Club logo

check-cve-2019-19781's Introduction

Welcome to cisagov

GitHub Build Status

Welcome to cisagov, the GitHub home for the Cybersecurity and Infrastructure Security Agency (CISA)!

This repository aims to make it easier to get working with GitHub and Free and Open Source Software (FOSS) for people who work at or with CISA.

For developer-focused documentation and guides, please visit our development-guide repository.

Common questions

Getting started with GitHub

  • How do I make a GitHub account?
  • Why do I add my work email instead of making a separate work-only GitHub account?
    • GitHub's terms of service say to use one account per person. Any commits made will be associated with the user who created them, and GitHub allows for granular, role-based access that can also be revoked when someone departs CISA.
  • How do I use GitHub? Where do I start?

GitHub access

Policies and content guides

  • What belongs in cisagov versus another GitHub organization?
    • Here are some questions to ask when considering posting a project:
      • Does CISA use or develop the software? Is it developed by or for one of the groups or divisions within CISA?
        • If not, we recommend the authors create their own GitHub organization and post their work there
      • What source control system is in place currently?
        • Many source control systems, such as Mercurial and GitLab, can export the entire development history for import into GitHub - this is by far the preferred method
      • Is the project still under active development or is it in maintenance?
        • If the project no longer has a team performing maintenance, we recommend the repository be archived to make that clear to people who may want to use it
  • What belongs on cisa.gov versus on cisagov?
    • The cisa.gov site is primarily focused at an audience outside of CISA, such as Critical Infrastructure partners or the public
    • cisagov is for both internal and external users, as well as partners. It exists specifically to share projects with the public as well as internal users.
  • Working in public (dos and don'ts, best practices)
    • As a best practice, use the cisagov organization issue templates and pull request templates. These templates are available by default in all repositories created in the cisagov organization.
    • As a best practice, we require code reviews before merging pull requests. This is done using branch protection.
  • When should I talk to CISA External Affairs (EA)?
    • Early and often!
  • What is CISA's open source policy?

Feedback and contact

Have an idea about how to make these pages better? File an issue!

For any repository-specific questions or feedback, please make an issue in that repository so the appropriate team will see it.

For more about CISA as an agency or any of its subcomponents, please visit the About CISA page on cisa.gov.

For other GitHub-related questions, feel free to email us.

Developer resources

We have a cisagov development-guide repository, which contains coding standards, steps for setting up a development environment, and other information.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Thanks

We would like to thank the General Services Administration and 18F, the Consumer Financial Protection Bureau, Department of Defense, and Office of Management and Budget for their work in blazing the path for the use of FOSS in the U.S. federal government.

License

This project is in the worldwide public domain.

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

check-cve-2019-19781's People

Contributors

dav3r avatar felddy avatar hillaryj avatar jsf9k avatar mcdonnnj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

check-cve-2019-19781's Issues

Installation Error when using Python 2

๐Ÿ› Bug Report

Error on install using Kali Linux.

To Reproduce

Steps to reproduce the behavior:

Expected behavior

I would expect to be able to run the commands described in the "Usage" section of https://github.com/cisagov/check-cve-2019-19781

Any helpful log output

root@kali:~/check-cve-2019-19781# pip install -r requirements.txt 
Obtaining file:///root/check-cve-2019-19781 (from -r requirements.txt (line 1))
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/root/check-cve-2019-19781/setup.py", line 38, in <module>
        long_description=readme(),
      File "/root/check-cve-2019-19781/setup.py", line 21, in readme
        with open("README.md", encoding="utf-8") as f:
    TypeError: 'encoding' is an invalid keyword argument for this function
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /root/check-cve-2019-19781/
root@kali:~/check-cve-2019-19781#

Docker instructions

Use this to run the latest cve-2019-19781 as a docker container:

Dockerfile:

FROM python:3.8
WORKDIR /srv
RUN git clone https://github.com/cisagov/check-cve-2019-19781.git .; \
    pip install -r requirements.txt
ENTRYPOINT ["cve-2019-19781"]

Run with:

docker build --no-cache -t check-cve-2019-19781 .
docker run --rm -it check-cve-2019-19781 YOUR-DOMAIN.TLD

(Replace YOUR-DOMAIN.TLD with our actual domain)

Error installing

Hello,

I am trying to isntall in ubuntu 18.04 with python 3.6 installed.

when i try the pip install command, i am getting the following error:

cve_2019_19781-1.0.1-py3-none-any.whl is not a supported wheel on this platform.

When i try to install from the source, i get the follwoing error:
Command "python setup.py egg_info" failed with error code 1 in /home/gw/check-cve-2019-19781/

Python code runs easily in Windows. FYI for Windows users.

๐Ÿš€ Feature Proposal

Add information in your documentation that this code runs very easily within MS Windows after downloading and installing Python 3.X. I struggled trying to get the code running in Ubuntu for a long time before realizing that Python is available for Windows. After installing Python your install command ran correctly and the app runs very well.

Motivation

Example

Please provide an example for how this feature would be used.

Pitch

Why does this feature belong in this project?
Hopefully adding this information will make it easier for Windows only IT to run this utility to check their Netscalers.

Unable to execute utility after successful install

Having an issue running the program, I am new to Python so any help would be great.

C:\python>py -m pip install https://github.com/cisagov/check-cve-2019-19781/releases/download/v1.0.0/cve_2019_19781-1.0.0-py3-none-any.whl
Requirement already satisfied: cve-2019-19781==1.0.0 from https://github.com/cisagov/check-cve-2019-19781/releases/download/v1.0.0/cve_2019_19781-1.0.0-py3-none-any.whl in c:\users\lrobcke\appdata\local\programs\python\python38-32\lib\site-packages\cve_2019_19781-1.0.0-py3.8.egg (1.0.0)
Requirement already satisfied: docopt in c:\users\lrobcke\appdata\local\programs\python\python38-32\lib\site-packages\docopt-0.6.2-py3.8.egg (from cve-2019-19781==1.0.0) (0.6.2)
Requirement already satisfied: setuptools in c:\users\lrobcke\appdata\local\programs\python\python38-32\lib\site-packages (from cve-2019-19781==1.0.0) (41.2.0)
Requirement already satisfied: urllib3 in c:\users\lrobcke\appdata\local\programs\python\python38-32\lib\site-packages\urllib3-1.25.7-py3.8.egg (from cve-2019-19781==1.0.0) (1.25.7)
C:\python>py cve-2019-19781
C:\Users\lrobcke\AppData\Local\Programs\Python\Python38-32\python.exe: can't open file 'cve-2019-19781': [Errno 2] No such file or directory
C:\python>python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> cve-2019-19781 --log-level=LEVEL virtuallab.pace.edu
  File "<stdin>", line 1
    cve-2019-19781 --log-level=LEVEL virtuallab.pace.edu
                                     ^
SyntaxError: invalid syntax
>>> cve-2019-19781 [--log-level=LEVEL] virtuallab.pace.edu
  File "<stdin>", line 1
    cve-2019-19781 [--log-level=LEVEL] virtuallab.pace.edu

logic backwards for check???

๐Ÿ› Bug Report

Seems to me the logic in this code is backwards. It returns "vulnerable" when it's not unless I'm really missing something. We have multiple Netscalers and applied the mitigation when it was made publically available, but have been asked to check using this tool.

Tool is installed in a python virtualenv on Arch with Python 3.8. Installs fine.

running curl -k --path-as-is https://10.x.y.z/vpn/../vpns/ returns a HTTP/1.1 403 with the HTML output:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /vpns/
on this server.</p>
</body></html>

To Reproduce

running: ./cve-2019-19781 --log-level=debug 10.x.y.z returns:

2020-01-28 12:34:07,261 DEBUG Disabling insecure request warnings.
2020-01-28 12:34:07,261 DEBUG Disabling URL normalization.
2020-01-28 12:34:07,261 DEBUG Creating connection pool, retries=2, timeout=10s
2020-01-28 12:34:07,261 DEBUG Connecting to https://10.x.y.z/vpn/../vpns/
2020-01-28 12:34:07,262 DEBUG Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=0, status=None)
2020-01-28 12:34:07,262 DEBUG Starting new HTTPS connection (1): 10.x.y.z:443
2020-01-28 12:34:07,274 DEBUG https://10.x.y.z:443 "GET /vpn/../vpns/ HTTP/1.1" 403 207
2020-01-28 12:34:07,274 DEBUG Response status: 403
2020-01-28 12:34:07,274 DEBUG Data:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /vpns/
on this server.</p>
</body></html>

2020-01-28 12:34:07,275 WARNING 10.x.y.z appears to be vulnerable.

Expected behavior

It's my understanding that if you're getting a 403 it's been mitigated. Either change:
return INSECURE_CONTENT in decoded_data
to
return INSECURE_CONTENT not in decoded_data

or change the try if / else output around.

Am I totally wrong about my understanding of the mitigation? TrustedSec's code here: https://github.com/trustedsec/cve-2019-19781/blob/master/cve-2019-19781_scanner.py makes a request to:
https://HOST/vpn/js/../../vpns/cfg/smb.conf
and if that doesn't return the content of that smb.conf, but returns a 403 status code it's not vulnerable.

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 1144: invalid start byte

๐Ÿ› Bug Report

$ cve-2019-19781 citrix.beispiel.de
Traceback (most recent call last):
  File "/home/ehret/.local/bin/cve-2019-19781", line 11, in <module>
    load_entry_point('cve-2019-19781', 'console_scripts', 'cve-2019-19781')()
  File "/tmp/check-cve-2019-19781/src/check_cve/check.py", line 117, in main
    if is_vulnerable(host, retries, timeout):
  File "/tmp/check-cve-2019-19781/src/check_cve/check.py", line 64, in is_vulnerable
    decoded_data = response.data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 1144: invalid start byte

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.