0% found this document useful (0 votes)
2 views51 pages

Lecture Note_Hacking Security Programming 1

The document outlines the development of hacking security software, including concepts like debuggers, hooking, code injection, fuzzing, and tool automation. It also covers the setup of a Windows virtual machine using Oracle VM VirtualBox and the installation of Python development environments. Learning objectives include understanding hacking security software, building virtual machines, and setting up Python programming environments.

Uploaded by

robotgpt.grupal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views51 pages

Lecture Note_Hacking Security Programming 1

The document outlines the development of hacking security software, including concepts like debuggers, hooking, code injection, fuzzing, and tool automation. It also covers the setup of a Windows virtual machine using Oracle VM VirtualBox and the installation of Python development environments. Learning objectives include understanding hacking security software, building virtual machines, and setting up Python programming environments.

Uploaded by

robotgpt.grupal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HACKING &

SECURITY
PROGRAMMING

Introduction

Professor Son Kyu-sik 1


학습목Table of Contents

1. Development of Hacking Security Software
2. Building Windows Virtual Machine
3. Setting up Python Programming Environment

Learning Objectives

§ We can explain the concept of hacking security software and its development process.
§ We can explain the necessity of virtual machines and build a Windows virtual machine.
§ We can explain the features of Python and set up a Python programming environment.

2
1. Hacking Security Software Development
1) Hacking Security Software
▐ Concept of Hacking Security Software
} Definition of Hacking Security Software
• It is software used as a tool to detect hacking threats (vulnerabilities).
} Technologies in Hacking Security Software
• It includes debuggers, hooking, code injection, fuzzing, automation of attack tools,
emulation techniques, etc.
• Knowledge of utilizing computer operating system APIs is required.
• The technologies needed for developing hacking tools are the same.

Hacking security Hacking tool


software software
development development
techniques techniques

3
1. Hacking Security Software Development
1) Hacking Security Software
▐ Debugger
} Definition
• A tool to help debug programs
• It finds bugs and defects in programs by viewing or changing program executable code,
process memory contents, and CPU register contents to arbitrary values.
} The Role of a Debugger
• It acts as eyes for hackers to look into the target and find weaknesses
• It detects software flaws, develop exploits, assist with fuzzing, and investigate malicious
SW

Exploit creation,
fuzzer creation,
Processes
forensics
(code, memory, CPU
registers)
4
1. Hacking Security Software Development
1) Hacking Security Software
▐ Hooking
} Definition
• It intercepts function calls, messages, etc., to modify and extend functionality.
} Function
• It monitors program memory and data access, changing execution flow and behavior.
} Uses
• It is used by rootkits to hide themselves.
• It is used by key loggers to intercept keystrokes.

Hooking handler

Program Function
5
1. Hacking Security Software Development
1) Hacking Security Software
▐ Code Injection
} Definition
• It is a technique of injecting malicious code into input data to alter the behavior or
execution results of a program.
} Legitimate use
• It dynamically extends and modifies program behavior to diversify services.
} Illegal use
• It illegally accesses data to destroy it or attempt privilege escalation.

login: ...(;delete *;)...

passwd:
6
1. Hacking Security Software Development
1) Hacking Security Software
▐ Fuzzing
} Definition
• It is a program testing technique where abnormal data is deliberately input into the program
to find bugs, and it can be misused for hacking.
} Uses
• It finds vulnerabilities such as buffer overflow and integer overflow.
• It identifies bugs and vulnerabilities in file handling functions
of OS or applications.
} Types of Fuzzers
• Generation-based fuzzer Fuzzer
• Mutation fuzzer
Bug

7
1. Hacking Security Software Development
1) Hacking Security Software
▐ Tool Automation
} Definition
• A program that controls the functions of software testing and hacking tools, enabling
automatic operation of the tools.
• The tools support automation API libraries and interpreters.
} Example: Automation-capable debugger -- IDA Pro
• It provides an automation scripting language (IDA Python).
• Automates both static and dynamic analysis.

Job Script
Debugging
control interpreter or Target
Engine
script API Process

DB editor Job spec.,


debugging data 8
1. Hacking Security Software Development
1) Hacking Security Software
▐ Emulator
} Definition
• It is a type of virtual machine that mimics the functionality of a target to provide the
same service.
• Example: CPU, interfaces, computer hardware architecture, etc.
} Usage
• It allows safe execution of malicious code and enables reverse engineering and analysis.

