#utilizing standard social scripts to wreak havoc
Explore tagged Tumblr posts
Text
I usually donât care if people donât ask them back, but Iâm also autistic, so
But hereâs a quick tip: most of the questions youâre expected to ask in return are all small talk questions. How are you? How was your day? What did you do this weekend? Most of these youâre socially expected to say back, simply because itâs polite and it shows you care about the other person (note: you donât have to care about the other person. Most people donât actually want a detailed recounting of your day, they just say that automatically. If youâve ever told a server âyou tooâ in response to âenjoy your mealâ, thatâs exactly what small talk is to most people.)
HERES THE FUN PART. You can use those automatic small talk questions to completely throw people off their game, because youâve deviated from the socially acceptable script. This is a great power, to be used in only the most dire of circumstances.
For example, when I was a junior in high school (11th grade, second to last year), I received a call from a scammer. He asked, âHi, how are you today?â And I, being sick and tired (mono) and depressed (friend died) and a teenager (rip), decided to respond truthfully. âHonestly, not great. Iâve been really depressed lately.â He didnât like that, because he had to reply to what I said, instead of just launching into his scammer spiel, using my automatic reply as a springboard. So instead he said, âOh, uh, Iâm sorry about thatâŠâ and then he hung up.
There's this thing that I only just realised yesterday... Y'know how there's questions where if you're asked them, you're socially expected to ask them back? For some reason it's only just clicked in my head that that's a category of thing, and I realised I'âm really bad at being able to tell if I'âm supposed to ask a question back. Now like, in other people's eyes, is failing to reciprocate a question when expected to, rude in the same sense as failing to respond to a question when asked? Or do people understand it when it happens
49 notes
·
View notes
Text
Original Post from Rapid7 Author: Robert Lerner
Earlier this month, Verizon released its 2019 Data Breach Investigation Report. It revealed, unsurprisingly, that a good chunk of breaches were the result of attacks at the application layer and that there was a major shift (almost to the 50% crossover point) in payment card breach volume sources to compromising web servers.
Rapid7âs own [Master] Chief Data Scientist Bob Rudis and our Rapid7 Labs research team pored over the report to identify some key points to help the Rapid7 community navigate through this sea of information. In his blog post summarizing the top findings in the 2019 Verizon DBIR report, Bob provided some guidance to help you better safeguard your organization, and the following section really hit home for me:
âItâs time to get serious about adopting critical security headers like Content Security Policy and designing web applications modularly to enable clean and easy use of subresource integrity attributes on resources you load. While you can start with just focusing on the core pages that deal with logins and payment card transactions, you should consider adopting these two technologies holistically across all web-facing components. If you source your e-commerce applications from a third party, ensure you mandate the use of these technologies in your procurement processes.â
During my spare time, Iâve built both an auditing tool and a tool to retrieve the Top 500 list from Moz to better understand how the worldâs largest companies use headers. Through this, Iâve discovered the best place to address vulnerabilities is within your software itself. Click here to evaluate your site.
Browsers may have varying or even no support for the various security headers, so they should be part of defense in depth and not viewed as a holistic solution.
As this project plays very nicely into how you can heed Bobâs advice, Iâve created a series of real-world scenarios in which attackers can manipulate unsecured HTTP headers and how to prevent your organization from falling victim to tactics used to exploit them. But before I get into the fun stuff, letâs start with a refresher on what HTTP headers are.
What are HTTP headers?
Before you even see a page load or download file, your browser (or any client, such as cURL, wget, etc.) and a server have a conversation. During this conversation, the browser may ask for a specific resource, request a specific language, and tell the server what type of browser you are using.
The server responds with information, such as how many bytes are ready to be sent, the type of server being used, and the cookies to set.
Hereâs an example request:
GET /index.html HTTP/1.1 Host: www.rapid7.com User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Referer: https://www.google.com/?q=best+dast+ever Connection: keep-alive Upgrade-Insecure-Requests: 1
Hereâs an example response:
200 OK Connection: Keep-Alive Content-Encoding: gzip Content-Type: text/html; charset=utf-8 Date: Mon, 31 Feb 2020 00:00:00 GMT Last-Modified: Mon, 18 Jan 2019 02:36:04 GMT Server: Apache Transfer-Encoding: chunked X-Frame-Options: DENY (Response body here)
As you can see, thereâs a lot of conversations going on behind the scenesâand this happens several times for each page you requested. Not all of these headers are strictly for rendering your page: Some tell the site not to track you (such as DNT headers), while others tell the browser not to allow frames on the site (such as X-Frame-Options). Sometimes these headers leak into the user realm (bet youâve seen a few 404: File Not Found pages). The better you know your site, the more restrictive you can be when configuring your headers, and the more secure your site can be.
I will cover the most common security headers you will find on servers across the internet. For each of these headers, Iâll provide a standards document if one is available (such as a Working Draft or RFC), assuming the scope isnât too broad (the entire HTTP specification, for example). I will also include additional resources and links to the CWEs, where applicable. This document uses the term âmedia typesâ to refer to what was previously called âMIME Types,â as IANA has changed the terminology.
Custom headers and the âX-â prefix
Standards organizationsâwhat would we do without them? RFC 2047 §5.1 states that any nonstandard HTTP header be denoted and prefixed with âX-â (hence many of the headers in this blog). RFC 6648 deprecates this. Chances are that the legacy âX-â headers will outlive this blog post, so for nearly all purposes and intents, these should be used in lieu of their non-prefixed alternatives.
Imagine, if you willâŠ
In this hypothetical scenario, imagine you are checking your employerâs intranet forum and you see a topic that catches your eye: âAn estimated 60% of the workforce will be laid off this week!â
Panic ensues until the inevitable HR memo comes out stating that this forum post is false and no one is getting laid off. An investigation into how this could have happened uncovers that your organization has fallen victim to a social engineering scheme. But how did this schemer get in?
Here are some examples of vulnerabilities that may have been exploited:
You can set your accountâs password without providing your current password
There is a cross-site scripting (XSS) vulnerability in the forums
The forum admin only skimmed this wonderful blog entry.
These would allow the attacker to wreak havoc by using the following tactics:
Make a really crafty forum topic title that everyone will click and talk about
Leverages the XSS vulnerability within a forum topic
Executes var cookie = document.cookie;
Makes an XMLHttpRequest to their server with this cookie value
Stand up a server to receive these cookies
Make a cURL request back to the server, using the cookie to authenticate
Set the password to a new value
Log the user out
In this situation, anybody who clicks the forum topic will instantly have their account password reset and be logged off. With this tactic, attackers will be collecting accounts like Pokémon.
So, which headers can help us out here?
HTTP is a stateless protocol, which means it cannot associate state between two requests. Sessions are a technique of providing a unique identifier to your siteâs users, allowing them to persist login state across several page loads. These may be persisted across URLs (bad) or across cookies (good). Because of that, we need to ensure we protect information from being stolen. There are three security-focused attributes within a cookie header, but today we are going to focus on HTTPOnly:
Cookie attributes
Example
Set-Cookie: id=Rapid7; Expires=Wed, 06 Mar 2019 02:42:26 GMT; Secure; HttpOnly; SameSite=strict
HTTPOnly attribute
The HTTPOnly flag informs the browser that the cookie may only be transmitted via HTTPâthat is, it is not available to java script in the form of alert(document.cookie);. This greatly reduces the utility in an XSS attack.
Secure attribute
As discussed, there is little excuse for not using HTTPS throughout your application. The âSecureâ flag instructs the browser to only send this cookie value to requests made via HTTPS. If your connection is subject to an HTTP Downgrade and MiTM attack, this cookie will not be transmitted which will prevent account theft.
SameSite attribute
Can I Use?
The SameSite attribute is used to control how cookies are applied to requests when they originate from a third-party domain. If a user is logged into example.com, they can click around the site and maintain logged-in state. If they then visit rapid7.com, and Rapid7 links back to Example.com to leverage an XSRF vulnerability, then this will be executed against the userâs account on example.com.
If the SameSite attribute is set to Strict, the previous example would fail. The browser would detect this and not transmit the cookiesâtherefore, the attack would apply to a guest account.
By setting the HTTPOnly flag on our cookies, we instruct the browser that it may not send the cookie to the browser via Javascriptâs document.cookie. This single-handedly would have mitigated the kill chain Iâve presented earlier where an account could be compromised. Another header that would have been useful is:
X-XSS-Protection
Example
X-XSS-Protection: 1; mode=block
Moz Top 500
This header is present on 35% of sites. Many browsers have built in XSS protection that site operators can control. A blank setting disables the protection mechanism, and an attribute of â1â instructs the browser to attempt to sanitize the content. Finally, setting the header to â1; mode=blockâ tells the browser to stop rendering the page. The latter option is recommended.
This header enables the in-built XSS filtering or blocking that browsers use, and therefore may have also blocked this attack by restricting access to the page where the XSS vulnerability existed.
Other scenarios
The decision to go with the account theft model was to illustrate a real-world situation that could be dire to an organization without backups or that is visible to the public. Cookies can simply be stored, with no programmatic action being performed. It is possible for a stolen cookie to be used to perform any number of actions on your site, from buying items to deleting customers.
Other ways to limit this attack include:
Regenerate cookie values and expire the previous value whenever the following happens:
A user authenticates, or after logoff
A user changes roles, such as logging into an admin panel
After several page loads, this limits the validity period
Limit the session duration
Set either a â0â on the session cookie, or an explicit expiry time. (Also enforce this server-side, since spoofing this on the client is really easy.)
Leverage an additional identifier along with the cookie, such as the userâs IP address, user agent, or other information.
Write secure code
So, what are you waiting for? Go and evaluate your site to verify that your web server is correctly responding with headers designed for security, and stay tuned for my next blog on âHidden Helpers: Security-Focused HTTP Headers.â
Looking to identify security vulnerabilities in your web applications? Try InsightAppSec today for free.
Get Started
#gallery-0-5 { margin: auto; } #gallery-0-5 .gallery-item { float: left; margin-top: 10px; text-align: center; width: 33%; } #gallery-0-5 img { border: 2px solid #cfcfcf; } #gallery-0-5 .gallery-caption { margin-left: 0; } /* see gallery_shortcode() in wp-includes/media.php */
Go to Source Author: Robert Lerner Hidden Helpers: Security-Focused HTTPÂ Headers Original Post from Rapid7 Author: Robert Lerner Earlier this month, Verizon released its 2019 Data Breach Investigation Report.
0 notes