Odo Head Spa offered by Odo Beauty Care Limited

Odo Beauty Care Limited Welcome to our first Odo Head Spa Salon located at 9F Pennington Com Bldg., 17 Pennington Street, Causeway Bay (Near to Regal Hotel, Hong Kong and above 7-11) 香港铜锣湾边寧顿亍 17号 边寧顿商业大厅厦电梯 9字 鄰近香港富豪酒店,7-11 樓上 TEL: 9010-1586 English and Japanese only (英/日语) Email: info@odo.com.hk BY APPOINTMENT ONLY 完全予約制 敬请电約

網頁

Powered By Blogger

2020年4月14日星期二

Vsftpd Backdoor - Ekoparty Prectf - Amn3S1A Team

It's a 32bits elf binary of some version of vsftpd, where it have been added a backdoor, they don't specify is an authentication backdoor, a special command or other stuff.

I started looking for something weird on the authentication routines, but I didn't found anything significant in a brief period of time, so I decided to do a bindiff, that was the key for locating the backdoor quickly. I do a quick diff of the strings with the command "strings bin | sort -u" and "vimdiff" and noticed that the backdoored binary has the symbol "execl" which is weird because is a call for executing elfs, don't needed for a ftp service, and weird that the compiled binary doesn't has that symbol.





Looking the xrefs of "execl" on IDA I found that code that is a clear backdoor, it create a socket, bind a port and duplicate the stdin, stdout and stderr to the socket and use the execl:



There are one xrefs to this function, the function that decides when trigger that is that kind of systems equations decision:


The backdoor was not on the authentication, it was a special command to trigger the backdoor, which is obfuscated on that systems equation, it was no needed to use a z3 equation solver because is a simple one and I did it by hand.



The equation:
cmd[0] = 69
cmd[1] = 78
cmd[1] + cmd[2] = 154
cmd[2] + cmd[3] = 202
cmd[3] + cmd[4] = 241
cmd[4] + cmd[5] = 233
cmd[5] + cmd[6] = 217
cmd[6] + cmd[7] = 218
cmd[7] + cmd[8] = 228
cmd[8] + cmd[9] = 212
cmd[9] + cmd[10] = 195
cmd[10] + cmd[11] = 195
cmd[11] + cmd[12] = 201
cmd[12] + cmd[13] = 207
cmd[13] + cmd[14] = 203
cmd[14] + cmd[15] = 215
cmd[15] + cmd[16] = 235
cmd[16] + cmd[17] = 242

The solution:
cmd[0] = 69
cmd[1] = 75
cmd[2] = 79
cmd[3] = 123
cmd[4] = 118
cmd[5] = 115
cmd[6] = 102
cmd[7] = 116
cmd[8] = 112
cmd[9] = 100
cmd[10] = 95
cmd[11] = 100
cmd[12] = 101
cmd[13] = 106
cmd[14] = 97                    
cmd[15] = 118
cmd[16] = 117
cmd[17] = 125


The flag:
EKO{vsftpd_dejavu}

The binary:
https://ctf.ekoparty.org/static/pre-ekoparty/backdoor


More articles

PKCE: What Can(Not) Be Protected


This post is about PKCE [RFC7636], a protection mechanism for OAuth and OpenIDConnect designed for public clients to detect the authorization code interception attack.
At the beginning of our research, we wrongly believed that PKCE protects mobile and native apps from the so called „App Impersonation" attacks. Considering our ideas and after a short discussion with the authors of the PKCE specification, we found out that PKCE does not address this issue.
In other words, the protection of PKCE can be bypassed on public clients (mobile and native apps) by using a maliciously acting app.

OAuth Code Flow


In Figure 1, we briefly introduce how the OAuth flow works on mobile apps and show show the reason why we do need PKCE.
In our example the user has two apps installed on the mobile phone: an Honest App and an Evil App. We assume that the Evil App is able to register the same handler as the Honest App and thus intercept messages sent to the Honest App. If you are more interested in this issue, you can find more information here [1].

Figure 1: An example of the "authorization code interception" attack on mobile devices. 

Step 1: A user starts the Honest App and initiates the authentication via OpenID Connect or the authorization via OAuth. Consequentially, the Honest App generates an Auth Request containing the OpenID Connect/OAuth parameters: client_id, state, redirect_uri, scope, authorization_grant, nonce, …. 
Step 2: The Browser is called and the Auth Request is sent to the Authorization Server (usually Facebook, Google, …).
  • The Honest App could use a Web View browser. However, the current specification clearly advice to use the operating system's default browser and avoid the usage of Web Views [2]. In addition, Google does not allow the usage of Web View browser since August 2016 [3].
Step 3: We asume that the user is authenticated and he authorizes the access to the requested resources. As a result, the Auth Response containing the code is sent back to the browser.

Step 4: Now, the browser calls the Honest App registered handler. However, the Evil App is registered on this handler too and receives the code.

