SlideShare a Scribd company logo
1 of 79
Download to read offline
Hacking Like It's 2013
  /* The Workshop */
             #include “Itzik Kotler“
Agenda
●
    Pythonect
●
    Developing Domain-specific Language w/ Pythonect
●
    Hackersh
●
    Q&A
Pythonect
●
    Pythonect is a portmanteau of the words Python and Connect
●
    New, experimental, general-purpose dataflow programming language
    based on Python
●
    Current “stable“ version (True to Apr 9 2013): 0.4.2
●
    Made available under 'Modified BSD License'
●
    Influenced by: Unix Shell Scripting, Python, Perl
●
    Cross-platform (should run on any Python supported platform)
●
    Website: http://www.pythonect.org/
A few words on the Development
●
    Written purely in Python (2.7)
    –   Works on CPython 2.x, and Jython 2.7 implementations
●
    Tests written in PyUnit
●
    Hosted on GitHub
●
    Commits tested by Travis CI
Installing and Using The Pythonect Interpreter
●
    Install directly from PyPI using easy_install or pip:
    –   easy_install Pythonect
        OR
    –   pip install Pythonect
●
    Clone the git repository:
    –   git clone git://github.com/ikotler/pythonect.git
    –   cd pythonect
    –   python setup.py install
The Pythonect Interpreter
●
    Written and integrated with the Python environment:
    % pythonect
    Python 2.7.3 (default, Aug           1 2012, 05:14:39)
    [Pythonect 0.4.2] on linux2
    Type "help", "copyright", "credits" or "license"
    for more information.
    >>>
Dataflow Programming


   Programming paradigm that treats data as something originating
from a source, flows through a number of components and arrives at
 a final destination - most suitable when developing applications that
              are themselves focused on the "flow" of data.
Dataflow Example
        A video signal processor which may start with video input,
modifies it through a number of processing components (i.e. video filters),
                  and finally outputs it to a video display.




                                  Video              Screen
               Local
                                   B&W               Output
                File
                                  Frame              Display
              Reader
                                Procressor
Dataflow Example
Want to change a feed from a local file to a remote file on a website?

                             No problem!




                                 Video             Screen
              URL                 B&W              Output
           Downloader            Frame             Display
                               Procressor
Dataflow Example
Want to write the Video B&W Frame Processor output
          to both a screen and a local file?

                   No problem!


                                        Local
                                         File
                       Video            Writer
     URL                B&W
  Downloader           Frame
                     Procressor         Screen
                                        Output
                                        Display
Dataflow Programming Advantages
●
    Concurrency and parallelism are natural
●
    Data flow networks are natural for representing process
●
    Data flow programs are more extensible than traditional
    programs
Dataflow Programming Disadvantages
●
    The mindset of data flow programming is unfamiliar to most
    programmers
●
    The intervention of the run-time system can be expensive
Dataflow Programming Languages
●
    Spreadsheets are essentially dataflow (e.g. Excel)
●
    VHDL, Verilog and other hardware description languages are
    essentially dataflow
●
    XProc
●
    Max/Msp
●
    ... Etc.
<Pythonect Examples>
'Hello, world' -> print




String   Function
What do we have here?
●   -> is a Pythonect Control Operator, it means async forward.
●   There's also | (i.e. Pipe) which means sync forward.
●   'Hello, world' is a literal string
●   print is a function
"Hello, world" -> [print, print]




                 Function
        String
                 Function

    ["Hello, world", "Hello, world"] -> print




                  String
                           Function
                  String
range(99, 0, -1) 
        | [ _ % 2 == 0 ] 
            -> str 
            -> _ + " bottle(s) of beer on the wall," 
            -> print 
            -> _.split(' on')[0] + '.' 
            -> print 
            -> print("Take one down, pass it around,")




Integer     Filter    Function   Expression   Function   Function   Function   Function
Basic Pythonect Syntax Summary
●   -> is async forward.
●   | (i.e. Pipe) is sync forward.
●   _ (i.e. Underscore) is current value in flow
<Pythonect Security Scripts/Examples>
ROT13 Encrypt & Decrypt




raw_input() -> _.encode('rot13') -> print




         Function   Function   Function
Check if FTP Server Supports Anonymous Login



'ftp.gnu.org' 
    -> ftplib.FTP 
    -> _.login() 
    -> print("Allow anonymous")




        String     Class    Function   Function
(Multi-thread) HTTP Directory Brute-force


sys.argv[1] 
    -> [str(_ + '/' + x) for x in open(sys.argv[2],'r').read().split('n')] 
    -> [(_, urllib.urlopen(_))] 
    -> _[1].getcode() != 404 
    -> print "%s returns %s" % (_[0], _[1], _[1].getcode())




                                     Function       Filter       Function

         String      Nested Loop
                                        ...
Command line Fuzzer



['%s', '%n', 'A', 'a', '0', '!', '$', '%', '*', '+', ',', '-', '.', '/', ':'] 
    | [_ * n for n in [256, 512, 1024, 2048, 4096]] 
        | os.system('/bin/ping ' + _)




                     Array        Nested Loop       Function
(Multi-thread) Generic File format Fuzzer



open('dana.jpg', 'r').read() 
    -> itertools.permutations 
        -> open('output_' + hex(_.__hash__()) + '.jpg', 'w').write(''.join(_))




                                                    Function

                     String         Function
                                                       ...
