Hot answers tagged

57

Try sending a HEAD request. I'm assuming that with ascii.txt included, the output of the script is just over a nice number like 4096 bytes, a common output_buffering value. Once the script has written output_buffering bytes, it needs to flush the output buffer before continuing. Normally this works fine and the script continues, but if the request type is ...


26

The security flaw isn't in MD5 in this case. And the idea isn't to get if (!isset($_POST['pass']) || md5($_POST['pass'])!='castle') to evaluate in favor of the hacker. The vulnerability appears when you crash the script. The admin privileges are not conditional. No matter what the user gets their permission elevated by setting 1 to $_SESSION['admin_level']. ...


17

I've seen a similar challenge somewhere. Try to send something like 'QNKCDZO' as input. md5('QNKCDZO') is '0e830400451993494058024219903391' (note the 0e prefix in the hash indicating scientific notation of a number) and since the code uses the != operator (instead of the type sensitive !==) PHP (older versions only?) will actually cast it to a number before ...


9

I haven't been able to test in PHP 5.5.9, and what I'm going to propose doesn't work on my PHP 5.6.22 (but I might have made some silly mistake). The only workaround I can fathom is if MD5 returns something that is treated as a number. I've Googled and found something which seems germane.


8

The flaw in your thinking is here: You have just taken an input, turned it into gibberish in a certain way that only you know how to reverse... Compare that to using a tried and true strong encryption with a long decryption key that only you know what it is. It's possible that your algorithm is equally as secure as the tried and true algorithm, but it ...


6

Encryption can happen at any of the levels of the OSI model. TLS happens at something like the session or transport level. Quantum Crytography isn't exactly encryption, but would be at the physical level. PGP in an email would be at the application level. Remember that the OSI model is just one model, and largely represents an idea of separation of ...


5

You should always use an AEAD mode if you can, especially over the network. Crypto++ seems to support GCM, which is a good AEAD mode that has seen use in TLS 1.2. (There are others that are just as good, but TLS's "star power" lends GCM a lot of credibility.) Importantly, AEAD modes authenticate "additional data." This is unencrypted data not included with ...


5

So both of your scenarios rely on the attacker having root access to the phone. In security, it's generally considered that once an attacker has root access, it's game over. That said, there are still interesting things to be said about your question. You asked: Is there a situation where the secure element does offer a clear security benefit to this ...


4

Let's say we can try 10,000,000,000 SHA-256 hashes per second. For us to find the 256 byte hash, we have to search approximately half the search space, so we need to compute 2^255 hashes. This will take 2^255 / 10,000,000,000 seconds, or about 183587153154040137340770841274555916814545257270485419900205 years. Edit: I screwed up the calculation, because I ...


4

In my personal opinion, the layers are a bit fuzzy. In my mind there's physical, ethernet, IP, TCP, TLS, and finally some protocol like http. Or physical, ethernet, IP and finally ICMP, for example. Which OSI layers those are exactly? Who cares. TLS is called Transport Layer Security, but in my mind the transport layer is TCP/UDP. Googling, most people ...


4

I see that you accepted gabedwrds solution (which is excellent, by the way), but I wanted to post one potential solution that I have used in the past when doing some interesting pentesting practice. (I am by no means an expert in that field, but I am sometimes a hobbiest.) If you will notice, the script never sets any policy for handling a user abort. By ...


3

The algorithm in your example is basically a really simple Caesar Cipher with a fixed key (1), and no, that's definitely not secure. An attacker could determine what algorithm you used rather easily just by analyzing the ciphertext. Other schemes you might come up with could very well have similar vulnerabilities which would let a cryptanalyst reverse ...


3

It seems surprising because crypto libraries are available on all (major) platforms. But it sounds often simpler than it is. For example accessing the Crypto API on Windows takes a lot of additional code to do it properly. But the amount of malware authors being very familiar with cryptography is rather small. Therefore they tend to focus on functionality ...


2

As an addendum to dr jimbob's answer: There are utilities that look for these patterns and try to extract keys that way. Disclaimer: I have not tried any of these utilities. This post is just a nicer version of the links posted by user "void-star" on HN. (See below.) Whitepapers about the general idea: Adi Shamir and Nicko van Someren, 1998-09-22, ...


2

Similar to what others have said, PHP has a max memory size. If you put in POST data that was JUST big enough to use ALMOST all of PHP's memory up, then it could conceivably crash when it gets exactly to this line if it ran out of memory: echo 'Wrong or empty password.' This is built on three principles: 1) When sessions are enabled, PHP doesn't flush ...


2

It depends what you mean by "secure" :) CHAP: Client authentication request send its user name to the server Server responds with a nonce Client calculates hash(nonce|password) and send to the server Server verifies the password Cons: All data is transmitted in clear text i.e. it possible for an attacker to eavesdrop and brute-force the hash offline ...


