Skip to content

Commit

Permalink
Minor: README and screenshot updated & TLS/SSL checks improved
Browse files Browse the repository at this point in the history
  • Loading branch information
rfc-st committed Nov 18, 2023
1 parent f6df0e1 commit fe0ff31
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ HTTP Headers Analyzer<br />
<img src="https://github.com/rfc-st/humble/blob/master/screenshots/humble.PNG" alt="Full analysis" width=70% height=70%>
</p>
<br />
.: (Linux) - TLS/SSL checks (requires https://testssl.sh/ and Unix machine (for now!).<br />
.: (Linux) - TLS/SSL checks (requires https://testssl.sh/ and Unix machine, for now!).<br />
```
$ Options used: -f -g -p -U -s --hints
```
<p></p>
<p align="center">
<img src="https://github.com/rfc-st/humble/blob/master/screenshots/humble_encryption_s.PNG" alt="TLS/SSL analysis" width=70% height=70%>
Expand Down
30 changes: 11 additions & 19 deletions humble.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,41 +293,33 @@ def testssl_params(directory, uri):
if not path.isfile(testssl_file):
sys.exit(f"\n{get_detail('[notestssl_path]')}")
else:
testssl_analysis(testssl_file, uri)
# Check './testssl.sh --help' to choose your preferred options
command = f'{testssl_file} -f -g -p -U -s --hints "{uri}"'
testssl_analysis(command)


def testssl_analysis(testssl_file, uri):
# Check './testssl.sh --help' to choose your preferred options:
# -p: checks TLS/SSL protocols (including SPDY/HTTP2)
# -U: tests all vulnerabilities (if applicable)
# -s: tests standard cipher categories by strength
# --hints: additional hints to findings
command = f'{testssl_file} -p -U -s --hints "{uri}"'
def testssl_analysis(command):
try:
process = subprocess.Popen(command, shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE, text=True)
while True:
line = process.stdout.readline()
if not line:
ln = process.stdout.readline()
if not ln:
break
print(line, end='')

if 'Done' in line:
print(ln, end='')
if 'Done' in ln:
process.terminate()
process.wait()
sys.exit()

stdout, stderr = process.communicate()

if stdout:
print(stdout)
if stderr:
print(stderr)
print(stdout or '')
print(stderr or '')
except subprocess.CalledProcessError as e:
print(e.stderr)
except Exception as e:
print(f"Error running testssl analysis!: {e}")
print(f"Error running testssl.sh analysis!: {e}")


def get_details_lines():
Expand Down
Binary file modified screenshots/humble_encryption_s.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fe0ff31

Please sign in to comment.