Compute MALWARE.EXE's MD5 & SHA1




"MALWARE.EXE" -> [os.system("/usr/bin/md5sum " + _), os.system("/usr/bin/sha1sum " + _)]




                                                Function

                                String
                                                Function
Compute MALWARE.EXE's Entropy
●
    Entropy.py:                                             ●
                                                                Pythonect:
    import math
                                                                "MALWARE.EXE" 
    def entropy(data):
       entropy = 0                                                  -> open(_, 'r').read() 
       if data:
                                                                        -> entropy.entropy 
           for x in range(2**8):
                  p_x = float(data.count(chr(x))) / len(data)
                                                                            -> print
                  if p_x > 0:
                      entropy += - p_x * math.log(p_x, 2)
       return entropy
References / More Examples
●
    My Blog
    –   Scraping LinkedIn Public Profiles for Fun and Profit
    –   Fuzzing Like A Boss with Pythonect
    –   Automated Static Malware Analysis with Pythonect
●
    LightBulbOne (Blog)
    –   Fuzzy iOS Messages!
Pythonect Roadmap
●
    Support Python 3k
●
    Support Stackless Python
●
    Support IronPython
●
    Support GPU Programming
●
    Fix bugs, etc.
Questions?
Moving on!


Developing Domain-specific Language (DSL)
             with Pythonect
Domain-specific Language
●
    Domain-specific language (DSL) is a mini-language aiming at
    representing constructs for a given domain
●
    DSL is effective if the words and idioms in the language
    adequately capture what needs to be represented
●
    DSL can also add syntax sugar
Why?
      Why create a custom tag or an object with methods?


                         Elegant Code Reuse

Instead of having to recode algorithms every time you need them, you can just
write a phrase in your DSL and you will have shorter, more easily maintainable
                                    programs
Example for DSL's
●
    Programming Language R
●
    XSLT
●
    Regular Expression
●
    Graphviz
●
    Shell utilities (awk, sed, dc, bc)
●
    Software development tools (make, yacc, lex)
●
    Etc.
<DSL/Examples>
Example #1: XSLT 'Hello, world'
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="p">
      Hello world! - From hello.xsl.
   </xsl:template>
</xsl:stylesheet>
Example #2: Graphviz/DOT 'Hello, world'
digraph G
{
    Hello → World
}
Domain-specific Language with Pythonect
●
    Pythonect provides various features to let you easily develop
    your own DSLs:
    –   Built-in Python module Autoloader
    –   Concurrency (Threads & Processes)
    –   Abstract Syntax (i.e. Generic Flow Operators)
Built-in Python AutoLoader
●
    The AutoLoader loads Python modules from the file system
    when needed
●   In other words, no need to import modules explicitly.
●
    The sacrifice is run-time speed for ease-of-coding and speed
    of the initial import()ing.
'Hello, world' -> string.split


                  i.e.

                  import string
                  return string.split
Concurrency (Threads & Processes)
●
    Multi-threading:
    –   'Hello, world' -> [print, print]
●
    Multi-processing:
    –   'Hello, world' -> [print, print]
●
    Mix:
    –   'Hello, world' -> [print, print &]
Abstract Syntax
●
    Brackets for Scope:
    –   []
●
    Arrows and Pipes for Flows:
    –   | and ->
●
    Dict and Logical Keywords for Control Flow:
    –   {} and not/or/and
So, imagine the following is a real script:



from_file('malware.exe') 
    -> extract_base64_strings 
        -> to_xml
IT IS!
(with Pythonect)
Meet SMALL
                 Simple Malware AnaLysis Language

●
    Toy language for analyzing malware samples
●
    Single Python file (14 functions, 215 lines of text)
●
    Runs on top of Pythonect
SMALL Features
●
    Extract IPv4 Addresses from Binaries
●
    Extract Base64 Strings from Binaries
●
    Calculate MD5/SHA1/CRC32
●
    Determine File Type (via /usr/bin/file)
●
    Create XML Reports
How Does SMALL Work?
●
    SMALL functions are divided into two groups:
    –   Root, these functions start a flow
    –   Normal, these functions continues or closes the flow
●   Root functions accept String and return dict
    –   e.g. from_file()
●   Normal functions accept dict and return dict
    –   e.g.   extract_base64_strings()
<Pythonect/Security DSL (i.e. SMALL) Examples>
How to Start the SMALL Interpreter

                     pythonect -m SMALL -i

●
    The '-m' means - run library module as a script
●
    The '-i' means - inspect interactively after running script
●
    Just like Python :)
Extract Base64 Strings and Save As XML



 from_file('malware.exe') 
     -> extract_base64_strings 
         -> to_xml




Function   Function   Function
Extract IPv4 Addresses and Save As XML



 from_file('malware.exe') 
     -> extract_ipv4_addresses 
         -> to_xml




Function   Function   Function
Compute MD5, SHA1, CRC32, and FileType

 from_file('malware.exe') 
     -> md5sum 
         -> sha1sum 
             -> crc32 
                 -> file_type 
                      -> to_xml


Function   Function   Function
Other (Potential) Security Domains:
●
    Reverse Engineering
●
    Malware Analysis
●
    Penetration Testing
●
    Intelligence Gathering
●
    Fuzzing
●
    Etc.