2

Assuming a very good hash, use one of Sjoerd's answers. If the hash were very, very bad, however a collision could be calcuated in microseconds. i.e. 256 bit/byte hash alone means nothing unless it was designed properly. A naive hash could be something as simple as a CRC, which was never intended to be secure. Even hashes designed for security purposes ...


2

Wow, I am very unimpressed with that PyNaCl doc page that you linked to; Among other things, they don't explain what this nonce is being used for internally. That makes it hard to answer your question. That said, the example code has some comments that give some hints about what it's doing inside, so I think we can puzzle through it. Usually, a "nonce" is a ...


2

Most vendors using SSL/TLS commonly use OpenSSL who keeps a detailed record of vulnerabilities associated with SSL/TLS. Subscribing to security sites like Bugtraq will keep you in the loop regarding disclosed (known) vulnerabilites associated with OpenSSL and may tell you about the other SSL libraries as well. You would also want to subscribe to other ...


1

Most ransomware use strong encryption algorithms, which means that you will have a hard time trying to decrypt the encrypted files without the corresponding decryption key. The malware uses an AES key to encrypt files. The AES key for decryption is written in the files encrypted by the malware. However, this key is encrypted with an RSA public key embedded ...


1

I have contacted the authors and they were very helpful. The original quote says it all: The book is about randomized algorithms that act on data sets. You can always view these as deterministic algorithms, which take two inputs -- the data set, and also a string of random bits. The definition of differential privacy has a probability operator, and ...


1

McNerdHair is correct to require you to use an authenticated mode. There are more options than GCM mode though: GCM mode is fast. It is sometimes called a 1.5 pass authenticated mode because of the fast GMAC calculation. It is standardized by NIST. CCM mode is another NIST certified mode specifically created for packet encryption, i.e. transport mode ...


1

My question is are they talking about whole javax.crypto package ? No. They are referring to the Crypto provider for javax.crypto. Do I need to remove these all ? No. So long as you did not manually specify to use the Crypto provider, you are fine. Search your code for the string "Crypto" (with a capital C).


1

A malicious forum administrator cannot forge the signed text in such a way that it will look like it comes from your key pair. However, a malicious forum administrator can replace both your public key and signed text, with his own public key and signed text, and display it to the person(s) you're communicating with, while still showing you your own public ...


1

It is not a viable encryption method for the technically inclined. 1) All parties that you will give the ciphertext to will need to know the encrypt/decrypt steps. This already ensures that it's not just you who knows the algorithm. 2) You will not be doing this by hand. You will need to turn your algorithm into a software product, that will be distributed ...


1

Firstly, on HTTP there is no way to do this securely. And when you include a TLS connection (a.k.a. HTTPS), why decrypt at the browser? That sounds as possibly the worst place to do so. If confidentiality is really that needed use proper encryption technologies like PGP/GPG and have the user decrypt / encrypt that on his/her/it machine. All you do is ...


1

Assuming you can modify the ./ascii.txt, I would put this text inside: <?php override_function('md5', '$a', 'return "castle";'); And that should work.


1

It depends on the protocol used. TLS is used for application level end-to-end encryption so it is somewhere at levels 5..7 (the distinction between these levels is blurry). Protocols like IPSec or OpenVPN instead work at the level of IP protocol, i.e. network layer which is layer 3. But there are also VPN technologies which do a VPN at the data link layer, i....


1

With proper encryption, it could be impossible to know that an encrypted file was originally an executable. Of course, if it gets redistributed in that exact same binary state, antivirus makers could identify a signature to recognize it. Such a distribution system would require a process to be already present on the client computer to decrypt and run the ...


1

There's a tool to detect packed .exes called PEiD . As for good-to-know stuff, check out this reading about how to detect packed .exes based on raw binary data. There are other tools like RDG Packer Detector, but most of them detect specific packers based on signature checking, so practically the same way an anti-virus does.



Only top voted, non community-wiki answers of a minimum length are eligible