O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Security Engineering

Gustav j Inglês 151 flashcards

Flashcards do conjunto (151)

  1. 1What are the main security properties CIA?1. Confidentiality
    can non-authorized entities see data?
    2. Integrity
    has the data been altered? (observe/enforce data integrity)
    3. Availability
    is data always available?
    +
    4. Non-repudiation
    • Impossible to deny a transaction or having sent a message.
  2. 2what is Auditability of a system?the ability to reconstruct earlier states of a system
  3. 3Evaluate a risk:1. Probability that the risk occurs
    2. Severity of the consequences
    Considering probability*consequence:
    how much am I willing to invest money/time to secure against that risk?
  4. 4What is social engineering?Non-technical:
    Don‘t hack system; „hack“ people
    • Impersonating IT staff
    • Playing on users' sympathy
    • Using intimidation tactics
    • Shoulder surfing
  5. 5What attacks can be done with 'unchecked user input'Attacks:
    1. Buffer-overflow attacks
    2. XSS=Cross Site Scripting
    3. SQL-injection
  6. 6Explain Buffer Overflow attacksExploit unchecked user input:
    insert very big/long input to make a buffer overflow --> overwriting memory
    Can overwrite the return address of the Stackframe to point back to own malicious code to gain access to shell etc.
  7. 7Explain SQL injectionsExcploit unchecked user input:
    inject SQL queries to read/change data of a database.
  8. 8Explain Cross Site Scripting attacksExploit unchecked user input:
    inject javascript in websites that executes on a user's web browser
    Disclose cookies etc.
  9. 9Difference between Safety vs. SecuritySafety:
    protecting the environment
    from the system
    Security:
    securing the system from the environment(external threats)
  10. 10What is an Attack Tree?Use Attack tree to:
    Systematically model how attacks patterns can be executed
  11. 11what is Non-repudiation?Signatures enables Non-repuadiation.
    Non-repudiation is the assurance that someone cannot deny the validity of of a Transaction/Message.
    Proof of the origin of data and the integrity of the data. In other words, non-repudiation makes it very difficult to successfully deny who/where a message came from as well as the authenticity of that message.
  12. 12What is an Asset?Something of value to an entity/company that can be tangible/intangible
  13. 13What is a Threat?something/someone(attacker) that can Exploit a Vulnerability
  14. 14what is a Vulnerability?A weakness of an asset that can be exploited by an attacker
  15. 15what is an Exploit?the actual Attack
  16. 16What are are the standard techniques for listing Safety/Security Requirements?1. Safety: FTA
    2. Security: Misuse Cases, Attack Trees
  17. 17What is Requirements EngineeringRequirements Engineering is about eliciting, understanding, and specifying what the system should do, and which properties it should satisfy
    Understand the problem the system should solve. Through user requirements etc
    Should have quantifiable/verifiable clear requirements
  18. 18Is Security a functional or a non-functional requirement?Non-Functional requirement:
    describes constraints on the system. Eg Security, performance, maintainability
    Functional R:
    describe what the system is supposed
    to do -> features/functionality
  19. 19goal of: Fault Tree AnalysisGoal: identify all conditions that could lead to a system failure.
    Need to know how the system works to do FTA.
  20. 20What is Security Design?mapping Security Requirements to
    Security Mechanisms
  21. 21Standard Security Design Principles: high-level guidelines Principles embody best practices1. Least Privilege
    2. Complete Mediation
    3. Secure fail-safe defaults/Implicit deny
    4. Compartmentalization
    5. Minimum Exposure
    6. Open Design
    7. Economy of Mechanism
    8. Defense in Depth
    9. Least Common Mechanism
    10. Psychological Acceptability
  22. 22explain Least PrivilegeEvery subject should have minimum privelege/access to be able to complete it's job.
    eg. Do NOT use sudo root user for hosting your web server
  23. 23explain Complete MediationAccess to every object must be controlled in a way that is not circumventable
    eg.
    Sniffing traffic to circumvent access-control mechanisms imposed by the web application. End- to-end encryption can help here.
  24. 24explain Secure fail-safe defaults/Implicit denySystems should start in a secure state and return to a secure default state in case of failure
    eg.
    base access rights on permission rather than exclusion - default is lack of access
    --> Use white-lists, rather than black-lists
  25. 25explain CompartmentalizationOrganize resources in different compartments/zones isolated from others
    eg.
    Keep your DB on a separate server from your backend - separate data and code
  26. 26explain Minimum exposureeg.
    No unnecessary ports open for servers. No redundant external API functions
    Don't indicate why a login fail(password/username)
  27. 27explain Open DesignThe security mechanisms of a system should not depend on the secrecy of its design or implementation
    -
    systems should be secure by design and not depend on obscurity to remain secure(Kerchoff's principle)
    eg.
    Hashes. The design+implementation is open, but currently unbrakable
  28. 28explain Economy of MechanismSecurity mechanisms should be as simple as possible
  29. 29explain Defense in DepthAdd multiple layers of security mechanisms
    eg.
    Two factor authentication
  30. 30explain Least Common MechanismSeparation of Privelege
    Mechanisms used to access resources, should not be shared.
    eg.
    Restrict access to some (sensitive) components of your system
    to users on the local network
  31. 31explain Psychological AcceptabilitySecurity mechanisms should not hamper accessibility of a resource unnecessarily
    Difficult balance: security vs. accessability
    If there is a security mechanism annoying people, they will circumvent it
    eg.
    force change of password every 2 weeks
  32. 32Information DIsclosureMaking secret information Known.
  33. 33Open Design principle advantages/disadvantages+ Code is not confidential, cannot leak
    - Cannot store keys within the code
    - Facilitates vulnerability discovery of hackers
  34. 34Give example of two conflicting security PrinciplesSecurity in Depth vs. Psychological Accept.
    eg. two-factor authentication
    the in depth security can hamper Accessibility
  35. 35why are Security Patterns hard to define?security is cross-cutting:
    Security Patterns cannot be defined locally, but has to consider all parts of a system
    + can be used to avoid mistakes that others have done before
  36. 36explain Biba modelBiba:
    an Integrity policy: No write UP
    =
    Read UP
    *** Write DOWN ***
  37. 37explain Bell-La PadulaBell-La Padula(a MAC model):
    a Confidentiality policy: No read UP
    =
    Write UP
    *** Read DOWN ***
  38. 38Access Control (AC) List becomes too large to be practical for a system with many files and users, what are other options?RBAC - Role-Based Access Control
    define roles that have certain access rights/permissions and assign subjects into these roles.
    Role permissions can be updated without the need to update the permissions of every subject.
    eg. Doctor>Nurse>Intern
    Role Hierarchies with inheritance simplify policy expressions
    Doctor has also the permissions as the roles below
  39. 39DAC/Discretionary AC: What user is allowed to chmod permissions of a file (Read, Write, Execute)DAC:
    Owner can decide/grant permissions to others
    + Flexible
    - Flexible=open for mistakes and abuse
  40. 40MAC/Mandatory AC:MAC:
    the system controls access to an object and an individual user cannot alter that access.
    - less flexible
    + less prone to security holes
  41. 41What two principles has to hold for Integrity?Read UP
    *** Write DOWN ***
  42. 42What two principles has to hold for Confidentiality?Write UP
    *** Read DOWN ***
    Write UP makes sense:
    to not disclose information from a higher clearance further down
  43. 43explain Chinese-Wall policyBased on BLP
    Company Datasets: CD
    Conflict of Interest Classes: CIC
    eg. cunsultancy firm that works for competing companies - should not leak information between.
    --> Not allowed to work at same different companies within the same Conflict Class - past or simultaneously.
  44. 44Chinese-Wall policy: How does the Conflict of Interest Class work?A simple policy to prevent conflict of interest:
    A subject s can access any information as long as it has never accessed information from a different company in the same conflict class.
    /Indirect information flow can still occur
  45. 45• BLP: access rights are (usually) assumed to be static. • Chinese Wall: access rights are changed dynamically, and must thus be re-examined in every state transition.:)
  46. 46Difference between Access and Usage Control- Access control defines and enforces access conditions
    - Usage control additionally defines and enforces what must and what must not happen after distribution of data
    eg. pdf file with non-copy control
  47. 47Authentication = ...validation of Identification
  48. 48Despite their simple, intuitive design, Access Control Matrices are not the first choice when it comes to storing access rights. Why?Matrix becomes very big for even a normal system
    Except from highly priveleged users, most users need only privelege to a subset of objects
    Many empty cells => waste of space
    Role-Based makes more sense.
    Esp when changing access rights
  49. 49properties of Symmetric KeysEither, the Encryption and the Decryption keys are the same.
    Or,
    symmetric-key if for each associated encryption/decryption key pair (e; d), it is computationally “easy” to determine d knowing only e, and to determine e from d.
    More effiecient than Asymmetric keys.
  50. 50Property of Asymmetric keysAsymmetric keys:
    Private key for decryption
    Public key for encryption
    The keys cannot be derived from each other.
    Public key can be sent out and Private key can be used to sign.
    Less efficient than Symmetric keys.
  51. 51What is plaintext?data that is not encrypted.
    Never store PWs in plaintext.
    Encryption:
    plaintext -> ciphertext
  52. 52Is an Encryption function/transform Bijective?Bijection = Onto + One-to-One
    Encryption is required to be Bijective:
    so that it is possible to Decrypt a message to the unique plaintext that was Enrcypted
  53. 53Terminology Σ - alphabet {0,1}, {a,b,c...} M - message space(uses Σ) C - ciphertext space(can differ from Σ) K - key space(one element of K is a key)Encryption key:
    e belongs to K, uniquely determines a bijection Ee : M → C
    Decryption key:
    d belongs to K, uniquely determines a bijection Dd : C → M
    For each Key pair: (e, d)
    Encryption key e, there exist one Decryption key d such that:
    Dd = Ee^(-1)
    Dd(Ee(m)) = m for all m in M
  54. 54Symmetric Key Cryptography: symmetric-key pair of (e, d) e is symmetric to d(+tvärtom) pros/cons?+ Symmetric keys are more efficient than asymmetric keys
    - Since keys (e, d) are Symmetric:
    computationally easy to calculate the other key if one of the keys in the pair is known.
  55. 55explain the Subsitution Cipher: One-time padsOne character is replaced by another, predefined, character.
    Key as long as message:
    message + random code % modulo 26
    Unbreakable unless the one-time pad/encryption key is intercepted or used twice
  56. 56How to brake a Mono-Alphabetic Substitution Cipher eg. Block ciphers where: Encryption simply maps each letter to another letterBrake by Statistical attacks:
    letter frequency distribution of a language.
    Since each plain word will always have the same cipher.
  57. 57What is a statistical attack?If you know the letter frequency distribution, Mono-Alphabetic Substitution Ciphers are easy to brake.
    If an Encryption scheme always uses the same letter to encode another letter:
    then easy to brake by using letter frequencies diagrams of a language.
  58. 58explain Homophonic Subsitution CiphersΣ={a,b}, H(a)={00,10}, H(b)={01,11}
    --> Each letter can be uniquely Encrypted into two different ciphers
    Makes statistical attacks more difficult.
  59. 59explain Polyalphabetic Substitution Ciphersblock ciphers with length t over alphabet Σ
    Breaks statistical properties
    Break by:
    determine block length t(amount of keys), then perform frequency analysis on each block
    KIOV repeated after 9 letters, NU after 6, 3 divides both, guess t=3
  60. 60explain Simple transition cipher:the decryption key is the inverse permutation
  61. 61Composition of ciphers: Does combining several different ciphers more secure?Combining more ciphers do not make encryption safer.
  62. 62DES (broken) • Data Encryption Standard (DES) most well-known symmetric-key block cipher Solution: triple-DES, 3DES (1981) • Encrypt with key 1, decrypt with key 2, encrypt with key 3 what is used today?AES
    Advanced Encryption Standard (AES)
    is used today for encryption
  63. 63Desirable charachteristics for Block Ciphers1. Each bit of ciphertext should depend on all bits of the message and all bits of the key
    2. No statistical relationship between ciphertext and plaintext
    3. Altering any plaintext bit should alter any ciphertext bit by probability .5
    4. Altering a cipher bit should result in an unpredictable change in the recovered plaintext
  64. 64Stream ciphers: Block ciphers encrypt block-by-block, e.g., 64 bits, and are memoryless Stream ciphers aren‘t: keystream is generated along with ciphertext; e.g. bit-by-bit (real-time-transmission):)
  65. 65Determine the integrity of a messagesender:
    1. hash the message and encrypt the hash
    2. send the message along with the encrypted hash
    receiver:
    1. Decrypt the message
    2. Hash message
    3. if self computed encrypted hash of the message is equal to the one received --> integrity was kept
  66. 66Public/Asymmetric key cryptographyLess efficient than Symmetric,
    but better to distribute over insecure channels.
    --> Only need to distribute Public key. Keep Private/Secret key secret.
  67. 67How to use Public key cryptography to send message over insecure channel?1. Bob creates a Key pair of a Public and a Private key.
    2. Bob sends his PubK over the insecure network to Alice.
    ** MITM intercepts the PubK **
    3. Alice uses Bob's PubK to encrypt her message and sends the message to Bob
    ** MITM intercepts the encrypted message, but cannot decrypt it **
    4. Bob receives Alice message and Decrypts it with his PrivKey
    ** though possible for MITM to send fake PubK to Alice
  68. 68RSA Public-key encryption Why is it secure?Factoring of large numbers is, as is widely believed, computationally infeasible (retrieve p,q from n).
  69. 69Digital signatures1. Bob sends his PubK to Alice
    2. Bob encrypts a message m and sends m along with encrypted m
    3. Alice decrypts encrypted m with Bobs PubK
    4. If m and decrypted m are same, Bob sent the message.
    Guarantees Integrity and Authenticity that Bob has the corresponding PrivKey of the PubKey
  70. 70explain SSL/TLS secure communicationSSL/TLS
    - Cryptographic protocol for key exchange
    solves the problem of exchanging keys:
    sending Public Keys over the internet and Authentication/Signatures that actually the correct sender reaches the intended receiver
    By using PubK third party infrastructure
    - need to trust authentication authorities
  71. 71How to prevent replay attacks of Symmetric Key agreement?Use nonces or timestamps.
    eg. Needham Schroeder Protocol
  72. 72explain Diffe Hellman key exchange agreementpaint mixing!
    1. Mix shared base paint yellow + own secret paint.
    2. Exchange the mixed paint
    3. Add own secret paint to the mixed paint received
    4. If end paint is the same, athentic
  73. 73Why are PKI Public Key Infrastructures and Public key certificates needed?Because otherwise you can not trust that the sender is or the intended receiver is not Eve
    Public Key Certificates:
    obtain an authenticated copy of an entity‘s public key
  74. 74Side-Channel attacks eg.1. Power-Consumption analysis
    2. Timing measurements
    3. Padding Oracle attacks
    4. Cold-Boot attacks(HW)
  75. 75explain Power-Consumption analysisuse Oscilloscope:
    to decrypt RSA: Asymmetric Cryptography
    square and mult | square
    power consumption:
    square and mult > square
  76. 76explain Padding Oracle attack / counter by: avoid reporting if padded correctly or notif a plain text message is shorter than maximum length allowed -->
    Padding bits are added.
    If an Oracle tells attacker: if given the Ciphertext, if its corresponding plaintext P would be correctly padded or not - possible to recover P
  77. 77Define EntropyLevel of randomness
    High entropy = lack of pattern
    Keys have high entropy and can by this be found by analysis of memory
  78. 78explain White-box cryptographyHiding keys in SW
    split up keys and mixed with other data
    --> obfuscation
  79. 79Message Authentication Codes: MAC Goal: Determine Integrity of a message1. Take a message, compute the hash.
    2. Encrypt the hash.
    3. Sends the message in plaintext along with the encrypted hash.
    4. Receiver can then take the plaintext received and hash+encrypt
    5. If the encrypted hash received and self computed are identical, the message has not been tampered with.
  80. 80What is the probability of an attacker guessing the plaintext given a ciphertext encrypted with a One-Time-Pad (OTP) that uses a uniformly distributed random secret key of length equal to 128-bits? Motivate why.--> plaintext is also 128 bits
    50%
    guessing all bits would be 1/2^128
  81. 81Why are Hash functions not used to maintain confidentiality of data?Given the one-way/non-invertibility property of hash functions:
    cannot unhash hashed data.
    Hashing is used to maintain the
    * Integrity * of data!!
  82. 82How can we use a public key crypto system to guarantee authenticity of message?1. Sign a message (encrypt with PrivKey)
    2. Publish the corresponding PubK
    3. Send the message along with the signature
    4. Verify with the PubKey that the message was signed with the SecretKey
    5. Message is authentic if assuming the Secret Key is not comprimised
  83. 83How would you combine symmetric and asymmetric key algorithms to implement secure key exchange between two parties?1. Alice sends her PubKey to Bob
    2. Bob uses Alice's PubKey to encrypt a Symmetric Session key and sends it to Alice
    3. Alice decrypts the Session key with her PrivKey
    4. Alice and Bob can now communicate by encrypting all messages with the same Symmetric Session Key
    More complicated verison SSL/TSL
  84. 84Symmetric key propertiesEncryption and Decryption key are the Same.
    Otherwise if not, the one key is easy to derive from the other.
  85. 85Drawbacks of augmenting the Securecy of a system:increased Securecy mechanisms
    can possibly hamper:
    1. Usability
    2. Efficiency
    cryptography comes with Overhead that will impact real-time requirements
    3. Accountability
    if a user is totally anonymous, more to enforce non-repudiation
  86. 86explain Onion Routing/TOR networkmessage is encrypted and from the Tor client, a random path through 3 Tor nodes is taken to the receiver. Impossible to track.
  87. 87Releasing a DB to the public How would you release a DB of potentially sensitive data to the public without compromising privacy? --> have to anonymise personal data first (very complicated to do right) Have to think of Quasi-identifierseg.
    The Netflix prize: In 2006 Netflix released an anonymised version of a database of user ratings to films (100 Mio. records). showed that by cross-linking it with the IMDB public non- anonymous database, it was possible to compromise the identity of users.
  88. 88explain Quasi-identifiersKey attributes=Uniquely identifying info:
    eg. Name, address, phonenumber
    Quasi-identifiers are a combination of attributes that can be used to identify users.
    Sensitive Attributes:
    medical records, salaries, political view..
  89. 89two classes of Access Control: DAC vs MACDAC: child C decides who can read her diary - owner subject controls the access of an object
    --> flexible, but might be unsafe. Open for abuse.
    MAC - Mandatory AC
    less flexible, more safe
  90. 90When is a table K-anonymous?A table is K anonymous if:
    for all Quasi-identifiers, there is atleast K records
    A table is Not K anonymous if:
    for any Quasi-identifier, there exist only one record
    --> identifiable
  91. 91How to reach K-anonymity?Generalisation:
    replace quasi identifiers with with less specific values:
    ZIP: 168**, age: 20 < x < 30,
    Suppression:
    blurr data entirely to just: *
  92. 92K-Anonymity attacks: when is a K-anonymous table attackable?1. Homogenity attack
    sensitive attributes lack diversity
    2. Background-knowledge attack
  93. 93K-anonymity Homogenity attackif the sensitive attribute in an equivalence class - Lacks Diversity:
    Quasi-identifiers groups an equivalence class of K records all with the same disease
  94. 94K-anonymity Background knowledge attackOr attacker has background knowledge:
    sensitive attribute data of rows in an equivalence class:
    hepatitis
    cancer
    cancer
    /Alice knows Bob is vaccinated against hepatitis --> Bob has cancer
  95. 95explain L-DiversityBuilds on top on K-Anonymity.
    Take into account Homogenity attacks and Background Knowledge
  96. 96a table is L-Diverse ifa table block(quasi equivalence class) is L-Diverse if there are at least (L) different values of the sensitive attribute
    a Table is L-Diverse if all blocks of the table are L-Diverse
    A background knowledge attack can only succeed if the attacker has (L-1) background knowledge. A high (L) makes such an attack near impossible
  97. 97L-Diversity attacks1. Skewness attack
    can deduce the probabilites that Bob has any of the sensitive attributes in the block
    2. Similarity attack
    All attributes of the block happen to have similar values of the sensitive attribute
  98. 98explain T-closenessTries to avoid L-diversity problems
    • Privacy is measured by the information gain of an observer.
    • Separates the information gain into two parts:
    1. Information gain about the whole population
    2. Information gain about specific individuals
    t-Closeness is described with the distance between the two distributions:
    1. Q: distribution of the sensitive attribute value in the whole table
    2. P: distribution of sensitive attribute value in one block
    • An equivalence class is said to have t-closeness if the distance between the distribution of a sensitive attribute in this class and the distribution of the attribute in the whole table is NO more than a threshold (t).
    and the table has the t-closeness value satisfied by all blocks.
  99. 99explain Differential PrivacyDifferential privacy aims to provide means to maximize the accuracy of queries from statistical databases while minimizing the chances of identifying its records
    Differential privacy is a condition on the release mechanism and not on the dataset itself.
  100. 100Privacy in Location-Based services Location k-anonymity Major privacy risk = tracking users + learning behavioral patternssubmitted cloaked position region must contain K individuals.
    Othewise make dummy queries
    Common attacks:
    1. Spatial Knowledge attack
    2. Multi Query attack
    3. Maximum Movement boundary attack
  101. 101steps of Diffie-Hellman Key Agreement (color paint buckets) • Prime p and generator g publicly known • xA, xB not computable from yA, yB (one-way functions: discrete logarithm problem)Alice perspective:
    1. Select random xA from [0, ..., p-2]
    2. Compute yA := g^(xA) mod p
    3. Exchange yA with Bob's yB
    4. Compute kAB := yB^(xA) mod p
    ^mixes Bob's secret with Alice secret paint (and the common yellow paint g)
  102. 102How can the “Man-in-the-Middle” and “replay attacks” materialize in the case of the Needham- Schroeder protocol?The symmetric key between Alice and Bob is sent without verifier of freshness,
    eg. nonce or timestamp
    Counter replay attacks by adding a
    nonce/timestamp
  103. 103explain Kerberosbuilds on the Needham-Schröder protocol
    the Kerberos service is used to distribute session keys, the server allows synchronized clocks and thhus using timestamps.
    --Need to trust third party server
  104. 104do SSL/TSL (https) protect from MITM?SSL protects from MITM, but not form MATE if server is comprimised
  105. 105What are side channel attacks?Attacks based on the actual implementation of a cryptographic system - where the asset is recovered via channels that are not the input(plaintext) or output(ciphertext) channels.
  106. 106explain ObfuscationObfuscating a program P, transforms P to a functionally equivalent(same output/input behavior) version P' that is harder to extract information from
    -
    Obfuscation protects against MATE
    Obfuscater vs. De-Obfuscator
    Cons -- Memory size increases and execution slowdonw
  107. 107Is there a way to protect cryptographic keys stored in shipped out programs?White-box Cryptography
    obfuscates the key by splitting it up and hiding it at different memory locations
  108. 108Static vs. Dynamic Obfuscation1. Static Obfuscater
    works kind of like a compiler, changes the source code. Remains fixed during runtime
    Makes Static nalysis harder
    -- can be attacked by Dynamic analysis(debugging, tracing)
    2. Dynamic Obfuscator
    programs keep changing during runtime
    Makes Dynamic analysis harder
  109. 109What parts can be changed by Obfuscation?Point of insertion:
    Source code
    Intermediate representation
    Assembly code
    Transformation targets:
    Layout → scramble identifiers and code layout
    Data → obfuscate data (structures) embedded in code
    Control flow → obfuscate secret algorithms
  110. 110name some: Automated/Static code obfuscation techniques1. Scramble Identifiers
    replace identifier names with rand strings
    - countered by finding patterns
    2. Garbage insertion
    insert dead code
    - countered by good tools like compilers
    3. Opaque Predicates
    insert bogus control flow to make complicated predicates
    - countered by Abstract Interpretaion
  111. 111name some techniques of Dynamic code obfuscation1. Build-and-Execute
    build code at runtime and then jump to it
    2. Self-Modification
    modify code during execution
    3. Encryption
    decrypting code only before running it and then decrypts it again
  112. 112What is a stack frame? Where does it start and where does it end? What kind of information is stored in a frame?1. a Process is created and memory is allocated, heap and stack etc.
    2. the Process makes a subroutine(function) call
    3. a Stackframe for the Subroutine is created within the Stack of the Process
    A Stackfram is the allocated memory for a subroutine. The Stackfram is stored in the stack region of the process memory.
    The Stack grows down (from high mem.addresses to low)
    towards the Heap
    The stackframe is removed when the subroutine returns.
    Cointains: local variables, return address
  113. 113What kind of attacks can an adversary launch against a buffer overflow vulnerable program?attacker can exploit the buffer overflow vulnerability to overwrite the return addresses run own malicious code in the Stack of the running Process
    1. Inject and run arbitrary shellcode with root access
    2. Overflow memory to crash the program
    --> DOS attacks
  114. 114We just overwrote the return address with a value outside of the scope of the assigned memory and got stopped by the kernel. The goal of an attacker would be to execute some code of his choice inside of the running process. This is done by placing the code in the region assigned to buf and by letting the return address (ret) point to the beginning of the area where the code is placed.Most often an attacker wants to open a shell on the target system. So he
    would try to insert the code to open a shell inside the memory assigned to buf
    and then would try to let the return pointer point to the starting point of his
    inserted code. The code would then be executed (when the procedure would
    have finished) inside the calling process and would inherit the whole process
    structure (pid, uid,...). This is also the reason why programs whose owner is
    root and where the setuid-bit is set are very critical, because the inserted code
    would then be executed with the uid set to root, so the attacker would get a
    root-shell. This implies, that the attacker would get full control of the target
    machine.
  115. 115In our example we will also try to open a shell, the code for the program to open a shell: shellcode.c. #include int main() { char* name[2]; name[0]="/bin/sh"; name[1]=NULL; execve(name[0], name, NULL); return 0; }This code should then be written in an executable format into the buffer
    (buf[50]). So we have to translate it into machine code
    fill the first part of the buffer (buf) with nop-instructions, this increases
    the probability, that our estimated return pointer points to one of the
    fields, where execution of our shellcode will start (compare the landing
    zone mentioned in the lecture notes)
    • place the machine code we want to be executed just behind the fields of
    nop-instructions
    • fill the rest with the estimated return address, so if proc has finished and
  116. 116explain HeartbleedNo boundary check
    leaking server memory contentes
  117. 117explain ShellShockuse magic string {::}
    to execute commands in Bash (Linux/Mac)
    all web servers running Linux affected
  118. 118what is a buffer?a temporary memory storage region
    Lack of boundary checking in C/C++:
    Buffer Overflow occurs when you try to store data in the buffer that exceeds the allocated buffer region.
    --> Segmentation Fault
  119. 119how is a Canary used to protect from buffer overflow? (Coal mine Canaries)A canary is a known value on the stack, which is tested before
    returning.
    --> to overwrite return address, you need to overwrite the Canary
  120. 120How to prevent SQL injections?allways Sanitize user input
    Use prepared statements for the queries
  121. 121What is Cross-Site scripting XXSInjects a JS script on a vulnerable website,
    so that the script is embedded in the HTML --> the script is then executed on clientSide
    • Website sends HTML to browser which renders it and executes Javascript.
    Attacker can see history, cookies etc of the broweser's user.
    1. Non-persistent / Reflected XSS
    2. Persistent / Stored XSS
    3. DOM-based XSS
  122. 122explain Non-Persistent/Reflected XSSConsider this code for page.php of www.website.com:
    Welcome to our website, “. $_GET[“name”]. “
    ;
    ?>
    intended: website.com?name=gustav
    XSS: send someone a link to the trusted website.com, but exploiting the vulnerability of the site and links
    with the hidden GET script request of:
    website.com?alert('Gotcha') difficult to see that link is malicious.
  123. 123explain Persistent/Stored XSSOnce again, the website itself is a trusted site - That just have a vulnerability for these XSS attacks
    a vulnerable website that allows attacker to inject a malicious script that becomes persistently stored on the webstite's DB.
    Eg. attacker injects a script in a comment in a comment feed that is stored in a DB.
    This script will then be executed every time someone views/refreshes that web page.
  124. 124How to prevent Non-Persistant + Persistant XXS?Sanitize user input!
    just filter for tags to defend against that kind of XSS
    Must include all different encodings of "<script>" tags
    or just disable Javascript...
  125. 125explain DOM-based XXSsimilar to reflective XXS, but server is not involved i.e. malicious code was never
    embedded in raw HTML and shipped to user.
    harder to defend against
  126. 126A4, A6 – Information Exposure/LeakageIf server is misconfigured: attacker can do:
    directory Listing and Traversing
    Kills confidentiality
    --> limit access locally
  127. 127explain Cross-site Request Forgery (XSRF)exploit that users are constantly logged in to different webservices by the "remember me" feature
  128. 128ClickJacking /Cursorjacking/tapjacking1. Overlay a trusted website with a hidden frame
    2. Interact with the “interesting” website e.g. a game.
    3. Your clicks are statically designed to perform an action on the legitimate frame.
  129. 129Defences against ClickjackingNever load legitimate website in a frame
    --> set the HTTP header X-Frame- Options to: deny/sameOrigin
    The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a , , <embed> or <object>. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.
    or: assert(window.self != window.top)
  130. 130explain same-origin policysame-origin policy enforces that JS scripts CANNOT access data from other websites.
    CORS = Cross-Origin Resource Sharing
    by default, same origin applies.
    Though the CORS of a website can be configured to accept other websites or all *
  131. 131How does checking the HTTP Referer header help mitigate XSRF attacks?the request has to issued from within an trusted/expected domain
  132. 132Various web-based attacks attempt to steal the user cookie. What mechanisms can we use to protect this valuable asset?set the path variable to allow acces to cookies only through eg.
    website.com/admin
    set the 'HttpOnly' flag to prevent access from client side scripts
  133. 133explain browser fingerprintingTracking/Identifying users by storing characteristics of the Browser fingerprints:
    screen size, undlying OS, plug-ins used etc.
  134. 134In the TOR network, is it possible for an HTTP reply to take a different path than the HTTP request corresponding to it?No
    otherwise wont find the way?
  135. 135explain Rainbow tablesa table with passwords and their corresponding precomputated Hash
    -
    used to crack password hashes
  136. 136How to defend against Dictionary/Rainbow attacks?Use salts!
    Salts prevents attackers from creating Ranbow tables where there is only one Hash for each password.
    Same passwords with differing Salts --> differing Hashes.
    Just one combination of password has almost an inf amount of hashes due to the salt.
  137. 137Do Salts need to be secret?No. The point of salts is just to increase the length/entropy of passwords.
  138. 138What makes a good security Question?1. Memorable
    2. Consistent
    3. Universal
    4. Safe
  139. 139define T-closenesst-closeness is the distance between two Distributions of sensitive attributes:
    1. the distribution of sensitive attribute in the whole population
    2. the distribution of sensitive attribute in one block
  140. 140define: 1. Line coverage 2. Branch coverage 3. Path coverage1. Measures how many lines of source code have been executed.
    2. Measures how many branches in code have been taken (conditional jumps).
    3. Measures how many paths have been taken (oops! Loops!).
  141. 141How can fuzz testing help in finding security flaws in programs?generate random input/test cases to finds bugs in program
  142. 142What is a fuzzer?A program that generates inputs(test cases) to a program.
    Random generated(black-box, not taking into account the structure of the code/branches),
  143. 143“The performance of a fuzzer can be assessed via the number of distinctive faults it discovers”. Do you agree? Why?No, the branch/path coverage is a better performance measure.
    Bugs found depend on their distribution and if there are any bugs at all in the program.
  144. 144explain Symbolic Execution/EvaluationTreat input(s) as Symbolic:
    a technique of analysing a program to find different constraints on input causing different branches to execute
    The calculated constraints on the inputs can be used as Test Cases to reach all execution paths.
  145. 145explain Penetration TestingIdentify vulnerabilities and try to simulate attack/exploit them.
  146. 146How to evaluate a riskRisk is a function of:
    Assets, Threats, and Vulnerabilities
    • Value of assets, probability of a threat materializing
    1. Value of Asset at risk and the consequence of the risk
    2. Probability of the risk
    3. The degree to which the outcome can be influenced
  147. 147What is ALE?Annual Loss Exposure (ALE):
    probability of threat materialization per annum x damage
  148. 148Needham-Schroeder protocol includes two key transer protocols: 1. Symmetric key exchange 2. Asymmetric What are the vulnerabilities of each?1. NS: Symmetric
    Vulnerable to Replay Attacks.
    Kerberos protocol builds upon the NS symmetric protocol and adds extra timestamps to make secure against Replay.
    2. NS: Asymmettric/Public Key protocol is vulnerable to a MITM/man-in-the-middle attack.
  149. 149explain Path Coveragemeasure of how many Paths of source code has been executed.
    Branches(conditional jumps) and loops
    For complete Path coverage: has to loop n amount of times.
    If loop has no restriction, n is infinite and complete Path Coverage is not possible.
  150. 1501. What is a stack frame? 2. Where does it start and where does it end? 3. What kind of information is stored in a frame?1. A stack frame is a memory region of a subroutine, in the stack of the calling process.
    2. The information is stored in the EBP and the ESP registars
    3. Parameter values, local variables, EBP value return address
  151. 151—

Informações

Descrição
FlashCards sobre Security Engineering, criado por Gustav j em 05-08-2019.
Criado por
Gustav j
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?