Questions?
Moving on!


 Hackersh
Hackersh
●
    Hackersh is a portmanteau of the words Hacker and Shell
●
    Shell (command interpreter) written with Pythonect-like syntax,
    built-in security commands, and out of the box wrappers for
    various security tools
●
    Current “stable“ version (True to Apr 1 2013): 0.1.0
●
    Made available under GNU General Public License v2 or later
●
    Influenced by: Unix Shell Scripting and Pythonect
●
    Cross-platform (should run on any Python supported platform)
●
    Website: http://www.hackersh.org
A few words on the Development
●
    Written purely in Python (2.7)
●
    Hosted on GitHub
Motivation
●
    Taking over the world
●
    Automating security tasks and reusing code as much as
    possible
Problems
●
    There are many good security tools out there...
    –   but only a few can take the others output and run on it
    –   but only a few of them give you built-in threads/processes
        controling for best results


●
    No matter how well you write your shell script, the next
    time you need to use it - for something slightly different -
    you will have to re-write it
Hackersh – The Solution
●
    Hackersh provides a “Standard Library“ where you can
    access your favorite security tools (as Components) and
    program them as easy as a Lego
●
    Hackersh lets you automagically scale your flows, using
    multithreading, multiprocessing, and even a Cloud
●
    Hackersh (using Pythonect as it's scripting engine) gives
    you the maximum flexibility to re-use your previous code
    while working on a new slightly-different version/script
Installing and Using The Hackersh
●
    Install directly from PyPI using easy_install or pip:
    –   easy_install Hackersh
        OR
    –   pip install Hackersh
●
    Clone the git repository:
    –   git clone git://github.com/ikotler/hackersh.git
    –   cd hackersh
    –   python setup.py install
Implementation
●
    Component-based software engineering
    –   External Components
        ●
            Nmap
        ●
            W3af
        ●
            Etc.
    –   Internal Components
        ●
            URL (i.e. Convert String to URL)
        ●
            IPv4_Address (i.e. Convert String to IPv4 Adress)
        ●
            Etc.
Component as Application
●
    Components accepts command line args:
    –   "localhost" -> hostname -> nmap("-P0")
●
    They also accept internal flags options as:
    –   "localhost" -> hostname -> nmap("-P0", debug=True)
Input/Output: Context
●
    Every Hackersh component (except the Hackersh Root
    Component) is standardized to accept and return the same
    data structure – Context.
●
    Context is a dict (i.e. associative array) that can be piped
    through different components
Same Context, Different Flow
●   "http://localhost" -> url -> nmap -> ping
    – Port scan a URL, if *ANY* port is open, ping it
●   "http://localhost" -> url -> ping -> nmap
    –   Ping the URL, if pingable, scan for *ANY* open ports
Ask The Context
●
    Context stores both Data and Metadata
●
    The Metadata aspect enables potential AI applications to fine-
    tune their service selection strategy based on service-specific
    characteristics
Conditional Flow


"http://localhost" 
    -> url 
        -> nmap 
            -> [_['PORT'] == '8080' and _['SERVICE'] == 'HTTP'] 
                -> w3af 
                    -> print
Hackersh High-level Diagram



                     Root
   Literal        Component    Context   Component   ...
(e.g. String)     (e.g. URL)
<Hackersh Scripts/Examples>
TCP & UDP Ports Scanning




         "localhost" -> hostname -> nmap




           Built-in    External
Target
         Component    Component
Class C (256 Hosts) Ping Sweep




         '192.168.1.0/24' -> ipv4_range -> ping




               Built-in    External
Target
             Component    Component
Web Server Vulnerability Scanner




 '127.0.0.1' -> ipv4_address -> nmap -> nikto




           Built-in    External    External
Target
         Component    Component   Component
Fork: Target as Hostname + Target as IP



"localhost" 
    -> hostname 
        -> [nslookup, pass] -> ...


                             Target
                                          ...
                          as Hostname
               Built-in
Target
             Component
                              Target
                                          ...
                          as IPv4 Addr.
Black-box Web App Pentration Testing

"http://localhost" 
    -> url 
    -> nmap 
    -> browse 
    -> w3af 
    -> print



             Built-in    External     Built-in    External     Built-in
Target
           Component    Component   Component    Component   Component
Hackersh Roadmap
●
    Unit Tests
●
    Documention
●
    More Tools
    – Metasploit
    – OpenVAS

    – TheHarvester

    – Hydra

    – …

●
    Builtin Commands
●
    Plugins System
●
    <YOUR IDEA HERE>
Hackersh Official TODO


https://github.com/ikotler/hackersh/blob/master/doc/TODO
Questions?
Thank you!

            My Twitter: @itzikkotler
            My Email: ik@ikotler.org
        My Website: http://www.ikotler.org

  Pythonect Website: http://www.pythonect.org
  Hackersh Website: http://www.hackersh.org

Feel free to contact me if you have any questions!

More Related Content

What's hot

Introduction to Machine Learning with TensorFlow
Introduction to Machine Learning with TensorFlowIntroduction to Machine Learning with TensorFlow
Introduction to Machine Learning with TensorFlowPaolo Tomeo
 
Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0Databricks
 
Introduction to Neural Networks in Tensorflow
Introduction to Neural Networks in TensorflowIntroduction to Neural Networks in Tensorflow
Introduction to Neural Networks in TensorflowNicholas McClure
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningOswald Campesato
 
Natural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usageNatural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usagehyunyoung Lee
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningOswald Campesato
 
Attention mechanisms with tensorflow
Attention mechanisms with tensorflowAttention mechanisms with tensorflow
Attention mechanisms with tensorflowKeon Kim
 
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlowRajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlowAI Frontiers
 
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...Altoros
 
DeepStochLog: Neural Stochastic Logic Programming
DeepStochLog: Neural Stochastic Logic ProgrammingDeepStochLog: Neural Stochastic Logic Programming
DeepStochLog: Neural Stochastic Logic ProgrammingThomas Winters
 
Working with NS2
Working with NS2Working with NS2
Working with NS2chanchal214
 
TensorFlow Dev Summit 2017 요약
TensorFlow Dev Summit 2017 요약TensorFlow Dev Summit 2017 요약
TensorFlow Dev Summit 2017 요약Jin Joong Kim
 
TensorFlow Dev Summit 2018 Extended: TensorFlow Eager Execution
TensorFlow Dev Summit 2018 Extended: TensorFlow Eager ExecutionTensorFlow Dev Summit 2018 Extended: TensorFlow Eager Execution
TensorFlow Dev Summit 2018 Extended: TensorFlow Eager ExecutionTaegyun Jeon
 
Introduction to Deep Learning with Python
Introduction to Deep Learning with PythonIntroduction to Deep Learning with Python
Introduction to Deep Learning with Pythonindico data
 
DIY Deep Learning with Caffe Workshop
DIY Deep Learning with Caffe WorkshopDIY Deep Learning with Caffe Workshop
DIY Deep Learning with Caffe Workshopodsc
 
Learning stochastic neural networks with Chainer
Learning stochastic neural networks with ChainerLearning stochastic neural networks with Chainer
Learning stochastic neural networks with ChainerSeiya Tokui
 
Introduction to theano, case study of Word Embeddings
Introduction to theano, case study of Word EmbeddingsIntroduction to theano, case study of Word Embeddings
Introduction to theano, case study of Word EmbeddingsShashank Gupta
 
Intro to Python (High School) Unit #2
Intro to Python (High School) Unit #2Intro to Python (High School) Unit #2
Intro to Python (High School) Unit #2Jay Coskey
 
Caffe framework tutorial2
Caffe framework tutorial2Caffe framework tutorial2
Caffe framework tutorial2Park Chunduck
 

What's hot (20)

Introduction to Machine Learning with TensorFlow
Introduction to Machine Learning with TensorFlowIntroduction to Machine Learning with TensorFlow
Introduction to Machine Learning with TensorFlow
 
Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0
 
Introduction to Neural Networks in Tensorflow
Introduction to Neural Networks in TensorflowIntroduction to Neural Networks in Tensorflow
Introduction to Neural Networks in Tensorflow
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep Learning
 
Natural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usageNatural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usage
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep Learning
 
Attention mechanisms with tensorflow
Attention mechanisms with tensorflowAttention mechanisms with tensorflow
Attention mechanisms with tensorflow
 
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlowRajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
 
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
 
DeepStochLog: Neural Stochastic Logic Programming
DeepStochLog: Neural Stochastic Logic ProgrammingDeepStochLog: Neural Stochastic Logic Programming
DeepStochLog: Neural Stochastic Logic Programming
 
Working with NS2
Working with NS2Working with NS2
Working with NS2
 
TensorFlow Dev Summit 2017 요약
TensorFlow Dev Summit 2017 요약TensorFlow Dev Summit 2017 요약
TensorFlow Dev Summit 2017 요약
 
TensorFlow Dev Summit 2018 Extended: TensorFlow Eager Execution
TensorFlow Dev Summit 2018 Extended: TensorFlow Eager ExecutionTensorFlow Dev Summit 2018 Extended: TensorFlow Eager Execution
TensorFlow Dev Summit 2018 Extended: TensorFlow Eager Execution
 
Introduction to Deep Learning with Python
Introduction to Deep Learning with PythonIntroduction to Deep Learning with Python
Introduction to Deep Learning with Python
 
DIY Deep Learning with Caffe Workshop
DIY Deep Learning with Caffe WorkshopDIY Deep Learning with Caffe Workshop
DIY Deep Learning with Caffe Workshop
 
Learning stochastic neural networks with Chainer
Learning stochastic neural networks with ChainerLearning stochastic neural networks with Chainer
Learning stochastic neural networks with Chainer
 
Python tour
Python tourPython tour
Python tour
 
Introduction to theano, case study of Word Embeddings
Introduction to theano, case study of Word EmbeddingsIntroduction to theano, case study of Word Embeddings
Introduction to theano, case study of Word Embeddings
 
Intro to Python (High School) Unit #2
Intro to Python (High School) Unit #2Intro to Python (High School) Unit #2
Intro to Python (High School) Unit #2
 
Caffe framework tutorial2
Caffe framework tutorial2Caffe framework tutorial2
Caffe framework tutorial2
 

Viewers also liked

In Plain Sight: The Perfect Exfiltration
In Plain Sight: The Perfect ExfiltrationIn Plain Sight: The Perfect Exfiltration
In Plain Sight: The Perfect ExfiltrationItzik Kotler
 
Selex ES EW Solutions Seminar at Paris Air Show 2013
Selex ES EW Solutions Seminar at Paris Air Show 2013Selex ES EW Solutions Seminar at Paris Air Show 2013
Selex ES EW Solutions Seminar at Paris Air Show 2013Leonardo
 
Lockheed martin interview questions and answers
Lockheed martin interview questions and answersLockheed martin interview questions and answers
Lockheed martin interview questions and answersKateBeckinsale123
 
Ew asia cw and ew joint space for comments (14 sep2016)
Ew asia cw and ew joint space   for comments (14 sep2016)Ew asia cw and ew joint space   for comments (14 sep2016)
Ew asia cw and ew joint space for comments (14 sep2016)TBSS Group
 
SWOT & PESTLE Analysis - Lockheed Martin
SWOT & PESTLE Analysis - Lockheed MartinSWOT & PESTLE Analysis - Lockheed Martin
SWOT & PESTLE Analysis - Lockheed MartinAgnel Noojibalthila
 
Cyber defense electronic warfare (ew)
Cyber defense electronic warfare (ew)Cyber defense electronic warfare (ew)
Cyber defense electronic warfare (ew)ntc thailand
 
Introduction to ELINT Analyses
Introduction to ELINT AnalysesIntroduction to ELINT Analyses
Introduction to ELINT AnalysesJoseph Hennawy
 
Analysis for Radar and Electronic Warfare
Analysis for Radar and Electronic WarfareAnalysis for Radar and Electronic Warfare
Analysis for Radar and Electronic WarfareReza Taryghat
 
A Tutorial on Radar System Engineering
A Tutorial on Radar System EngineeringA Tutorial on Radar System Engineering
A Tutorial on Radar System EngineeringTBSS Group
 
Electronic Warfare for the Republic of Singapore Air Force
Electronic Warfare for the Republic of Singapore Air ForceElectronic Warfare for the Republic of Singapore Air Force
Electronic Warfare for the Republic of Singapore Air ForceTBSS Group
 
Green Day 2016 - Earth Observation satellites support climate change monitoring
Green Day 2016 - Earth Observation satellites support climate change monitoringGreen Day 2016 - Earth Observation satellites support climate change monitoring
Green Day 2016 - Earth Observation satellites support climate change monitoringLeonardo
 
UK Spectrum Policy Forum - Jade McCready, BAE Systems -Defence Sector Briefin...
UK Spectrum Policy Forum - Jade McCready, BAE Systems -Defence Sector Briefin...UK Spectrum Policy Forum - Jade McCready, BAE Systems -Defence Sector Briefin...
UK Spectrum Policy Forum - Jade McCready, BAE Systems -Defence Sector Briefin...techUK
 

Viewers also liked (13)

In Plain Sight: The Perfect Exfiltration
In Plain Sight: The Perfect ExfiltrationIn Plain Sight: The Perfect Exfiltration
In Plain Sight: The Perfect Exfiltration
 
Selex ES EW Solutions Seminar at Paris Air Show 2013
Selex ES EW Solutions Seminar at Paris Air Show 2013Selex ES EW Solutions Seminar at Paris Air Show 2013
Selex ES EW Solutions Seminar at Paris Air Show 2013
 
Lockheed martin interview questions and answers
Lockheed martin interview questions and answersLockheed martin interview questions and answers
Lockheed martin interview questions and answers
 
Ew asia cw and ew joint space for comments (14 sep2016)
Ew asia cw and ew joint space   for comments (14 sep2016)Ew asia cw and ew joint space   for comments (14 sep2016)
Ew asia cw and ew joint space for comments (14 sep2016)
 
SWOT & PESTLE Analysis - Lockheed Martin
SWOT & PESTLE Analysis - Lockheed MartinSWOT & PESTLE Analysis - Lockheed Martin
SWOT & PESTLE Analysis - Lockheed Martin
 
Cyber defense electronic warfare (ew)
Cyber defense electronic warfare (ew)Cyber defense electronic warfare (ew)
Cyber defense electronic warfare (ew)
 
Final ew ppt
Final ew pptFinal ew ppt
Final ew ppt
 
Introduction to ELINT Analyses
Introduction to ELINT AnalysesIntroduction to ELINT Analyses
Introduction to ELINT Analyses
 
Analysis for Radar and Electronic Warfare
Analysis for Radar and Electronic WarfareAnalysis for Radar and Electronic Warfare
Analysis for Radar and Electronic Warfare
 
A Tutorial on Radar System Engineering
A Tutorial on Radar System EngineeringA Tutorial on Radar System Engineering
A Tutorial on Radar System Engineering
 
Electronic Warfare for the Republic of Singapore Air Force
Electronic Warfare for the Republic of Singapore Air ForceElectronic Warfare for the Republic of Singapore Air Force
Electronic Warfare for the Republic of Singapore Air Force
 
Green Day 2016 - Earth Observation satellites support climate change monitoring
Green Day 2016 - Earth Observation satellites support climate change monitoringGreen Day 2016 - Earth Observation satellites support climate change monitoring
Green Day 2016 - Earth Observation satellites support climate change monitoring
 
UK Spectrum Policy Forum - Jade McCready, BAE Systems -Defence Sector Briefin...
UK Spectrum Policy Forum - Jade McCready, BAE Systems -Defence Sector Briefin...UK Spectrum Policy Forum - Jade McCready, BAE Systems -Defence Sector Briefin...
UK Spectrum Policy Forum - Jade McCready, BAE Systems -Defence Sector Briefin...
 

Similar to Hack Like It's 2013 (The Workshop)

Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Bastian Feder
 
An Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAn Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAdam Getchell
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdbRoman Podoliaka
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microserviceGiulio De Donato
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container EraSadayuki Furuhashi
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughgabriellekuruvilla
 
(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_languageNico Ludwig
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systemssosorry
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeDmitri Nesteruk
 
Yaetos Tech Overview
Yaetos Tech OverviewYaetos Tech Overview
Yaetos Tech Overviewprevota
 
iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)Eran Duchan
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsGraham Dumpleton
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MoreMatt Harrison
 
Python Basics for Operators Troubleshooting OpenStack
Python Basics for Operators Troubleshooting OpenStackPython Basics for Operators Troubleshooting OpenStack
Python Basics for Operators Troubleshooting OpenStackJames Dennis
 
A intro to (hosted) Shiny Apps
A intro to (hosted) Shiny AppsA intro to (hosted) Shiny Apps
A intro to (hosted) Shiny AppsDaniel Koller
 

Similar to Hack Like It's 2013 (The Workshop) (20)

Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 
An Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAn Overview Of Python With Functional Programming
An Overview Of Python With Functional Programming
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microservice
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container Era
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
Ropython-windbg-python-extensions
Ropython-windbg-python-extensionsRopython-windbg-python-extensions
Ropython-windbg-python-extensions
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
My Saminar On Php
My Saminar On PhpMy Saminar On Php
My Saminar On Php
 
(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/Invoke
 
Yaetos Tech Overview
Yaetos Tech OverviewYaetos Tech Overview
Yaetos Tech Overview
 
iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and More
 
Intro django
Intro djangoIntro django
Intro django
 
Python Basics for Operators Troubleshooting OpenStack
Python Basics for Operators Troubleshooting OpenStackPython Basics for Operators Troubleshooting OpenStack
Python Basics for Operators Troubleshooting OpenStack
 
A intro to (hosted) Shiny Apps
A intro to (hosted) Shiny AppsA intro to (hosted) Shiny Apps
A intro to (hosted) Shiny Apps
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Hack Like It's 2013 (The Workshop)

  • 1. Hacking Like It's 2013 /* The Workshop */ #include “Itzik Kotler“
  • 2. Agenda ● Pythonect ● Developing Domain-specific Language w/ Pythonect ● Hackersh ● Q&A
  • 3. Pythonect ● Pythonect is a portmanteau of the words Python and Connect ● New, experimental, general-purpose dataflow programming language based on Python ● Current “stable“ version (True to Apr 9 2013): 0.4.2 ● Made available under 'Modified BSD License' ● Influenced by: Unix Shell Scripting, Python, Perl ● Cross-platform (should run on any Python supported platform) ● Website: http://www.pythonect.org/
  • 4. A few words on the Development ● Written purely in Python (2.7) – Works on CPython 2.x, and Jython 2.7 implementations ● Tests written in PyUnit ● Hosted on GitHub ● Commits tested by Travis CI
  • 5. Installing and Using The Pythonect Interpreter ● Install directly from PyPI using easy_install or pip: – easy_install Pythonect OR – pip install Pythonect ● Clone the git repository: – git clone git://github.com/ikotler/pythonect.git – cd pythonect – python setup.py install
  • 6. The Pythonect Interpreter ● Written and integrated with the Python environment: % pythonect Python 2.7.3 (default, Aug 1 2012, 05:14:39) [Pythonect 0.4.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
  • 7. Dataflow Programming Programming paradigm that treats data as something originating from a source, flows through a number of components and arrives at a final destination - most suitable when developing applications that are themselves focused on the "flow" of data.
  • 8. Dataflow Example A video signal processor which may start with video input, modifies it through a number of processing components (i.e. video filters), and finally outputs it to a video display. Video Screen Local B&W Output File Frame Display Reader Procressor
  • 9. Dataflow Example Want to change a feed from a local file to a remote file on a website? No problem! Video Screen URL B&W Output Downloader Frame Display Procressor
  • 10. Dataflow Example Want to write the Video B&W Frame Processor output to both a screen and a local file? No problem! Local File Video Writer URL B&W Downloader Frame Procressor Screen Output Display
  • 11. Dataflow Programming Advantages ● Concurrency and parallelism are natural ● Data flow networks are natural for representing process ● Data flow programs are more extensible than traditional programs
  • 12. Dataflow Programming Disadvantages ● The mindset of data flow programming is unfamiliar to most programmers ● The intervention of the run-time system can be expensive
  • 13. Dataflow Programming Languages ● Spreadsheets are essentially dataflow (e.g. Excel) ● VHDL, Verilog and other hardware description languages are essentially dataflow ● XProc ● Max/Msp ● ... Etc.
  • 15. 'Hello, world' -> print String Function
  • 16. What do we have here? ● -> is a Pythonect Control Operator, it means async forward. ● There's also | (i.e. Pipe) which means sync forward. ● 'Hello, world' is a literal string ● print is a function
  • 17. "Hello, world" -> [print, print] Function String Function
  • 18. ["Hello, world", "Hello, world"] -> print String Function String
  • 19. range(99, 0, -1) | [ _ % 2 == 0 ] -> str -> _ + " bottle(s) of beer on the wall," -> print -> _.split(' on')[0] + '.' -> print -> print("Take one down, pass it around,") Integer Filter Function Expression Function Function Function Function
  • 20. Basic Pythonect Syntax Summary ● -> is async forward. ● | (i.e. Pipe) is sync forward. ● _ (i.e. Underscore) is current value in flow
  • 22. ROT13 Encrypt & Decrypt raw_input() -> _.encode('rot13') -> print Function Function Function
  • 23. Check if FTP Server Supports Anonymous Login 'ftp.gnu.org' -> ftplib.FTP -> _.login() -> print("Allow anonymous") String Class Function Function
  • 24. (Multi-thread) HTTP Directory Brute-force sys.argv[1] -> [str(_ + '/' + x) for x in open(sys.argv[2],'r').read().split('n')] -> [(_, urllib.urlopen(_))] -> _[1].getcode() != 404 -> print "%s returns %s" % (_[0], _[1], _[1].getcode()) Function Filter Function String Nested Loop ...
  • 25. Command line Fuzzer ['%s', '%n', 'A', 'a', '0', '!', '$', '%', '*', '+', ',', '-', '.', '/', ':'] | [_ * n for n in [256, 512, 1024, 2048, 4096]] | os.system('/bin/ping ' + _) Array Nested Loop Function
  • 26. (Multi-thread) Generic File format Fuzzer open('dana.jpg', 'r').read() -> itertools.permutations -> open('output_' + hex(_.__hash__()) + '.jpg', 'w').write(''.join(_)) Function String Function ...
  • 27. Compute MALWARE.EXE's MD5 & SHA1 "MALWARE.EXE" -> [os.system("/usr/bin/md5sum " + _), os.system("/usr/bin/sha1sum " + _)] Function String Function
  • 28. Compute MALWARE.EXE's Entropy ● Entropy.py: ● Pythonect: import math "MALWARE.EXE" def entropy(data): entropy = 0 -> open(_, 'r').read() if data: -> entropy.entropy for x in range(2**8): p_x = float(data.count(chr(x))) / len(data) -> print if p_x > 0: entropy += - p_x * math.log(p_x, 2) return entropy
  • 29. References / More Examples ● My Blog – Scraping LinkedIn Public Profiles for Fun and Profit – Fuzzing Like A Boss with Pythonect – Automated Static Malware Analysis with Pythonect ● LightBulbOne (Blog) – Fuzzy iOS Messages!
  • 30. Pythonect Roadmap ● Support Python 3k ● Support Stackless Python ● Support IronPython ● Support GPU Programming ● Fix bugs, etc.
  • 32. Moving on! Developing Domain-specific Language (DSL) with Pythonect
  • 33. Domain-specific Language ● Domain-specific language (DSL) is a mini-language aiming at representing constructs for a given domain ● DSL is effective if the words and idioms in the language adequately capture what needs to be represented ● DSL can also add syntax sugar
  • 34. Why? Why create a custom tag or an object with methods? Elegant Code Reuse Instead of having to recode algorithms every time you need them, you can just write a phrase in your DSL and you will have shorter, more easily maintainable programs
  • 35. Example for DSL's ● Programming Language R ● XSLT ● Regular Expression ● Graphviz ● Shell utilities (awk, sed, dc, bc) ● Software development tools (make, yacc, lex) ● Etc.
  • 37. Example #1: XSLT 'Hello, world' <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="p"> Hello world! - From hello.xsl. </xsl:template> </xsl:stylesheet>
  • 38. Example #2: Graphviz/DOT 'Hello, world' digraph G { Hello → World }
  • 39. Domain-specific Language with Pythonect ● Pythonect provides various features to let you easily develop your own DSLs: – Built-in Python module Autoloader – Concurrency (Threads & Processes) – Abstract Syntax (i.e. Generic Flow Operators)
  • 40. Built-in Python AutoLoader ● The AutoLoader loads Python modules from the file system when needed ● In other words, no need to import modules explicitly. ● The sacrifice is run-time speed for ease-of-coding and speed of the initial import()ing.
  • 41. 'Hello, world' -> string.split i.e. import string return string.split
  • 42. Concurrency (Threads & Processes) ● Multi-threading: – 'Hello, world' -> [print, print] ● Multi-processing: – 'Hello, world' -> [print, print] ● Mix: – 'Hello, world' -> [print, print &]
  • 43. Abstract Syntax ● Brackets for Scope: – [] ● Arrows and Pipes for Flows: – | and -> ● Dict and Logical Keywords for Control Flow: – {} and not/or/and
  • 44. So, imagine the following is a real script: from_file('malware.exe') -> extract_base64_strings -> to_xml
  • 46. Meet SMALL Simple Malware AnaLysis Language ● Toy language for analyzing malware samples ● Single Python file (14 functions, 215 lines of text) ● Runs on top of Pythonect
  • 47. SMALL Features ● Extract IPv4 Addresses from Binaries ● Extract Base64 Strings from Binaries ● Calculate MD5/SHA1/CRC32 ● Determine File Type (via /usr/bin/file) ● Create XML Reports
  • 48. How Does SMALL Work? ● SMALL functions are divided into two groups: – Root, these functions start a flow – Normal, these functions continues or closes the flow ● Root functions accept String and return dict – e.g. from_file() ● Normal functions accept dict and return dict – e.g. extract_base64_strings()
  • 49. <Pythonect/Security DSL (i.e. SMALL) Examples>
  • 50. How to Start the SMALL Interpreter pythonect -m SMALL -i ● The '-m' means - run library module as a script ● The '-i' means - inspect interactively after running script ● Just like Python :)
  • 51. Extract Base64 Strings and Save As XML from_file('malware.exe') -> extract_base64_strings -> to_xml Function Function Function
  • 52. Extract IPv4 Addresses and Save As XML from_file('malware.exe') -> extract_ipv4_addresses -> to_xml Function Function Function
  • 53. Compute MD5, SHA1, CRC32, and FileType from_file('malware.exe') -> md5sum -> sha1sum -> crc32 -> file_type -> to_xml Function Function Function
  • 54. Other (Potential) Security Domains: ● Reverse Engineering ● Malware Analysis ● Penetration Testing ● Intelligence Gathering ● Fuzzing ● Etc.
  • 57. Hackersh ● Hackersh is a portmanteau of the words Hacker and Shell ● Shell (command interpreter) written with Pythonect-like syntax, built-in security commands, and out of the box wrappers for various security tools ● Current “stable“ version (True to Apr 1 2013): 0.1.0 ● Made available under GNU General Public License v2 or later ● Influenced by: Unix Shell Scripting and Pythonect ● Cross-platform (should run on any Python supported platform) ● Website: http://www.hackersh.org
  • 58. A few words on the Development ● Written purely in Python (2.7) ● Hosted on GitHub
  • 59. Motivation ● Taking over the world ● Automating security tasks and reusing code as much as possible
  • 60. Problems ● There are many good security tools out there... – but only a few can take the others output and run on it – but only a few of them give you built-in threads/processes controling for best results ● No matter how well you write your shell script, the next time you need to use it - for something slightly different - you will have to re-write it
  • 61. Hackersh – The Solution ● Hackersh provides a “Standard Library“ where you can access your favorite security tools (as Components) and program them as easy as a Lego ● Hackersh lets you automagically scale your flows, using multithreading, multiprocessing, and even a Cloud ● Hackersh (using Pythonect as it's scripting engine) gives you the maximum flexibility to re-use your previous code while working on a new slightly-different version/script
  • 62. Installing and Using The Hackersh ● Install directly from PyPI using easy_install or pip: – easy_install Hackersh OR – pip install Hackersh ● Clone the git repository: – git clone git://github.com/ikotler/hackersh.git – cd hackersh – python setup.py install
  • 63. Implementation ● Component-based software engineering – External Components ● Nmap ● W3af ● Etc. – Internal Components ● URL (i.e. Convert String to URL) ● IPv4_Address (i.e. Convert String to IPv4 Adress) ● Etc.
  • 64. Component as Application ● Components accepts command line args: – "localhost" -> hostname -> nmap("-P0") ● They also accept internal flags options as: – "localhost" -> hostname -> nmap("-P0", debug=True)
  • 65. Input/Output: Context ● Every Hackersh component (except the Hackersh Root Component) is standardized to accept and return the same data structure – Context. ● Context is a dict (i.e. associative array) that can be piped through different components
  • 66. Same Context, Different Flow ● "http://localhost" -> url -> nmap -> ping – Port scan a URL, if *ANY* port is open, ping it ● "http://localhost" -> url -> ping -> nmap – Ping the URL, if pingable, scan for *ANY* open ports
  • 67. Ask The Context ● Context stores both Data and Metadata ● The Metadata aspect enables potential AI applications to fine- tune their service selection strategy based on service-specific characteristics
  • 68. Conditional Flow "http://localhost" -> url -> nmap -> [_['PORT'] == '8080' and _['SERVICE'] == 'HTTP'] -> w3af -> print
  • 69. Hackersh High-level Diagram Root Literal Component Context Component ... (e.g. String) (e.g. URL)
  • 71. TCP & UDP Ports Scanning "localhost" -> hostname -> nmap Built-in External Target Component Component
  • 72. Class C (256 Hosts) Ping Sweep '192.168.1.0/24' -> ipv4_range -> ping Built-in External Target Component Component
  • 73. Web Server Vulnerability Scanner '127.0.0.1' -> ipv4_address -> nmap -> nikto Built-in External External Target Component Component Component
  • 74. Fork: Target as Hostname + Target as IP "localhost" -> hostname -> [nslookup, pass] -> ... Target ... as Hostname Built-in Target Component Target ... as IPv4 Addr.
  • 75. Black-box Web App Pentration Testing "http://localhost" -> url -> nmap -> browse -> w3af -> print Built-in External Built-in External Built-in Target Component Component Component Component Component
  • 76. Hackersh Roadmap ● Unit Tests ● Documention ● More Tools – Metasploit – OpenVAS – TheHarvester – Hydra – … ● Builtin Commands ● Plugins System ● <YOUR IDEA HERE>
  • 79. Thank you! My Twitter: @itzikkotler My Email: ik@ikotler.org My Website: http://www.ikotler.org Pythonect Website: http://www.pythonect.org Hackersh Website: http://www.hackersh.org Feel free to contact me if you have any questions!