Step 5: The Evil App sends the stolen code to the Authorization Server and receives the corresponding access_token in step 6. Now, the Evil App can access the authorized ressources.
  • Optionally, in step 5 the App can authenticate on the Authorization Server via client_id, client_secret. Since, Apps are public clients they do not have any protection mechanisms regarding the storage of this information. Thus, an attacker can easy get this information and add it to the Evil App.

    Proof Key for Code Exchange - PKCE (RFC 7636)

    Now, let's see how PKCE does prevent the attack. The basic idea of PKCE is to bind the Auth Request in Step 1 to the code redemption in Step 5. In other words, only the app generated the Auth Request is able to redeem the generated code.


    Figure 2: PKCE - RFC 7636 

    Step 1: The Auth Request is generated as previosly described. Additionally, two parameters are added:
    • The Honest App generates a random string called code_verifier
    • The Honest App computes the code_challenge=SHA-256(code_verifier)
    • The Honest App specifies the challenge_method=SHA256

    Step 2: The Authorization Server receives the Auth Request and binds the code to the received code_challenge and challenge_method.
    • Later in Step 5, the Authorzation Server expects to receive the code_verifier. By comparing the SHA-256(code_verifier) value with the recieved code_challenge, the Authorization Server verifies that the sender of the Auth Request ist the same as the sender of the code.
    Step 3-4: The code leaks again to the Evil App.

    Step 5: Now, Evil App must send the code_verifier together with the code. Unfortunatelly, the App does not have it and is not able to compute it. Thus, it cannot redeem the code.

     PKCE Bypass via App Impersonation

    Again, PKCE binds the Auth Request to the coderedemption.
    The question rises, if an Evil App can build its own Auth Request with its own code_verifier, code_challenge and challenge_method.The short answer is – yes, it can.

    Figure 3: Bypassing PKCE via the App Impersonation attack
    Step 1: The Evil App generates an Auth Request. The Auth Request contains the client_id and redirect_uri of the Honest App. Thus, the User and the Authorization Server cannot recognize that the Evil App initiates this request. 

    Step 2-4: These steps do not deviate from the previous description in Figure 2.

    Step 5: In Step 5 the Evil App sends the code_verifier used for the computation of the code_challenge. Thus, the stolen code can be successfully redeemed and the Evil App receives the access_token and id_token.

    OAuth 2.0 for Native Apps

    The attack cannot be prevented by PKCE. However, the IETF working group is currently working on a Draft describing recommendations for using OAuth 2.0 for native apps.

    References

    Vladislav Mladenov
    Christian Mainka (@CheariX)
    Continue reading

    Ethical Hacking Platform For Penetration Testing | How To Hack The Invite Code: Join Hack The Box (HTB)

    Hack The Box

    Hack The Box (HTB) is a free platform available to ethical hackers to do a penetration testing for ethical hacking projects. It consist of different type of challenges that are updated constantly. Some of the challenges related to the real world scenarios and rest of the challenges related to learning towards a CTF style of challenges.
    Before joining to HTB, there is a simple task for you to prove your skills after that you'll able to create an account, and then you'll be able to access to your HTB Lab, where several challenges await for you to hack them. That's the beginning step for all of us to joining this. If you got success while hacking then you'll get points.

    Task For Joining The HTB

    Before joining the HTB, there is a task to hack invite code and paste that code in the code box for further registration to your account. You can complete a simple challenge to prove your skills, if you don't hack that then here is a short video below this content about hacking the invite code. Watch the video and hack the code!


    In this Video you'll learn about How to join Hack the box (HTB) in Kali Linux and other Linux Distributions.


    The game is set in a fantasy version of WWII, where two kids who are best friends are separated when an evil king (with robots) comes to power. They impose harsh restrictions on one of the kids (the girl) forcing them to wear certain clothing, mocking them, and creating dangerous situations. They only want to play together, and only by working together can the kids reveal their true power.

    The game uses cute graphics against black and white dystopian steampunk backdrops of ghettos, garbage, and barbed wire. The story is narrated by Patrick Stewart.



    I'm happy that they are not directly using Holocaust imagery, since this tends to end up in the hands of Nazis who enjoy watching Jews lose the game (like they enjoy watching Holocaust movies and rooting for the bad guys).

    I don't know exactly how the story plays out. It might be an apologetic for Poland: the main characters are obviously the bad German regime and the two kids, Polish and Jewish, who work together and are both victims. Or it might not. You could gloss over that and simply enjoy the game. Apparently, the game was inspired by the real lives of some of the developers.

    HT: Engadget via Boing Boing

    2020年4月9日星期四

    Storium Theory: Tell The Story Of The Characters

    I've written in the past about the responsibility of the narrator to use the details provided by player characters, and to set up challenges for the player characters chosen for the game. Today, I'd like to delve into that same general idea, but from a slightly different angle.

    As narrator, you're responsible for setting up the story. You're responsible for figuring out possibilities for the game arc - the way the game will start, how it will progress, what variations could come up along the way, how open things are to being altered by the player characters and by how much, and where the story is likely to go. I've written about these concepts quite a bit, as the responsibility the narrator holds for defining the game as a whole is pretty huge.

    But don't forget that as narrator, your job is also to help the stories of the player characters - the main characters, the stars - emerge.

    I wrote about this in brief a while back, when I discussed game arcs vs. character arcs - a story, ultimately, is not about what happens to the world at large, but what happens to the characters we are following. Therefore, the narrator's job is not just to define the world's plot, the game arc. The narrator's job is also - in fact, arguably more importantly - to help draw out character arcs and issues.

    It is all well and good to have a grand, epic game plot, or events that will affect the fate of the world, or other things that will affect a great many people beyond the main characters. That's fine. In many genres, in fact, it's pretty darn essential.

    And it's fine to have a structured story, plotted out to some degree in advance, with some events set reasonably in stone. Some narrators use looser setups with greater player influence, others use more defined ones with less player influence, and those are just a matter of the narrator's particular style. As I said in my discussion of said styles, they're all pretty much fine - it's just a matter of narrators and players who like similar styles finding each other.

    So that's all fine.

    But what's essential, no matter how you're running the game, is that the story needs to relate to the main characters. It needs to tie in with them. Not just involve them. Any story involves its main characters. What I'm encouraging you to do is more: Go beyond involving them. Go beyond just having them affect events in the story and be affected by them.

    The story needs to be about them. It needs to relate to them. Even if there are events in the tale that would have happened without them, there need to be major, major elements of the tale that directly relate to the main characters.

    Elements of the main characters' pasts should impact how the story develops. Who the main characters are should matter to the tale. Who they are should be tied intricately in.

    Don't just set up events that would work with any group of characters. Look at the characters you have and design events, or at least twist events, to work specifically with them. The tale should never, ever feel like it would happen precisely the same way with another group of player characters. Sure, there can be certain broad strokes that could potentially come out regardless, but the intricate details of the story, the motivations and drama? That should all emerge from who these particular characters are.

    And while the responsibility for that falls in part on the players - these are their characters, after all - it can't rest entirely on their shoulders. You, the narrator, must help them. You, the narrator, must make efforts to connect your tale to their tales.

    I don't think I'm always successful at this, myself, but when I narrate a Storium game, I want the players to feel like it ended up tied in very strongly with their characters. I want them to feel like their characters' personal problems, issues, subplots, nemeses, and more all got involved. Even when the events start out not directly tied to them, I want them to end up tied in. I want the story to be the story of these characters, not the story of the situation.

    That's the sort of mindset I encourage you to have.

    Characters have their own subplots (they even have cards for those), their own issues, their own relationships, their own details. And these are not side elements to the story. These are the heart of the tale. These are what gives a tale meaning and drama and emotion.

    Do not look at the individual character elements as the things to let players do when the main plot takes a break. Do not look at them as the things players can pull in if they want, so long as they don't get in the way of your primary tale. Do not look at them as "side" elements. Do not look at them as things to be covered "between" major threats.

    These are not side elements. These are not less important. These are the very center of your story.

    Some narrators plot out a lot in advance. Others take things as they come. Either is fine. But in either case, let the characters guide your story. You can plan events. But plan events around the issues raised by the main characters. Maybe you have things plotted out in advance. That's absolutely fine. But plot them out around the main characters.

    There should never be a point in your tale where you say to yourself, "Well, this would be a good point to let the players go explore their personal plots, because I need a break between things for the main plot." That's because the personal plots and the overall plot should be interwoven sufficiently that pursuing the personal plots is pursuing the main plot, or vice versa.

    If a player character has a villain in their background who kidnapped their brother, finding that person shouldn't be a side story. That person should be intricately tied to the main story, so that by pursuing the overall plot, the character plot is also explored, and by pursuing the kidnapper, the overall plot elements are revealed.

    If a player character was accused of a crime they didn't commit, witnessed a foul deed, murdered a rival, sought approval from a parent, idolized a mentor...those are not things to leave on the sidelines or just explore when you have time. Those are things to tie into the tale. Those are things, in fact, to build the tale around as much as you can. The actual culprit is involved. The murdered rival had information that could've helped. The idolized mentor tried and failed to solve the problem...or maybe is involved in it.

    Again, that doesn't mean you can't have an outline to start - having an outline to start is a great narration style. But the outline should be modified by the player characters. The story should fit their stories, and call to their themes.

    Remember, you aren't just telling a story - you are telling the story of the characters. Don't build a generic story and then slot them in, or fit their tales into the breaks. Interweave the characters with the tale, and the tale with the characters, as much as you can manage.