9
1. Hacking Security Software Development
2) Hacking Security Software Development Lifecycle (SDLC)
▐ SW Development Life Cycle (SDLC)
} SDLC Model
• It consists of a workflow diagram and development environment architecture.

Software
Software Software design Software
Requirements
design implementation testing
Analysis

Requirements Software build Testing


Design tools
analysis tools tools tools

10
1. Hacking Security Software Development
2) Hacking Security Software Development Lifecycle (SDLC)
▐ Hacking Security SDLC Tasks
} Software Requirements Analysis
• It defines hacking objectives, expected effects, and exploitable system vulnerabilities.
} Software Design
• It defines program algorithms and data structures.
• It chooses libraries provided by the programming language.
} Software Build
• It performs coding, code review, unit testing, and debugging.
• It uses virtual machines to securely build hacking security programs.
} Software Integration Testing
• It tests the integrated functionality and service performance of hacking security programs.
• It considers the uncertainty of testing.

It is the phenomenon where fixing a software


defect leads to the introduction of another defect.
11
2. Windows Virtual Machine Setup
1) Virtual Machine (VM)
▐ The Concept of VM
} The Definition of VM
• A combination of software (SW), firmware (FW), and hardware (HW) that virtualizes
(virtualization) and emulates a single computer system
} The Components of VM
• A single VM consists of a hypervisor and a guest OS.
• Applications (app.) are supported by the guest OS.

Hacking security Software development


application software environment application
Host
Computer VM
guest OS

hypervisor
1
2. Windows Virtual Machine Setup
1) Virtual Machine (VM)
▐ Hypervisor
} Definition
• It is referred to as a Virtual Machine Monitor (VMM).
• It emulates and virtualizes actual computer hardware (HW), firmware (FW), and device
drivers (Drv) to create a virtual computer platform where the guest OS operates.
} Hypervisor Classification
• Type-1 (Bare Metal)
• Type-2 (Hosted)

2
2. Windows Virtual Machine Setup
2) Oracle™ VM VirtualBox
▐ Features
} Classification
• Type-2 (Hosted) hypervisor
• A free and open-source x86 hardware virtualization product developed and provided by
Oracle
} Host OS
• VirtualBox operates on various OS such as Windows, Linux, and macOS.
} Guest OS
• It supports OS like Windows, Linux (Ubuntu, Kali, etc.), BSD, OS/2, Solaris, and more.
} CPU Hardware Virtualization Support
• It uses Intel CPU's VT-x and AMD CPU's AMD-V for enhanced speed and security.

3
2. Windows Virtual Machine Setup
2) Oracle™ VM VirtualBox
▐ Host Computer
} Definition
• The computer where VirtualBox (v.6.1 or higher) is installed.
} HW and OS
• It must have a hardware architecture based on x86 and AMD CPUs.
• It must use Windows (10, 11), Linux, or macOS X (v.10.13–10.15).

Download Site
Host
computer

4
2. Windows Virtual Machine Setup
2) Oracle™ VM VirtualBox
▐ VirtualBox Download Site
} URL -- [Link]
• [Link]

5
2. Windows Virtual Machine Setup
2) Oracle™ VM VirtualBox
▐ Selecting and Downloading the VirtualBox Program
} Selection Criteria
• Host OS: Windows 10, 11, Linux, Solaris, OS X

open

You have selected to open the next file:

File format:
Original location :
Would you like to save this file?

save cancel

6
2. Windows Virtual Machine Setup
2) Oracle™ VM VirtualBox
▐ Installing VirtualBox
} Installation Program Initial Screen

} VirtualBox Installation Custom Setup


• By default, it provides USB, Networking, and Python2 features.
• Some features can be excluded based on user needs.
• The installation directory can be changed and specified. 7
2. Windows Virtual Machine Setup
2) Oracle™ VM VirtualBox
▐ Installing VirtualBox
} Installation in progress

8
2. Windows Virtual Machine Setup
2) Oracle™ VM VirtualBox
▐ First launch of VirtualBox
} Initial screen of Oracle VM VirtualBox Manager (OVVM)

9
2. Windows Virtual Machine Setup
2) Oracle™ VM VirtualBox
▐ Initial Setup of VirtualBox
} Setting the VM default directory (if necessary)
• [File] / [Preference...] / [General]/ [Default Machine Folder]

