Executing Host Commands

Slides:



Advertisements
Similar presentations
SARA Reken- en NetwerkdienstenToPoS | 3 juni 2007 More efficient job submission Evert Lammerts SARA Computing and Networking Services High Performance.
Advertisements

Procedures and Functions. What are they? They are both blocks of code that can be reused to perform specific task. However there is a difference: Function-
User-defined Functions Selim Aksoy Bilkent University Department of Computer Engineering
Guide To UNIX Using Linux Third Edition
BizTalk Adapter Pack (SAP) Installation
Python Mini-Course University of Oklahoma Department of Psychology Day 1 – Lesson 2 Fundamentals of Programming Languages 4/5/09 Python Mini-Course: Day.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
1 Shell Programming – Extra Slides. 2 Counting the number of lines in a file #!/bin/sh #countLines1 filename=$1#Should check if arguments are given count=0.
A Guide to Unix Using Linux Fourth Edition
The Python interpreter CSE 140 University of Washington Michael Ernst.
Shell (Part 2). Example r What if we want to support something like this: m ps –le | sort r One process should execute ps –le and another should execute.
Constructive Computer Architecture Tutorial 3: Debugging SMIPS Andy Wright 6.S195 TA October 4, 2013http://csg.csail.mit.edu/6.s195T03-1.
Website s Azure Websites is an enterprise class cloud solution for developing, testing and running web apps. Azure Websites allows you to focus on what.
Shell (Addendum). Example r What if we want to support something like this: m ps –le | sort r One process should execute ps –le and another should execute.
Illustration of a Visual Basic Program Running an Ada Program 1 by Richard Conn 11 September 1999.
Shell Interface Shell Interface Functions Data. Graphical Interface Graphical Interface Command-line Interface Command-line Interface Experiments Private.
POWERSHELL BASICS. BACKGROUND  Powershell is a task automation and scripting language based off the.NET framework  It provides the user full access.
The Python interpreter CSE 160 University of Washington Ruth Anderson 1.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
Release Management with Visual Studio Team Services
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
JMU GenCyber Boot Camp Summer, “Canned” Exploits For many known vulnerabilities attackers do not have to write their own exploit code Many repositories.
OPERATING SYSTEM BASICS. What is an operating system and what does it do? The operating system has two basic functions: –communicates with the PC.
1 Lecture 7 Introduction to Shell Scripts COP 3353 Introduction to UNIX.
Wouter Verkerke, NIKHEF 1 Using ‘stoomboot’ for NIKHEF-ATLAS batch computing What is ‘stoomboot’ – Hardware –16 machines, each 2x quad-core Pentium = 128.
Operating System Simulator
PowerShell Chattanooga
Week 3 Redirection, Pipes, and Background
Department of Computer Engineering
Process API COMP 755.
Python Lesson 12 Mr. Kalmes.
The Python interpreter
Setting up your DEV C++.
Python Lesson 12 Mr. Kalmes.
PDO Database Connections
CSE 303 Concepts and Tools for Software Development
An Intro to ALM Using TFS and Visual Studio for Source Control, Build Automation, Continuous Integration and Deployments.
Globus Job Management. Globus Job Management Globus Job Management A: GRAM B: Globus Job Commands C: Laboratory: globusrun.
TRANSLATORS AND IDEs Key Revision Points.
File redirection ls > out
PDO Database Connections
The Python interpreter
PDO Database Connections
Program Requirements.
Welcome to Automated Visual regression testing
Metasploit Analysis Report Overview
Chapter Four UNIX File Processing.
Delivering Business Value Faster
MySQL Backup, Transfer and Restore
More advanced BASH usage
The Condor JobRouter.
Form Validation, Part 2 (with jQuery, HTML5, and CSS)
Michael P. McCumber Task Force Meeting April 3, 2006
CSE 303 Concepts and Tools for Software Development
NodeJS, Variables, Input/Output (I/O)
Functions MIS 3406 Department of MIS Fox School of Business
String Processing 1 MIS 3406 Department of MIS Fox School of Business
MVC – Model View Controller
Reading and Writing Text Files
NodeJS, Variables, Input/Output (I/O)
Metasploit assignment – Arkadiy Kantor – Mis-5212
Introduction to Linux Commands
Executing Host Commands
Following Malware Execution in IDA
The Python interpreter
Reliably Executing External Processes
The Python interpreter
Programming Techniques
UpgradeX and CloudSuite
Presentation transcript:

Executing Host Commands MIS 3406 Department of MIS Fox School of Business Temple University

Why Execute Host Commands Why would you want to execute host commands within code? Automate repetitive tasks Moving data Monitoring systems Backups DevOps Automated operations Automated testing Automated migration of code and data Dev  QA  Prod

What do you need to be able to do? Execute a command Capture and process the output Stdout – Stderr – Capture the “Exit Code” (a.k.a. “Return Code”) Conditional execution of code based on results of the host command

Execute a command at the command line… Arguments 1, 2 and 3 stdout

Let’s execute it within NodeJS… Setup .spawnSync stdout Command Arguments 1, 2 and 3 stderr Exit Code

How about a bad command… Setup .spawnSync stdout Command Arguments 1, 2 and 3 stderr Exit Code

OS Command (not a .exe) – Windows Only Arguments Need a Shell stdout stderr Exit Code

HostCommandWithExe.js Get your first program running that executes a host command with an exe.

HostCommandWithoutExe.js Get your first program running that executes a host command without an exe.

Challenges MyPing MyDir WhoAmI MyHostName MyIPAddress LookupIPAddress