Intro to Python
What it is, how to use it, and why it’s useful
Announcements
● CSG Firetalks (3/27) - goo.gl/R7rxw6
● HackUTD (2/23 - 2/24) - hackutd.co
● Mitre Cyber Challenge (2/22) - mitrestemctf.org
● Cisco: Customer Experience TAC - Mar 1st, 2019 9 AM to 5 PM -
cabrush@cisco.com
● InfoSec
A little history
● Python was named after Monty Python
● Python is a descendant of ABC
● Python was developed by Guido Van Rossum to appeal to
Unix/C programmers
Python Versions
● 2.7 vs 3.0
○ Some differences include making print a function,
only one integer type, and modifying integer division
Interactive Shell
● Way for the user to access the Python interpreter
● Run Python commands in an interactive environment
Collection data types (arrays)
● List
○ ordered, mutable, allows duplicate members
● Tuple
○ ordered, immutable, allows duplicate members
● Set
○ unordered, unindexed, duplicate members not allowed
● Dictionary
○ unordered, mutable, indexed, duplicate members not
allowed.
What about security?
There are many, many libraries and tools written in python
that do different things.
Some of these libraries and tools are useful for security-
related endeavors.
pwntools - exploit writing in python
● from pwn import *
● A CTF framework and exploit development library
● pwnlib
○ pwnlib.shellcraft - bunch of shellcodes
○ pwnlib.util.fiddling - bit fiddling
■ encode, decode to/from Base64
PyCryptodome
● Great for cryptography and security engineering-related stuff
● low-level primitives
○ Symmetric ciphers, stream ciphers, cryptographic hashes,
other cool things
Helpful Links/Tutorials
● https://www.w3schools.com/python/default.asp
● https://www.python-
course.eu/python3_history_and_philosophy.php
● http://docs.pwntools.com/en/stable/
● https://www.secureauth.com/labs/open-source-tools/impacket

Intro to python

  • 1.
    Intro to Python Whatit is, how to use it, and why it’s useful
  • 2.
    Announcements ● CSG Firetalks(3/27) - goo.gl/R7rxw6 ● HackUTD (2/23 - 2/24) - hackutd.co ● Mitre Cyber Challenge (2/22) - mitrestemctf.org ● Cisco: Customer Experience TAC - Mar 1st, 2019 9 AM to 5 PM - cabrush@cisco.com ● InfoSec
  • 3.
    A little history ●Python was named after Monty Python ● Python is a descendant of ABC ● Python was developed by Guido Van Rossum to appeal to Unix/C programmers
  • 4.
    Python Versions ● 2.7vs 3.0 ○ Some differences include making print a function, only one integer type, and modifying integer division
  • 5.
    Interactive Shell ● Wayfor the user to access the Python interpreter ● Run Python commands in an interactive environment
  • 6.
    Collection data types(arrays) ● List ○ ordered, mutable, allows duplicate members ● Tuple ○ ordered, immutable, allows duplicate members ● Set ○ unordered, unindexed, duplicate members not allowed ● Dictionary ○ unordered, mutable, indexed, duplicate members not allowed.
  • 7.
    What about security? Thereare many, many libraries and tools written in python that do different things. Some of these libraries and tools are useful for security- related endeavors.
  • 8.
    pwntools - exploitwriting in python ● from pwn import * ● A CTF framework and exploit development library ● pwnlib ○ pwnlib.shellcraft - bunch of shellcodes ○ pwnlib.util.fiddling - bit fiddling ■ encode, decode to/from Base64
  • 9.
    PyCryptodome ● Great forcryptography and security engineering-related stuff ● low-level primitives ○ Symmetric ciphers, stream ciphers, cryptographic hashes, other cool things
  • 10.
    Helpful Links/Tutorials ● https://www.w3schools.com/python/default.asp ●https://www.python- course.eu/python3_history_and_philosophy.php ● http://docs.pwntools.com/en/stable/ ● https://www.secureauth.com/labs/open-source-tools/impacket

Editor's Notes

  • #3 CSG ‘Intro’ CTF at HackUTD: 7pm (4hrs long) Mitre: More Advanced CTF Cisco: Customer Experience TAC team will be hosting customers and students to share live demos with over 10 Presenters! It’s a one day event focused on technical discussions, how to engage TAC, the issues of tomorrow TAC is working on, etc. The event is free to attend, but club members do have to sign up because there are limited slots available so email cabrush@cisco.com
  • #4 ABC is a general-purpose programming language and programming environment
  • #5 Integer division now yields a float instead of an integer
  • #6 Demo Time State Disclaimer
  • #11 impacket