├── .DS_Store ├── .gitignore ├── AutoPen.py ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── dependencies.py ├── general_use.py ├── images ├── AutoPen.png ├── AutoPenBlack.png ├── M4_SO_Small.gif ├── background_front.jpg ├── background_off_side.jpg ├── background_side.jpg └── file.gif ├── info ├── TandC.txt ├── about.txt └── howto.txt ├── install.py ├── install_basics.py ├── main.py ├── old ├── AutoPen.kv ├── dummy.txt ├── main.py └── testkivy │ ├── .idea │ ├── misc.xml │ ├── modules.xml │ ├── testkivy.iml │ └── workspace.xml │ ├── AutoPen.png │ ├── background.jpg │ ├── background.png │ ├── cheesepoofs │ ├── .DS_Store │ └── kerplunk │ │ ├── __pycache__ │ │ └── script.cpython-34.pyc │ │ └── script.py │ ├── main.py │ └── tips.txt ├── open_.py ├── replay.grc ├── store_data.grc ├── test.py ├── text ├── aircrack_ng.txt ├── aircrack_ng_example.txt ├── bluelog.txt ├── bluelog_example.txt ├── bluemaho.txt ├── bluemaho_example.txt ├── bluez.txt ├── bluez_example.txt ├── btscanner.txt ├── btscanner_example.txt ├── c0f.txt ├── c0f_example.txt ├── canbadger.txt ├── canbadger_example.txt ├── canbus_utils.txt ├── canbus_utils_example.txt ├── canutils.txt ├── canutils_example.txt ├── canutilsx.txt ├── canutilsx_example.txt ├── caringcaribou.txt ├── caringcaribou_example.txt ├── gnuradio.txt ├── gnuradio_example.txt ├── gqrx.txt ├── gqrx_example.txt ├── installed.txt ├── j1939.txt ├── j1939_example.txt ├── katoolin.txt ├── katoolin_example.txt ├── kayak.txt ├── kayak_example.txt ├── o2oo.txt ├── o2oo_example.txt ├── pyobd.txt ├── pyobd_example.txt ├── tio.txt ├── tio_example.txt ├── tshark.txt ├── tshark_example.txt ├── udsim.txt ├── udsim_example.txt ├── wireshark.txt └── wireshark_example.txt ├── tools.py ├── uninstall.py ├── update.py ├── vcan └── vm_install.py /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | *.pyc 3 | log.txt 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at m.raashid.ansari@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 autopen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # autopen 2 | 3 | Autopen is an open-source toolkit designed to assist security analysts, manufacturers, and various professionals to detect 4 | potential vulnerabilities in vehicles using the tools that will be provided. The product is meant to simplify installation, 5 | help the user in getting to know what tools are at their disposal, and teach them how to use them. 6 | 7 | ## Installation 8 | 9 | Autopen has only been tested on Ubuntu and Kali Linux. Other linux distributions may work but cannot be guaranteed. Because most of the scripts are written in python 3, these instructions assume you have python 3 installed. To install Python 3 on Linux, run the following command in terminal: 10 | 11 | `sudo apt-get install python3` 12 | 13 | `sudo apt-get install python3-pip` 14 | 15 | ### VM Install 16 | 17 | Running the software on a VM is different then running it on a dedicated install. VM's generally are missing more dependencies so require more installations. Kivy in specific needs to be run in a Python environment in the VM. Because there are a number of steps needed to do this, we have created a script that will install the dependencies, set-up and enter the Python environment needed to run Kivy. To install, clone/download the repository. In the autopen directory, run the following script: 18 | 19 | `python3 vm_install.py` 20 | 21 | When prompted to keep dash as the default shell, select No. 22 | 23 | ### Installing on bootable Linux 24 | 25 | To run Autopen, having Python 3 and pip3 installed, the repository needs to be added and the following dependencies must be installed. 26 | 27 | `sudo add-apt-repository ppa:kivy-team/kivy` 28 | 29 | `pip3 install python3-kivy` 30 | 31 | `pip3 install cython==0.23` 32 | 33 | ## Running the Program 34 | 35 | Once installed, you can run AutoPen using the following command. 36 | 37 | `python3 AutoPen.py | tee log.txt` 38 | 39 | The second part of the command (`tee log.txt`) will create a log.txt file. (To append to an existing log.txt file, change this command to be (`tee -a log.txt`) In this file, all of the output from the program will be stored making it much easier to trace back an error. Please refer to this file if the program crashes or something does not install properly. 40 | 41 | 42 | 43 | ## Quick Notes 44 | 45 | In order to automate things, autopen uses the [subprocess](https://docs.python.org/3/library/subprocess.html#subprocess.check_output) module. 46 | -------------------------------------------------------------------------------- /dependencies.py: -------------------------------------------------------------------------------- 1 | ''' 2 | This script checks and/or installs necessary dependencies to run tools 3 | ''' 4 | 5 | 6 | import general_use 7 | import subprocess 8 | import os 9 | 10 | repo_bluez = 'https://github.com/khvzak/bluez-tools.git' 11 | link_lightblue = 'http://prdownloads.sourceforge.net/lightblue/lightblue-0.4.tar.gz?download' 12 | 13 | def commandline_install(pack_man, i): 14 | general_use.update(pack_man) 15 | return subprocess.run(['sudo', pack_man, '-y', 'install', i]).returncode 16 | 17 | def download_install(link): 18 | return subprocess.run(['curl', '-O', link]).returncode 19 | 20 | def clone_git_repo(repo): 21 | return subprocess.run(["git", "clone", repo]).returncode 22 | 23 | def install_pyserial(link): 24 | ''' 25 | This function installs pyserial. This library is needed to run pyobd, specifically 2.0 because this is the version needed. 26 | ''' 27 | 28 | d_rc = download_install(link) #FYI MIGHT BE ABLE TO RUN PIP INSTALL PYSERIAL. But this will installs the latest version 29 | if d_rc != 0: 30 | print ('DOWNLOAD FAILED: Failed to download pyserial') 31 | print ('ERROR CODE:', d_rc) 32 | return d_rc 33 | else: 34 | print ('DOWNLOAD SUCCESSFUL: Successfully downloaded pyserial') 35 | print ('Building PySerial 2.0 package...') 36 | current_dir = os.getcwd() 37 | path = current_dir + '/pyserial-2.0' 38 | os.chdir(path) 39 | build_rc = subprocess.run(['python', 'setup.py', 'build']).returncode 40 | if build_rc != 0: 41 | print ('BUILD FAILED: Failed to build pyserial.') 42 | print ('ERROR CODE:', build_rc) 43 | return build_rc 44 | else: 45 | print ('BUILD SUCCESSFUL: Successfully completed pyserial build') 46 | print ('Installing pyserial...') 47 | i_rc = subprocess.run(['sudo', 'python', 'setup.py', 'install']).returncode 48 | if i_rc != 0: 49 | return i_rc 50 | else: 51 | return 0 52 | general_use.move_up_directory() 53 | 54 | 55 | def install_NPM(pack_man): 56 | ''' 57 | This function installs NPM. This is a dependency needed to run canbus-utils 58 | ''' 59 | 60 | print ('Installing npm...') 61 | npm_rc = commandline_install(pack_man, 'npm') 62 | if npm_rc != 0: 63 | print ('INSTALLATION FAILED: Could not install npm. This package is necessary to run canbus-utils') 64 | print ('ERROR CODE:', npm_rc) 65 | return npm_rc 66 | else: 67 | print ('INSTALLATION SUCCESSFUL: Successfully installed npm') 68 | return 0 69 | 70 | def check_symlink(source_file, symlink): 71 | ''' 72 | This function checks whether there is a symbolic link between source_file and symlink. If it does not exists, it creates one 73 | ''' 74 | 75 | check_rc = subprocess.run(['test', '-h', symlink]).returncode 76 | if check_rc!= 0: 77 | print ('Creating symbolic link between', source_file, 'and', symlink, '...') 78 | symlink_rc = subprocess.run(['sudo', 'ln', '-s', source_file, symlink]).returncode #this might not work 79 | if symlink_rc != 0: 80 | print ('SYMLINK CREATION FAILED: Failed to create a symbolic link between', source_file, 'and', symlink) 81 | elif symlink_rc == 0: 82 | print ('SYMLINK CREATION SUCCESSFUL: Successfully created a symbolic link between', source_file, 'and', symlink) 83 | return symlink_rc 84 | else: 85 | print ('Symbolic link already created between', source_file, 'and', symlink) 86 | return 0 87 | 88 | def check_NPM(pack_man): 89 | ''' 90 | This function checks if NPM is installed. If it is not, it installs it. This is a dependency needed to run canbus-utils 91 | ''' 92 | 93 | try: 94 | print ('Checking nodejs existence...') 95 | print ('If nodejs exists, version number will be printed below:') 96 | check_node_existence_rc = subprocess.run(['/usr/bin/nodejs', '--version']).returncode 97 | except FileNotFoundError: 98 | check_node_existence_rc = -1 99 | try: 100 | print ('Checking node existence...') 101 | print ('If node exists, version number will be printed below:') 102 | check_npm_existence_rc = subprocess.run(['/usr/bin/node', '--version']).returncode 103 | except FileNotFoundError: 104 | check_npm_existence_rc = -1 105 | 106 | if check_node_existence_rc == 0: 107 | if check_npm_existence_rc == 0: 108 | print ('CONFIRMATION COMPLETE: Both node.js and npm are installed') 109 | i_rc = 0 110 | else: 111 | i_rc = install_NPM(pack_man) 112 | else: 113 | print ('Installing nodejs...') 114 | node_rc = commandline_install(pack_man, 'nodejs') 115 | if node_rc != 0: 116 | print ('INSTALLATION FAILED: Could not install nodejs. This package is necessary to run npm which is used for canbus-utils') 117 | print ('ERROR CODE:', node_rc) 118 | i_rc = node_rc 119 | else: 120 | print ('INSTALLATION SUCCESSFUL: Successfully installed nodejs') 121 | print ('Installing npm...') 122 | i_rc = install_NPM(pack_man) 123 | 124 | if i_rc != 0: 125 | return i_rc 126 | else: 127 | print ('Checking for symbolic link existence between nodejs (/usr/bin/nodejs) and npm (/usr/bin/node)') 128 | symlink_rc = check_symlink('/usr/bin/nodejs', '/usr/bin/node') 129 | if symlink_rc != 0: 130 | return symlink_rc 131 | else: 132 | print ('Confirming complete installation of nodejs and npm...') #dk if will keep this yet, we'll see 133 | node_check_rc = subprocess.run(['/usr/bin/nodejs', '--version']).returncode 134 | npm_check_rc = subprocess.run(['/usr/bin/node', '--version']).returncode 135 | if node_check_rc == 0 and npm_check_rc == 0: 136 | print ('CONFIRMATION COMPLETE: Successfully confirmed installation of both node.js and npm') 137 | return 0 138 | else: 139 | if node_check_rc != 0: 140 | print ('CONFIRMATION FAILED: Could not confirm installation of node.js') 141 | print ('ERROR CODE:', node_check_rc) 142 | return node_check_rc 143 | elif npm_check_rc != 0: 144 | print ('CONFIRMATION FAILED: Could not confirm installation of npm') 145 | print ('ERROR CODE:', npm_check_rc) 146 | return npm_check_rc 147 | 148 | def install_bluez(pack_man): 149 | ''' 150 | This function installs the bluez dependency. This is also available via sudo apt-get and comes installed in most VM's so we have removed it as a tool and no longer use this function 151 | However, we kept this code here just incase bluez is not included in your VM and sudo apt-get bluez does not work 152 | To use this script, follow the instructions in the user manual on how to add a tool (in this case bluez) 153 | In the install.py, call this function. 154 | ''' 155 | print ('Installing Bluez...') 156 | print ('Cloning Bluez repository...') 157 | clone_rc = clone_git_repo(repo_bluez) 158 | if clone_rc != 0: 159 | print ('CLONING FAILED: Failed to clone repository at', repo_bluez) 160 | print ('ERROR CODE:', clone_rc) 161 | else: 162 | print ('CLONING SUCCESSFUL: Successfully cloned repository at', repo_bluez) 163 | current_dir = os.getcwd() 164 | path = current_dir + '/bluez-tools' 165 | os.chdir(path) 166 | read_rc = commandline_install(pack_man, 'libreadline-dev') 167 | if read_rc != 0: 168 | print ('INSTALLATION FAILED: Failed to install readline.h file. This is needed to complete autoconf') 169 | print ('ERROR CODE:', read_rc) 170 | return read_rc 171 | else: 172 | print ('INSTALLATION SUCCESSFUL: Successfully installed readline.h') 173 | print ('Installing autoconf...') 174 | auto_rc = commandline_install(pack_man, 'autoconf') 175 | if auto_rc != 0: 176 | print ('INSTALLATION FAILED: Failed to install autoconf. Cannot complete bluez installation') 177 | print ('ERROR CODE:'. auto_rc) 178 | return auto_rc 179 | else: 180 | print ('INSTALLATION SUCCESSFUL: Successfully installed autoconf') 181 | print ('Running autogen.sh...') 182 | autogen_rc = subprocess.run(['./autogen.sh']).returncode 183 | if autogen_rc != 0: 184 | print ('AUTOGENERATION FAILED: Failed to run autogen.sh. Cannot complete bluez installation') 185 | print ('ERROR CODE:', autogen_rc) 186 | return autogen_rc 187 | else: 188 | print ('AUTOGENERATION SUCCESSFUL: Successfully ran autogen.sh') 189 | print ('Running configure...') 190 | config_rc = subprocess.run(['./configure']).returncode 191 | if config_rc != 0: 192 | print ('CONFIGURATION FAILED: Failed to run ./configure after cloning Bluez repo') 193 | print ('ERROR CODE:', config_rc) 194 | return config_rc 195 | else: 196 | print ('CONFIGURATION SUCCESSFUL: Successfully ran ./configure after cloning Bluez repo') 197 | print ('Compiling...') 198 | make_rc = subprocess.run(['make']).returncode 199 | if make_rc != 0: 200 | print ('COMPILATION FAILED: Failed to compile bluez package') 201 | print ('ERROR CODE:', make_rc) 202 | return make_rc 203 | else: 204 | print ('COMPILATION SUCCESSFUL: Successfully compiled bluez package') 205 | print ('Installing Bluez...') 206 | make_install_rc = subprocess.run(['sudo', 'make', 'install']).returncode 207 | if make_install_rc != 0: 208 | print ('INSTALLATION FAILED: Failed to run "make install"') 209 | print ('ERROR CODE:', make_install_rc) 210 | return make_install_rc 211 | else: 212 | print ('INSTALLATION SUCCESSFUL: Successfully ran make install') 213 | return 0 214 | general_use.move_up_directory() 215 | 216 | def install_lightblue(pack_man): 217 | ''' 218 | This function installs the lightblue library/dependency 219 | ''' 220 | 221 | print ('Installing pybluez...') 222 | pyb_rc = subprocess.run(['sudo', '-H', 'pip', 'install', 'pybluez']).returncode 223 | if pyb_rc != 0: 224 | print ('INSTALLATION FAILED: Failed to install pybluez. Cannot complete lightblue installation') 225 | print ('ERROR CODE:', pyb_rc) 226 | return pyb_rc 227 | else: 228 | print ('INSTALLATION SUCCESSFUL: Successfully installed pybluez') 229 | print ('Downloading lightblue...') 230 | light_rc = download_install(link_lightblue) 231 | if light_rc != 0: 232 | print ('DOWNLOAD FAILED: Failed to download lightblue. Cannot complete lightblue installation') 233 | print ('ERROR CODE:', light_rc) 234 | return light_rc 235 | else: 236 | print ('DOWNLOAD SUCCESSFUL: Successfully downloaded lightblue .tar') 237 | print ('Extracting files...') 238 | ex_rc = subprocess.run(['tar', '-xzvf', 'lightblue-0.4.tar']).returncode 239 | if ex_rc != 0: 240 | print ('EXTRACTION FAILED: Failed to decompress the tar file (lightblue-0.4.tar). Cannot complete lightblue installation') 241 | print ('ERROR CODE:', ex_rc) 242 | return ex_rc 243 | else: 244 | print ('EXTRACTION SUCCESSFUL: Successfully decompressed lightblue-0.4.tar') 245 | setup_rc = subprocess.run(['python', 'setup.py', 'install']).returncode 246 | if setup_rc != 0: 247 | print ('INSTALLATION FAILED: Failed to install lightblue') 248 | print ('ERROR CODE:', setup_rc) 249 | return setup_rc 250 | else: 251 | print ('INSTALLATION SUCCESSFUL: Successfully installed lightblue') 252 | return 0 253 | 254 | def can_utils_x(pack_man): 255 | ''' 256 | This function installs the matplot-lib library which is needed for can-utils-x to run 257 | ''' 258 | 259 | mat_rc = commandline_install(pack_man, 'python-matplotlib') 260 | if mat_rc != 0: 261 | print ('INSTALLATION FAILED: Failed to install matplotlib from python. This is needed to run do') 262 | print ('ERROR CODE:'. mat_rc) 263 | else: 264 | print ('INSTALLATION SUCCESSFUL: Successfully installed matplotlib from python') 265 | socket = github_tools(pack_man, 'can-utils', repo) #this clones and installs the can-utils repository which is also needed for can-utils to run 266 | return mat_rc 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | -------------------------------------------------------------------------------- /general_use.py: -------------------------------------------------------------------------------- 1 | ''' 2 | 3 | This script has functions that can be used across all scripts 4 | 5 | ''' 6 | import platform 7 | import subprocess 8 | import os 9 | 10 | def check_distribution(): 11 | ''' 12 | This function checks which distribution the user is running and returns that distribution type 13 | ''' 14 | 15 | distro = '' 16 | distribution = (platform.linux_distribution())[0] 17 | 18 | if 'Kali' == distribution or 'kali' == distribution: 19 | distro = 'kali' 20 | elif 'Debian' == distribution or 'debian' == distribution: 21 | distro = 'debian' 22 | elif 'Ubuntu' == distribution or 'ubuntu' == distribution: 23 | distro = 'ubuntu' 24 | elif 'Red Hat' == distribution or 'red hat' == distribution: 25 | distro = 'red hat' 26 | 27 | return distro 28 | 29 | def package_tool(d): 30 | ''' 31 | This function returns which package manager the system uses to install scripts based on the distribution 32 | ''' 33 | 34 | pt = '' 35 | 36 | if d == 'kali' or d == 'debian' or d == 'ubuntu': 37 | pt = 'apt-get' 38 | elif d == 'red hat': 39 | pt = 'yum' 40 | 41 | return pt 42 | 43 | def update(pack_man): 44 | ''' 45 | This function updates software packages based on repository state 46 | This needs to be included at the beginning of every major installation function 47 | ''' 48 | update_rc = subprocess.run(['sudo', pack_man, 'update']).returncode 49 | if update_rc != 0: 50 | print ('UPDATE_ FAILED: Failed to update_ system') 51 | print ('ERROR CODE:', update_rc) 52 | else: 53 | print ('UPDATE_ SUCCESSFUL: Successfully updated system') 54 | 55 | def move_up_directory(): 56 | ''' 57 | This function moves up one directory from where the program is currently running. 58 | To successfully install/open tools, different files need to be used that could be in other directories. 59 | This is used to make sure that at the end of the process for that tool, the program ends in the main autopen directory. 60 | ''' 61 | 62 | c = os.getcwd() 63 | s = c.rfind('/') 64 | os.chdir(c[:s]) -------------------------------------------------------------------------------- /images/AutoPen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/images/AutoPen.png -------------------------------------------------------------------------------- /images/AutoPenBlack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/images/AutoPenBlack.png -------------------------------------------------------------------------------- /images/M4_SO_Small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/images/M4_SO_Small.gif -------------------------------------------------------------------------------- /images/background_front.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/images/background_front.jpg -------------------------------------------------------------------------------- /images/background_off_side.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/images/background_off_side.jpg -------------------------------------------------------------------------------- /images/background_side.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/images/background_side.jpg -------------------------------------------------------------------------------- /images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/images/file.gif -------------------------------------------------------------------------------- /info/TandC.txt: -------------------------------------------------------------------------------- 1 | Terms and Condition -------------------------------------------------------------------------------- /info/about.txt: -------------------------------------------------------------------------------- 1 | This is the about page -------------------------------------------------------------------------------- /info/howto.txt: -------------------------------------------------------------------------------- 1 | This is the how to page -------------------------------------------------------------------------------- /install.py: -------------------------------------------------------------------------------- 1 | import general_use 2 | import dependencies 3 | import tools 4 | import subprocess 5 | 6 | def install(toolname): 7 | ''' 8 | This function calls the appropriate installation function (github, download or command line) to install the tool provided (toolname) 9 | ''' 10 | 11 | repo_canbus_utils = 'https://github.com/digitalbond/canbus-utils.git' 12 | repo_kayak = 'https://github.com/dschanoeh/Kayak.git' 13 | repo_caringcaribou = 'https://github.com/CaringCaribou/caringcaribou.git' #want to check this to make sure it works, instructions a bit unclear 14 | repo_c0f = 'https://github.com/zombieCraig/c0f.git' 15 | repo_udsim = 'https://github.com/zombieCraig/UDSim.git' 16 | repo_j1939 = 'https://github.com/wang701/can-utils-j1939.git' 17 | repo_canbadger = 'https://github.com/Gutenshit/CANBadger.git' 18 | repo_canbadger_server = 'https://github.com/Gutenshit/CANBadger-Server.git' 19 | 20 | repo_katoolin = 'https://github.com/LionSec/katoolin.git' 21 | 22 | repo_bluelog = 'https://github.com/MS3FGX/Bluelog.git' 23 | repo_bluemaho = 'https://github.com/zenware/bluemaho.git' 24 | 25 | link_pyobd = 'http://www.obdtester.com/download/pyobd_0.9.3.tar.gz' #this might not work 26 | link_o2oo = 'https://www.vanheusden.com/O2OO/O2OO-0.9.tgz' 27 | link_romraider = 'http://assembla.com/spaces/romraider/documents/a5Ao9gHEir5P9Udmr6QqzO/download/RomRaider0.5.9RC3-linux.jar' 28 | 29 | d = general_use.check_distribution() 30 | pack_man = general_use.package_tool(d) 31 | 32 | 33 | 34 | if toolname == 'canbus-utils': 35 | return tools.github_tools(pack_man, 'canbus-utils', repo_canbus_utils) 36 | elif toolname == 'Kayak': 37 | return tools.github_tools(pack_man, 'Kayak', repo_kayak) 38 | elif toolname == 'caringcaribou': 39 | return tools.github_tools(pack_man, 'caringcaribou', repo_caringcaribou) #CANT TEST THIS UNLESS A DEVICE IS ATTACHED AND SET UP 40 | elif toolname == 'c0f': 41 | return tools.github_tools(pack_man, 'c0f', repo_c0f) 42 | elif toolname == 'udsim': 43 | return tools.github_tools(pack_man, 'udsim', repo_udsim) #CANT TEST THIS UNLESS A DEVICE IS ATTACHED AND SET UP 44 | elif toolname == 'katoolin': 45 | return tools.github_tools(pack_man, 'katoolin', repo_katoolin) 46 | elif toolname == 'bluelog': 47 | return tools.github_tools(pack_man, 'Bluelog', repo_bluelog) 48 | elif toolname == 'bluemaho': 49 | return tools.github_tools(pack_man, 'bluemaho', repo_bluemaho) 50 | elif toolname == 'j1939': 51 | return tools.github_tools(pack_man, 'j1939', repo_j1939) 52 | elif toolname == 'canbadger-hw': 53 | return tools.github_tools(pack_man, 'canbadger-hw', repo_canbadger) #CANT TEST THIS UNLESS A DEVICE IS ATTACHED AND SET UP 54 | elif toolname == 'canbadger-sw': 55 | return tools.github_tools(pack_man, 'canbadger-sw', repo_canbadger_server) 56 | elif toolname == 'can-utils-x': 57 | return dependencies.can_utils_x(pack_man) 58 | 59 | elif toolname == 'pyobd': 60 | return tools.downloaded_tools(pack_man, 'pyobd', link_pyobd) #MAY NOT INSTALL, IT NEEDS OLDER LIBRARIES 61 | elif toolname == 'o2oo': 62 | return tools.downloaded_tools(pack_man, 'o2oo', link_o2oo) 63 | 64 | elif toolname == 'btscanner': 65 | return tools.installed_tools(pack_man, 'btscanner') 66 | elif toolname == 'gnuradio': 67 | return tools.installed_tools(pack_man, 'gnuradio') 68 | elif toolname == 'aircrack-ng': 69 | return tools.installed_tools(pack_man, 'aircrack-ng') 70 | elif toolname == 'gqrx': 71 | return tools.installed_tools(pack_man, 'gqrx') 72 | elif toolname == 'can-utils': 73 | return tools.installed_tools(pack_man, 'can-utils') 74 | elif toolname == 'wireshark': 75 | return tools.installed_tools(pack_man, 'wireshark') 76 | elif toolname == 'tshark': 77 | return tools.installed_tools(pack_man, 'tshark') 78 | 79 | def test(name): 80 | it = open('installed.txt', 'a') 81 | it.write(name) 82 | it.write('\n') 83 | return 0 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /install_basics.py: -------------------------------------------------------------------------------- 1 | ''' 2 | 3 | This script begins by first checking the distribution that the user has and will install the following commands/libraries: 4 | 5 | git 6 | python3 7 | 8 | Assumes user is running as root and has apt-get installed 9 | 10 | ''' 11 | 12 | import general_use 13 | import dependencies 14 | import subprocess 15 | 16 | distro = general_use.check_distribution() 17 | pack_man = general_use.package_tool(distro) 18 | 19 | def install_python(pack_man): 20 | ''' 21 | This function installs or updates Python 3 depending on whether it is already on the system or not 22 | ''' 23 | 24 | print ('Installing/Updating Python 3...') 25 | 26 | p_rc = dependencies.commandline_install(pack_man, "python3") 27 | if p_rc != 0: 28 | print ('INSTALLATION FAILED: Could not install Python 3') 29 | print ("ERROR CODE:", p_rc) 30 | else: 31 | print ('INSTALLATION SUCCESSFUL: Python 3 successfully installed') 32 | 33 | def update_git(pack_man): 34 | ''' 35 | This function installs or updates git depending on whether it is already on the system or not 36 | ''' 37 | 38 | print('Installing git...') 39 | g_rc = dependencies.commandline_install(pack_man, "git") 40 | 41 | if g_rc != 0: 42 | print ("INSTALLATION FAILED: Could not install git. This is needed to install some of the tools") 43 | print ("ERROR CODE:", g_rc) 44 | else: 45 | print ("INSTALLATION SUCCESSFUL: Git successfully installed") 46 | 47 | def install_curl(pack_man): 48 | ''' 49 | This function installs curl 50 | ''' 51 | 52 | print ('Installing curl...') 53 | c_rc = dependencies.commandline_install(pack_man, 'curl') 54 | if c_rc != 0: 55 | print ('INSTALLATION FAILED: Could not install curl. This is needed to install some of the tools') 56 | print ('ERROR CODE:', c_rc) 57 | else: 58 | print ('INSTALLATION SUCCESSFUL: curl successfully installed') 59 | 60 | def install_pip(pack_man): 61 | ''' 62 | This function installs pip3 63 | ''' 64 | 65 | 66 | pip_rc = dependencies.commandline_install(pack_man, 'python3-pip') 67 | if pip_rc != 0: 68 | print ('INSTALLATION FAILED: Failed to install pip. This is needed to install some dependencies for tools') 69 | print ('ERROR CODE:', pip_rc) 70 | else: 71 | print ('INSTALLATION COMPLETE: Successfully installed pip') 72 | 73 | 74 | install_python(pack_man) 75 | update_git(pack_man) 76 | install_curl(pack_man) 77 | install_pip(pack_man) 78 | 79 | -------------------------------------------------------------------------------- /old/AutoPen.kv: -------------------------------------------------------------------------------- 1 | #:import ListAdapter kivy.adapters.listadapter.ListAdapter 2 | #:import ListItemButton kivy.uix.listview.ListItemButton 3 | 4 | : 5 | canvas.before: 6 | Rectangle: 7 | source: 'background.jpg' 8 | pos: self.pos 9 | size: self.size 10 | 11 | : 12 | selected_color: 0.5, 0.5, 0.5, 1 13 | deselected_color: 0.7, 0.7, 0.7, 1 -------------------------------------------------------------------------------- /old/dummy.txt: -------------------------------------------------------------------------------- 1 | with open("canutils.txt", "r") as stream: 2 | labeltext = stream.read() 3 | label = Label(text=labeltext, markup=True, text_size=(400,680), pos_hint={'x':0, 'y':.15}) 4 | self.mainpage.add_widget(label) 5 | with open("canutilsexample.txt", "r") as stream: 6 | labeltext = stream.read() 7 | example = Label(text=labeltext, markup=True, text_size=(400, 680), pos_hint={'x': 0.3, 'y': .25}) 8 | self.mainpage.add_widget(example) 9 | 10 | canutils.txt 11 | [size=32][b]Can-utils[/b][/size] 12 | [size=20]by [i]ZombieCraig[/i] 13 | 14 | SocketCAN userspace utilities and tools 15 | 16 | CAN is a message-based network protocol designed for vehicles originally initially created by Robert Bosch GmbH. SocketCAN is a set of open source CAN drivers and a networking stack contributed by Volkswagen Research to the Linux kernel. 17 | 18 | This package contains some userspace utilities for Linux SocketCAN subsystem: asc2log, bcmserver, canbusload, can-calc-bit-timing, candump, canfdtest, cangen, cangw, canlogserver, canplayer, cansend, cansniffer, isotpdump, isotprecv, isotpperf, isotpsend, isotpserver, isotpsniffer, isotptun, log2asc, log2long, slcan_attach, slcand and slcanpty. 19 | [/size] 20 | 21 | canutilsexample.txt 22 | To listen to traffic on the bus, we can use candump. 23 | 24 | To show all traffic in real time on device can0: 25 | 26 | candump can0 27 | 28 | The displayed messages can be filtered using a mask and identifier. Two filter types are available: 29 | 30 | [can_id]:[can_mask] matches when [received_can_id] & [can_mask] == [can_id] & [mask] 31 | [can_id]~[can_mask] matches when [received_can_id] & [can_mask] != [can_id] & [mask] -------------------------------------------------------------------------------- /old/main.py: -------------------------------------------------------------------------------- 1 | import kivy 2 | kivy.require('1.9.0') 3 | 4 | from kivy.app import App 5 | from kivy.uix.image import Image 6 | from kivy.uix.dropdown import DropDown 7 | from kivy.uix.button import Button 8 | from kivy.uix.boxlayout import BoxLayout 9 | from kivy.uix.floatlayout import FloatLayout 10 | from kivy.adapters.listadapter import ListAdapter 11 | from kivy.uix.listview import ListItemButton, ListView 12 | from kivy.base import runTouchApp 13 | from kivy.uix.spinner import Spinner 14 | from kivy.uix.textinput import TextInput 15 | 16 | from kivy.uix.label import Label 17 | 18 | from kivy.lang import Builder 19 | from tools import install 20 | 21 | class AutoPen(App): 22 | 23 | ''' 24 | def __init__(self, **kwargs): 25 | super(App, self).__init__(**kwargs) 26 | with self.canvas: 27 | welcome = Label(text='Welcome to Autopen', size_hint=(.6,.3), pos_hint={'x':.2,'y':.7}, background_color=[1,0,1,0]) 28 | self.mainpage.add_widget(welcome) 29 | ''' 30 | 31 | def build(self): 32 | 33 | self.mainpage = FloatLayout() 34 | 35 | #btn = Button(text='Back', on_release=self.callback, size_hint=(0.15, 0.1), pos_hint={'x': 0, 'y': .9}) 36 | #car = Image(source='AutoPen.png') 37 | 38 | 39 | def MainPage(instance): 40 | self.mainpage.clear_widgets() #going to have to overwrite this function later 41 | self.can = Button(text='CAN', size_hint=(.2, .1), pos_hint={'x':.1, 'y':.2}) 42 | self.wifi_SDR = Button(text='Wi-fi/SDR', size_hint=(.2, .1), pos_hint = {'x':.1, 'y':.6}) 43 | self.bluetooth = Button(text='Bluetooth', size_hint=(.2,.1), pos_hint={'x':.7, 'y':.2}) 44 | self.miscellaneous = Button(text='Miscellaneous', size_hint=(.2,.1), pos_hint={'x':.7, 'y':.6}) 45 | self.back = Button(text='Back', size_hint=(.1,.05), pos_hint={'x':0, 'y':0}) 46 | 47 | 48 | tools_title = Button(text='Tools', size_hint=(.6,.3), pos_hint={'x':.2,'y':.8}, background_color=[1,0,1,0]) 49 | self.mainpage.add_widget(tools_title) 50 | 51 | #adding buttons to main tools 52 | self.mainpage.add_widget(self.can) 53 | self.mainpage.add_widget(self.wifi_SDR) 54 | self.mainpage.add_widget(self.bluetooth) 55 | self.mainpage.add_widget(self.miscellaneous) 56 | self.mainpage.add_widget(self.back) 57 | 58 | self.can.bind(on_press=canPage) 59 | self.bluetooth.bind(on_press=bluetoothPage) 60 | self.wifi_SDR.bind(on_press=wifi_SDRPage) 61 | self.miscellaneous.bind(on_press=miscellaneousPage) 62 | 63 | 64 | def databasePage(instance): 65 | self.mainpage.remove_widget(self.welcome) 66 | self.mainpage.remove_widget(self.database) 67 | self.mainpage.remove_widget(self.howto) 68 | self.mainpage.remove_widget(self.terms) 69 | self.mainpage.remove_widget(self.tools) 70 | self.mainpage.remove_widget(self.search) 71 | 72 | database_title = Button(text='Database', size_hint=(.6,.3), pos_hint={'x':.2,'y':.7}, background_color=[1,0,0,0]) 73 | self.mainpage.add_widget(database_title) 74 | 75 | self.create = Button(text='Create New Car', size_hint=(.2,.1), pos_hint={'x':.1, 'y':.5}) 76 | self.load = Button(text='Load Car', size_hint=(.2,.1), pos_hint={'x':.1,'y':.4}) 77 | self.back = Button(text='Back', size_hint=(.1,.05), pos_hint={'x':0, 'y':0}) 78 | self.cont = Button(text='Continue', size_hint=(.1,.05), pos_hint={'x':.9, 'y':0}) 79 | 80 | 81 | self.mainpage.add_widget(self.create) 82 | self.mainpage.add_widget(self.load) 83 | self.mainpage.add_widget(self.back) 84 | self.mainpage.add_widget(self.cont) 85 | 86 | #self.tools = Button(text='Tools', size_hint=(.3,.1), pos_hint={'x':.35, 'y':.5}) 87 | 88 | self.create.bind(on_press=createCarButton) 89 | self.load.bind(on_press=loadCarButton) 90 | #self.back.bind(on_press=self.mainpage) 91 | self.cont.bind(on_press=MainPage) 92 | 93 | def on_text(instance, value): 94 | print('The widget', instance, 'have:', value) 95 | 96 | 97 | def createCarButton(button): 98 | layout = button.parent 99 | model = TextInput(text='Input Car Model', background_color=[1,1,0,0.5], size_hint=(.3,.1), pos_hint={'x':.3,'y':.5}) 100 | make = TextInput(text='Input Car Make', background_color=[1,1,0,0.5], size_hint=(.3,.1), pos_hint={'x':.3, 'y':.4}) 101 | year = TextInput(text='Input Car Year', background_color=[1,1,0,0.5], size_hint=(.3,.1), pos_hint={'x':.3, 'y':.3}) 102 | creat = Button(text='Create', size_hint=(.3,.1), pos_hint={'x':.3,'y':.2}) 103 | 104 | self.mainpage.add_widget(model) 105 | self.mainpage.add_widget(make) 106 | self.mainpage.add_widget(year) 107 | self.mainpage.add_widget(creat) 108 | # print (textinput) 109 | 110 | 111 | def loadCarButton(button): 112 | layout = button.parent 113 | 114 | self.welcome = Button(text='Welcome to Autopen', size_hint=(.6,.3), pos_hint={'x':.2,'y':.7}, background_color=[1,0,1,1]) 115 | self.mainpage.add_widget(self.welcome) 116 | 117 | self.howto = Button(text='How-To', size_hint=(.3,.1), pos_hint={'x':.35, 'y':.4}) 118 | self.search = Button(text='Search', size_hint=(.3,.1), pos_hint={'x':.35, 'y':.3}) 119 | self.terms = Button(text='Terms and Conditions', size_hint=(.3,.1), pos_hint={'x':.35, 'y':.2}) 120 | 121 | self.mainpage.add_widget(self.howto) 122 | self.mainpage.add_widget(self.search) 123 | self.mainpage.add_widget(self.terms) 124 | 125 | self.database = Button(text='Register Vehicle', size_hint=(.3,.1), pos_hint={'x':.35, 'y':.6}) 126 | self.mainpage.add_widget(self.database) 127 | self.database.bind(on_press=databasePage) 128 | 129 | self.tools = Button(text='Tools', size_hint=(.3,.1), pos_hint={'x':.35, 'y':.5}) 130 | self.mainpage.add_widget(self.tools) 131 | self.tools.bind(on_press=MainPage) 132 | 133 | def canutilsPage(instance): 134 | 135 | self.install = Button(text='Install', size_hint=(.2,.1), pos_hint={'x':.4, 'y':.1}) 136 | self.mainpage.add_widget(self.install) 137 | #self.install.bind(on_press=test_install.test()) 138 | 139 | def canPage(instance): 140 | self.mainpage.remove_widget(self.can) 141 | self.mainpage.remove_widget(self.wifi_SDR) 142 | self.mainpage.remove_widget(self.bluetooth) 143 | self.mainpage.remove_widget(self.miscellaneous) 144 | 145 | tools_title = Button(text='Tools', size_hint=(.6,.3), pos_hint={'x':.2,'y':.8}, background_color=[1,0,1,0]) 146 | self.mainpage.add_widget(tools_title) 147 | 148 | #l = Label(text='CAN Tools', font_size='20sp', halign='left', valign='top', size=(2,2)) 149 | can_title = Button(text='CAN Tools', size_hint=(.2,.1), pos_hint={'x':.05,'y':.85}, background_color=[1,0,0,0.5]) 150 | self.mainpage.add_widget(can_title) 151 | 152 | self.canutils = Button(text='Can-utils', size_hint=(.2,.1), pos_hint={'x':.05,'y':.75}) 153 | canbus_utils = Button(text='Canbus-utils', size_hint=(.2,.1), pos_hint={'x':.05,'y':.65}) 154 | kayak = Button(text='Kayak', size_hint=(.2,.1), pos_hint={'x':.05, 'y':.55}) 155 | caringcaribou = Button(text='Caring Caribou', size_hint=(.2,.1), pos_hint={'x':.05, 'y':.45}) 156 | c0f = Button(text='c0f', size_hint=(.2,.1), pos_hint={'x':.05, 'y':.35}) 157 | UDSim = Button(text='UDSim', size_hint=(.2,.1), pos_hint={'x':.05, 'y':.25}) 158 | DO = Button(text='PyOBD',size_hint=(.2,.1), pos_hint={'x':.05,'y':.15}) 159 | O2OO = Button(text='O2OO', size_hint=(.2,.1), pos_hint={'x':.05, 'y':.05}) 160 | 161 | self.mainpage.add_widget(self.canutils) 162 | self.mainpage.add_widget(canbus_utils) 163 | self.mainpage.add_widget(c0f) 164 | self.mainpage.add_widget(kayak) 165 | self.mainpage.add_widget(caringcaribou) 166 | self.mainpage.add_widget(UDSim) 167 | self.mainpage.add_widget(DO) 168 | self.mainpage.add_widget(O2OO) 169 | 170 | self.back.bind(on_press=MainPage) 171 | self.canutils.bind(on_press=canutilsPage) 172 | 173 | def bluetoothPage(instance): 174 | self.mainpage.remove_widget(self.can) 175 | self.mainpage.remove_widget(self.wifi_SDR) 176 | self.mainpage.remove_widget(self.bluetooth) 177 | self.mainpage.remove_widget(self.miscellaneous) 178 | 179 | tools_title = Button(text='Tools', size_hint=(.6,.3), pos_hint={'x':.2,'y':.8}, background_color=[1,0,1,0]) 180 | self.mainpage.add_widget(tools_title) 181 | 182 | bluetooth_title = Button(text='Bluetooth Tools', size_hint=(.25,.1), pos_hint={'x':.05,'y':.85}, background_color=[1,0,0,0.5]) 183 | self.mainpage.add_widget(bluetooth_title) 184 | 185 | bluelog = Button(text='Bluelog', size_hint=(.25,.1), pos_hint={'x':.05,'y':.75}) 186 | bluemaho = Button(text='Bluemaho', size_hint=(.25,.1), pos_hint={'x':.05,'y':.65}) 187 | btscanner = Button(text='BTScanner', size_hint=(.25,.1), pos_hint={'x':.05, 'y':.55}) 188 | bluetooth_tools = Button(text='Bluetooth Tools Package', size_hint=(.25,.1), pos_hint={'x':.05, 'y':.45}) 189 | 190 | install = Button(text='Install', size_hint=(.2,.1), pos_hint={'x':.4, 'y':.1}) 191 | 192 | self.mainpage.add_widget(bluelog) 193 | self.mainpage.add_widget(bluemaho) 194 | self.mainpage.add_widget(btscanner) 195 | self.mainpage.add_widget(bluetooth_tools) 196 | self.mainpage.add_widget(install) 197 | 198 | 199 | self.back.bind(on_press=MainPage) 200 | 201 | def wifi_SDRPage(instance): 202 | self.mainpage.remove_widget(self.can) 203 | self.mainpage.remove_widget(self.wifi_SDR) 204 | self.mainpage.remove_widget(self.bluetooth) 205 | self.mainpage.remove_widget(self.miscellaneous) 206 | 207 | tools_title = Button(text='Tools', size_hint=(.6,.3), pos_hint={'x':.2,'y':.8}, background_color=[1,0,1,0]) 208 | self.mainpage.add_widget(tools_title) 209 | 210 | title = Button(text='Wi-fi/SDR Tools', size_hint=(.25,.1), pos_hint={'x':.05,'y':.85}, background_color=[1,0,0,0.5]) 211 | self.mainpage.add_widget(title) 212 | 213 | aircrack = Button(text='Aircrack-ng', size_hint=(.25,.1), pos_hint={'x':.05,'y':.75}) 214 | gnuradio = Button(text='GNU Radio', size_hint=(.25,.1), pos_hint={'x':.05,'y':.65}) 215 | 216 | install = Button(text='Install', size_hint=(.2,.1), pos_hint={'x':.4, 'y':.1}) 217 | 218 | self.mainpage.add_widget(aircrack) 219 | self.mainpage.add_widget(gnuradio) 220 | self.mainpage.add_widget(install) 221 | 222 | 223 | self.back.bind(on_press=MainPage) 224 | 225 | def miscellaneousPage(instance): 226 | self.mainpage.remove_widget(self.can) 227 | self.mainpage.remove_widget(self.wifi_SDR) 228 | self.mainpage.remove_widget(self.bluetooth) 229 | self.mainpage.remove_widget(self.miscellaneous) 230 | 231 | tools_title = Button(text='Tools', size_hint=(.6,.3), pos_hint={'x':.2,'y':.8}, background_color=[1,0,1,0]) 232 | self.mainpage.add_widget(tools_title) 233 | 234 | miscel_title = Button(text='Miscellaneous Tools', size_hint=(.25,.1), pos_hint={'x':.05,'y':.85}, background_color=[1,0,0,0.5]) 235 | self.mainpage.add_widget(miscel_title) 236 | 237 | katoolin = Button(text='Katoolin', size_hint=(.25,.1), pos_hint={'x':.05,'y':.75}) 238 | romraider = Button(text='Romraider', size_hint=(.25,.1), pos_hint={'x':.05,'y':.65}) 239 | 240 | install = Button(text='Install', size_hint=(.2,.1), pos_hint={'x':.4, 'y':.1}) 241 | 242 | self.mainpage.add_widget(katoolin) 243 | self.mainpage.add_widget(romraider) 244 | self.mainpage.add_widget(install) 245 | 246 | self.back.bind(on_press=MainPage) 247 | 248 | return self.mainpage 249 | 250 | class Loading(App): 251 | def build(self): 252 | mainpage = FloatLayout() 253 | logo = Image(source='AutoPen.png', pos_hint={'center_x': 0.5, 'center_y': .6}) 254 | spiderman = Label( 255 | text='[size=24][i]With Great Power comes Great Responsibility[/i][/size]', 256 | markup=True, 257 | pos_hint={'center_x': 0.5, 'center_y': .2}) 258 | enter = Button(text='enter', size_hint=(0.2,0.1), pos_hint={'center_x': 0.5, 'center_y': .1}) 259 | mainpage.add_widget(logo) 260 | mainpage.add_widget(spiderman) 261 | mainpage.add_widget(enter) 262 | return mainpage 263 | #layout.add_widget(MainToolsScreen()) 264 | 265 | if __name__ == "__main__": 266 | AutoPen().run() 267 | 268 | 269 | #def main_page(): 270 | #main tools buttons 271 | ''' 272 | 273 | : 274 | FloatLayout: 275 | Button: 276 | id: 'can' 277 | text: 'CAN' 278 | size_hint: (.2, .1) 279 | pos_hint: {'x':.1, 'y':.2} 280 | on_release: root.callback() 281 | Button: 282 | id: 'wifi' 283 | text: 'Wi-fi' 284 | size_hint: (.2, .1) 285 | pos_hint: {'x':.1, 'y':.6} 286 | ''' 287 | 288 | 289 | 290 | -------------------------------------------------------------------------------- /old/testkivy/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /old/testkivy/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /old/testkivy/.idea/testkivy.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | -------------------------------------------------------------------------------- /old/testkivy/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 62 | 63 | 64 | 72 | 73 | 74 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 112 | 113 | 114 | 115 | 118 | 119 | 122 | 123 | 124 | 125 | 128 | 129 | 132 | 133 | 136 | 137 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 173 | 174 | 190 | 191 | 202 | 203 | 221 | 222 | 240 | 241 | 261 | 262 | 283 | 284 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 1490678443019 326 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 359 | 362 | 363 | 364 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | -------------------------------------------------------------------------------- /old/testkivy/AutoPen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/old/testkivy/AutoPen.png -------------------------------------------------------------------------------- /old/testkivy/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/old/testkivy/background.jpg -------------------------------------------------------------------------------- /old/testkivy/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/old/testkivy/background.png -------------------------------------------------------------------------------- /old/testkivy/cheesepoofs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/old/testkivy/cheesepoofs/.DS_Store -------------------------------------------------------------------------------- /old/testkivy/cheesepoofs/kerplunk/__pycache__/script.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/old/testkivy/cheesepoofs/kerplunk/__pycache__/script.cpython-34.pyc -------------------------------------------------------------------------------- /old/testkivy/cheesepoofs/kerplunk/script.py: -------------------------------------------------------------------------------- 1 | def install_script(): 2 | print ("JESUS BEJESUS ITS INSTALLING") -------------------------------------------------------------------------------- /old/testkivy/main.py: -------------------------------------------------------------------------------- 1 | import kivy 2 | kivy.require('1.9.0') 3 | from cheesepoofs.kerplunk import script 4 | 5 | from kivy.app import App 6 | from kivy.uix.boxlayout import BoxLayout 7 | from kivy.uix.label import Label 8 | from kivy.uix.button import Button 9 | from kivy.lang import Builder 10 | from kivy.animation import Animation 11 | from kivy.uix.floatlayout import FloatLayout 12 | from kivy.uix.image import Image 13 | from kivy.uix.textinput import TextInput 14 | from kivy.graphics import Color, Rectangle 15 | 16 | Builder.load_string(''' 17 | 18 | Label: 19 | id: loki 20 | text: 'loki: I AM YOUR GOD!' 21 | Button: 22 | id: hulk 23 | text: "press to smash loki" 24 | on_release: root.hulk_smash() 25 | ''') 26 | 27 | 28 | class Marvel(BoxLayout): 29 | 30 | def hulk_smash(self): 31 | self.ids.hulk.text = "hulk: puny god!" 32 | self.ids["loki"].text = "loki: >_ Sets scanning device, default is "hci0" 8 | -o Sets output filename, default is "devices.log" 9 | -v Verbose, prints discovered devices to the terminal 10 | -q Quiet, turns off nonessential terminal outout 11 | -d Enables daemon mode, Bluelog will run in background 12 | -k Kill an already running Blue log process 13 | -l Start "Blue log Live", default is disabled 14 | 15 | Logging Options: 16 | -n Write device names to log, default is disabled 17 | -m Write device manufacturer to log, default is disabled 18 | -c Write device class to log, default is disabled 19 | -f Use "friendly" device class, default is disabled 20 | -t Write timestamps to log, default is disabled 21 | -x Obfuscate discovered MACs, default is disabled 22 | -e Encode discovered MACs with CRC32, default disabled 23 | -b Enable BlueProPro log format, see README 24 | 25 | Advanced Options: 26 | -r Name resolution retries, default is 3 27 | -a Amnesia, Blue log will forget device after given time 28 | -w Scanning window in seconds, see README 29 | -s Syslog only mode, no log file. Default is disabled 30 | 31 | 32 | The following is a brief example of how BlueLog might be used. The machine on which it is being used must have a bluetooth module, and it must be enabled. 33 | 34 | autopen@autopen:~$ sudo bluelog -v -o bluelog.log 35 | Bluelog (v1.1.0) by MS3FGX 36 | --------------------------- 37 | Autodetecting device...OK 38 | Opening output file: blue log.log...OK 39 | Writing PID file: /tmp/blue log.pid...OK 40 | Scan started at [11/18/15 11:55:20] on 11:11:11:11:11:11. 41 | Hit Ctrl+C to end scan. 42 | [11/18/15 11:55:24] D8:3C:69:76:31:6E,IGNORED,0x5a020c 43 | 44 | Closing files and freeing memory...Done! 45 | -------------------------------------------------------------------------------- /text/bluemaho.txt: -------------------------------------------------------------------------------- 1 | BlueMaho is GUI-shell (interface) for suite of tools for testing security of bluetooth devices. It is freeware, opensource, written on python, uses wxPyhon. It can be used for testing BT-devices for known vulnerabilities and major thing to do – testing to find unknown vulns. Also it can form nice statistics. 2 | 3 | 4 | Features: 5 | 6 | scan for devices, show advanced info, SDP records, vendor etc 7 | track devices – show where and how much times device was seen, its name changes 8 | loop scan – it can scan all time, showing you online devices 9 | alerts with sound if new device found 10 | on_new_device – you can spacify what command should it run when it founds new device 11 | it can use separate dongles – one for scaning (loop scan) and one for running tools or exploits 12 | send files 13 | change name, class, mode, BD_ADDR of local HCI devices 14 | save results in database 15 | form nice statistics (uniq devices by day/hour, vendors, services etc) 16 | test remote device for known vulnerabilities (see exploits for more details) 17 | test remote device for unknown vulnerabilities (see tools for more details) 18 | themes! you can customize it 19 | 20 | 21 | What tools and exploits it consist of? 22 | 23 | Tools: 24 | 25 | atshell.c by Bastian Ballmann (modified attest.c by Marcel Holtmann) 26 | bccmd by Marcel Holtmann 27 | bdaddr.c by Marcel Holtmann 28 | bluetracker.py by smiley 29 | carwhisperer v0.2 by Martin Herfurt 30 | psm_scan and rfcomm_scan from bt_audit-0.1.1 by Collin R. Mulliner 31 | BSS (Bluetooth Stack Smasher) v0.8 by Pierre Betouin 32 | btftp v0.1 by Marcel Holtmann 33 | btobex v0.1 by Marcel Holtmann 34 | greenplaque v1.5 by digitalmunition.com 35 | L2CAP packetgenerator by Bastian Ballmann 36 | obex stress tests 0.1 37 | redfang v2.50 by Ollie Whitehouse 38 | ussp-push v0.10 by Davide Libenzi 39 | exploits/attacks: 40 | Bluebugger v0.1 by Martin J. Muench 41 | bluePIMp by Kevin Finisterre 42 | BlueZ hcidump v1.29 DoS PoC by Pierre Betouin 43 | helomoto by Adam Laurie 44 | hidattack v0.1 by Collin R. Mulliner 45 | Mode 3 abuse attack 46 | Nokia N70 l2cap packet DoS PoC Pierre Betouin 47 | opush abuse (prompts flood) DoS attack 48 | Sony-Ericsson reset display PoC by Pierre Betouin 49 | you can add your own tools by editing 'exploits/exploits.lst' and 'tools/tools.lst' 50 | 51 | 52 | Requirements: 53 | 54 | OS (tested with Debian 4.0 Etch / 2.6.18) 55 | python (python 2.4 http://www.python.org) 56 | wxPython (python-wxgtk2.6 http://www.wxpython.org) 57 | BlueZ (3.9/3.24) http://www.bluez.org 58 | Eterm to open tools somewhere, you can set another term in 'config/defaul.conf' changing the value of 'cmd_term' variable. (tested with 1.1 ver) 59 | pkg-config(0.21), 'tee' used in tools/showmaxlocaldevinfo.sh, openobex, obexftp 60 | libopenobex1 + libopenobex-dev (needed by ussp-push) 61 | libxml2, libxml2-dev (needed by btftp) 62 | libusb-dev (needed by bccmd) 63 | libreadline5-dev (needed by atshell.c) 64 | lightblue-0.3.3 (needed by obexstress.py) 65 | hardware: any bluez compatible bluetooth-device -------------------------------------------------------------------------------- /text/bluemaho_example.txt: -------------------------------------------------------------------------------- 1 | Bluemaho is a tool for sniffing the bluetooth network. It is important that the bluetooth hardware on your machine is properly configured. 2 | 3 | Bluemaho has a graphical user interface, and is fairly intuitive. 4 | 5 | Description 6 | 7 | BlueMaho is GUI-shell (interface) for suite of tools for testing security of bluetooth devices. It is freeware, opensource, written on python, uses wxPyhon. It can be used for testing BT-devices for known vulnerabilities and major thing to do – testing to find unknown vulns. Also it can form nice statistics. 8 | 9 | 10 | Features: 11 | 12 | scan for devices, show advanced info, SDP records, vendor etc 13 | track devices – show where and how much times device was seen, its name changes 14 | loop scan – it can scan all time, showing you online devices 15 | alerts with sound if new device found 16 | on_new_device – you can spacify what command should it run when it founds new device 17 | it can use separate dongles – one for scaning (loop scan) and one for running tools or exploits 18 | send files 19 | change name, class, mode, BD_ADDR of local HCI devices 20 | save results in database 21 | form nice statistics (uniq devices by day/hour, vendors, services etc) 22 | test remote device for known vulnerabilities (see exploits for more details) 23 | test remote device for unknown vulnerabilities (see tools for more details) 24 | themes! you can customize it 25 | Source: https://wiki.thc.org/BlueMaho 26 | BlueMaho Homepage | Kali BlueMaho Repo 27 | 28 | Author: The Hacker’s Choice 29 | License: GPLv2 30 | 31 | To run, simply execute bluemaho.py 32 | 33 | 34 | 35 | Because it is a graphical tool, the amount of overhead needed to use it is minimal. Once you have monitored and collected the data you want, it is fairly simple. The packets can be stored, and examined. 36 | -------------------------------------------------------------------------------- /text/bluez.txt: -------------------------------------------------------------------------------- 1 | BlueZ provides support for the core Bluetooth layers and protocols. It is flexible, efficient and uses a modular implementation. It has many interesting features: 2 | 3 | Features: 4 | Complete modular implementation 5 | Symmetric multi processing safe 6 | Multithreaded data processing 7 | Support for multiple Bluetooth devices 8 | Real hardware abstraction 9 | Standard socket interface to all layers 10 | Device and service level security support 11 | 12 | Currently BlueZ consists of many separate modules: 13 | Bluetooth kernel subsystem core 14 | L2CAP and SCO audio kernel layers 15 | RFCOMM, BNEP, CMTP and HIDP kernel implementations 16 | HCI UART, USB, PCMCIA and virtual device drivers 17 | General Bluetooth and SDP libraries and daemons 18 | Configuration and testing utilities 19 | Protocol decoding and analysis tools 20 | 21 | Platforms: 22 | The BlueZ kernel modules, libraries and utilities are known to be working perfect on many architectures supported by Linux. This also includes single and multi processor platforms as well as hyper threading systems: 23 | 24 | Intel and AMD x86 25 | AMD64 and EM64T (x86-64) 26 | SUN SPARC 32/64bit 27 | PowerPC 32/64bit 28 | Intel StrongARM and XScale 29 | Hitachi/Renesas SH processors 30 | Motorola DragonBall 31 | 32 | 33 | Distributions: 34 | Support for BlueZ can be found in many Linux distributions and in general it is compatible with any Linux system on the market: 35 | 36 | Debian GNU/Linux 37 | Ubuntu Linux 38 | Fedora Core / Red Hat Linux 39 | OpenSuSE / SuSE Linux 40 | Mandrake Linux 41 | Gentoo Linux 42 | Chrome OS -------------------------------------------------------------------------------- /text/bluez_example.txt: -------------------------------------------------------------------------------- 1 | Requirements 2 | 3 | In order to use BlueZ, you need to have at least a 2.4.4 Linux kernel. The 2.4.6 kernel has BlueZ built-in. 4 | In case, if you want to use the latest version of BlueZ ( see section 2.1 for download instructions), you 5 | should disable native BlueZ support. 6 | BlueZ can be used with USB or Serial interface based Bluetooth devices. Additionally, Bluez provides 7 | Virtual HCI device (vhci) which can be used to test your Bluetooth applications. This is very useful if you 8 | do not have any real Bluetooth devices. 9 | 10 | 11 | Compilation and Installation 12 | 13 | To configure BlueZ run 14 | ./configure 15 | to configure BlueZ for your kernel. The configure command automatically searches for all the required 16 | components and packages. Optionally, the configure support the following options: 17 | --enable-debug enable BlueZ debugging 18 | --with-kernel= kernel source path (default is /usr/src/linux) 19 | Once the Configure ran successfully, to compile and install run BlueZ, run: 20 | make install 21 | That’s it!. Now, follow the next section to use BlueZ. See the README and configure.help for further 22 | compilation instructions including instructions for cross-compilation. 23 | As usually it is good to check /var/log/messages for any output messages. 24 | 25 | If you want to update your Linux kernel tree with the up to date CVS version run make update and 26 | recompile your kernel. 27 | If you want the latest stuff don’t enable Bluetooth support in the kernel and use BlueZ - 1.2 or the latest 28 | CVS code instead. Be sure to have control of which modules you are loading. 29 | 30 | 31 | Loading BlueZ Modules 32 | 33 | The following lines need to be present in your /etc/modules.conf always in order for BlueZ to work 34 | correctly: 35 | alias net-pf-31 bluez 36 | alias bt-proto-0 l2cap 37 | If you want to use UART based Bluetooth devices, add the following line to your /etc/modules.conf 38 | in addition to the above: 39 | alias tty-ldisc-15 hci_uart 40 | If you want to use the Virtual HCI device, add the following line to your /etc/modules.conf: 41 | alias char-major-10-250 hci_vhci 42 | After making any of the above changes, you can run ”depmod -a” to enable auto-loading of BlueZ 43 | modules. 44 | Manual loading of the modules can be done by: 45 | modprobe bluez 46 | modprobe hci_uart UART support. Optional 47 | modprobe hci_usb USB support. Optional 48 | modprobe l2cap 49 | You should see the BlueZ modules if you run lsmod. If there are any errors, check your 50 | /var/log/messages file. 51 | 52 | 53 | Device Intitialization 54 | 55 | UART Devices 56 | Make sure that your /etc/hcid.conf is correct (tty, speed, flow, etc). See the example provided with 57 | the package (daemons/hcid.conf). Start hcid. 58 | To configure the UART devices you need to use the tool hciattach. It can be called either manually or 59 | from the PCMCIA cardmgr scripts. The syntax is given in the Tools section. 60 | # 61 | # HCI daemon configuration file. 62 | # 63 | # $Id: bluezhowto.tex,v 1.5.1.2 2001/11/14 12:03:10 beutel Exp $ 64 | # 65 | # HCId options 66 | options { 67 | # Automaticaly initialize new devices 68 | autoinit yes; 69 | } 70 | # Default settings for HCI devices 71 | default { 72 | # Local device name 73 | name BlueZ; 74 | # Local device class 75 | class 0x100; 76 | # Default packet type 77 | pkt_type DH1,DM1; 78 | } 79 | # HCI devices with UART interface configured without the use of hciattach 80 | #uart { 81 | # /dev/ttyS0 57600 flow ericsson; 82 | # /dev/ttyS1 57600 flow ericsson; 83 | #} 84 | USB Device 85 | Be sure to have USB support properly installed on your system. Plug in your USB device, check that the 86 | USB stack is loaded (usb-core and uhci or usb-uhci or ohci) and do: 87 | modprobe hci_usb 88 | Devices get initialized when they are plugged in (USB) or on the startup of the deamon (UART). When 89 | configured correctly they should be brought up automatically. Check your kernel and system logs for 90 | error messages. 91 | You can manually bring device up by using the hciconfig command: 92 | hciconfig hci0 up 93 | 94 | 95 | Debugging the BlueZ Driver 96 | 97 | If things go wrong don’t panic but follow these guidelines. 98 | Check  the system log /var/log/messages  the debug output from the BlueZ driver  for dead processes, like hcid  if you are loading the right modules compiled for your current kernel from the right location. 99 | Also please try this: 100 | cvs update get the very latest CVS code 101 | make distclean clean any changes in the code 102 | ./configure --enable-debug enable debug output in the BlueZ driver 103 | make update will make sure that Bluetooth headers in the kernel-tree are uptodate 104 | make 105 | make install install the newly comiled modules and tools 106 | 107 | Does it still hang ? If it does:  reboot  unplug all Bluetooth USB devices (maybe even unplug all data and power connections for a while 108 | if you are using developer hardware)  comment out all uart devices in /etc/hcid.conf  kill hcid (if it was running)  start emulator hciemud localhost:10  start hcid 109 | If you decide to call for help please include the following information in addition to you system logs:  What bluetooth device are you using (Ericsson, Digi, etc.)?  GCC version?  What do you do and when exactly does it hang?  cat /etc/hcid.conf 110 | 111 | 112 | Tools 113 | 114 | hciconfig - HCI device configuration utility 115 | hciconfig hciX [up Open and initialize HCI device 116 | |down Close HCI device 117 | |reset Reset HCI device 118 | |rstat] Reset stat conters 119 | |auth Enable Authentication 120 | |noauth Disable Authentication 121 | |encrypt Enable Encryption 122 | |noencrypt Disable Encryption 123 | |piscan Set page scan and inquiry scan mode 124 | |noscan Disable scan modes 125 | |iscan Set inquiry scan mode only 126 | |pscan Set page scan mode only 127 | |inq [length] Inquiry of devices 128 | |ptype [type] Set packet type 129 | |lm [mode] Get/Set default link mode 130 | |lp [policy] Get/Set default link policy 131 | |conn Show active connections 132 | |features Show features 133 | |name [name] Get/Set local name 134 | |class [class] Get/Set class of device 135 | |version Display version information 136 | To query the current default packet type: 137 | hciconfig hci0 ptype 138 | To set the new packet type: 139 | hciconfig hci0 ptype 140 | hciattach - HCI UART driver initialization utility 141 | hciattach [speed] [flow] 142 | A simple utility that initializes a given serial port. It can be called either manually or from the PCMCIA 143 | cardmgr scripts. It is also working hot-plug for UART based PCMCIA devices. Using this tool you can 144 | add/delete UART devices without restarting HCId. 145 | hciattach ttyS0 xircom 115200 flow 146 | hciattach ttyS1 ericsson 115200 flow 147 | hciattach ttyS2 any 57600 148 | The PCMCIA cardmgr calls it like: 149 | hciattach ttyS1 0x0123,0x4567 150 | l2ping - L2CAP ping 151 | l2ping [-S source addr] [-s size] [-c count] [-f] 152 | l2test - L2CAP testing 153 | l2test [-b bytes] [-P psm] [-I imtu] [-O omtu] [bd_addr] 154 | Modes: -d Dump (server) 155 | -c Reconnect (client) 156 | -m Multiple connects (client) 157 | -r Receive (server) 158 | -s Send (client) 159 | Options: -I Incoming MTU that we accept 160 | -O Minimum outgoing MTU that we need 161 | -b Size of the data chunks in kb 162 | -P Use this PSM 163 | If you have several devices on one box this may be useful: 164 | -S 165 | A simple throughput test using l2test: 166 | Server: l2test -I 2000 -r 167 | Client: l2test -O 2000 -s 168 | scotest - SCO testing 169 | scotest [-b bytes] [bd_addr] 170 | Modes: -d Dump (server) 171 | -c Reconnect (client) 172 | -m Multiple connects (client) 173 | -r Receive (server) 174 | -s Send (client) 175 | 176 | 177 | Additional Tools 178 | 179 | hcidump - HCI packet analyzer 180 | hcidump <-i hciX> [-h] 181 | hcitool - Generic writing and monitoring to the HCI interface 182 | hcitool [-i hciX] OGF OCF param... 183 | where OGF Is the OpCode Group Field (00-3F), 184 | OCF is the OpCode Command Field (0000-03FF), 185 | param... are parameters. 186 | Each parameter is a sequence of bytes. Bytes are entered in hexadecimal form without spaces, most 187 | significant byte first. The size of each parameter is determined based on the number of bytes entered. 188 | An example to do an inquiry using LAP 0x9E8B33 for 10 1.28 sec and unlimited responses is: 189 | hcitool -i hci0 01 0001 33 8b 9e 10 00 190 | and to stop the inquiry: 191 | hcitool -i hci0 01 0002 192 | hciemud - HCI Emulation daemon 193 | hciemud [-n] local_address 194 | 195 | 196 | Tools Examples 197 | 198 | Trace 1: DualPPro SMP machine. 2 Bluetooth devices (Ericsson AppTK) connected via UART. 199 | bluetooth11:/> uname -a 200 | Linux bluetooth11.qualcomm.com 2.4.4 #4 SMP Mon Apr 30 18:55:18 PDT 2001 201 | bluetooth11:/> cat /etc/modules.conf 202 | alias eth0 tlan 203 | alias char-major-108 ppp_async 204 | alias char-major-10-200 tun 205 | # BlueZ 206 | alias net-pf-31 bluez 207 | alias bt-proto-0 l2cap 208 | alias tty-ldisc-14 hci_uart 209 | bluetooth11:/> cat /etc/hcid.conf 210 | # 211 | # HCI daemon configuration file. 212 | # 213 | # $Id: bluezhowto.tex,v 1.5.1.2 2001/11/14 12:03:10 beutel Exp $ 214 | # 215 | # HCI devices with UART interface 216 | uart { 217 | /dev/ttyS0 115200 flow ericsson; 218 | /dev/ttyS1 115200 flow ericsson; 219 | #/dev/ttyS0 57600 flow; 220 | } 221 | bluetooth11:/> lsmod 222 | Module Size Used by 223 | tlan 25056 1 (autoclean) 224 | bluetooth11:/> hcid 225 | bluetooth11:/> hciconfig 226 | hci0: Type: UART 227 | BD Address: 00:D0:B7:03:4B:F0 ACL MTU: 672:10 SCO: MTU 0:0 228 | UP RUNNING NORMAL PSCAN ISCAN 229 | RX bytes:62 acl:0 sco:0 events:7 errors:0 230 | TX bytes:36 acl:0 sco:0 commands:7 errors:0 231 | hci1: Type: UART 232 | BD Address: 00:D0:B7:03:4B:85 ACL MTU: 800:10 SCO: MTU 0:0 233 | UP RUNNING NORMAL PSCAN ISCAN 234 | RX bytes:62 acl:0 sco:0 events:7 errors:0 235 | TX bytes:36 acl:0 sco:0 commands:7 errors:0 236 | bluetooth11:/> lsmod 237 | Module Size Used by 238 | hci_uart 4656 2 (autoclean) 239 | bluez 22544 3 (autoclean) [hci_uart] 240 | bluetooth11:/> l2ping 00:D0:B7:03:4B:85 241 | Ping: 00:D0:B7:03:4B:85 from 00:D0:B7:03:4B:F0 (data size 20) ... 242 | 20 bytes from 00:D0:B7:03:4B:85 id 200 time 48.91ms 243 | 20 bytes from 00:D0:B7:03:4B:85 id 201 time 50.02ms 244 | 2 sent, 2 received, 0% loss 245 | bluetooth11:/usr/src/bluez/tools> ./l2test -r -b 10 -I 2000 & 246 | [1] 22761 247 | l2test[22761]: Waiting for connection on psm 10 ... 248 | bluetooth11:/usr/src/bluez/tools> ./l2test -s 00:D0:B7:03:4B:85 249 | l2test[22763]: Connected [imtu 672, omtu 2000, flush_to 65535] 250 | l2test[22763]: Sending ... 251 | l2test[22764]: Connect from 00:D0:B7:03:4B:F0 [imtu 2000, omtu 672, flush_to 65535] 252 | l2test[22764]: Receiving ... 253 | l2test[22764]: 10240 bytes in 0.01m speed 11.12 kb 254 | l2test[22764]: 10240 bytes in 0.01m speed 11.12 kb 255 | l2test[22764]: 10240 bytes in 0.02m speed 11.00 kb 256 | l2test[22764]: 10240 bytes in 0.01m speed 11.12 kb 257 | l2test[22764]: 10240 bytes in 0.01m speed 11.12 kb 258 | l2test[22764]: 10240 bytes in 0.01m speed 11.12 kb 259 | 260 | l2test[22764]: Read failed. Connection reset by peer(104) 261 | l2test[22764]: Disconnect 262 | bluetooth11:/> lsmod 263 | Module Size Used by 264 | l2cap 17520 0 (autoclean) 265 | hci_uart 4656 2 (autoclean) 266 | bluez 22544 3 (autoclean) [l2cap hci_uart] 267 | tlan 25056 1 (autoclean) 268 | Trace 2: Notebook (Compaq PIII). 1 Bluetooth device (Ericsson AppTK) connected via USB. 269 | btdemo1:˜>lsmod 270 | Module Size Used by 271 | uhci 23040 0 (unused) 272 | eepro100 15984 1 (autoclean) 273 | usbcore 48784 1 [uhci] 274 | btdemo1:˜>modprobe l2cap 275 | btdemo1:˜>lsmod 276 | Module Size Used by 277 | l2cap 15552 0 (unused) 278 | bluez 20624 0 [l2cap] 279 | uhci 23040 0 (unused) 280 | eepro100 15984 1 (autoclean) 281 | usbcore 48784 1 [uhci] 282 | btdemo1:˜>modprobe hci_usb 283 | btdemo1:˜>hciconfig 284 | hci0: Type: USB 285 | BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO: MTU 0:0 286 | DOWN NORMAL 287 | RX bytes:0 acl:0 sco:0 events:0 errors:0 288 | TX bytes:0 acl:0 sco:0 commands:0 errors:0 289 | btdemo1:˜>hciconfig hci0 up 290 | btdemo1:˜>hciconfig 291 | hci0: Type: USB 292 | BD Address: 00:D0:B7:03:4B:3B ACL MTU: 672:10 SCO: MTU 255:255 293 | UP RUNNING NORMAL PSCAN ISCAN 294 | RX bytes:61 acl:0 sco:0 events:8 errors:0 295 | TX bytes:33 acl:0 sco:0 commands:8 errors:0 296 | btdemo1:˜>l2ping aa:aa:aa:aa:aa:aa 297 | Can’t connect.: Host is down 298 | Trace3: Setting packet types on Ericsson AppTK 299 | bluez:/usr/src>hciconfig hci0 300 | hci0: Type: USB 301 | BD Address: 00:D0:B7:03:4B:3D ACL MTU: 672:10 SCO: MTU 255:255 302 | UP RUNNING NORMAL PSCAN ISCAN 303 | RX bytes:55 acl:0 sco:0 events:7 errors:0 304 | TX bytes:29 acl:0 sco:0 commands:7 errors:0 305 | bluez:/usr/src>hciconfig hci0 ptype 306 | hci0: Type: USB 307 | Default packet type: DM1 DM3 DM5 DH1 DH3 DH5 308 | bluez:/usr/src>hciconfig hci0 ptype DH1,DH5 309 | bluez:/usr/src>hciconfig hci0 ptype 310 | hci0: Type: USB 311 | Default packet type: DH1 DH5 -------------------------------------------------------------------------------- /text/btscanner.txt: -------------------------------------------------------------------------------- 1 | Btscanner is much better tool what is like kismet for bluetooth devices. BT scanner search devices and show them on the screen and if you want to see more info about devices you can just hit enter and it shows devices mac address, which bt devices has found it, when it’s found and manufacturer of that found devices (based on first six digits of devices mac address). BT Scanner is a tool designed specifically to extract as much information as possible from a Bluetooth device without the requirement to pair. A detailed information screen extracts HCI and SDP information, and maintains an open connection to monitor the RSSI and link quality. -------------------------------------------------------------------------------- /text/btscanner_example.txt: -------------------------------------------------------------------------------- 1 | BTscanner is an open source tool used for the sniffing and injection of bluetooth packets. 2 | 3 | Btscanner is much better tool what is like kismet for bluetooth devices. BT scanner search devices and show them on the screen and if you want to see more info about devices you can just hit enter and it shows devices mac address, which bt devices has found it, when it’s found and manufacturer of that found devices (based on first six digits of devices mac address). BT Scanner is a tool designed specifically to extract as much information as possible from a Bluetooth device without the requirement to pair. A detailed information screen extracts HCI and SDP information, and maintains an open connection to monitor the RSSI and link quality. 4 | 5 | 6 | Steps to use: 7 | 8 | 1. Start bluetooth process: service bluetooth satrt 9 | 2. Open btScanner: btscanner 10 | 3. Press i to start scanning. 11 | 4. Once scanning, you can look at all the bluetooth modules which are currently talking to the one on your machine, and look at all the bluetooth packets being sent and received, as long as they are in range. 12 | -------------------------------------------------------------------------------- /text/c0f.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]c0f[/b][/size] 2 | 3 | CAN of Fingers (c0f) is lovingly based off of the passive network OS detection tool p0f. c0f is designed to analyze CAN bus traffic and fingerprint the Make and Model. This tool is still very experimental and alpha and is currently being used as a proof of concept. 4 | 5 | Signal IDs 6 | 7 | Signal Intervals 8 | 9 | DLC Size 10 | 11 | Padding values -------------------------------------------------------------------------------- /text/c0f_example.txt: -------------------------------------------------------------------------------- 1 | c0f - CAN Bus passivel Make/Model fingerprint system 2 | 3 | CAN of Fingers (c0f) is lovingly based off of the passive network OS detection tool p0f. c0f is designed to analyze CAN bus traffic and fingerprint the Make and Model. This tool is still very experimental and alpha and is currently being used as a proof of concept. 4 | 5 | Signal IDs 6 | 7 | Signal Intervals 8 | 9 | DLC Size 10 | 11 | Padding values 12 | 13 | Author 14 | 15 | Author 16 | 17 | Craig Smith (craig@theialabs.com) for Open Garages 18 | 19 | Copyright 20 | 21 | Copyright © 2015 Craig Smith 22 | 23 | 24 | 25 | 26 | [b]== Using c0f[/b] 27 | 28 | First you will want to use candump from can-utils (on linux) to record some CAN traffic from 29 | a vehicle that is turned completed on (not just in Auxiliary mode). You will want at least 2000 30 | packets...which should only take a few seconds but more won't hurt anything. Have candump 31 | log this to a file. For instance 32 | 33 | $ candump -l /tmp/mycan.log -n 5000 34 | 35 | now you can run c0f on it to get a fingerprint 36 | 37 | $ bundle exec bin/c0f --logfile /tmp/mycan.log 38 | 39 | This should output some JSON 40 | 41 | ```json 42 | {"Make": "Unknown", "Model": "Unknown", "Year": "Unknown", "Trim": "Unknown", "Dynamic": "true", "Common": [ { "ID": "166" },{ "ID": "158" },{ "ID": "161" },{ "ID": "191" },{ "ID": "18E" },{ "ID": "133" },{ "ID": "136" },{ "ID": "13A" },{ "ID": "13F" },{ "ID": "164" },{ "ID": "17C" },{ "ID": "183" },{ "ID": "143" },{ "ID": "095" } ], "MainID": "143", "MainInterval": "0.009998683195847732"} 43 | ``` 44 | The fingerprint is calculated by a few things: 45 | 46 | * Signal ID 47 | * Signal Intervals 48 | * Dynamic Size DLC 49 | * Padding (if not dynamic) 50 | 51 | Parts of the fingerprint that need explaining are: 52 | 53 | * Common IDs are Signal IDs that repeat a lot on the bus. 54 | * MainID is the most common signal with the highest interval rate 55 | * MainInterval is that rate 56 | 57 | Assuming you know what vehilce you are attached to you can create a file with this JSON 58 | data in it and fill in the Make, Model, etc. Then you can add it to a DB like so: 59 | 60 | ``` 61 | $ bundle exec bin/c0f --add-fp /tmp/fp --fpdb /tmp/candb 62 | Created Tables 63 | Loaded 0 fingerprints from DB 64 | Successfully inserted fingprint (1) 65 | ``` 66 | 67 | Now if you check the logfile against the database it should correctly identify the vehicle 68 | 69 | $ bundle exec bin/c0f --logfile /tmp/mycan.log --fpdb /tmp/candb 70 | 71 | ```json 72 | {"Make": "Honda", "Model": "Civic", "Year": "2009", "Trim": "Hybrid", "Dynamic": "true", "Common": [ { "ID": "166" },{ "ID": "158" },{ "ID": "161" },{ "ID": "191" },{ "ID": "18E" },{ "ID": "133" },{ "ID": "136" },{ "ID": "13A" },{ "ID": "13F" },{ "ID": "164" },{ "ID": "17C" },{ "ID": "183" },{ "ID": "143" },{ "ID": "095" } ], "MainID": "143", "MainInterval": "0.009998683195847732"} 73 | ``` 74 | 75 | == Tests 76 | 77 | You can run some cucumber tests with: 78 | 79 | $ rake features 80 | 81 | Some unit tests also exist 82 | 83 | $ rake test 84 | -------------------------------------------------------------------------------- /text/canbadger.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]CANBadger[/b][/size] 2 | 3 | The CANBadger has been developed to make car hacking easier and faster. At that point of time, existing tools were expensive and a lot of tools turned out to require a lot of configuration or modification. So instead, we wanted to make a cheap, open-source tool that anybody can afford, while enabling new attacks such as Man-in-the-Middle of live CAN traffic and the diagnostics security hijack. Furthermore, we wanted a tool that can run standalone, not yet another interface. The CANBadger consists of both hardware and software. The main interface is a LPC1768/LPC1769 processor mounted on a custom PCB, which offers two CAN interfaces, SD Card, a blinky LED, some GPIO pins, power supply for peripherals and the ethernet port. With the CANBadger Server, you can even control multiple ethernet-connected CANBadgers from your computer. -------------------------------------------------------------------------------- /text/canbadger_example.txt: -------------------------------------------------------------------------------- 1 | CAN Badger, a tool designed to ease the way a vehicle is reversed. It is a hardware tool, not just an interface connected to a PC. 2 | 3 | Like its predecessor, the ECU Tool, the CAN Badger is able to handle the Security in ECUs in an easy way, as well as provide verbose information on what's going on in the buses. Want to learn how to approach vehicle electronics security in a practical way? Come and visit us at Arsenal! 4 | 5 | 6 | 7 | The repository consists of python modules that can be used to create a python file utilizing the tool. An example python program is shown below 8 | 9 | import socket 10 | import struct 11 | import time 12 | 13 | from ethernet_message import * 14 | 15 | NODE_IP = "10.0.0.113" 16 | PORT = 13371 17 | tport = 15555 # we will get msgs from cb after connect here 18 | sock = socket.socket(socket.AF_INET, # Internet 19 | socket.SOCK_DGRAM) # UDP 20 | sock.bind(('0.0.0.0', tport)) 21 | sock.sendto(b'\x04' + b'\x00' + struct.pack(' 20 | ``` 21 | ## Tools 22 | ### unique_ids 23 | This tool will listen on CANBus and print out a list of all unique IDs (upon exit) that were seen as well as an optional count 24 | 25 | #### Options 26 | ```sh 27 | -i: can interface (default vcan0) 28 | --count: print the count of occurences by ID (default false) 29 | ``` 30 | 31 | ### watch_id 32 | A tool for analyzing different messages on a given ID. Messages are printed out to console as they are received and the bytes that differ from a previous message are colored. Useful for identifyinig data boundaries such as a 2 byte RPM value. 33 | 34 | #### Options 35 | ```sh 36 | -i: can interface (default vcan0) 37 | --id: ID to watch (base16). Multiple IDs supported 38 | --color: Color the bytes that have changed sine the previous message. default true 39 | ``` 40 | 41 | ### decode_obdii 42 | Listens on CANBus an prints out OBDII request and replies. OBDII message types are provided according to standard request modes and PIDs (e.g. VIN Request or Engine Speed Request). 43 | 44 | ### canbus_IDS 45 | A very simple IDS for CANBus configurable with JSON. 46 | 47 | Messages that match the provided indicators will be logged to stdout. 48 | 49 | Future versions will allow defining indicators by ctypes structs, ranges, bitmasks, etc in message data. 50 | 51 | #### Example JSON config 52 | ```JSON 53 | [{"id":"0x7DF","severity":"HIGH","logmsg":"Attempted OBDII communication"}] 54 | ``` 55 | 56 | ### fuzz 57 | A tool for fuzzing random data to random IDs. The tool accepts a minimum and maximum setting for range of IDs to fuzz and then sends random data to said ID. 58 | 59 | You may optionally provide a base buffer to mutate upon using the --basebuffer switch and providing a hex string of bytes. The --mutationRate, --mutateIndexMin, and --mutateIndexMax control how often and which bytes to mutate. 60 | 61 | For example, if you wanted to fuzz ID 0x431 with a base buffer of "0011223344556677" and only change the bytes "4455" you would provide a command like 62 | 63 | ```sh 64 | node fuzz.js --min 0x431 --max 0x431 --basebuffer "0011223344556677" --mutateIndexMin 4 --mutateIndexMax 5 65 | ``` 66 | -------------------------------------------------------------------------------- /text/canutils.txt: -------------------------------------------------------------------------------- 1 | [size=24][b]Can-utils[/b][/size] 2 | by [i]ZombieCraig[/i] 3 | 4 | SocketCAN userspace utilities and tools 5 | 6 | CAN is a message-based network protocol designed for vehicles originally initially created by Robert Bosch GmbH. SocketCAN is a set of open source CAN drivers and a networking stack contributed by Volkswagen Research to the Linux kernel. 7 | 8 | This package contains some userspace utilities for Linux SocketCAN subsystem: asc2log, bcmserver, canbusload, can-calc-bit-timing, candump, canfdtest, cangen, cangw, canlogserver, canplayer, cansend, cansniffer, isotpdump, isotprecv, isotpperf, isotpsend, isotpserver, isotpsniffer, isotptun, log2asc, log2long, slcan_attach, slcand and slcanpty. 9 | -------------------------------------------------------------------------------- /text/canutils_example.txt: -------------------------------------------------------------------------------- 1 | Note that these are only basic cases. Please look at the man pages for more details. 2 | 3 | [b]slcand[/b] is a daemon that links a serial interface to a virtual CAN device. 4 | Usage: 5 | sudo slcand -o -c -s0 /dev/ttyACM0 can0 6 | This will bring up a CAN interface called can0 at 10k bus speed (s0-s8, where s8 is 1M bus speed), using the CAN interface driver ttyACM0. 7 | Please note that the driver name may be different and require you to find out what it is first. 8 | 9 | 10 | [b]candump[/b] is a utility that allows the user to look at all the CAN traffic traveling on the network. 11 | Basic Usage: 12 | candump can0 13 | This will show all traffic on the CAN bus in real time 14 | Filtering: 15 | candump can0,0x161:0x7FF 16 | This will show only the messages with ARB ID 161 17 | Saving Output: 18 | candump -l can0 19 | 20 | [b]cansniffer[/b] is a utility that allows the user to filter more reliably through CAN traffic. It can be used side by side with candump. 21 | Basic Usage: 22 | cansniffer -cae can0 23 | This will slowly begin to weed out the ARB ID that do not change, making it easier to spot the ARB IDs that are active. 24 | 25 | [b]cansend[/b] is a utility that allows the user to send a specific CAN message onto the CAN bus. 26 | Basic Usage: 27 | cansend can0 161#1122334455667788 28 | This will send a message on the CAN bus with ARB ID 161 and data of 1122334455667788 (8 bytes) 29 | 30 | [b]cangen[/b] is a utility that allows the user to send a series of messages along the CAN bus. 31 | Basic Usage: 32 | cangen can0 33 | This will continously send random messages on the CAN bus 34 | Specific ID: 35 | cangen can0 -g 4 -I 161 36 | This will continously send CAN messages with ARB ID 161 and random data at 4 millisecond intervals. 37 | 38 | [b]canplayer[/b] is a utility that allows the user to replay logged CAN traffic. Requires output from candump (see Saving Output under candump). 39 | Basic Usage: 40 | canplayer -I [filename] 41 | This will replay the candump data from the log file. Please note that the -l modifier for candump formats the data specifically for playback. -------------------------------------------------------------------------------- /text/canutilsx.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]Can-utils-X[/b][/size] 2 | GUI Based implementation of can-utils by ZombieCraig. Functionally works the same, with GUI of liveplots and active data streams similar to Vehicle Spy 3. 3 | Uses matplotlib. -------------------------------------------------------------------------------- /text/canutilsx_example.txt: -------------------------------------------------------------------------------- 1 | SocketCAN userspace utilities and tools 2 | 3 | This repository contains some userspace utilities for Linux CAN subsystem (aka SocketCAN): 4 | 5 | Basic tools to display, record, generate and replay CAN traffic 6 | 7 | candump : display, filter and log CAN data to files 8 | canplayer : replay CAN logfiles 9 | cansend : send a single frame 10 | cangen : generate (random) CAN traffic 11 | cansniffer : display CAN data content differences (just 11bit CAN IDs) 12 | CAN access via IP sockets 13 | 14 | canlogserver : log CAN frames from a remote/local host 15 | bcmserver : interactive BCM configuration (remote/local) 16 | socketcand : use RAW/BCM/ISO-TP sockets via TCP/IP sockets 17 | CAN in-kernel gateway configuration 18 | 19 | cangw : CAN gateway userpace tool for netlink configuration 20 | CAN bus measurement and testing 21 | 22 | canbusload : calculate and display the CAN busload 23 | can-calc-bit-timing : userspace version of in-kernel bitrate calculation 24 | canfdtest : Full-duplex test program (DUT and host part) 25 | ISO-TP tools ISO15765-2:2016 for Linux 26 | 27 | isotpsend : send a single ISO-TP PDU 28 | isotprecv : receive ISO-TP PDU(s) 29 | isotpsniffer : 'wiretap' ISO-TP PDU(s) 30 | isotpdump : 'wiretap' and interpret CAN messages (CAN_RAW) 31 | isotpserver : IP server for simple TCP/IP <-> ISO 15765-2 bridging (ASCII HEX) 32 | isotpperf : ISO15765-2 protocol performance visualisation 33 | isotptun : create a bi-directional IP tunnel on CAN via ISO-TP 34 | Log file converters 35 | 36 | asc2log : convert ASC logfile to compact CAN frame logfile 37 | log2asc : convert compact CAN frame logfile to ASC logfile 38 | log2long : convert compact CAN frame representation into user readable 39 | Serial Line Discipline configuration (for slcan driver) 40 | 41 | slcan_attach : userspace tool for serial line CAN interface configuration 42 | slcand : daemon for serial line CAN interface configuration 43 | slcanpty : creates a pty for applications using the slcan ASCII protocol 44 | 45 | 46 | While not specific to CANtact, can-utils provides a simple set of tools for working with CAN from the Linux command line. In this article, we'll go over the usage of several tools. Note that can-utils requires SocketCAN, and only works on Linux. 47 | 48 | Installing can-utils 49 | Installation will vary between Linux distributions. 50 | 51 | Ubuntu and Debian 52 | 53 | sudo apt-get install can-utils 54 | 55 | Load Kernel Modules 56 | You will need to ensure your kernel has the CAN modules enabled. This is done with modprobe: 57 | 58 | sudo modprobe can 59 | 60 | To use virtual CAN devices: 61 | 62 | sudo modprobe vcan 63 | 64 | Configuring the Network Interface 65 | Usage of can-utils requires a SocketCAN device. For information on using CANtact with SocketCAN, see the Quick Start Guide. For other devices, refer to the manufacturer's documentation. 66 | 67 | Once the device has been created, it must be enabled using ifconfig. For a device called can0, use the command: 68 | 69 | sudo ifconfig can0 up 70 | 71 | The Utilities 72 | Now that everything is set up, we can start communicating using the utilities in the can-utils package. 73 | 74 | candump 75 | 76 | To listen to traffic on the bus, we can use candump. 77 | 78 | To show all traffic in real time on device can0: 79 | 80 | candump can0 81 | 82 | The displayed messages can be filtered using a mask and identifier. Two filter types are available: 83 | 84 | [can_id]:[can_mask] matches when [received_can_id] & [can_mask] == [can_id] & [mask] 85 | [can_id]~[can_mask] matches when [received_can_id] & [can_mask] != [can_id] & [mask] 86 | 87 | Multiple filters can be combined by separating with commas. 88 | 89 | Examples 90 | 91 | Only show messages with ID 0x123: 92 | candump vcan0,0x123:0x7FF 93 | 94 | Only show messages with ID 0x123 or ID 0x456: 95 | candump vcan0,0x123:0x7FF,0x456:0x7FF 96 | 97 | cansend 98 | 99 | The cansend utility sends a single CAN frame. You will have to specify a device, an identifier and data bytes to send. For example: 100 | 101 | cansend can0 123#1122334455667788 102 | 103 | will send a message on interface can0 with identifier 0x123 and data bytes [0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88]. Note that this tool always assumes values are given in hexidecimal. 104 | 105 | Virtual CAN Devices 106 | Virtual CAN devices, or vcan devices, can be used to send CAN frames around in memory. This is useful for simulation, testing, and bridging. It also lets you try out can-utils without having a hardware CAN device. 107 | 108 | To create a vcan device use: 109 | 110 | sudo ip link add name vcan0 type vcan 111 | 112 | NOTE: If you get the error RTNETLINK answers: Operation not supported, load the module with sudo modprobe vcan and try again. 113 | 114 | Once the device is created, you can use it like any other CAN device. Just replace can0 in the above examples with vcan0. For example: 115 | 116 | sudo ifconfig vcan0 up 117 | cansend vcan0 123#1122334455667788 118 | candump vcan0 119 | -------------------------------------------------------------------------------- /text/caringcaribou.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]Caring Caribou[/b][/size] 2 | 3 | Features and Architecture 4 | 5 | CaringCaribou is module based with a master command (cc.py) that runs the show. The reason for this is to enable an easy drop-in architecture for new modules. 6 | 7 | List of Modules 8 | 9 | dcm.py - Diagnostics ISO 14229 10 | 11 | discovery - ArbID Discovery. Tries to connect (02 10 01) to all possible ArbId (0x000-0x7FF) and collect valid responses (xx 7F or xx 50) 12 | services - Service Discovery. Brute force all Service Id's (SID) and report any responses (anything that is not xx F7 11) 13 | subfunc - Sub-function Discovery. Brute force engine that takes SID and an index indicating which positions to brute force as input. 14 | dtc - Diagnostic Trouble Codes. Fetches DTCs. Can clear DTCs and MIL (Engine Light) as well. 15 | Detailed information on the dcm-module. 16 | 17 | xcp.py - Universal Measurement and Calibration Protocol (XCP) 18 | 19 | discovery - ArbId Discovery. Tries to connect (FF) to all possible ArbId (0x000-0x7FF) and collect all valid responses (FF or FE) 20 | info - XCP Get Basic Information. Connects and gets information about XCP abilities in the target environment 21 | dump - XCP Upload. Used to dump ECU memory (SRAM, flash and bootloader) to file 22 | Detailed information on the xcp-module. 23 | 24 | listener.py - Listener 25 | 26 | ArbId listener - register all ArbIds heard on the CAN bus 27 | Detailed information on the listener-module. 28 | 29 | send.py - Send CAN packets 30 | 31 | Raw message transmission module, used to drive manual test cases 32 | Detailed information on the send-module. 33 | 34 | dump.py - Dump CAN traffic 35 | 36 | Dump incoming traffic to stdout or file. 37 | Detailed information on the dump-module. 38 | 39 | can_actions.py 40 | 41 | This is the daddy of all shared module functionality. Imported by all modules. Provides abstraction for access to the CAN bus, CAN bruteforce engines etc. -------------------------------------------------------------------------------- /text/caringcaribou_example.txt: -------------------------------------------------------------------------------- 1 | How to use 2 | 3 | The best way to understand how to use Caring Caribou is by envoking cc.py's help menu: 4 | python cc.py -h 5 | 6 | Example use 7 | 8 | In this example we have connected a compatible hardware (PiCAN) to our client computer (a Raspberry Pi) and installed the software according to the instructions. 9 | 10 | The PiCAN is then connected to a CAN bus that features one or more ECUs. Since we know very little about the target ECUs, a great start is to do some discovery. Currently three types of discovery is available; dcm discovery, xcp discovery and the listener. 11 | 12 | The listener 13 | 14 | Lets start with the listener: 15 | 16 | cd //tool 17 | 18 | ./cc.py -h 19 | 20 | ./cc.py listener -h 21 | 22 | ./cc.py listener (end the listener with ctrl-C) 23 | 24 | Last ID: 0x002 (total found: 30) 25 | 26 | Detected arbitration IDs: 27 | Arb id 0x001 114 hits 28 | Arb id 0x002 13 hits 29 | 30 | On our system we found two active arbitration IDs - probably sending some important signal/measurement repeatedly. Let's investigate if diagnostics are present on some ECUs. 31 | 32 | Diagnostic discovery 33 | 34 | ./cc.py dcm -h 35 | 36 | ./cc.py dcm discovery -h 37 | 38 | ./cc.py dcm discovery -min 0x003 (no need to do discovery on 0x001 and 0x002) 39 | 40 | Loaded module 'dcm' 41 | 42 | Starting diagnostics service discovery 43 | Sending diagnostics Tester Present to 0x0733 44 | Found diagnostics at arbitration ID 0x0733, reply at 0x0633 45 | 46 | Great! Now we now what arbitration ID to use when we look for services and subfunctions: 47 | 48 | ./cc.py dcm services 0x733 0x633 49 | 50 | This gives us that the service READ_DATA_BY_IDENTIFIER (0x22) is available. 0x22 is typically followed by a two byte parameter ID (PID). The two bytes are in positions 2 and 3 and since we want to try them all we enter both 2 and 3 into the subfunction discovery indices list 51 | 52 | ./cc.py dcm subfunc 0x733 0x633 0x22 2 3 53 | 54 | Loading module 'dcm' 55 | 56 | Starting DCM sub-function discovery 57 | Probing sub-function 0x22 data ['0c', 'ab'] (found: 4) 58 | 59 | Found sub-functions for services 0x22 (READ_DATA_BY_IDENTIFIER) 60 | 61 | Sub-function 01 00 62 | Sub-function 01 01 63 | Sub-function 01 02 64 | Sub-function 02 00 65 | 66 | Terminated by user 67 | 68 | Xcp discovery 69 | 70 | Enough with diagnostics, let's investigate xcp in more or less the same way 71 | 72 | ./cc.py xcp -h 73 | 74 | ./cc.py xcp discovery -h 75 | 76 | ./cc.py xcp discovery -min 0x003 ((no need to do discovery on 0x001 and 0x002) 77 | 78 | Loaded module 'xcp' 79 | 80 | Starting XCP discovery 81 | Sending XCP Connect to 0x03e8 > DECODE CONNECT RESPONSE 82 | 83 | Resource protection status 84 | (...skipping) 85 | 86 | COMM_MODE_BASIC 87 | (...skipping) 88 | 89 | Found XCP at arb ID 0x03e8, reply at 0x03e9 90 | 91 | For XCP you can get more information by running 92 | ./cc.py xcp info 0x3e8 0x3e9 93 | 94 | and you can try to dump parts of the memory by using 95 | ./cc.py xcp dump 0x3e8 0x3e9 0x1f0000000 0x4800 -f bootloader.hex -------------------------------------------------------------------------------- /text/gnuradio.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]GNU Radio[/b][/size] 2 | GNU Radio is a free & open-source software development toolkit that provides signal processing blocks to implement software radios. It can be used with readily-available low-cost external RF hardware to create software-defined radios, or without hardware in a simulation-like environment. It is widely used in hobbyist, academic and commercial environments to support both wireless communications research and real-world radio systems. -------------------------------------------------------------------------------- /text/gnuradio_example.txt: -------------------------------------------------------------------------------- 1 | Best tutorial can be found at this link: https://wiki.gnuradio.org/index.php/Guided_Tutorial_GRC 2 | The following is a guide for using GNU radio in python. https://wiki.gnuradio.org/index.php/Guided_Tutorial_GNU_Radio_in_Python 3 | 4 | 5 | uhd_fft --help 6 | linux; GNU C++ version 4.5.2; Boost_104200; UHD_003.003.000-d5d448e 7 | 8 | Usage: uhd_fft.py [options] 9 | 10 | Options: 11 | -h, --help show this help message and exit 12 | -a ADDRESS, --address=ADDRESS 13 | Address of UHD device, [default=addr=192.168.10.2] 14 | -A ANTENNA, --antenna=ANTENNA 15 | select Rx Antenna where appropriate 16 | -s SAMP_RATE, --samp-rate=SAMP_RATE 17 | set sample rate (bandwidth) [default=1000000.0] 18 | -f FREQ, --freq=FREQ set frequency to FREQ 19 | -g GAIN, --gain=GAIN set gain in dB (default is midpoint) 20 | -W, --waterfall Enable waterfall display 21 | -S, --oscilloscope Enable oscilloscope display 22 | --avg-alpha=AVG_ALPHA 23 | Set fftsink averaging factor, default=[0.1] 24 | --ref-scale=REF_SCALE 25 | Set dBFS=0dB input value, default=[1.0] 26 | --fft-size=FFT_SIZE Set number of FFT bins [default=1024] 27 | -------------------------------------------------------------------------------- /text/gqrx.txt: -------------------------------------------------------------------------------- 1 | Gqrx is an open source software defined radio receiver (SDR) powered by the GNU Radio and the Qt graphical toolkit. 2 | 3 | Gqrx SDR 2.6 with RFSpace Cloud-IQ 4 | 5 | Gqrx supports many of the SDR hardware available, including Airspy, Funcube Dongles, rtl-sdr, HackRF and USRP devices. See supported devices for a complete list. 6 | 7 | Gqrx is free software, licensed under the GNU General Public license allowing anyone to fix and modify it for their use. 8 | 9 | The latest stable version of Gqrx is 2.6, it is available for Linux, FreeBSD, Mac and even the Raspberry Pi, offering the following features: 10 | 11 | Discover devices attached to the computer. 12 | Process I/Q data from the supported devices. 13 | Change frequency, gain and apply various corrections (frequency, I/Q balance). 14 | AM, SSB, CW, FM-N and FM-W (mono and stereo) demodulators. 15 | Special FM mode for NOAA APT. 16 | Variable band pass filter. 17 | AGC, squelch and noise blankers. 18 | FFT plot and waterfall. 19 | Record and playback audio to / from WAV file. 20 | Record and playback raw baseband data. 21 | Spectrum analyzer mode where all signal processing is disabled. 22 | Basic remote control through TCP connection. 23 | Streaming audio output over UDP. -------------------------------------------------------------------------------- /text/gqrx_example.txt: -------------------------------------------------------------------------------- 1 | Installation 2 | In order to use gqrx you will need to install gnuradio and gqrx packages with the following command for Linux Debian: 3 | 4 | $ sudo apt-get install gnuradio gqrx 5 | Once gnuradio and gqrx are installed (above procedure depends on which OS you are using): 6 | 7 | Connect the FunCube Dongle Pro+ receiver to the PC USB-2 port (do not use a USB-3 port as it may not work reliably on all PC). Use an USB extension cable for the connection to the PC to distance the receiver from the PC (hefty source of noise) and minimise the mechanical loads applied to the dongle connectors. 8 | Connect the antenna to the female SMA connector of the FunCube dongle. For HF and VHF, I found it convenient to use 1m of RG-174 coax terminated at one end with a male SMA and a male BNC at the other end such that I can reuse my HF antenna tuning box. 9 | 10 | Starting gqrx 11 | Having the device connected to the PC and the appropriate antenna, open a terminal and launch gqrx with the line command: 12 | $ gqrx 13 | 14 | Using gqrx 15 | Full in-depth guid can be found at http://gqrx.dk/doc/practical-tricks-and-tips -------------------------------------------------------------------------------- /text/installed.txt: -------------------------------------------------------------------------------- 1 | can-utils 2 | wireshark 3 | canbadger 4 | udsim 5 | -------------------------------------------------------------------------------- /text/j1939.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]Can-utils-J1939[/b][/size] 2 | 3 | Version of can-utils for J1939 buses. 4 | 5 | Please use ONLY on vehicles with J1939 Can Buses. This includes trucks and large vehicles. 6 | 7 | https://github.com/wang701/can-utils-j1939 -------------------------------------------------------------------------------- /text/j1939_example.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/text/j1939_example.txt -------------------------------------------------------------------------------- /text/katoolin.txt: -------------------------------------------------------------------------------- 1 | katoolin 2 | 3 | Automatically install all Kali linux tools 4 | 5 | Features 6 | 7 | Add Kali linux repositories 8 | Remove kali linux repositories 9 | Install Kali linux tools -------------------------------------------------------------------------------- /text/katoolin_example.txt: -------------------------------------------------------------------------------- 1 | Usage 2 | 3 | Typing the number of a tool will install it 4 | Typing 0 will install all Kali Linux tools 5 | back : Go back 6 | gohome : Go to the main menu 7 | By installing armitage , you will install metasploit -------------------------------------------------------------------------------- /text/kayak.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]Kayak[/b][/size] 2 | 3 | Kayak is an application for CAN bus diagnosis and monitoring. Its main goals are a simple interface and platform independence. It is implemented in pure Java and has no platform specific dependencies. Kayak is based on SocketCAN and the connection to a SocketCAN bus takes place using TCP/IP and a socketcand server. Therefore the bus access is network transparent and can be shared with multiple users. -------------------------------------------------------------------------------- /text/kayak_example.txt: -------------------------------------------------------------------------------- 1 | View raw data on the bus 2 | 3 | When you have set up your project and all busses you need hit the play icon in the toolbar. Kayak will then start to open connections and in the bottom right corner of the application you can see the current simulation time. 4 | At first you will see no data. Right click on a bus you want to monitor and select Open RAW view. A new window will open showing you the frames that are on the bus. You can do this for all busses you want to watch and change the window layout to your needs. 5 | In a raw view you can: 6 | resort the frames by clicking on a table header 7 | enable a colorized presentation where bytes that change often are highlighted in read 8 | clear the list of all frames 9 | filter for specific IDs either by typing in the filter text field or selecting rows in the table and clicking Filter for selection. Filters can be toggled by the filter checkbox. Note that filtering not only helps you stay on top of things but also reduces the network load because less frames are transmitted. 10 | After closing all views for a bus the connection will be terminated. 11 | Record a log file 12 | 13 | Play a log file 14 | 15 | Kayak handles all log files you place in the Kayak log file folder. After installation this folder is [USER_DIR]/kayak/log/ but you can change it in the settings Every file in the folder named *.log | *.log.gz is displayed in Kayak. You can open the Log files window and browse them sorted by platform. 16 | If you want to play a log file you first have to create a project and add busses. You don't need to connect them to a socketcand becaus local loopback replay is possible. Select the log file and open it. 17 | In the new window you see a list of all busses in the log file. To connect a project bus to a bus in the log file drag it into the log input window. This way you can easily change bus configurations or only connect the busses you are interested in. 18 | After that you are ready to start the replay. Hit play in Kayak, open the bus views you want to watch and hit play in the Log input view to start replay. The bar will move as the log file is playing to indicate the current position. Below you can see the current start and stop time. They may be changed using the Set in and Set out buttons as known from video cut software. If you want the replay to start over at the end check the Infinite replay checkbox. You can pause, stop and play the replay at any time. 19 | View interpreted data 20 | 21 | Bus descriptions are handled the way log files are handled. The default folder is [USER_DIR]/kayak/descriptions/ and all .kcd files placed there are displayed in the Descriptions window. 22 | When you expand a file in this window you see all the bus descriptions a file contains. To load a description drag the bus from the description window to the Description: None node of a bus in you project. After doing this configuration open the Messages window. It contains all messages and signals of busses for which descriptions were loaded. This list can get quite huge so use the Search box if you are looking for a specific item. If you select a message or signal the Properties window shows all the information about this element. 23 | Currently there are two views that can display interpreted data. The first is the Message View. After opening it you can drag signals and messages there and you will see their current value in a tabular. 24 | The second is the Gauge view. Open a gauge view and drag a single signal into it. This view is useful for fast changing values like vehicle speed or engine speed. 25 | 26 | Map view 27 | 28 | To watch GPS signals from a log file on an Open Streetmap map you first need a network definition that contains latitude and longitude signals. Create a new project and connect this description to the bus on which the GPS signal is transmitted. After opening a map view you can drag those signals from the Message View into the corresponding fields of the Map view and the position will be show live on the map. You can move the map around and zoom in or out. Also you can clear the waypoint trail and deactivate following of the current position. 29 | If you are behind a proxy you first need to configure the proxy settings in Kayak to enable automatic tile loading from the Open Streetmap servers. 30 | 31 | 32 | More information is available at http://kayak.2codeornot2code.org/tutorial.html with pictures for help. -------------------------------------------------------------------------------- /text/o2oo.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]O2OO[/b][/size] 2 | 3 | Introduction 4 | 5 | O2OO is a (OBD-II compliant) car diagnostic tool. It reads sensor data from a car into an sqlite database. It can dump the measured values, generate graphs of the data and create a spreadsheetfile (tested with Libre Office and Excel 2010). That way you can analyse the behaviour of your car. O2OO can also produce a PDF-file with more indept data. This program should work with all cars made after 1996 (US) or 2001 (EU). 6 | O2OO can also retrieve the location from a GPS module and store it in the same database. It then can create a Google Maps KML-file, coloring the route-line with a color depending on a sensor-reading. -------------------------------------------------------------------------------- /text/o2oo_example.txt: -------------------------------------------------------------------------------- 1 | O2OO 2 | 3 | Introduction 4 | 5 | O2OO is a (OBD-II compliant) car diagnostic tool. It reads sensor data from a car into an sqlite database. It can dump the measured values, generate graphs of the data and create a spreadsheetfile (tested with Libre Office and Excel 2010). That way you can analyse the behaviour of your car. O2OO can also produce a PDF-file with more indept data. This program should work with all cars made after 1996 (US) or 2001 (EU). 6 | O2OO can also retrieve the location from a GPS module and store it in the same database. It then can create a Google Maps KML-file, coloring the route-line with a color depending on a sensor-reading. 7 | 8 | Also future versions will do some crude analysis of the data as well (got suggestions for that? contact me!) 9 | 10 | For O2OO to run you need an ELM327 adapter (which interfaces the CAN-bus of your vehicle to something a laptop understands enabling it to execute OBD2 commands). For GPS you need, of course a GPS which outputs standard NMEA "sentences" on a serial/usb/etc. port. 11 | 12 | 13 | 14 | For more tutorials, visit https://www.vanheusden.com/O2OO/ 15 | -------------------------------------------------------------------------------- /text/pyobd.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]pyOBD[/b][/size] 2 | 3 | pyOBD (aka pyOBD-II or pyOBD2) is an OBD-II compliant car diagnostic tool. It is designed to interface with low-cost ELM 32x OBD-II diagnostic interfaces such as ELM-USB. It will basically allow you to talk to your car's ECU,... display fault codes, display measured values, read status tests, etc. All cars made since 1996 (in the US) or 2001 (in the EU) must be OBD-II compliant, i.e. they should work with pyOBD. 4 | 5 | pyOBD is written entirely in Python and was originally written by Donour Sizemore, now maintained and improved by SECONS Ltd. and it is Free Software and is distributed under the terms of the GPL. -------------------------------------------------------------------------------- /text/pyobd_example.txt: -------------------------------------------------------------------------------- 1 | In its present state, pyobd2 is largely a library for further development. 2 | There are two command-line programs of interest: 3 | 4 | readiness.py -- queries a vehicle for its emissions inspection readiness; 5 | Checking for readiness requires that the vehicle's engine be running. 6 | Then run this script to see which internal monitors are ready for testing. 7 | 8 | record-all.py -- runs through all of the regression tests and records the 9 | communication sessions, packaging them up into "recorded-data.zip". 10 | To assist in the debugging and development of pyobd2, run this script 11 | and please send the resulting .zip file. 12 | 13 | The above two programs are reasonably useful sample code for using the 14 | pyobd2 library. The general outline of usage is: 15 | 16 | import obd 17 | import obd.message.OBDRequest 18 | 19 | # Find the scan tools attached to the computer and pick one 20 | interfaces = obd.interface.enumerate() 21 | interface = interfaces[0] 22 | 23 | # Open the connection with the vehicle 24 | interface.open() 25 | interface.set_protocol(None) 26 | interface.connect_to_vehicle() 27 | 28 | # Communicate with the vehicle 29 | request = obd.message.OBDRequest(sid=0x01, pid=0x00) 30 | responses = interface.send_request(request) 31 | 32 | # Close the connection 33 | interface.disconnect_from_vehicle() 34 | interface.close() 35 | -------------------------------------------------------------------------------- /text/tio.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/text/tio.txt -------------------------------------------------------------------------------- /text/tio_example.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quic/autopen/5479a0a1f4d5dbcaef35ac26737cb404fdfb0c85/text/tio_example.txt -------------------------------------------------------------------------------- /text/tshark.txt: -------------------------------------------------------------------------------- 1 | TShark is a terminal oriented version of Wireshark designed for capturing and displaying packets when an interactive user interface isn’t necessary or available. It supports the same options as wireshark. For more information on tshark see the manual pages (man tshark). 2 | -------------------------------------------------------------------------------- /text/tshark_example.txt: -------------------------------------------------------------------------------- 1 | TShark (Wireshark) 2.1.0 (v2.1.0rc0-502-g328fbc0 from master) 2 | Dump and analyze network traffic. 3 | See https://www.wireshark.org for more information. 4 | 5 | Usage: tshark [options] ... 6 | 7 | Capture interface: 8 | -i name or idx of interface (def: first non-loopback) 9 | -f packet filter in libpcap filter syntax 10 | -s packet snapshot length (def: 262144) 11 | -p don't capture in promiscuous mode 12 | -I capture in monitor mode, if available 13 | -B size of kernel buffer (def: 2MB) 14 | -y link layer type (def: first appropriate) 15 | -D print list of interfaces and exit 16 | -L print list of link-layer types of iface and exit 17 | 18 | Capture stop conditions: 19 | -c stop after n packets (def: infinite) 20 | -a ... duration:NUM - stop after NUM seconds 21 | filesize:NUM - stop this file after NUM KB 22 | files:NUM - stop after NUM files 23 | Capture output: 24 | -b ... duration:NUM - switch to next file after NUM secs 25 | filesize:NUM - switch to next file after NUM KB 26 | files:NUM - ringbuffer: replace after NUM files 27 | RPCAP options: 28 | -A : use RPCAP password authentication 29 | Input file: 30 | -r set the filename to read from (- to read from stdin) 31 | 32 | Processing: 33 | -2 perform a two-pass analysis 34 | -R packet Read filter in Wireshark display filter syntax 35 | -Y packet displaY filter in Wireshark display filter 36 | syntax 37 | -n disable all name resolutions (def: all enabled) 38 | -N enable specific name resolution(s): "mnNtCd" 39 | -d ==, ... 40 | "Decode As", see the man page for details 41 | Example: tcp.port==8888,http 42 | -H read a list of entries from a hosts file, which will 43 | then be written to a capture file. (Implies -W n) 44 | --disable-protocol 45 | disable dissection of proto_name 46 | --enable-heuristic 47 | enable dissection of heuristic protocol 48 | --disable-heuristic 49 | disable dissection of heuristic protocol 50 | Output: 51 | -w write packets to a pcap-format file named "outfile" 52 | (or to the standard output for "-") 53 | -C start with specified configuration profile 54 | -F set the output file type, default is pcapng 55 | an empty "-F" option will list the file types 56 | -V add output of packet tree (Packet Details) 57 | -O Only show packet details of these protocols, comma 58 | separated 59 | -P print packet summary even when writing to a file 60 | -S the line separator to print between packets 61 | -x add output of hex and ASCII dump (Packet Bytes) 62 | -T pdml|ps|psml|text|fields 63 | format of text output (def: text) 64 | -e field to print if -Tfields selected (e.g. tcp.port, 65 | _ws.col.Info) 66 | this option can be repeated to print multiple fields 67 | -E= set options for output when -Tfields selected: 68 | header=y|n switch headers on and off 69 | separator=/t|/s| select tab, space, printable character as separator 70 | occurrence=f|l|a print first, last or all occurrences of each field 71 | aggregator=,|/s| select comma, space, printable character as 72 | aggregator 73 | quote=d|s|n select double, single, no quotes for values 74 | -t a|ad|d|dd|e|r|u|ud output format of time stamps (def: r: rel. to first) 75 | -u s|hms output format of seconds (def: s: seconds) 76 | -l flush standard output after each packet 77 | -q be more quiet on stdout (e.g. when using statistics) 78 | -Q only log true errors to stderr (quieter than -q) 79 | -g enable group read access on the output file(s) 80 | -W n Save extra information in the file, if supported. 81 | n = write network address resolution information 82 | -X : eXtension options, see the man page for details 83 | -z various statistics, see the man page for details 84 | --capture-comment 85 | add a capture comment to the newly created 86 | output file (only for pcapng) 87 | 88 | Miscellaneous: 89 | -h display this help and exit 90 | -v display version info and exit 91 | -o : ... override preference setting 92 | -K keytab file to use for kerberos decryption 93 | -G [report] dump one of several available reports and exit 94 | default report="fields" 95 | use "-G ?" for more help -------------------------------------------------------------------------------- /text/udsim.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]UDSim[/b][/size] 2 | 3 | Unified Diagnostic Services Simulator 4 | 5 | The UDSim is a graphical simulator that can emulate different modules in a vehicle and respond to UDS request. It was designed as a training tool to run alongside of ICSim. It also has some unqiue learning features and can even be used to security test dealership or other tools that plug into the OBD dongle -------------------------------------------------------------------------------- /text/udsim_example.txt: -------------------------------------------------------------------------------- 1 | Capabilities 2 | 3 | UDSim takes the following command line options: 4 | 5 | Usage: udsim [options] 6 | -c Configuration file for simulator 7 | -l Parse candump log to generate learning DB 8 | -f Fullscreen 9 | -v Increase verbosity 10 | The only required argument is the CAN interface. There are some example CAN initialization scripts in the src folder for setting up canX and vcanX interfaces if you need them. 11 | 12 | UDSim as three modes: Learning, Simulation and Attack 13 | 14 | Learning 15 | 16 | By default UDSim listens for activity on the specified CAN interface and will automatically learn UDS capable modules in the vehicle based on live network traffic. To gather data you should attach a diagnostic device of some sort and run it against your vehicle while UDSim is monitoring the CANbus. 17 | 18 | Press the disk icon to Save the learned information. When you press Save a config file called, config_data.cfg is created. This is a fairly easy to read the summary of UDS Can packets layed out in an INI format. You may want to copy this file and give it a specific name once you saved it so you don't accidently overwrite it. This file can be used later by passing the -c option to UDSim. 19 | 20 | You can get UDSim to learn from recorded network traffic as well. If you feed UDSim a logfile via the -l option, it will parse all of the logging information and then automatically switch to simulation mode once it is done. The logfiles are in candump format. 21 | 22 | Because UDSim uses network communication to learn about modules in the vehicle that can communicate to UDS it does not need any previous knowledge of the vehicle to work. It can work on any vehicle that uses ISO-TP. It has some base knowledge of common UDS but does not rely on it and should work even on new vehicles or with vehicles with non-standard UDS commands. 23 | 24 | Simulation 25 | 26 | Once you are satisfied with that UDSim has learned enough informaion you can press the MODE button to toggle the state to Simulation. At this point UDSim will simulate the vehicle. You can detach UDSim from the actual car and your diagnostic tools should still function and pull informaion as if you were attached to a real car. 27 | 28 | Note for presenters: UDSim works very well for demonstrating attacks without showing the vehicle or device directly. You can record your attack session with UDSim (or any CAN Logger) an once UDSim has monitored the traffic you can save and modify the config file to protect the guilty. Then all you need to bring with you on stage is UDSim and the config file and you can recreate the attack in a live interactive manner. 29 | 30 | Simulation is also good for testing out CAN related tools or providing classes. Please note that simulation mode (in it's current revision) won't make up traffic it has never seen. So don't expect to query information in simulation mode that you it hasn't seen traffic for. 31 | 32 | Simulation Options 33 | 34 | There are two options available on a modules info card: Fake Responses and Ignore. Ignore is fairly self explanatory. If you set a module to ignore then it will not respond to incoming requests. 35 | 36 | Fake Responses uses behavior simular to uds-server in that it will try to create a response to any request even if it hasn't learned how that request works (ie: never seen it before). It does this by using the standard UDS syntax for responses and it will just plug in some default or random values for a response. This is mainly only useful to see what a tool is trying to talk to or if you need a module to use a mix of learned behavior and simulate behavior for any missing UDS requests. 37 | 38 | Attack 39 | 40 | UDSim has a builtin fuzzer. This is a very limited fuzzing system compared to a full blown fuzzing framework. However it can be useful for quick and easy fuzzing of a device and it understands and respects the ISO-TP protocol (unless you don't want it too). 41 | 42 | Attack Options 43 | 44 | The module info card has two options: Fuzz VIN and a Fuzz Level. 45 | 46 | When you are doing fuzzing of a module, it is often good to keep the VIN the VIN from changing. Many automototive tools use just the VIN to decide that they are indeed talking to the expected car. So unless you are testing the VIN inputs of the diagnostic tools, it is usually best to leave this unchecked. 47 | 48 | Fuzz Level. When the bar is to the far left that disables fuzzing and makes the module work in simulation mode. This can be useful if you want some modules to fuzz while others to work properly. This bar was originally designed to work with the fuzzing levels of uds-server but we are currently re-evaluating the fuzzing plan. As it stands here are the levels: 49 | 50 | 0 - No Fuzzing, simulation on 51 | 1 - Fuzz the data portion of a responses 52 | 2 - TBD - Current plan, variable length fuzzing 53 | 3 - TBD 54 | 4 - TBD - Current plan, fuzz even ISO-TP, complete random 55 | For now just use fuzz level 1 or 0. Most likely we will implement level 2 as planned and if there are better ideas for 3 and 4, let us know. For more complex fuzzing you should use Peach Fuzzer. 56 | 57 | Peach Fuzzer 58 | 59 | During the original design of UDSim it was going to use a built-in fuzzing system much like the uds-server predecessor. However, it was later decided that it would be better to offload fuzzing to a more complete engine. For this reason we have decided to export the learned information to another open source utility, Peach Fuzzer. There are still widgets in the UI for fuzzing that currently do not do anything. This is because we are still deciding if this is the correct approach. We may use the slider to change how Peach is fuzzing or we may scrap Peach altogether. 60 | 61 | The purpose of UDSim attack mode is to fuzz responses from the (simulated) vehicle. This is very useful in testing for vulnerabilities in dealership tools and in security auditing tools. We want to make UDSim easy to use but also allow the flexibility a research will need to dive in deeper in their research. 62 | 63 | Peach XML files are saved to fuzz_can.xml and can be further modified for your own testing purposes. 64 | 65 | For now consider the Attack mode very alpha. 66 | 67 | NOTE: There is currently a bug with Mono for the CAN publisher. In the mono source for UnixSocket, Mono has a feature that can check if the socket is writable. It does this by writing a 0 byte frame to the socket. This causes an error on a CAN socket which in turn makes Mono mark the socket as unwritable by setting a flag. Even if you later send a valid frame length, Mono will not even try to write the packet because of this flag. 68 | 69 | Issue is here: https://github.com/mono/mono/blob/master/mcs/class/Mono.Posix/Mono.Unix/UnixStream.cs#L63 70 | 71 | long write = Native.Syscall.write (fileDescriptor, IntPtr.Zero, 0); 72 | if (write != -1) 73 | canWrite = true; 74 | There are a few ways to work around this. We can wriate a different publisher that uses socketcand or a even more hacked up version that calls out to can-utils. 75 | 76 | I'm looking for some peach fuzzing experts to pitch in some feedback on the best direction to go with this. Until this the fuzz_can.xml is in a hold state until we know what type of data would be easiest for the publisher to digest. 77 | 78 | Source: https://github.com/zombieCraig/UDSim -------------------------------------------------------------------------------- /text/wireshark.txt: -------------------------------------------------------------------------------- 1 | [size=32][b]Wireshark[/b][/size] 2 | Wireshark is a free and open source packet analyzer. It is used for network troubleshooting, analysis, software and communications protocol development, and education. 3 | Wireshark is cross-platform, using the Qt widget toolkit in current releases to implement its user interface, and using pcap to capture packets; it runs on Linux, macOS, BSD, Solaris, some other Unix-like operating systems, and Microsoft Windows. -------------------------------------------------------------------------------- /text/wireshark_example.txt: -------------------------------------------------------------------------------- 1 | Once the wireshark GUI has opened, you’ll see that the dashboard has a left column box called ‘Interface List’. This list lets you know which devices and capture cards you can use. At the top of the application there is an option called ‘Capture Options’ which is exactly that, it allows you to modify and tweak how you would like to capture the packets of data that are being transmitted over your network -------------------------------------------------------------------------------- /tools.py: -------------------------------------------------------------------------------- 1 | ''' 2 | 3 | #Reference Links for me, might remove later we'll see how life goes 4 | can-utils : https://discuss.cantact.io/t/using-can-utils/24 (eric evenchick) 5 | canbus-utils : http://www.digitalbond.com/blog/2015/03/05/tool-release-digital-bond-canbus-utils/ 6 | NPM: http://blog.teamtreehouse.com/install-node-js-npm-linux 7 | NPM2: http://www.hostingadvice.com/how-to/install-nodejs-ubuntu-14-04/#node-version-manager (May 2016) 8 | 9 | TO DO: 10 | BACK-END: 11 | EXCEPTIONS: 12 | if repo has already been cloned, want it to continue with installation script 13 | if something fails to install. pass and skip the rest !! 14 | SMALL CHANGES: 15 | fix udsim code to print the correct library names 16 | caringcaribou hasn't been tested/not confirmed if install works because need to test it with socketCAN 17 | 18 | FRONT-END: 19 | ADD: 20 | highlight the buttons that are already installed, maybe gray out and make italics 21 | 22 | TEST: 23 | test caring caribou because a device needs to be set up to use it 24 | 25 | TO TELL USER: 26 | Note: 27 | can either clone our repo (this will probably still update github) or download the zip file and we will install git 28 | Make sure the user knows that this will all be cloned in the current directory aka most likely ~/Documents/autopen/ 29 | Note: 30 | ROMRAIDER: SUBARU - THIS IS NOT WORKING, INVALID OR CORRUPT .JAR 31 | Warning: RomRaider is intended for use only by experienced tuners who understand the consequences. As with any tuning solution, the potential 32 | for engine damage is very high when altering your ECUs hard coded values. The use of appropriate equipment (ie, knock sensor, wideband oxygen 33 | sensor) is extremely important. By downloading RomRaider, you agree to assume all risks and accept its license. Use at your own risk. 34 | Note: 35 | ELM327: 36 | Be forewarned that the ELM327 has limited buffer space, so you will lose packets when sniffing, 37 | and transmission can be a bit imprecise, but if you're in a pinch this is the cheapest route. 38 | 39 | TOOLS MAY BE INCLUDED: 40 | CANIBUS FOR ELM327: 41 | (go-server) 42 | CANTACT: 43 | will provide a section in here with the github link and the website link so that the user can build their own 44 | Also, will possibly provide steps on how to do so (will learn how to do this first) 45 | METASPLOIT HARDWARE BRIDGE 46 | AVRDUDESS: 47 | (this one not sure if im going to install yet) 48 | 49 | ''' 50 | 51 | import general_use 52 | import dependencies 53 | import subprocess 54 | import os 55 | import uninstall 56 | 57 | link_pyobd_debian = 'http://www.obdtester.com/download/pyobd_0.9.3_all.deb' 58 | link_pyserial = 'https://sourceforge.net/projects/pyserial/files/pyserial/2.0/pyserial-2.0.zip/download' 59 | link_pythoncan = 'https://bitbucket.org/hardbyte/python-can/get/77eea796362b.zip' 60 | link_package = 'https://pkgconfig.freedesktop.org/releases/pkg-config-0.21.tar.gz' #needed for bluelog 61 | 62 | def github_tools(pack_man, toolname, repo): 63 | ''' 64 | This function installs the tools that use github 65 | rc stands for returncode 66 | ''' 67 | general_use.update(pack_man) 68 | f_rc = -1 69 | it = open('installed.txt', 'a') 70 | 71 | print ("Cloning repository...") 72 | 73 | try: 74 | remove = uninstall.uninstall(toolname) 75 | except: 76 | pass 77 | 78 | git_rc = dependencies.clone_git_repo(repo) 79 | if git_rc != 0: 80 | print ('CLONING FAILED: Failed to clone repository at', repo) 81 | print ('ERROR CODE:', git_rc) 82 | else: 83 | print ('CLONING SUCCESSFUL: Successfully cloned repository at', repo) 84 | 85 | back_index = repo.rfind('/') 86 | dot_index = repo.rfind('.') 87 | folder_name = repo[back_index:dot_index] 88 | print ('Changing directory to', folder_name[1:], '...') 89 | os.chdir(os.getcwd() + folder_name) 90 | 91 | if toolname == 'canbus-utils': 92 | print ('Beginning canbus-utils installation...') 93 | npm_check_rc = dependencies.check_NPM(pack_man) 94 | if npm_check_rc != 0: 95 | print ('INSTALLATION FAILED: Failed to install canbus-utils dependencies. Check node.js and npm status') 96 | print ('ERROR CODE:', npm_check_rc) 97 | else: 98 | print ('INSTALLATION SUCCESSFUL: Successfully installed node.js and npm') 99 | print ('Installing canbus-utils...') 100 | f_rc = subprocess.run(['npm', 'install']).returncode 101 | if f_rc != 0: 102 | print ('INSTALLATION FAILED: Failed to run "npm install". Cannot complete canbus-utils installation') 103 | print ('ERROR CODE:', f_rc) 104 | else: 105 | print ('INSTALLATION SUCCESSFUL: Successfully installed canbus-utils') 106 | 107 | elif toolname == 'Kayak': 108 | print ('Beginning kayak installation...') 109 | check_maven_rc = dependencies.commandline_install(pack_man, 'maven') 110 | if check_maven_rc != 0: 111 | print ('INSTALLATION FAILED: Failed to install maven. Cannot complete kayak installation') 112 | print ('ERROR CODE:', check_maven_rc) 113 | else: 114 | print ('Installing jdk...') 115 | jdk_rc = dependencies.commandline_install(pack_man, 'default-jdk') 116 | if jdk_rc != 0: 117 | print ('INSTALLATION FAILED: Failed to install jdk. This compiler is needed to run mvn clean. Cannot complete kayak installation') 118 | else: 119 | ('Installing kayak...') 120 | f_rc = (subprocess.run(['mvn', 'clean', 'package'])).returncode 121 | if f_rc != 0: 122 | print ('INSTALLATION FAILED: Failed to run "mvn clean package". Cannot complete kayak installation') 123 | print ('ERROR CODE:', f_rc) 124 | else: 125 | print ('INSTALLATION SUCCESSFUL: Successfully installed kayak') 126 | 127 | elif toolname == 'caringcaribou': 128 | print ('Beginning caringcaribou installation...') 129 | print ('Setting up usb-to-can connection...') 130 | load_rc = subprocess.run(['sudo', 'modprobe', 'can']).returncode 131 | if load_rc != 0: 132 | print ('LOAD FAILED: Failed to load CAN module. Cannot complete caringcaribou installation') 133 | print ('ERROR CODE:', load_rc) 134 | else: 135 | print ('LOAD SUCCESSFUL: Successfully loaded CAN module') 136 | 137 | #user needs to know the CAN bus they are on (change can_bus) 138 | #user needs to know the bitrate that the bus runs with (change bitrate) 139 | #add front-end functionality later so that the user can input it from there vs. modifying the code 140 | 141 | can_bus = 'can0' 142 | bitrate = 500000 143 | print ('Setting up CAN device...') 144 | setup_can_rc = subprocess.run(['sudo', 'ip', 'link', 'set', can_bus, 'up', 'type', 'can', 'bitrate', str(bitrate)]).returncode 145 | if setup_can_rc != 0: 146 | print ('SETUP FAILED: Failed to set-up can device.') 147 | print ('ERROR CODE:', setup_can_rc) 148 | else: 149 | print ('SETUP SUCCESSFUL: Successfully set-up can device. This will now display as a normal network interface as can0') 150 | pcan_rc = dependencies.download_install(link_pythoncan) 151 | if pcan_rc != 0: 152 | print ('DOWNLOAD FAILED: Failed to download pythoncan from', link_pythoncan, 'Cannot complete caringcaribou installation') 153 | print ('ERROR CODE:', pcan_rc) 154 | else: 155 | print ('DOWNLOAD SUCCESSFUL: Successfully downloaded pythoncan from', link_pythoncan) 156 | f_rc = subprocess.run(['sudo', 'python', 'setup.py', 'install']).returncode 157 | if f_rc != 0: 158 | print ('DOWNLOAD SUCCESSFUL: Failed to install python-can. Cannot complete caringcaribou installation') 159 | print ('ERROR CODE:', f_rc) 160 | else: 161 | print ('INSTALLATION SUCCESSFUL: Successfully installed python-can. Caringcaribou installation complete') 162 | 163 | 164 | elif toolname == 'c0f': 165 | print ('Beginning c0f installation') 166 | print ('Installing gem...') 167 | gem_rc = dependencies.commandline_install(pack_man, 'rubygems') 168 | if gem_rc != 0: 169 | print ('INSTALLATION FAILED: Failed to install gem. Cannot complete c0f installation') 170 | print ('ERROR CODE:', gem_rc) 171 | else: 172 | print ('INSTALLATION SUCCESSFUL: Successfully installed gem') 173 | headers_rc = dependencies.commandline_install(pack_man, 'ruby-dev') 174 | if headers_rc != 0: 175 | print ('INSTALLATION FAILED: Failed to install header files for ruby. Cannot complete c0f installation') 176 | print ('ERROR CODE:', headers_rc) 177 | else: 178 | print ('INSTALLATION SUCCESSFUL: Successfully installed header files for ruby') 179 | print ('Installing sqlite3 library...') 180 | sql_rc = dependencies.commandline_install(pack_man, "libsqlite3-dev") 181 | if sql_rc != 0: 182 | print ('INSTALLATION FAILED: Failed to install sqlite3 library') 183 | print ('ERROR CODE:'. sql_rc) 184 | else: 185 | print ('INSTALLATION SUCCESSFUL: Successfully installed sqlite3') 186 | print ('Installing c0f...') 187 | f_rc = subprocess.run(['sudo', 'gem', 'install', 'c0f']).returncode 188 | if f_rc != 0: 189 | print ('INSTALLATION FAILED: Failed to install c0f.') 190 | print ('ERROR CODE:', f_rc) 191 | else: 192 | print ('INSTALLATION SUCCESSFUL: Successfully installed c0f') 193 | 194 | elif toolname == 'udsim': 195 | print ('Beginning udsim installation...') 196 | f_rc = 0 197 | 198 | ttf_dev = dependencies.commandline_install(pack_man, 'libsdl2-ttf-dev') 199 | image = dependencies.commandline_install(pack_man, 'libsdl2-image-2.0.0') 200 | returncode_list = [ttf_dev, image] 201 | lib_names = ['ttf-dev', 'image'] 202 | for i, j in enumerate(returncode_list): 203 | if j != 0: 204 | f_rc = -1 205 | print ('INSTALLATION FAILED: Could not install library libsdl2-', lib_names[i]) 206 | print ('ERROR CODE:', j) 207 | else: 208 | print ('INSTALLATION SUCCESSFUL: Successfully installed library libsdl2-', i) 209 | if f_rc != 0: 210 | print ('INSTALLATION FAILED: Failed to install libraries needed to compile UDSIM. Cannot complete udsim installation') 211 | print ('ERROR CODE:', f_rc) 212 | else: 213 | print ('INSTALLATION COMPLETE: Successfully installed the libraries needed to compile UDSIM.') 214 | 215 | 216 | elif toolname == 'Bluelog': #has an optional web mode so when running want to add that functionality. (just run make to run) 217 | print ('Installing bluelog...') 218 | f_rc = subprocess.run(['sudo', 'make', 'install']).returncode 219 | if f_rc != 0: 220 | print ('INSTALLATION FAILED: Failed to install bluelog') 221 | print ('ERROR CODE:', f_rc) 222 | else: 223 | print ('INSTALLATION SUCCESSFUL: Successfully installed bluelog') 224 | it.write('bluelog') 225 | elif toolname == 'bluemaho': 226 | print ('Beginning bluemaho installation...') 227 | print ('Installing bluemaho dependencies...') 228 | wxpython = dependencies.commandline_install(pack_man, 'python-wxgtk3.0') 229 | bluez = dependencies.commandline_install(pack_man, 'bluez') 230 | config = dependencies.download_install(link_package) 231 | #lightblue = dependencies.install_lightblue(pack_man) ---> issue installing this one so need to figure this out 232 | 233 | depend = ['libopenobex2-dev', 'libxml2', 'libxml2-dev', 'libusb-dev'] 234 | returncodes = [dependencies.commandline_install(pack_man, i) for i in depend] 235 | #depend.append('lightblue') 236 | depend.append('wxpython') #appends the name of the dependencies and returncodes to appropriate lists to have one list of 237 | depend.append('bluez') 238 | depend.append('config') 239 | #returncodes.append(lightblue) 240 | returncodes.append(wxpython) 241 | returncodes.append(bluez) 242 | returncodes.append(config) 243 | 244 | essential = 0 245 | 246 | for i,j in enumerate(returncodes): 247 | if j != 0: 248 | if i < 7: 249 | print ('INSTALLATION FAILED: Failed to install dependency', depend[i], '. This may remove the ability to run a specific attack using Bluemaho. Please refer to the github repo') 250 | print ('ERROR CODE:', j) 251 | essential = j 252 | else: 253 | print ('INSTALLATION FAILED: Failed to install dependency', depend[i]) 254 | essential = -1 255 | 256 | if essential != 0: 257 | print ('INSTALLATION FAILED: Failed to install all Bluemaho dependencies') 258 | else: 259 | print ('INSTALLATION SUCCESSFUL: Successfully installed all dependencies for Bluemaho') 260 | print ('Building Bluemaho...') 261 | c_dir = os.getcwd() 262 | path = c_dir + '/config' 263 | os.chdir(path) 264 | f_rc = subprocess.run(['./build.sh']).returncode 265 | if f_rc != 0: 266 | print ('BUILD FAILED: Failed to build and complete installation of Bluemaho') 267 | print ('ERROR CODE:', f_rc) 268 | else: 269 | print ('BUILD SUCCESSFUL: Successfully completed Bluemaho build') 270 | general_use.move_up_directory() 271 | 272 | elif toolname == 'katoolin': 273 | cp_rc = subprocess.run(['sudo', 'cp', 'katoolin.py', '/usr/bin/katoolin']).returncode 274 | if cp_rc != 0: 275 | print ('COPY FAILED: Could not copy katoolin.py to /usr/bin/katoolin') 276 | print ('ERROR CODE:', cp_rc) 277 | else: 278 | print ('COPY SUCCESSFUL: Successfully copied katoolin.py to /usr/bin/katoolin') 279 | print ("Setting /usr/bin/katoolin to executable...") 280 | f_rc = subprocess.run(["sudo", "chmod", "+x", "/usr/bin/katoolin"]).returncode #executable script for both you and your group but not for the world. 281 | if f_rc != 0: 282 | print ("CONVERSION FAILED: Could not make /usr/bin/katoolin executable") 283 | print ("ERROR CODE:", f_rc) 284 | else: 285 | print ("CONVERSION SUCCESSFUL: /usr/bin/katoolin set to executable") 286 | print ('INSTALLATION SUCCESSFUL: Successfully installed katoolin') 287 | 288 | elif toolname == 'j1939': 289 | f_rc = subprocess.run(['make']).returncode 290 | if f_rc != 0: 291 | print ('INSTALLATION FAILED: Failed to install can-utils-j1939. Could not run create executables running make') 292 | print ('ERROR CODE:', f_rc) 293 | else: 294 | print ('INSTALLATION SUCCESSFUL: Successfully installed can-utils-j1939') 295 | 296 | elif toolname == 'canbadger-hw': 297 | f_rc = 0 298 | print ('REPOSITORY AVAILABLE: The CANBadger repository has been cloned to your machine') 299 | print ('If you need help, refer to the tutorial on the right side of the tool page to build the hardware') 300 | 301 | elif toolname == 'canbadger-sw': 302 | print ('here1') 303 | libs = ['python-qt4', 'pyqt4-dev-tools', 'qtcreator'] 304 | rcs = [dependencies.commandline_install(pack_man, i) for i in libs] 305 | 306 | print ('here2') 307 | for i,j in enumerate(rcs): 308 | if j != 0: 309 | print ('here3') 310 | if i < 3: 311 | print ('here4') 312 | print ('INSTALLATION SUCCESSFUL: Failed to install dependency', libs[i], '. This may remove the ability to run a specific attack using Bluemaho. Please refer to the github repo') 313 | print ('ERROR CODE:', j) 314 | f_rc = j 315 | else: 316 | print ('here5') 317 | print ('INSTALLATION FAILED: Failed to install dependency', libs[i]) 318 | f_rc = -1 319 | 320 | if f_rc != 0: 321 | print ('here6') 322 | print ('INSTALLATION FAILED: Failed to install canbadger-server dependencies') 323 | print ('ERROR CODE:', f_rc) 324 | else: 325 | print ('here7') 326 | print ('INSTALLATION SUCCESSFUL: Successfully installed all dependencies for canbadger-server') 327 | 328 | 329 | 330 | #changes back to /autopen --> writes to installed.txt if the tool has been installed successfully 331 | general_use.move_up_directory() 332 | if f_rc == 0: 333 | it.write(toolname) 334 | it.write('\n') 335 | it.close() 336 | return f_rc 337 | 338 | def downloaded_tools(pack_man, toolname, link): #WxPython and some other library 339 | ''' 340 | This function installs tools that are found on the internet by using the curl command 341 | ''' 342 | 343 | general_use.update(pack_man) 344 | d = general_use.check_distribution() 345 | f_rc = -1 346 | it = open('installed.txt', 'a') 347 | 348 | #NOTE: If pyOBD link doesn't work, the install.html is available 349 | down_rc = dependencies.download_install(link) 350 | if down_rc != 0: 351 | print ('DOWNLOAD FAILED: Failed to download file for', toolname, 'using download link:', link) 352 | print ('ERROR CODE:', down_rc) 353 | else: 354 | print ('DOWNLOAD SUCCESSFUL: Successfully downloaded file for', toolname) 355 | 356 | if toolname == 'pyobd': #not 100% sure this is going to work (pyserial = 2.0, wxpython = 2.4, doesnt work with 2.5) 357 | print ('Beginning pyobd installation...') 358 | if d == 'debian': 359 | deb_rc = dependencies.download_install(link_pyobd_debian) 360 | if deb_rc != 0: 361 | print ('Download Failed: Failed to download debian specific file') 362 | print ('Installing pyserial...') 363 | pyserial_rc = subprocess.run(['python3', '-m', 'pip', 'install', 'pyserial']).returncode 364 | if pyserial_rc != 0: 365 | print ('INSTALLATION FAILED: Failed to install pyserial. Cannot complete pyobd installation') 366 | print ('ERROR CODE:', pyserial_rc) 367 | else: 368 | print ('INSTALLATION SUCCESSFUL: Successfully installed pyserial') 369 | print ('Installing WxPython version 3.0...') 370 | wx_rc = dependencies.commandline_install(pack_man, 'python-wxgtk3.0') 371 | if wx_rc != 0: 372 | print ('INSTALLATION FAILED: Failed to install python-wxgtk3.0. Cannot complete pyobd installation') 373 | print ('ERROR CODE:', wx_rc) 374 | else: 375 | print ('INSTALLATION SUCCESSFUL: Successfully installed python-wxgtk3') 376 | print ('Extracting pyobd...') 377 | ext_rc = subprocess.run(['tar', '-xzvf', 'pyobd_0.9.3.tar.gz']).returncode 378 | if ext_rc != 0: 379 | print ('EXTRACTION FAILED: Failed to decompress pyobd tar file') 380 | print ('ERROR CODE:', ext_rc) 381 | else: 382 | print ('EXTRACTION SUCCESSFUL: Successfully decompressed tar file. Successfully installed pyobd') 383 | print ('Removing .tar.gz file...') 384 | f_rc = subprocess.run(['rm', '-rf', 'pyobd_0.9.3.tar.gz']).returncode 385 | if f_rc != 0: 386 | print ('REMOVAL FAILED: Failed to remove pyobd tar.gz file') 387 | print ('ERROR CODE', f_rc) 388 | else: 389 | print ('REMOVAL SUCCESSFUL: Successfully removed pyobd tar.gz file') 390 | 391 | elif toolname == 'o2oo': 392 | print ('Beginning o2oo installation...') 393 | extract_rc = subprocess.run(['tar', '-xzvf', 'O2OO-0.9.tgz']).returncode 394 | if extract_rc != 0: 395 | print ('EXTRACTION FAILED: Failed to decompress the o2oo tar file') 396 | print ('ERROR CODE:', extract_rc) 397 | else: 398 | print ('EXTRACTION SUCCESSFUL: Successfully extracted o2oo tar file.') 399 | print ('Installing o2oo dependencies...') 400 | 401 | l = ['libncurses-dev', 'libsqlite3-dev', 'libgps-dev', 'libgd2-xpm-dev', 'libhpdf-dev', 'libtinyxml2-dev', 'libcurl4-openssl-dev', 'libfftw3-dev'] 402 | rc = [dependencies.commandline_install(pack_man, i) for i in l] 403 | 404 | ins = 0 405 | 406 | for i,j in enumerate(rc): 407 | if j != 0: 408 | print ('INSTALLATION FAILED: Failed to install dependency', l[i], '. This may remove the ability to run a specific attack using Bluemaho. Please refer to the github repo') 409 | print ('ERROR CODE:', j) 410 | ins = j 411 | 412 | if ins != 0: 413 | print ('INSTALLATION FAILED: Failed to install o2oo dependencies') 414 | else: 415 | print ('INSTALLATION SUCCESSFUL: Successfully installed all dependencies for o2oo') 416 | current = os.getcwd() 417 | p = current + '/O2OO-0.9' 418 | os.chdir(p) 419 | mak_rc = subprocess.run(['sudo', 'make', 'install']).returncode 420 | if mak_rc != 0: 421 | print ('BUILD FAILED: Failed to build o2oo') 422 | print ('ERROR CODE:', mak_rc) 423 | else: 424 | print ('BUILD SUCCESSFUL: Successfully built o2oo and installed') 425 | print ('Removing .tgz file...') 426 | f_rc = subprocess.run(['rm', '-rf', 'O2OO-0.9.tgz']).returncode 427 | if f_rc != 0: 428 | print ('REMOVAL FAILED: Failed to remove o2oo .tgz file') 429 | print ('ERROR CODE', f_rc) 430 | else: 431 | print ('REMOVAL SUCCESSFUL: Successfully removed o2oo .tgz file') 432 | general_use.move_up_directory() 433 | 434 | elif toolname == 'romraider': 435 | print ('Beginning romraider installation...') 436 | f_rc = dependencies.download_install(link) 437 | if f_rc != 0: 438 | print ('INSTALLATION FAILED: Failed to install RomRaiders.') 439 | print ('ERROR CODE:', f_rc) 440 | else: 441 | print ('INSTALLATION SUCCESSFUL: Successfully installed RomRaiders') 442 | 443 | if f_rc == 0: 444 | it.write(toolname) 445 | it.write('\n') 446 | it.close() 447 | return f_rc 448 | 449 | def installed_tools(pack_man, toolname): 450 | ''' 451 | This function installs tools that are apt-getable / yumable 452 | ''' 453 | 454 | general_use.update(pack_man) 455 | 456 | install_rc = -1 457 | it = open('installed.txt', 'a') 458 | 459 | if toolname == 'btscanner': 460 | print ('Beginning btscanner installation...') 461 | install_rc = dependencies.commandline_install(pack_man, 'btscanner') 462 | elif toolname == 'gnuradio': 463 | print ('Beginning gnuradio installation...') 464 | install_rc = dependencies.commandline_install(pack_man, 'gnuradio') 465 | elif toolname == 'aircrack-ng': 466 | print ('Beginning aircrack-ng installation...') 467 | install_rc = dependencies.commandline_install(pack_man, 'aircrack-ng') 468 | elif toolname == 'wireshark': 469 | print ('Beginning wireshark installation...') 470 | install_rc = dependencies.commandline_install(pack_man, 'wireshark') 471 | elif toolname == 'can-utils': 472 | print ('Beginning can-utils installation...') 473 | install_rc = dependencies.commandline_install(pack_man, 'can-utils') 474 | elif toolname == 'tshark': 475 | print ('Beginning tshark installation...') 476 | install_rc = dependencies.commandline_install(pack_man, 'tshark') 477 | elif toolname == 'gqrx': 478 | print ('Beginning gqrx installation...') 479 | install_rc = dependencies.commandline_install(pack_man, 'gqrx-sdr') 480 | 481 | if install_rc != 0: 482 | print ('INSTALLATION FAILED: Failed to install', toolname) 483 | print ('ERROR CODE:', install_rc) 484 | else: 485 | print ('INSTALLATION SUCCESSFUL: Successfully installed', toolname) 486 | if toolname == 'gnuradio': 487 | dep_rc = dependencies.commandline_install(pack_man, 'gr-osmosdr') 488 | if dep_rc != 0: 489 | print ('INSTALLATION FAILED: Failed to install gr-osmosdr dependency. gnuradio may not have certain features') 490 | print ('ERROR CODE:', dep_rc) 491 | else: 492 | print ('INSTALLATION SUCCESSFUL: Successfully installed gr-osmosdr dependency for gnuradio') 493 | elif toolname == 'gqrx': 494 | dep_rc = dependencies.commandline_install(pack_man, 'libvolk1-bin') 495 | if dep_rc != 0: 496 | print ('INSTALLATION FAILED: Failed to install libvolk1-bin. gqrx will still work as expected') 497 | print ('libvolk1-bin is a tool that optimizes GNU Radio performance') 498 | else: 499 | print ('INSTALLATION SUCCESSFUL: Successfully installed libvolk1-bin. This optimizes gqrx usage') 500 | run_rc = subprocess.run(['volk_profile']).returncode 501 | if run_rc != 0: 502 | print ('RUN FAILED: Failed to run volk_profile to complete gqrx usage optimization') 503 | print ('gqrx will still run as expected') 504 | print ('ERROR CODE:', run_rc) 505 | else: 506 | print ('RUN SUCCESSFUL: Successfully ran volk_profile. gqrx optimization complete') 507 | elif toolname == 'can-utils': 508 | print ('Ensuring CAN modules are enabled...') 509 | f_rc = subprocess.run(['sudo', 'modprobe', 'can']).returncode #not sure if going to keep this yet mainly cuz might not be necessary, also need to check if redhat has modprobe, it should but need to check (also just check generally if other linux has this already installed) 510 | if f_rc != 0: 511 | print ('CHECK FAILED: Failed to add a LKM to the kernel. Can-utils may not be fully functional') 512 | print ('ERROR CODE:', f_rc) 513 | else: 514 | print ('CHECK SUCCESSFUL: Successfully added a LKM to the kernel') 515 | 516 | 517 | #don't necessarily need to not include in list of installed tools, just might want to list that the libraries were not installed. (log.txt file) 518 | if install_rc == 0: 519 | it.write(toolname) 520 | it.write('\n') 521 | it.close() 522 | return install_rc 523 | 524 | 525 | 526 | -------------------------------------------------------------------------------- /uninstall.py: -------------------------------------------------------------------------------- 1 | import general_use 2 | import dependencies 3 | import tools 4 | import subprocess 5 | import os 6 | 7 | def uninstall(toolname): 8 | repo_canbus_utils = 'https://github.com/digitalbond/canbus-utils.git' 9 | repo_kayak = 'https://github.com/dschanoeh/Kayak.git' 10 | repo_caringcaribou = 'https://github.com/CaringCaribou/caringcaribou.git' #want to check this to make sure it works, instructions a bit unclear 11 | repo_c0f = 'https://github.com/zombieCraig/c0f.git' 12 | repo_udsim = 'https://github.com/zombieCraig/UDSim.git' 13 | repo_j1939 = 'https://github.com/wang701/can-utils-j1939.git' 14 | repo_canbadger = 'https://github.com/Gutenshit/CANBadger.git' 15 | repo_canbadger_server = 'https://github.com/Gutenshit/CANBadger-Server.git' 16 | 17 | repo_katoolin = 'https://github.com/LionSec/katoolin.git' 18 | 19 | repo_bluelog = 'https://github.com/MS3FGX/Bluelog.git' 20 | repo_bluemaho = 'https://github.com/zenware/bluemaho.git' 21 | 22 | link_pyobd = 'http://www.obdtester.com/download/pyobd_0.9.3.tar.gz' #this might not work 23 | link_o2oo = 'https://www.vanheusden.com/O2OO/O2OO-0.9.tgz' 24 | link_romraider = 'http://assembla.com/spaces/romraider/documents/a5Ao9gHEir5P9Udmr6QqzO/download/RomRaider0.5.9RC3-linux.jar' 25 | 26 | d = general_use.check_distribution() 27 | pack_man = general_use.package_tool(d) 28 | rm_rc = -1 29 | 30 | #check path to make sure it's in the autopen directory 31 | curr = os.getcwd() 32 | back_index = curr.rfind('/') 33 | ap_index = curr.find('autopen') 34 | if curr[back_index:] != '/autopen': 35 | path = curr[:ap_index+7] 36 | else: 37 | path = curr 38 | 39 | os.chdir(path) 40 | 41 | try: 42 | if toolname == 'canbus-utils': 43 | rm_rc = subprocess.run(['rm', '-rf', 'canbus-utils']).returncode 44 | elif toolname == 'Kayak': 45 | rm_rc = subprocess.run(['rm', '-rf', 'Kayak']).returncode 46 | elif toolname == 'caringcaribou': 47 | rm_rc = subprocess.run(['rm', '-rf', 'caringcaribou']).returncode 48 | elif toolname == 'c0f': 49 | rm_rc = subprocess.run(['rm', '-rf', 'c0f']).returncode 50 | elif toolname == 'udsim': 51 | rm_rc = subprocess.run(['rm', '-rf', 'UDSim']).returncode 52 | elif toolname == 'katoolin': 53 | rm_rc = subprocess.run(['rm', '-rf', 'katoolin']).returncode 54 | elif toolname == 'bluelog': 55 | rm_rc = subprocess.run(['rm', '-rf', 'Bluelog']).returncode 56 | elif toolname == 'bluemaho': 57 | rm_rc = subprocess.run(['rm', '-rf', 'bluemaho']).returncode 58 | elif toolname == 'j1939': 59 | rm_rc = subprocess.run(['rm', '-rf', 'can-utils-j1939']).returncode 60 | elif toolname == 'canbadger-hw': 61 | rm_rc = subprocess.run(['rm', '-rf', 'CANBadger']).returncode 62 | 63 | #https://github.com/Gutenshit/CANBadger/wiki/Getting-the-board-ready 64 | 65 | elif toolname == 'canbadger-sw': 66 | rm_rc = subprocess.run(['rm', '-rf', 'CANBadger-Server']).returncode 67 | 68 | elif toolname == 'pyobd': 69 | try: 70 | rm_rc = subprocess.run(['rm', '-rf','pyobd_0.9.3.tar.gz']).returncode 71 | except: 72 | pass 73 | try: 74 | rm_rc = subprocess.run('rm', '-rf', 'pyobd-0.9.3').returncode 75 | except: 76 | pass 77 | elif toolname == 'o2oo': 78 | try: 79 | rm_rc = subprocess.run(['rm', '-rf','O2OO-0.9.tgz']).returncode 80 | except: 81 | pass 82 | try: 83 | rm_rc = subprocess.run('rm', '-rf', 'O2OO-0.9').returncode 84 | except: 85 | pass 86 | 87 | elif toolname == 'btscanner': 88 | rm_rc = subprocess.run(['sudo', pack_man, 'purge', '-y','btscanner']).returncode 89 | elif toolname == 'gnuradio': 90 | rm_rc = subprocess.run(['sudo', pack_man, 'purge','-y', 'gnuradio']).returncode 91 | elif toolname == 'aircrack-ng': 92 | rm_rc = subprocess.run(['sudo', pack_man, 'purge','-y', 'aircrack-ng']).returncode 93 | elif toolname == 'gqrx': 94 | rm_rc = subprocess.run(['sudo', pack_man, 'purge', '-y','gqrx']).returncode 95 | elif toolname == 'can-utils': 96 | rm_rc = subprocess.run(['sudo', pack_man, 'purge','-y', 'can-utils']).returncode 97 | elif toolname == 'wireshark': 98 | rm_rc = subprocess.run(['sudo', pack_man, 'purge','-y', 'wireshark']).returncode 99 | elif toolname == 'tshark': 100 | rm_rc = subprocess.run(['sudo', pack_man, 'purge','-y', 'tshark']).returncode 101 | 102 | except: 103 | print ('Not in correct directory') 104 | print ('current directory is: ', os.getcwd()) 105 | pass 106 | 107 | if rm_rc == 0: 108 | #remove the tool from the text file 109 | f = open("installed.txt","r+") 110 | d = f.readlines() 111 | f.seek(0) 112 | for i in d: 113 | if i != toolname: 114 | f.write(i) 115 | f.truncate() 116 | 117 | print ('UNINSTALL SUCCESSFUL: Successfully uninstalled', toolname) 118 | 119 | return rm_rc 120 | 121 | def test(name): 122 | return 0 123 | 124 | -------------------------------------------------------------------------------- /update.py: -------------------------------------------------------------------------------- 1 | import general_use 2 | import dependencies 3 | import subprocess 4 | import os 5 | 6 | def update(toolname): 7 | 8 | #github tools 9 | repo_canbus_utils = 'https://github.com/digitalbond/canbus-utils.git' 10 | repo_kayak = 'https://github.com/dschanoeh/Kayak.git' 11 | repo_caringcaribou = 'https://github.com/CaringCaribou/caringcaribou.git' #want to check this to make sure it works, instructions a bit unclear 12 | repo_c0f = 'https://github.com/zombieCraig/c0f.git' 13 | repo_udsim = 'https://github.com/zombieCraig/UDSim.git' 14 | repo_j1939 = 'https://github.com/wang701/can-utils-j1939.git' 15 | repo_canbadger = 'https://github.com/Gutenshit/CANBadger.git' 16 | repo_canbadger_server = 'https://github.com/Gutenshit/CANBadger-Server.git' 17 | 18 | repo_katoolin = 'https://github.com/LionSec/katoolin.git' 19 | 20 | repo_bluelog = 'https://github.com/MS3FGX/Bluelog.git' 21 | repo_bluemaho = 'https://github.com/zenware/bluemaho.git' 22 | 23 | #downloaded tools 24 | link_pyobd = 'http://www.obdtester.com/download/pyobd_0.9.3.tar.gz' #this might not work 25 | link_o2oo = 'https://www.vanheusden.com/O2OO/O2OO-0.9.tgz' 26 | link_romraider = 'http://assembla.com/spaces/romraider/documents/a5Ao9gHEir5P9Udmr6QqzO/download/RomRaider0.5.9RC3-linux.jar' 27 | 28 | #add exception to check if the tool is installed, in case they accidentally click this. Possibly add a pop-up that says "need to install first" 29 | 30 | #check path to make sure it's in the autopen directory 31 | curr = os.getcwd() 32 | back_index = curr.rfind('/') 33 | ap_index = curr.find('autopen') 34 | if curr[back_index:] != '/autopen': 35 | path = curr[:ap_index+7] 36 | else: 37 | path = curr 38 | os.chdir(path) 39 | 40 | github_tools = ['canbus-utils', 'Kayak', 'caringcaribou', 'c0f', 'udsim', 'j1939', 'canbadger-hw', 'canbadger-sw', 'katoolin', 'bluelog', 'bluemaho'] 41 | downloaded_tools = ['pyobd', 'o2oo', 'romraider'] 42 | commandline_tools = ['bluez', 'btscanner', 'gnuradio', 'aircrack-ng', 'wireshark', 'can-utils', 'tshark', 'gqrx'] 43 | 44 | 45 | try: 46 | if toolname in github_tools: 47 | if toolname == 'canbus-utils': 48 | p = os.getcwd() + '/canbus-utils' 49 | os.chdir(p) 50 | elif toolname == 'Kayak': 51 | p = os.getcwd() + '/Kayak' 52 | os.chdir(p) 53 | elif toolname == 'caringcaribou': 54 | p = os.getcwd() + '/caringcaribou' 55 | os.chdir(p) 56 | elif toolname == 'c0f': 57 | p = os.getcwd() + '/c0f' 58 | os.chdir(p) 59 | elif toolname == 'udsim': 60 | p = os.getcwd() + '/UDSim' 61 | os.chdir(p) 62 | elif toolname == 'j1939': 63 | p = os.getcwd() + '/can-utils-j1939' 64 | os.chdir(p) 65 | elif toolname == 'canbadger-hw': 66 | p = os.getcwd() + '/CANBadger' 67 | os.chdir(p) 68 | elif toolname == 'canbadger-sw': 69 | p = os.getcwd() + '/CANBadger-Server' 70 | os.chdir(p) 71 | elif toolname == 'katoolin': 72 | p = os.getcwd() + '/katoolin' 73 | os.chdir(p) 74 | elif toolname == 'bluelog': 75 | p = os.getcwd() + '/Bluelog' 76 | os.chdir(p) 77 | elif toolname == 'bluemaho': 78 | p = os.getcwd() + '/bluemaho' 79 | os.chdir(p) 80 | 81 | # github tools are updated based on whether local commit is the same version as the master commit 82 | 83 | master = subprocess.run(['git', 'rev-parse', 'master'], stdout=subprocess.PIPE).stdout 84 | origin_master = subprocess.run(['git', 'rev-parse', 'master'], stdout=subprocess.PIPE).stdout 85 | 86 | master_id = master.decode('utf-8') 87 | origin_master_id = origin_master.decode('utf-8') 88 | 89 | #users repo is behind master 90 | if master_id != origin_master_id: 91 | print ('Updating', toolname, '...') 92 | pull_rc = subprocess.run(['git', 'pull', 'origin', 'master']).returncode 93 | if pull_rc != 0: 94 | print ('UPDATE FAILED: Failed to update', toolname) 95 | print ('ERROR CODE:', pull_rc) 96 | else: 97 | print ('UPDATE SUCCESSFUL: Successfully updated', toolname) 98 | return 0 99 | else: 100 | print (toolname, 'is already up to date') 101 | return 0 102 | 103 | elif toolname in commandline_tools: 104 | print ('Updating', toolname, '...') 105 | update_rc = subprocess.run(['sudo', 'apt-get', '--only-upgrade', '-y', 'install', toolname]).returncode 106 | if update_rc != 0: 107 | print ('UPDATE FAILED: Failed to update', toolname) 108 | print ('ERROR CODE:', update_rc) 109 | else: 110 | print ('UPDATE SUCCESSFUL: Successfully updated', toolname) 111 | return 0 112 | except: 113 | print ('Make sure tool is installed. Tool needs to be installed before updating') 114 | return 0 115 | 116 | 117 | 118 | def test(name): 119 | return 0 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /vcan: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Creates an interface named vcan0 for interfacing with device 3 | 4 | modprobe vcan 5 | sudo ip link add dev vcan0 type vcan 6 | sudo ip link set up vcan0 -------------------------------------------------------------------------------- /vm_install.py: -------------------------------------------------------------------------------- 1 | ''' 2 | 3 | This script is to be executed when running Autopen on a VM 4 | Running Autopen on a VM is not recommended when using hardware mainly because the hardware needs to be set up. 5 | Autopen works best with a dedicated install 6 | 7 | Make sure to run this script first or Autopen will not install 8 | 9 | ''' 10 | 11 | import subprocess 12 | import general_use 13 | 14 | ff_rc = subprocess.run(['sudo', 'apt-get', 'install', '-y', 'ffmpeg']).returncode 15 | if ff_rc != 0: 16 | print ('INSTALLATION FAILED: Failed to install ffmpeg library, trying alternative option: libav-tools') 17 | lib_rc = subprocess.run(['sudo', 'apt-get', 'install', '-y', 'libav-tools']).returncode 18 | if lib_rc != 0: 19 | print ('INSTALLATION FAILED: Failed to install alternative to ffmpeg install: libav-tools.') 20 | print ('Attempting to install using ffmpeg PPA') 21 | ppa_rc = subprocess.run(['sudo', 'add-apt-repository', 'ppa:mc3man/trusty-media']).returncode 22 | if ppa_rc != 0: 23 | print ('GET REPO FAILED: Failed to add-apt-repository of trusty-media where ffmpeg is located') 24 | print ('WITH ERROR CODE:', ppa_rc) 25 | print ('INSTALLATION FAILED: Could not install ffmpeg package. Functionality may be hindered and/or Autopen may not be able to run') 26 | else: 27 | print ('GET REPO SUCCESSFUL: Successfully added trusty-media repo where ffmpeg is located') 28 | up_rc = general_use.update(general_use.package_tool(check_distribution())) 29 | if up_rc != 0: 30 | print ('UPDATE FAILED: Failed to retrieve packages') 31 | print ('WITH ERROR CODE:', up_rc) 32 | else: 33 | print ('UPDATE SUCCESSFUL: Sucessfully retrived updated packages') 34 | ffm_rc = subprocess.run(['sudo', 'apt-get', 'install', 'ffmpeg']).returncode 35 | if ffm_rc != 0: 36 | print ('INSTALLATION FAILED: Could not install ffmpeg package. Functionality may be hindered and/or Autopen may not be able to run') 37 | print ('WITH ERROR CODE:', ffm_rc) 38 | else: 39 | print ('INSTALLATION SUCCESSFUL: Sucessfully installed ffmpeg package') 40 | 41 | 42 | libraries_rc = subprocess.run(['sudo', 'apt-get', 'install', '-y', 'python3-pip', 'build-essential', 'git', 'python-dev','libsdl2-dev', 'libsdl2-image-dev', 'libsdl2-mixer-dev',\ 43 | 'libsdl2-ttf-dev', 'libportmidi-dev', 'libswscale-dev', 'libavformat-dev', 'libavcodec-dev', 'zlib1g-dev']).returncode 44 | if libraries_rc != 0: 45 | print ('INSTALLATION FAILED: Failed to install one or more libraries needed to run Autopen in a VM environment') 46 | print ('Please refer to the log.txt file to check which library/dependency failed') 47 | print ('WITH ERROR CODE:', libraries_rc) 48 | else: 49 | ch_rc = subprocess.run(['sudo', 'pip3', 'install', 'virtualenv', 'setuptools']).returncode 50 | if ch_rc != 0: 51 | print ('INSTALLATION FAILED: Failed to install virtualenv and/or setuptools') 52 | print ('CANNOT COMPLETE INSTALLATION. Autopen will most likely not run') 53 | else: 54 | #virtualenv is a tool for creating isolated Python environments containing their own copy of python, pip 55 | x_rc = subprocess.run(['virtualenv', '--no-site-packages', 'kivyinstall']).returncode 56 | if x_rc != 0: 57 | print ('VIRTUALENV FAILED: Failed to setup kivy isolated environment') 58 | print ('WITH ERROR CODE:', x_rc) 59 | else: 60 | print ('Changing from dash to bash, hit "no" on the next prompt') 61 | subprocess.run(['sudo', 'dpkg-reconfigure', 'dash']) 62 | print ('VIRTUALENV SUCCESSFUL: Successfully setup kivy isolated environment') 63 | print ('Entering the virtualenv environment...') 64 | enter_rc = subprocess.run(['source ./kivyinstall/bin/activate'],shell=True).returncode 65 | if enter_rc != 0: 66 | print ('VIRTUALENV FAILED: Failed to enter the kivy python environment set-up') 67 | print ('WITH ERROR CODE:', enter_rc) 68 | else: 69 | print ('VIRTUALENV SUCCESSFUL: Successfully entered into kivy python envirnoment') 70 | print ('Installing cython...') 71 | cython_rc = subprocess.run(['pip3', 'install', 'Cython==0.23']).returncode 72 | if cython_rc != 0: 73 | print ('INSTALLATION FAILED: Failed to install Cython version 0.23') 74 | print ('WITH ERROR CODE:', cython_rc) 75 | else: 76 | print ('INSTALLATION SUCCESSFUL: Successfully installed Cython version 0.23') 77 | print ('Installing kivy...') 78 | kivy_rc = subprocess.run(['pip3', 'install', 'kivy']).returncode 79 | if kivy_rc != 0: 80 | print ('INSTALLATION FAILED: Failed to install kivy') 81 | print ('WITH ERROR CODE:', kivy_rc) 82 | else: 83 | print ('INSTALLATION SUCCESSFUL: Should now be able to run AutoPen.py') 84 | 85 | 86 | --------------------------------------------------------------------------------