SWEN-331: Engineering Secure Software Benjamin S Meyers
VOTD: OS Command Injection
Engineering Secure Software
Last Revised: September 17, 2020 1
VOTD: OS Command Injection Engineering Secure Software Last - - PowerPoint PPT Presentation
VOTD: OS Command Injection Engineering Secure Software Last Revised: September 17, 2020 SWEN-331: Engineering Secure Software Benjamin S Meyers 1 What is OS Command Injection Executing arbitrary commands on the host OS via a vulnerable
SWEN-331: Engineering Secure Software Benjamin S Meyers
Last Revised: September 17, 2020 1
SWEN-331: Engineering Secure Software Benjamin S Meyers
2
SWEN-331: Engineering Secure Software Benjamin S Meyers
3
# Ruby print “What files should I list?” line = gets system(“ls -lah #{line}”) // Java Scanner inputScanner = new Scanner(System.in); System.out.println(“What files should I list?”); String files = inputScanner.nextLine(); String command = “ls -lah ” + files; Process proc = Runtime.getRuntime().exec(command); # Python files = input(“What files should I list?”)
SWEN-331: Engineering Secure Software Benjamin S Meyers
4
# Ruby print “What files should I list?” line = gets # system(“ls -lah #{line}”) system(“ls”, “-lah”, “#{line.chomp}”) // Java Scanner inputScanner = new Scanner(System.in); System.out.println(“What files should I list?”); String files = inputScanner.nextLine(); String command = “ls -lah ” + files; // Process proc = Runtime.getRuntime().exec(command); String[] commandArr = command.split(“;”, 5); Process proc = Runtime.getRuntime().exec(commandArr[0]); # Python files = input(“What files should I list?”) # os.system(“ls -lah ” + files)
SWEN-331: Engineering Secure Software Benjamin S Meyers
5
# Ruby print “What files should I list?” line = gets # system(“ls -lah #{line}”) system(“ls”, “-lah”, “#{line.chomp}”) // Java Scanner inputScanner = new Scanner(System.in); System.out.println(“What files should I list?”); String files = inputScanner.nextLine(); String command = “ls -lah ” + files; // Process proc = Runtime.getRuntime().exec(command); String[] commandArr = command.split(“;”, 5); Process proc = Runtime.getRuntime().exec(commandArr[0]); # Python files = input(“What files should I list?”) # os.system(“ls -lah ” + files)
SWEN-331: Engineering Secure Software Benjamin S Meyers
6
SWEN-331: Engineering Secure Software Benjamin S Meyers
7
SWEN-331: Engineering Secure Software Benjamin S Meyers
8