10
2. Windows Virtual Machine Setup
2) Oracle™ VM VirtualBox
▐ Initial Setup of VirtualBox
} Changing the VM host key (HOST-KEY) (if necessary)
• [File] / [Preference...] / [Input] / [Virtual Machine] / [Host Key Combination]

11
2. Windows Virtual Machine
3) Windows VM Setup
▐ To obtain a Windows image for VM setup
} MS Edge development Windows 10 VM image (MS Edge Win10 VM)
• [Link]
} Windows 10 Enterprise 90-day evaluation version
• [Link]
} Windows 11 Enterprise development environment VM image
• [Link]

Host
Computer HS-app VM's HS-app
Sw.D.E. Sw.D.E.

Windows 10 Windows 10

hypervisor (VirtualBox)

12
2. Windows Virtual Machine
3) Windows VM Setup
▐ MS Edge Win10 Installation Site

Win7,
Win8.1,
Win9,
Win10

VirtualBox,
VMware, Vagrant,
Hyper-V, Parallels

These virtual machines expire after 90 days.


We recommend setting a snapshot when you first install the virtual machine which
13
you can roll back to later.
2. Windows Virtual Machine
3) Windows VM Setup
▐ Downloading MS Edge Win10 VM
} MS Edge - [Link]
• Archive of a Windows 10 VM image with MS Edge and IE11 installed.
• MS [Link] (approximately 7.1GB)

14
2. Windows Virtual Machine
3) Windows VM Setup
▐ Select MS Edge - Win10 VM
} In OVVM, select [Main Menu] > [File] > [Import Virtual Appliance], then choose the MS
Edge - [Link] file through the browser.

Configuration
Screen

15
2. Windows Virtual Machine
3) Windows VM Setup
▐ Preparing and running the MS Edge - Win10 VM implementation

Double-clicking the value field of


each configuration item allows users
to change or input the value.

16
2. Windows Virtual Machine
3) Windows VM Setup
▐ HSP-MS Edge-Win10 VM implementation completed
} Screen after VM implementation

§ Details
§ Snapshot A snapshot of the VM should be taken
§ Logs immediately after the implementation.

17
2. Windows Virtual Machine
3) Windows VM Setup
▐ Snapshot after the implementation of HSP-MS Edge-Win10 VM
} The snapshot version is displayed next to the VM name.

VM power on and start

HSP-MS Edge-Win10
(Snapshot 1)

18
2. Windows Virtual Machine
3) Windows VM Setup
▐ HSP-MS Edge-Win10 VM Booting

Passw0rd!

19
2. Windows Virtual Machine
3) Windows VM Setup
▐ Windows 10 account login and Windows 10 VM implementation completed.

Since the Windows


license validity
period is 90 days,
a solution should be prepared
before the validity period
expires.

20
3. Setting up the Python Development Environment
1) Python
▐ Overview of Python
} It supports multiple programming paradigms.
• Python is a language that supports structured, functional, and object-oriented
programming.
} It is easy to learn and use.
• Python is known for its simplicity in both learning and usage.
• Interpreter-based language
• Python is an interpreted language.
} It has many libraries available for hacking and security tasks.
• As most existing code is written in Python 2, this course will use Python 2.

1
3. Setting up the Python Development Environment
1) Python
▐ Free Python Development Environments
} IDLE (integrated development & learning environment)
• A basic IDE specifically for Python, provided by Python developers.
• It is easy to learn and ideal for small-scale program development.
• It comes bundled with Python installation, so no additional download is required.
} VS Code
• A lightweight yet powerful IDE with rich editing and debugging features, provided by
Microsoft
} PyDev
• It is a Python plugin module for Eclipse.
• It allows users to utilize Eclipse's rich editing and debugging features.

2
3. Setting up the Python Development Environment
2) Installing Python IDLE
▐ Installing Python Python 3.10.2
} Link -- [Link] (64-bit, 32-bit)
Python 2.7.18
(64-bits\, 32-bit)

3
3. Setting up the Python Development Environment
2) Installing Python IDLE
▐ Installing Python
} The Result of Installing

4
3. Setting up the Python Development Environment
2) Installing Python IDLE
▐ Installing Python 2.7.18
} Installation Start Screen

5
3. Setting up the Python Development Environment
2) Installing Python IDLE
▐ Installing Python 2.7.18
} Installation Options
• [install for all users] = True
• [destination directory] = "C:\Python27" | "C:\Python27-64" | "
• [Path env. variable] = add [Link] to Path

