<jupyter_start><jupyter_text>Introduction : Source code<jupyter_code># Date of creation : 17 july 2021
# Version : 1.0
# Description : This notebook helps in discovering vulns in github 
# Tools used here are:
1- github-search
2- trufflehog
3- gitgot
4- gitminer<jupyter_output><empty_output><jupyter_text>Github token<jupyter_code>github_token=""<jupyter_output><empty_output><jupyter_text>Importing packages<jupyter_code># Importing packages
import os<jupyter_output><empty_output><jupyter_text>Getting the location of working directory<jupyter_code># Getting the location of current directory

def getting_location_current_directory():
    cwd=os.getcwd()
    print("Location of current directory is :", cwd)
getting_location_current_directory()<jupyter_output>Location of current directory is : /root/Desktop/offensivenotebook/Sourcecode_assets<jupyter_text>Making directory name results to save the results<jupyter_code># Making directory name results

def directory_results():
    try:
        os.mkdir("Results")
    except Exception as e:
        print(e)
directory_results()<jupyter_output>[Errno 17] File exists: 'Results'<jupyter_text>CLONE OF REPO BASED ON ORGANIZATION NAME<jupyter_code># Cloning of repos based on org name

org=input("Enter the organization name :")

def cloning_repos():
    try:
        pass
    except Exception as e:
        print(e)
        
cloning_repos()<jupyter_output><empty_output><jupyter_text>FIND GITHUB ACCOUNT OF EMPLOYEE BASED ON COMPANY NAME<jupyter_code># Finding github account based on company name
company=input("Enter the company name :")

def find_repos():
    try:
        pass
    except Exception as e:
        print(e)
        
find_repos()<jupyter_output><empty_output><jupyter_text>LOOK FOR CONTRIBUTORS BASED ON ORGANIZATION NAME<jupyter_code># Looking for contributors

org=input("Enter the organization name :")

def seeking_contributors():
    try:
        pass
    except Exception as e:
        print(e)
seeking_contributors()<jupyter_output><empty_output><jupyter_text>GITHUB USER BASED ON USERNAME/KEYWORD<jupyter_code># Looking for users

user=input("Enter the username")

def seeking_user():
    try:
        pass
    except Exception as e:
        print(e)
seeking_user()<jupyter_output><empty_output><jupyter_text>PERFORM CODE SEARCH SUCH AS PASSWORD, CONFIG & ETC  BASED ON ORGANIZATION NAME OR REPO<jupyter_code># Searching for sensitive stuff

def sensitive_stuff():
    try:
        pass
    except Exception as e:
        print(e)
sensitive_stuff()<jupyter_output><empty_output><jupyter_text>GITHUB HISTORY<jupyter_code># Github history for sensitive information

def seeking_history():
    try:
        pass
    except Exception as e:
        print(e)
seeking_history()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08351331893448524, 'fraction_numerical': 0.005039596832253419, 'mean_word_length': 4.989224137931035, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '382618', 'license': 'MIT', 'n_tokens_mistral': 944, 'n_tokens_neox': 889, 'n_words': 231, 'path': 'Sourcecode_assets/Github_attack_vector.ipynb', 'repo_name': 'Operation-Falcon/AttackSurfaceManagement', 'size': '2778'}