GoConqr has a new look! Let us know what you think.

Quiz

2a Web application vulnerabilities

Yawen Hou 16 questions

Take the quiz

This quiz has question types that open in the usual player.

Questions in this quiz (16)

  1. 1For each risk on OWASP top 10, it describes:
    > [blank_start]threat[blank_end] [blank_start]agent[blank_end]: who carry out the attack
    > [blank_start]vulnerability[blank_end]: how is it possible
    >[blank_start]impact[blank_end] : what can happen
    > how to d[blank_start]etect[blank_end]
    >how to p[blank_start]revent[blank_end]
    1. Arevent
    2. Betect
    3. Cimpact
    4. Dvulnerability
    5. Ethreat
    6. Fagent
  2. 2A1 Injections:
    > Examples: S[blank_start]QL[blank_end], L[blank_start]DAP[blank_end]
    > Vulnerability: S[blank_start]pecial[blank_end] character sequences in user inputs can trigger an a[blank_start]ction[blank_end] in the context
    > Impact: The [blank_start]meaning[blank_end] of a request can be modified
    1. Ameaning
    2. Bpecial
    3. Cction
    4. DQL
    5. EDAP
  3. 3A1 - Injection - [blank_start]SQL[blank_end] injection
    > [blank_start]Blind[blank_end] injection: When there is no [blank_start]error[blank_end] message and no other output we can get feedback by inserting an operation that takes [blank_start]time[blank_end] to execute
    >> catid = 2 union select
    if([blank_start]substring[blank_end](user_password,1,1)=char(50), [blank_start]waitfor[blank_end](50),null) from users where user_id=1;
    >>> "%' AND LENGTH ((SELECT password FROM users WHERE name = 'inspector_derrick')) = {} [blank_start]AND[blank_end] '1' = '[blank_start]1[blank_end]"
    > [blank_start]OR[blank_end] '1' = '1' > return all rows

    > url: /personalities[blank_start]?[blank_end]id=2[blank_start]'[blank_end] UNION SELECT name, message FROM contact_messages WHERE mail = 'james@bond.mi5"
    1. ASQL
    2. BBlind
    3. Ctime
    4. Derror
    5. Esubstring
    6. Fwaitfor
    7. GAND
    8. H1
    9. IOR
    10. J?
    11. K'
  4. 4A1 Injection - [blank_start]LDAP[blank_end] injection
    LDAP is the lightweight directory access protocol to [blank_start]query[blank_end] directories to..
    > verify a user's password
    > read a user's attribute

    >> & = and, | = or, [blank_start]*[blank_end] = wildcard

    eg. (&(name=admin)([blank_start]&[blank_end]))(pwd=...))
    > (&) is always [blank_start]true[blank_end] and pwd=... is [blank_start]ignor[blank_end]ed

    > In 2017, Joomla bug: using a [blank_start]wildcard[blank_end] we can guess one character at a time
    Image for question 4
    1. ALDAP
    2. Bquery
    3. C*
    4. D&
    5. Etrue
    6. Fignor
    7. Gwildcard
  5. 5A1 - Injection - [blank_start]command[blank_end] injection:

    Runtime runtime = Runtime.getRuntime();
    String[] cmd = new String[3];
    cmd[0] = "cmd.exe" ;
    cmd[1] = "/C";
    cmd[2] = "dir " + *chosen_dir*;
    Process proc = runtime.exec(cmd);

    > If [blank_start]chosen_dir[blank_end] is ’photo & rmdir /s /q photo’ u'll remove photo!
    1. Acommand
    2. Bchosen_dir
  6. 6A1 Injection protection:
    > [blank_start]Input[blank_end] [blank_start]validation[blank_end] : refuse the characters u don't want with a regex
    > Encode data: [blank_start]escape[blank_end] special characters
    >> in SQL: ' becomes \'
    >> in HTML: < becomes &lt;
    >> in LDAP: ( becomes \28

    > use [blank_start]prepared[blank_end] [blank_start]statement[blank_end] in SQL:

    PreparedStatement pstmt =
    con.prepareStatement(
    "SELECT pwhash FROM table WHERE name = ? and
    pass = ?"
    );
    pstmt.setString(1, name_received);
    pstmt.setString(2, pass_received);
    1. AInput
    2. Bvalidation
    3. Cescape
    4. Dprepared
    5. Estatement
  7. 7A4 - XML External entities:
    > XML = markup language
    > elements are delimited by start and stop tags : <name> peter </name>

    > [blank_start]Document[blank_end] type [blank_start]definition[blank_end] (DTD): h[blank_start]eader[blank_end] of a XML files tat declares the type of data, which can contain MACROS ( [external] [blank_start]entities[blank_end])
    >> Billion laugh attack
    >>
    <!ENTITY xxe SYSTEM "file:///etc/passwd" >]>
    <foo>&xxe;</foo>

    The server will replac &xxe by the content of [blank_start]passwd[blank_end] file.
    The user can submit the above XML and have its content returned in a response >> access to any f[blank_start]ile[blank_end] on the system.

    Solution: Do not accept XML that contains [blank_start]DTD[blank_end] specifications!
    setFeature("http://apache.org/xml/features/[blank_start]dis[blank_end]allow-[blank_start]doctype[blank_end]decl",true);
    1. Adoctype
    2. Bdis
    3. CDTD
    4. DDocument
    5. Edefinition
    6. Feader
    7. Gentities
    8. Hpasswd
    9. Iile
  8. 8A5 - Broken access control
    > Access control = [blank_start]direct[blank_end] [blank_start]reference[blank_end]s
    > when a u[blank_start]ser[blank_end]-submitted parameter = direct reference to a r[blank_start]esource[blank_end], a user may try to change to access to other resources

    Having:
    http://bad.com/display_photos?template=css/p.css
    POST /users {"action":"unsubscribe", "user":"100293"}

    >> What if I tried
    http://bad.com/display_transactions?account=100299
    1. Adirect
    2. Breference
    3. Cser
    4. Desource
  9. 9A5 - [blank_start]Broken[blank_end] access [blank_start]control[blank_end] Protection:
    > Use an [blank_start]indirect[blank_end] reference, eg:
    https://bad.com/display_transactions?account=savings

    > Protect reference with a Hash-[blank_start]Mac[blank_end]:
    /display_transaction?employee_id=100293&HMAC=434A345B0

    >> if you change employee_id you will need to change the [blank_start]HMAC[blank_end] also, but you don't know the secret key
    1. AHMAC
    2. BMac
    3. Cindirect
    4. DBroken
    5. Econtrol
  10. 10A5 - Broken access control Protection:
    > For every URL, verify if the user has the [blank_start]right[blank_end]s to access it!
    ex.
    https://example.com/welcome ← anybody
    https://example.com/myprofile ← only logged-in users
    https://example.com/add_user ← only admins
    1. Aright

Information

Description
- Information security (2 Web app & Software vulnerabilities) Quiz on 2a Web application vulnerabilities, created by Yawen Hou on 08/06/2019.
Author
Yawen Hou
Language
English
Views
1
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?