6
3. Setting up the Python Development Environment
2) Installing Python IDLE
▐ Installing Python 2.7.18
} Installation Completion Screen

7
3. Setting up the Python Development Environment
2) Installing Python IDLE
▐ Installing Python 3.10.2
} Installation Start Screen

8
3. Setting up the Python Development Environment
2) Installing Python IDLE
▐ Installing Python 3.10.2
} Installation Options
• [Add Python 3.10 to PATH] [v]
• [Customize installation]
• [Optional Features] = {pip, tcl/tk and IDLE, Pthon test suite, py launcher, for all
users}
• [Install for all users] [v]
• [Download debugging symbols] [v]
• [Download debug bainaries] [v]
• [Customize install location] = "C:\Program Files (x86)\Python310-32" | "C:\Program
Files\Python310"
• [Disable path length limit] [v]

9
3. Setting up the Python Development Environment
1) Installing Python IDLE
▐ Installing Python 3.10.2
} Installation Completion Screen

10
3. Setting up the Python Development Environment
2) Installing Python IDLE
▐ Python and IDLE Installation Result
} Checking the contents of the PATH environment variable
(<windows prompt> PATH)
• PATH=
• C:\Program Files\Python310\Scripts\;
• C:\Program Files\Python310\;
• C:\Program Files (x86)\Python310-32\Scripts\;
• C:\Program Files (x86)\Python310-32\;
• C:\Python27-64\;
• C:\Python27-64\Scripts;
• C:\Python27\;
• C:\Python27\Scripts;
• (and…)

11
3. Setting up the Python Development Environment
2) Installing Python IDLE
▐ Checking Python and IDLE Installation Result
} PATH environment variable
• (…and)
• C:\Windows\system32;
• C:\Windows;
• C:\Windows\System32\Wbem;
• C:\Windows\System32\WindowsPowerShell\v1.0\;
• C:\Windows\System32\OpenSSH\;
• C:\ProgramData\chocolatey\bin;
• C:\Program Files\Puppet Labs\Puppet\bin;
• C:\Users\IEUser\AppData\Local\Microsoft\WindowsApps;

12
3. Setting up the Python Development Environment
3) Python Hello world!
▐ Running IDLE
} Running IDLE (Python GUI) from the Start menu

13
3. Setting up the Python Development Environment
3) Python Hello world!
▐ Running IDLE
} Running Python code in the IDLE code editor

14
3. Setting up the Python Development Environment
3) Python Hello world!
▐ Running IDLE
} Running Python code in the IDLE code editor

15
Source & Reference

§ [Link]
§ [Link]
§ [Link]
§ [Link]
§ [Link]

16
Summary

§ Hacking Security Software Development


• Hacking Security Software
üHacking Security SW Concepts -- Definition, Technology
üDebugger
üHooking
üCode injection
üFuzzing
üTool automation
üEmulator
• SW development lifecycle
üSDLC Model
üHacking Security SDLC Tasks

17
Summary

§ Windows Virtual Machine Setup


• Virtual Machine
üVM Concept
üHypervisor
• Oracle VM VirtualBox
üFeatures
üHost computer
üVirtualBox Installation Site
üSelecting and Installing VirtualBox Installer
üInstalling VirtualBox
üFirst Launch of VirtualBox
üInitial Setup of VirtualBox

18
Summary

§ Windows Virtual Machine Setup


• Windows VM setup
üTo Obtain a Windows Image for VM Setup
üMS Edge Win10 Installation Site
üInstalling MS Edge Win10 VM
üMS Edge - Selecting Win10 VM
üMS Edge - Preparing and Running the Win10 VM
üHSP-MSEdge-Win10 VM Setup Complete
üSnapshot after Setting up HSP-MSEdge-Win10 VM
üBooting HSP-MSEdge-Win10 VM
üLogging into Windows 10 Account and Completing the Windows 10 VM Setup

19
Summary

§ Setting up the Python Development Environment


• Python
üOverview of Python
üPython Development Environment
• Installing Python IDLE
üInstalling Python
üInstalling Python 2.7.18
üInstalling Python 3.10.2
üPython and IDLE Installation Results
üChecking Python and IDLE Installation Results
• Python Hello world
üRunning IDLE

20

You might also like