-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated many scripts and organised few
- Loading branch information
Showing
103 changed files
with
72,185 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import socket | ||
import os | ||
import requests | ||
import nmap3 # pip install python3-nmap | ||
|
||
""" | ||
First Python Program | ||
Just to see if we can run python3 successfully | ||
and modules are installed or not ;) | ||
""" | ||
|
||
name = "Sanjeev" | ||
print("Hello "+name+"\n") | ||
print("O.S. is: " + os.name) | ||
|
||
hostname = socket.gethostname() | ||
local_ip = socket.gethostbyname(hostname) | ||
public_ip = requests.get('https://checkip.amazonaws.com').text.strip() | ||
print("Your Computer Name is:" + hostname) | ||
print("Your Computer Local IP Address is:" + local_ip) | ||
print("Your Computer Public IP Address is:" + public_ip) | ||
print("\nChecking if nmap works:\nStarting nmap scan now...\n") | ||
|
||
# make nmap object | ||
nmap = nmap3.Nmap() | ||
|
||
#nmap version | ||
nmap_version = nmap.nmap_version() | ||
print (f"Nmap version: {nmap_version}") | ||
|
||
# scanning practical-devsecops.com | ||
url = 'aliencoders.org' | ||
"""" | ||
print("Starting nmap scan for url: " + url) | ||
results = nmap.nmap_version_detection(url) | ||
print(f"Here is the result for {url}: {results}") | ||
""" | ||
top_ports = nmap.scan_top_ports(url, args="-sV") | ||
print(f"These are the top ports: {top_ports}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from cryptography.fernet import Fernet | ||
|
||
key = Fernet.generate_key() | ||
cipher_suite = Fernet(key) | ||
message = "This is a secret message for a secret group. Not for crackers, but may be for Cryptanalyst!.".encode() | ||
|
||
cipher_text = cipher_suite.encrypt(message) | ||
print('Cipher Text is: ' + str(cipher_text)) | ||
|
||
plain_text = cipher_suite.decrypt(cipher_text) | ||
print('Here is the plain text:' + str(plain_text)) | ||
|
||
print('\nChecking if decrypted text is same as our message or not') | ||
|
||
if plain_text == message: print("Yes both are same\n") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import string | ||
import secrets | ||
|
||
def get_alphabet(): | ||
letters = string.ascii_letters | ||
digits = string.digits | ||
special_chars = string.punctuation | ||
|
||
# Alphabet is the combination of letters, digits and special characters | ||
alphabet = letters + digits + special_chars | ||
return alphabet | ||
|
||
# Password constraints | ||
# define password length, must be more than 8 chars | ||
# at least 1 upper case, 1 lower case, 1 digit and 1 special character | ||
password_len = int(input("Give password length(8 or more): ")) | ||
if password_len <8: | ||
exit("Length must be at least 8 characters") | ||
password = '' | ||
|
||
for i in range(password_len): | ||
password += ''.join(secrets.choice(get_alphabet())) | ||
|
||
print(f"Password is: {password}") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.