SSO Understainding Credentials and Authentication I would like to create a SSO where my users can login to machines and wordpress (php) websites.

So far I have LDAP with Kerberos working. I can login with the same credentials to every service, however I can't seem to avoid having to re-login when I move from one service or host to the next.

It's hard to wrap my head around authentication and credentials.

I think that you are mixing together authentication and authorization.  Being confused by both is very common, so let's first go through what SSO means in these terms.

The purpose of SSO is to authenticate once and then have the correct credentials to authorize yourself into several places.  This may be a single credential or several credentials.

If we use a holiday as an analogy we could say that if you purchase: a hotel room, a car and pass to the museum you may do something like a real-life SSO.  If you arrive at the hotel and the attendant, after checking your passport, gives you: your room key, your car key and your ticket to the museum; then you authorized once (to the attendant) and got three credentials that will authorize you in three different places.

Note that the attendant could as well give you a single key that would work for all three places: the room, the car, and serve as pass to the museum.  In that case you would have a single credential but it authorizes you into different places.

Finally note the tricks above: The hotel staff need to be aware of the fact that you rented the car and that you purchased the ticket to the museum.  Moreover, the car must support the same key type as the museum, and the museum must have an agreement with the hotel about the passes.

In WP and ssh (and other apps) things work the same way.  The application must be aware and configured to authorize through the credentials that a user received from authenticating through another app.

If you are using kerberos to give a ticket to a user which will make for the credntial, you can setup samba (kerberos methos = in smb.conf) and configure sshd (krb5_auth = yes).
If you want to use Shibbloleth you will need all apps that will be possible to login to with the credentials to support SAML.  As far as I'm aware sshd does not.

For other apps you need to check their configuration to what kind of an authentication they support.  Kerberos support is widespread, you will find ways of hooking into it almost everywhere (they may not be trivial though).

You need to perform the credential juggling.  For example, if your users have a browser add-on written by you on their machines you may be able to give them a kerberos ticket for the ssh client from WP.  If you have no control over their computers that is not possible (if a browser would allow to change the state of the ssh client, or vice-versa, that would be a problem).

But several apps simply do not support SSO and that's it.  If a specific museum in the city you want to make your holiday consider itself hipster and indie, and will not accept agreements with hotel chains, there's nothing you can do to get the pass to that museum at the hotel desk.


How to defeat ASLR in linux kernel? Possible Duplicate:
  Stack Overflows - Defeating Canaries, ASLR, DEP, NX

is there anyway to disable ASLR in Linux kernel 2.6.32-71.el6.x86_64, with Apache privileges??
I tried this commands:

 sudo bash -c "echo 0 > /proc/sys/kernel/randomize_va_space"

but because i do not have normal user privilege, this command did not work. Someone wrote exploit to get root access, but this exploit gives the following error message: "[11754: 5 (255)] tcsetattr: Invalid argument". I asked him about this and he told me to disable NX and ASLR.

I am working with centOS Lnux, Kernel 2.6.32-71.el6.x86_64, and there are many packages installed on the system like : mailman 2.1.12-14.e16, mailscanner 4.83.5-1, postfix 2.6.6-2.316.x86-64, dovecot 2.0-0.10.beta6.20100630.e16.x86-64, crontabs 1-10-32.1.e16, mysql 5.3-3

I also have a mysql account - I tried to add user to linux via mysql command line, but it did not work. Is there any way to create a linux user via mysql command line?

No.  ASLR is an important part of kernel security.  Non-root users are not supposed to be able to turn off ASLR.  The only way you're likely to be able to do it is to exploit a privilege escalation vulnerability to get root (as @Polynomial says), or exploit some other vulnerability in the system.


Does X.509v3 certificates prevent MITM attacks in SSH I was reading RFC 4251 (really all of the SSH RFCs) and in section 9 it goes into great length about security considerations listing 3 cases of MITM attacks. In several places in the RFCs the authors mention not having the proper infrastructure to distribute server keys from a central authority.

RFC 6187, if I understand it correctly, changes this does it not? Or am I confusing how the pieces interact with each other?

Granted the probability of a MITM attack seems remote in succeeding anyway based off my reading... or does the use of X.509 close some doors but open others?

X.509 is just a format for public key certificates, the type typically used by web browsers. The critical idea was to have the public key in the certificate signed by someone else who's public key you also trust. In web browsers these are the root certificates that come bundled with the browser. Typically companies like Comodo, DigiCert, GlobalSign, etc. They allow you to trust https://acme.com when acme.com's certificate is signed by a trusted root certificate. The same could be done for each ssh host as it is for web hosts, but it tends to be too much work and cost. So, you typically see a ssh 'fingerprint' when you ssh to a new host and a warning if the host changes its public key.

Notice that the public keys used to sign certificates still need to be distributed to the end user. Computer OSes like Windows and Linux also come bundled with root certificates. So the vulnerability in the X.509 scheme is in someone replacing trusted certificates in the software before it is installed on your system.


Why do I see bridged devices when monitoring Wi-Fi activity? I'm trying to figure out what information about my infrastructure can leak through Wi-Fi.

I ran Kismet and was surprised to see that a few minutes later, Kismet displayed not only the MAC addresses of mobile devices connected to my Wi-Fi, but also MAC addresses of devices which don't use Wi-Fi, such as the Ethernet surveillance camera or a bunch of virtual machines hosted on the servers which have no Wi-Fi access. This, obviously, is not very pleasing, since I don't expect anyone parked outside the building for a few hours to get an exact picture of the infrastructure.

How does Kismet know about those devices? I'm quite sure virtual machines I've seen in the list don't broadcast anything, so what is happening here?
What do I do in order to prevent this sort of information from leaking to anyone ready to listen to it? Wi-Fi access points are on the same network (i.e. they are connected to the same switch as the servers, and use the same network parameters), which, as I imagine, is a really bad idea. Should I get a dedicated network for them (with a router in the middle), or are there alternatives?

In the absence of a technical answer about Kismet, I think your best bet is to run a packet capture. Although your ethernet devices might not broadcast, your network may be configured as an unswitched zone and every node can see every other node's traffic.

If you can see all that traffic on WiFi, then your answer isn't about Kismet at all, but about your network design. Try that first.


Does filtering HTML syntax prevent a web shell from being dropped through a textbox? I have an admin panel that is running off a mysql db. On that panel, I have text boxes that allow an "Admin" to input plain text OR HTML Styling that will be displayed on a section of the site that is live. So for example, A user might input the following in a Title textbox;

  <b>The 'Rory' jumped over the moon</b>

The text boxes are set to only allow specific html syntax.

Does that prevent a web shell from being dropped on to the web server through the text boxes?

Is there a way to bypass the filtering?
If you manipulated the data in the DB, would it allow php to run?

It is very unlikely that this would be a viable route to dropping a web shell. The input is probably stored in a database, not in a file, so the interpreter (ASP, PHP, etc) will not process it as source code. A much more likely attack vector is Cross Site Scripting, if the filter is not strict enough.

EDIT to answer 2 points added later:

There is no way to know if the filter can be bypassed without analyzing the source or attempting to bypass it.
Understand how the PHP interpreter is invoked by the web server. In most cases, the web server calls the appropriate interpreter based on a file's extension (e.g. .php calls the PHP interpreter). The web server does not retrieve content directly from the database, so it cannot invoke the interpreter on database content. A vulnerability would exist if a PHP page retrieved user-defined strings from the database and eval'd them. I hope you can understand how unlikely such a situation would be.

Shortest form of this answer: Probably not, but try it if you don't believe me.


SSL/TLS client authentication - practical client cert validation How do real HTTPS servers validate client certificates? My context is business-to-business rather than regular human clients. I understand basic chain validation to a trusted root CA cert. But do servers typically have some sort of configuration to specify the subject names of certs they want to trust, or fingerprint values?

In one scenario a private CA acting on the server's behalf could sign the client certs so that ONLY their certs would be accepted. In another scenario the server trusts certs signed by any "regular" trusted CA (of the client's choosing) in their trust store. But if your system is to be closed (as in a business-to-business case) then you want additional filtering.

I realize at the application level if the cert chain is available then any further custom filtering can be done. But I just want to know in the real world, out of the box, what additional config web servers have to deal with this today during the TLS handshake.

Thank you.

When the server uses IIS, client authentication means mapping the client certificate to an identity, i.e. an account (local account or domain account, depending on context). IIS may apply two distinct methods, with confusing names:

clientCertificateMappingAuthentication: IIS will look for a domain account that either contains a copy of the exact client certificate, or at least a domain account whose User-Principal-Name attribute matches the one contained in the certificate (as a Subject Alt Name of type otherName, identified with a Microsoft-specified OID). Use of the UPN is subject to some arcane conditions, including storing a copy of the immediately issuing CA certificate (not the root CA) in the "enterprise NTAuth" certificate store of the IIS server machine, or that of the AD server, or maybe both. You may use this blog page for some guidance.
iisClientCertificateMappingAuthentication: this one has two sub-methods, that IIS documentation calls "one-to-one mapping" and "many-to-one mapping". In one-to-one mapping, the IIS configuration contains explicit mappings from an exact certificate (the complete certificate in Base64) to an account (local or domain). In many-to-one mapping, the configuration contains some rules that basically match parts of the IssuerDN and SubjectDN, and explicitly map matching certificates to a given account.

In the non-Microsoft world, in the Apache Web server, you would use SSLRequire to implement access rules, based on elements extracted from the certificate (in practice, IssuerDN and SubjectDN).

What must be remembered is that:

Certificates are for authentication, not for authorization. The former is about making sure of who is calling, the latter about deciding whether that specific client should be allowed to perform the requested access. The IIS model does authorization primarily with access rights: once the certificate was mapped to an account, the rest is AD-specific stuff with no relation anymore with certificates; this could be simple file access rights, or possibly finer-grained authorization configuration with AzMan or whatever replaces it in recent Windows versions.

Trying to do authorization with certificates (e.g. issuing client certificates that contain some information such as "can do operation X") usually ends in tears and grinding of teeth. For all its clunkiness, the Microsoft method has the merit of clearly separating authentication and authorization.
There is always a certificate validation step, which ensures that the certificate is genuine and acceptable. This includes checking all dates, cryptographic signatures, name chaining, revocation status...
There may be an additional filtering on paths, like what IIS does when using UPN-based client certificate mapping: the presence of the issuing CA in the enterprise NTAuth store acts as an extra check that will reject certificate paths that are valid, come from an accepted root, but did not go through the expected intermediate CA.


Require Same Session ID Through All Password Reset Process Steps Our password reset logic works as follows:

user clicks "forgot my password" and enters the email address of the account
email is sent with a cryptographically secure token, and the email address of the account for which the pw needs to be reset.
user clicks the link, and if the token matches, they see a box to enter a new password.

I read that we should require the sessionId to match all throughout this process.

Is that a feasible thing to require?  Are there any "normal use cases" where requiring the same session id would not work? Might IP address be a more appropriate e.g. to get around the below issue:

e.g. first two steps done in browser A, but when they click the link in the email, it opens browser B, thus, new session id.

EDIT - Two answers below.

Original Answer

You could embed another ID in the link which tracks back to the original Session ID.

Is the requirement that the email link, when clicked launches in the same browser or can it be on a different browser? What if it's on a different machine? For example, what if I reset the password from my phone, then move over to my computer or tablet, click on the link in the email and set up a new password? I might do this if I want to use the password store on my computer even though I started on my phone. From an ease of use perspective, it seems that the password link in the email and not the session ID from the original browser is important.

Furthermore, if the "Forgot Password" link was clicked by an attacker trying to gain entry and you force the Session ID to be the same, then the real user who receives the reset password link might experience a DOS depending upon how your system works. Certainly, the legitimate user can't reset her own password with the link provided because the Session ID originating the "Forgot Password" request resides in the attackers browser.

As application developer, you should be able to do one of the following:

Recognize a second session started from the password reset link as legitimate and let it go through.
Process the reset link and set it back to the first session ID.

However, I really think #2 is ill-advised given that an attacker might be clicking on the Forgot Password Link. I think your best bet is to use the second session.

Incidentally, the most paranoid systems I've seen force a re-login once the password has been reset. That is, you click "Forgot Password", get the email, click on the link, reset the password, then you're presented with a fresh login page which requires you to enter your username and new password (instead of quietly being logged in as a consequence of the password reset).

Second Answer - clarification in Question Comments

It looks like you're concerned with the OWASP article referenced. In this case, the article recommends doing one continuous session for a password reset and use an Alternate or Out Of Band (OOB) Channel to increase the likelihood you're speaking with the legitimate user. In this case, the user initiates the password reset process, answers security questions correctly, is locked out of the account, an OOB PIN code is sent via SMS or email (note, not a reset link), user enters correct PIN code, then new password may be entered.

This wasn't what the original question contained. In this case, a password reset link is not to be sent and only a PIN code to be viewed with an email reader and entered in the same password reset session flow. Jumping to a new Session ID (even if possible) ought to be seen as an attack or system bug and rejected.


How do data breaches of account login information end up in plaintext? For example, see this story. Am I missing something here? Are the login details actually still encrypted?

I don't understand how it is possible for a data breach of what I assume is encrypted information (GMail, Yahoo etc) to end up in an exploitable form (which I assume is only plaintext?).

Passwords should not be encrypted, they should be hashed. Encryption can be easily reversed if you have the key - and an attacker who has managed to steal the whole database probably has stolen the key as well. A hash can not be easily reversed.

When someone attempts to login, the server does not decrypt the stored password. Instead it hashes the provided password and see if it matches the stored hash of the password.

So if a hash function is designed to be hard to reverse, why does the passwords end up in plaintext? Because of brute force attacks.

If you have a hash, you can simply try to hash all possible passwords and see if you get a match. You might have to try a couple of millions before you find a match, but sooner or later you will. If you use a list of common passwords and try those first, it will be quick to break common passwords such as 123456.

To keep your passwords safe, you need to make "sooner or later" mean "so late it is not worth the effort". That is done by using hash functions deliberately designed to be slow even on modern hardware, so that trying millions and millions of passwords would take years or even millenia.

However, a lot of sites either use bad hash functions (that are fast, and therefore easy to brute force) or even worse - they just store the passwords in plain text or just encrypted. Therefore, a lot of passwords ends up in plaintext in the hands of hackers.

For more information on hashing, I recommend this question.


Penetration Testing Methodologies I have some issues regarding the concept of black, grey and white hat.

Where and in what penetration testing methodology I can find the black, grey or white hat concept definition?

When referring to black, grey and white hat the following is the definition:
White - A hacker who is hacking for profit with permission in order to test a system (This is called a penetration tester).
Grey - A hacker who works as a penetration tester but also as a illegal hacker.
Black - A hacker hacking illegally for any reason which can include all kinds of motives such as political, profit, revenge and so on...
When referring to black, grey and white box testing the definition is the following:
White - A tester has a deep understanding of the source code and the system and tries to build tailored tests to test the system
Grey - Almost same as white except the tester has less knowledge of the system and mixes black and white testing together.
Black - A tester will test the application as if he has no knowledge of application using all the normal testing techniques without diving into it deeper.
Notice: When speaking about "some_color box penetration testing" it is not common to do a grey box testing.


Is a "magic link" a kind of authentication? From what am I reading, magic links require users to provide their email and the user will be sent an email with the link to sign-in, and the users can use this link to log into the system.
Can this be called authentication? What we are validating is only the possession factor making the person has access to the email, no where we are confirming the user identity.

How safe it is to validate only the possession factor of authentication. Anyone who knows my email can request sign-in link on my behalf

Can this be used with public emails like gmail, yahoo?

If this is considered a form of authentication, can it be compared to the authorization_code authorization grant in OAuth? Is the unique code in a magic link comparable to the authorization_code in OAuth?

Do you know those "Login with Facebook" and "Login with Gmail" buttons all around the web? They are almost the same.
When you allow someone to login with their Facebook account, you are validating that the person have access to that Facebook account and in no way confirming his identity. That confirmation is being delegated to Facebook.
A magic link does essentially the same. Opening the link does confirm that the user have access to the email, but the authentication is being delegated to his email provider.

Anyone who knows my email can request sign-in link on my behalf

People that know your email can try to login on your behalf, and they can do exact the same on your email provider. And on any service on the internet. Being able to try to login isn't the same as authenticating themselves, so it makes no difference.
They won't be able to login because they don't have the link, and if you click on the link, you are logging in, not them. So it does not matter.

Can this be used with public emails like Gmail, Yahoo?

They are not public emails. I have a Gmail account and I am pretty sure it isn't public. A public email would be those disposable emails (like Mailinator, for example).
A public email from Mailinator can be read by anyone, so if your service says "The link has been sent to supersecret@mailinator.com", anyone can just get there and grab the token.
But if the token is sent to "supersecret@gmail.com," only the owner of that email can access the token. And it makes no difference if the email is from Google, Yahoo, or the White House: only the one (or ones) with access to that email can have the token.

If this is considered a form of authentication, can it be compared to the auth_code authorization grant in oauth?

If the token cannot be reused, it's the same as OAuth.


Device fingerprinting & Mass Computer Surveillance Device fingerprinting is one of the biggest privacy problems as explained because people think cleaning cookies, using proxy servers or blocking domains can protect them (when blacklisted trackers simply ask a whitelisted tracker to iframe their code from a new domain).

Tor might fix the problem but it isn't practical because 99% of people don't use Tor and Tor users don't use it for 99% of their online activity, maybe because of security concerns about exist node for HTTP traffic, heavy attacks against Tor network from nosy governments, or just speed problem. We need a solution for normal web browsers.

Disabling javascript may prevent some data leakage but we can't do that because most websites won't work properly without javascript. Even without javascript we have unique fingerprints because 99% of users don't disable it (even Noscript whitelisted google.com and several other tracker by default, and Noscript only has 2 million user compared to billions of internet users).

For example: Alice searches "abc" with her real fingerprint. later she trying search "xyz" but anonymously (VM+proxy+remove cookies+block javascript/flash/java). Since 99% of people have javascript with a unique fingerprint, by disabling it and using a blank fingerprint Alice tells the search engine provider they can analysis just 1% of their users. if "xyz" has unique patterns, (e.g grammar mistakes, rare queries etc) the search provider can relate it to Alice when she took all steps to protect her identity but failed because other people didn't. i think the only way is putting ourselves into 99% category.

My questions:

is there any software to add/remove/change parameters naturally with one click? (if ThreatMetrix's claim is true about CPU clock time differentials to create perfect fingerprints and detect any proxy or how far our PC is located from server then i guess no software can help.)
When Firefox is open source is there any patch to make one-time NP-complete natural fingerprint in private browsing mode and became haystack ?
or we have to wait several more years for no reason?

A couple of things to note:

1) The internet and HTTP makes it very easy to track to track users fingerprinting and persistent client data are just 2 approaches (CPU timing is not a very effective one IME).

2) never underestimate the stupidity of the general public. While the well publicized face of device fingerprinting is in relation to abuse of privacy it protects millions (billions?) of people against online fraud

3) making your machine appear 'black' or returning false data is more likely to make it stand out than disappear

Yes there are tools freely available which attempt to undermine the effectiveness of fingerprinting. Do they work? Yes they change the fingerprint - but they don't help to protect your privacy.

The issue of privacy primarily concerns the abuse of that information - however in many places collection of such data can constitute an offence. The most effective thing you can do to protect your privacy and protect yourself from abuses of privacy is to lobby your representation for appropriate and effective laws.


How an attacker can intercept the message for his own benefit I was solving questions related to security and come across this questions:

You receive an email message that purports to come from your bank. It asks you to click a link for some reasonable-sounding administrative purpose. How can you verify that the message actually did come from your bank?

Now play the role of an attacker. How could you intercept the message described in part (1) and convert it to your purposes while still making both the bank and the customer think the message is authentic and trustworthy?

You receive an email message that purports to come from your bank. It asks you to click a link for some reasonable-sounding administrative purpose. How can you verify that the message actually did come from your bank?

In general, you cannot.

That's why, if I get a message from my bank, it doesn't contain any links. It either contains a self contained message that cannot compromise my security ("more than 300 euro has been withdrawn from your account") or it simply contains the message that I should look into my mailbox on the website. I don't think many banks will sign their content with e.g. PGP or protect the messages otherwise.

Banking apps of course have more possibilities in this regard: normally you can trust the app (make sure you do), and the app can trust the messages send to it using a signature scheme.

  Now play the role of an attacker. How could you intercept the message described in part (1) and convert it to your purposes while still making both the bank and the customer think the message is authentic and trustworthy?

You would not have to intercept any messages. You can just spoof a message. Maybe you receive a message by having access to a bank account yourself, in some way or another. Or you just take the style of the banking site and use that to create a reasonably looking message.

There is no reason to make the bank trust your message; you're trying to trick the customer. The bank trusts the customer to create transactions for their behalf.


DNS Cache poisioning examples, or other criteria when a client ignores a response Is there a concise set of rules that describe what 99% percent of DNS responders accept?

Conversely, are there are set of rules that define when DNS queries are invalid?

I would think that the answer I'm looking for is like this:

  If the DNS server encounters a FQDN that is not equal to the current traversal location, then it must discard any additional records that are sent in the query, and traverse the DNS  hierarchy from the root.

I imagine there's a pretty big difference between what does happen and what should happen. Also, there's a decent amount of inconsistency in this behavior which depends (at least theoretically) on whether or not the server thinks it's supposed to be doing recursive queries.

The "Additional Information" section is there to prevent (otherwise inevitable) additional lookups, thus reducing both the total lookup time and also the strain on the DNS server.

The "rule" as has been largely accepted by the community divides servers into two groups: "authoritative nameservers" and "resolving nameservers". That is, either a DNS server is used to serve a specific set of domains, or it is used to act as a proxy doing recursive DNS lookups to other servers on behalf of a client.

For authoritative nameservers, the following rules apply:

Do not return any records for which the server is not the authority
(Corollary) Do not do recursive lookups (which would violate rule 1)
Do not cache anything (which, of course, would be completely unnecessary anyway if rules 1 and 2 are being followed; which is kind of the point)

For resolving nameservers, the following rules apply:

Do not cache or return any records which you did not specifically request (or would have requested from that specific server)
Do not cache or return any records which came from a source that is not authoritative for that domain (doing 2 probably implies 1, which again is the point)

The end result is that domains will only come from either authoritative nameservers, or from resolving servers which directly requested the information from authoritative nameservers. This, by definition, means that cache poisoning is not happening.

You'll get additional information from a nameserver when it thinks it has additional information that might help you. If you're questing from an authoritative nameserver, your additional information should be limited to only what's stored on the server. That may mean that if your response is a CNAME to a foreign domain then all you get is a list of the root servers. But if the server has the correct answer for you (such as when the canonical name is within the same zone as the CNAME record), then you should get the most specific information available.

If, on the other hand, you're making requests to a caching resolver, then the server will server will often make additional requests so that the answer you get is something you can use.  This is particularly true in the case of CNAME records, but may apply in other cases too.


Best secure way to transfer virus from server to different location for investigation I'm looking for a safe way to transfer a sample of a virus from an infected server to a laptop on a remote location, for further investigation.
Not sure how it's done in a proper way. Transfer via USB is not available...
Any advice is highly appreciated.

The "industry standard" of transferring sensitive samples is to encrypt the sample. Then you can use any preferred way of transferring files like email. This also prevents antivirus products from detecting and possibly destroying the sample. An accessible and secure way of encrypting is to use a file archiver and set a password. Note that some email gateway antivirus products will try to unpack the archive by using a short password list.


Kik | WhatsApp - Encrypted? iOS / Android Message encryption tips Kik says that their client is using ssl etc. But it's kind of hard to tell if the messages is actually encrypted between the devices. What i can understand is that they don't got device-to-device encryption.

WhatsApp is it the same with.

Is there any other IM clients out there for the mobile phones that you really can trust on the encryption (aes256 or better) ?

I am looking for the best device-To-device encryption message app for iPhone & Android.

Gibberbot is made by the same project team that created Tor for Android. It's opensource so you can check out it's encryption and see if it satisfies you.


understanding the "Offering RSA public key" step during SSH connection initialization During SSHv2 connection initialization, there is a following debug message:

debug1: Offering RSA public key: /home/user/.ssh/id_rsa

Am I correct that actually no public key is sent to server? In addition, /home/user/.ssh/id_rsa is my private key. What exactly does this Offering RSA public key message mean?

When the SSH client displays this message, it's trying to authenticate the user on the server (userauth_pubkey in sshconnect2.c). The client needs to demonstrate that it has the private key corresponding to a public key that is authorized on the server. The file name displayed in the debug message is the name of the private key file (e.g. passed as an argument to -i or as the IdentityFile configuration directive).

At the point where this message is displayed, the client doesn't use the private key, only the public key. However, the client wants to know that the private key is available, because if the server agrees to use this public key then the client will have to demonstrate that it knows the private key. The client sends an SSH_MSG_USERAUTH_REQUEST message to the server with the publickey method containing the public key. If the server agrees to use this public key (“debug1: Server accepts key”) then the client will later use the private key to sign a challenge sent by the server in another SSH_MSG_USERAUTH_REQUEST message (in sign_and_send_pubkey — the have_sig byte changes from 0 (“tell me if you like this key”) to 1 (“here's a proof that I'm me, let me in”)).


Is IP restriction enough or should I SSL my web authentication? I want to connect to my home install of phpmyadmin. I restricted the connection for this to my 2 IPs.

But I don't really understand this whole OSI layering. I do know that the IP is saved in the second layer, and I guess that the IP restriction will just look for this layer.

Is it possible to read out the password from the 7th layer, even if I have an IP restriction?

The OSI layers are a model which was not meant for IP but for an older, competing protocol. IP does not fit well in that layer, especially when envisioning SSL (which must be both in layer 6 and layer 4, which is logically impossible). These layers are just confusing, so don't use them.

IP restrictions means that your server will refuse to pursue connections which are tagged with the wrong IP address. This does not protect the data against eavesdroppers.

Let me take an analogy: suppose that your connections are good old letters, with a destination address, and a sender address. The envelopes are transparent. The equivalent of IP restrictions is when the recipient refuses to even open, let alone respond to, envelopes which are not tagged with a "known sender" address. But nobody guarantees that the sender address written on the envelope is genuine; sending a letter with a fake sender address is easy. Of course, if I, an attacker, send a letter with your address as alleged sender, I won't see the response (unless I plunder your mailbox). But the recipient may have already have acted upon the letter contents, believing them to originate from you. Moreover, since the envelopes are transparent, every postman may read the contents of the letters.

For real protection, you need opaque letters, entrusted to armed conveyers in an armored vehicle. In the Internet world, this is called SSL (aka HTTPS in a Web context).


Windows DLL Injection In the past recent years of mine, I have been doing a lot of DLL injection with a few indie games and MMORPGs. I fully understand how to do it, and how it works for allowing these games to work not as the developer's intend them to.

If I am able to compromise these games so easily and fast, what keeps me from doing it to the Windows itself in general?

...because what's going on is that you're compromising your own system. If you read the Old/New Thing blog, the author calls it "being on the other side of an airtight hatchway".

It's like asking what's preventing people from entering your house - all your friends would ask "yes, but you lock your doors, don't you?"; you can "break into" your own house trivially - you already have the key. Breaking into someone else's house is pretty difficult if, y'know, they never give you the key...


How can I know that the CA certificates in my computer have not been spoofed? As far as I know, the browser contains  the certificates of several CA. When I access http://gmail.com, the site says it is Gmail, it exposes a certificate signed by one of the CA I have in my computer, that way it knows that the site is who it pretends to be since a CA back this claim.

But, what if in my office computer, my employer set its own CA certificate in the machines, and does a Man-in-the-Middle attack?

My employer store a fake CA certificate in all the machines as Googlee Corp. (note the typo)
I access http://gmail.com
A proxy catches the request, proxy the response.
The proxy returns custom certificate signed by Googlee Corp.
My computer assumes that the certificate is valid, because a CA certificate installed in my computer backs the claim.
The browser shows that I am through a secure connection to Gmail.

Thanks.

Once upon a time, you could check your root certificates against a paper book:
http://www.cl.cam.ac.uk/research/security/Trust-Register/

These days, try to check as many independent sources as possible - for example install different browsers on different operating systems on virtual machines, and see if they agree with each other.

If you are worried specifically about your employer, print out a list of the root CAs at work and take it home and compare it with your home machine. (Or vice versa, bring in a printout from home.) If you work somewhere that isn't allowed, I'm surprised you haven't just been told to accept a new certificate and that you will be monitored anyway.

If you think the NSA have compromised both your work and home, and anyone you ask to burn you a CD-ROM for a clean install might also be an NSA plant, you have bigger problems. (And if you're right to think that, even bigger problems than that.)

Edit: Something I forgot - certificate pinning (draft standard). This will warn you if the certificate used by e.g. http://gmail.com changes in an unexpected way, so may alert you to a MITM attack. A explanation of how it works for Google: https://www.imperialviolet.org/2011/05/04/pinning.html

And DANE. That's not really something you can do, but it's something that may alert you to that sort of attack if it is adopted. See also https://www.imperialviolet.org/2011/06/16/dnssecchrome.html


Hosting company advised us to avoid PHP for security reasons. Are they right? I'm doing a redesign for a client who's understandably concerned about security after having been hacked in the past. I had initially suggested using a simple PHP include for header and footer templates and a contact form they wanted. They are reluctant because they were advised by their hosting company that using PHP is a security concern which might allow someone to break into cPanel and gain control of the site.

This, to me, sounds about like telling someone to never drive so they won't be in a car accident. My gut instinct is that the host is trying to shift blame onto the client for security flaws in their own system. Also, the server still has PHP installed, whether or not we use it, so I'm questioning how much this actually reduces the attack surface... But since I'm not a security expert, I don't want to stick my foot in my mouth.

I told my client that to process the contact form they're going to need some form of dynamic scripting. (False?) They asked if I could just use PHP on that one page. Would this be measurably safer, or is it the equivalent of locking your car doors and leaving the window rolled down?

How much truth is there to the claim that using any PHP script, no matter how simple, is an inherent security problem? We're on shared hosting with no SSL. Is it reasonable to assume we got hacked due to using PHP? Will we be any safer if we don't use it, but can't uninstall it? Because if not, we have other problems.

(Would the answer be different for any other language?)

It's not so much that PHP itself has security problems (assuming needed security updates), as it is there exists a lot of popular PHP-based software with rampant security problems. You could fault PHP for being a language that gives you enough rope to choke yourself, but the real problem is just how prevalent vulnerable PHP code actually is. One need look no further than the Stack Overflow PHP tag to find PHP newbies writing horrifically vulnerable code based on some atrocity of an old tutorial.

Additionally, a significant number of popular PHP software known for their rampant security flaws is based on very old code and coding practices. Many of these old practices are considered bad-practices because of inherent security problems.

  This, to me, sounds about like telling someone to never drive so they won't be in a car accident.

Pretty much yes. Better advice might be along the lines of "don't drive an old car with no airbags".

  My gut instinct is that the host is trying to shift blame onto the client for security flaws in their own system.

Not necessarily. If a user uses the same password for the WordPress site and cPanel, compromising the WordPress password also compromises cPanel. That would be the fault of the user. Hackers rarely need to get that far though, and just use a PHP shell.

  I told my client that to process the contact form they're going to need some form of dynamic scripting. (False?)

Not necessarily true. You could use a 3rd party service to handle the mail sending. Then the service handles the dynamic server scripting and take over the security implications. There are numerous such services available with varying feature sets, and they are popular for powering contact forms on statically generated sites.

  How much truth is there to the claim that using any PHP script, no matter how simple, is an inherent security problem?

Some, but not much. PHP does involve some active code, in both PHP and the server software which executes it. If there were ever a security vulnerability in that process which did not depend on specific PHP code, it could be exploited. While that risk is tiny, it's a risk a server with no such support does not have.


How can I ensure that only the message I sent, and nothing else reaches the receiver? How do I make sure that the open channel I use to send a message to a specific receiver, is not used by a third party to send unwanted files and compromise the receivers system? Is there a method by which I could notice if any additional files or messages were transferred?

Use TLS.

Create a TLS connection between you and the server and verify no MITM has occurred (check certs, fingerprints, etc).

No third party will be able to inject any payload as they will not be able to encrypt/decrypt within your TLS connection.


I'm currently receiving a targeted attack Since yesterday, I receive forged mails which are targeted at me. They use personal information, seem to come from one of my friends and only contain links to these web sites:

http kaosbolaclothing.com/ceremonyemploy/Dean_Edwards28/
http www.sidat.com.mx/engagediatmosphere/Matthew_Bailey44/

(links disabled to prevent someone from accidentally following them).

What should I do now?

[EDIT] Some more information:

The mail addresses me personally (by first name)
The sender is the full name of my friend (no typos) but the attacker is using different sender emails (probably forged).

Here is the mail header (personal information replaced with ${...}):

Content-Transfer-Encoding:   quoted-printable
Content-Type:    text/plain; charset=utf-8
DKIM-Signature:  v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1345684031; bh=GeuilzHJrvCxtRBuL4FZxQ7aXRM6tpTAePrK26c0570=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Yr4o5RXwGl5U/PCXc8Fjb2jSCXJ+Tm2Hp2OIjZ5uLP896jlz7BL8fOzaFrDYfkHRnYjDCjUQh8ID/P1lFoFDvi7SNHZpK765gG6yyGfMqOk3Beoozxk60WsNoyy7+R/K/X+RQ+x7ZCWmwYaqDwIn9L0neohCsdKJGKtdZOPFyXM=
Date:    Wed, 22 Aug 2012 18:07:11 -0700 (PDT)
Delivery-date:   Thu, 23 Aug 2012 03:07:17 +0200
DomainKey-Signature:     a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=6LG8CeLCvrnyj4Nognto3b5cV3zLh/o3gtbFxCf0pYJHx3ulUef0M4XNTe9lU5WnIMwpZaBdaSrF7K31KcBvKwJJcbfwpKNGdezUfKNQC00Fmo4sUur9ZrehWrV+j97HmD/UlEcZKuFwE0Lrq1+MYItPkgEGCeOYaDWBAPqbNsI=;
Envelope-to:     ${my email}
From:    ${name of friend} <${different addresses}>
MIME-Version:    1.0
Message-ID:  <1345684031.52519.YahooMailNeo@web163902.mail.gq1.yahoo.com>
Received:
from nm23-vm1.bullet.mail.ne1.yahoo.com ([98.138.91.50]) by www.hepe.com with smtp (Exim 4.72) (envelope-from <rosmery81jimenez@yahoo.com>) id 1T4LtC-0007qp-De for digulla@hepe.com; Thu, 23 Aug 2012 03:07:17 +0200
from [98.138.90.51] by nm23.bullet.mail.ne1.yahoo.com with NNFMP; 23 Aug 2012 01:07:12 -0000
from [98.138.89.174] by tm4.bullet.mail.ne1.yahoo.com with NNFMP; 23 Aug 2012 01:07:12 -0000
from [127.0.0.1] by omp1030.mail.ne1.yahoo.com with NNFMP; 23 Aug 2012 01:07:12 -0000
(qmail 52628 invoked by uid 60001); 23 Aug 2012 01:07:11 -0000
from [216.58.103.108] by web163902.mail.gq1.yahoo.com via HTTP; Wed, 22 Aug 2012 18:07:11 PDT
Reply-To:    ${different addresses}
Return-path:     <${different addresses}>
Subject:     FOR ${my name}
To:  ${my email}
X-Mailer:    YahooMailWebService/0.8.121.416
X-Sender-Host-Country:   USA
X-Spam-Checker-Version:  SpamAssassin 3.3.1 (2010-03-16) on sebigbos.hepe.com
X-Spam-Status:   No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1
X-YMail-OSG:     grrWpYMVM1nX9hYw_uNTgdCPoNKWu5jkv0EmY0ZHG4tPd2O mRxwvLiQpCv.k64Dpw3ncbfn2yZ8BJSdT8MQfa30vkl_20DL1PRE.Znx._Cq 5nmBpOrqzrKpnI6FQWrv09oazY4eKdfYj4Tctb69dInKejxmOVmrJBDVT.Bg qe.buX4abq2f0JwUSlgieoxQcVlERFSy4ENI6.t633e4GCpKFaWn.5bJk_P5 VYpdFdVgBtyttRn6e1PQFCI4LkETAAzBcXtlcXf2yF5aL7C4SMWhbpXbbyN9 rOdZXO1vl_hxHl5wCY88YrPkKcm9QvRNHDdyIx0PrnEP3GYiLHPbl_4PoB6K m12Bda2O5ObmO8XC4_OOYc.xfkm8DKezgTyMlvooh1miYOyiELCNMhiTsdbq 4tPsZYnwmhGInOo4qnW6zZuhgIMtwmT2PYKubcjX1xWFNQUpKbAK1pdhEycK KcAiO.c43J1A3fnOZ1oNUeIttRKcRtKaRXjL35UmQadPYDIYQOjK9Dq1LCT3 6rSl2ROTg73gxGH_h1wpAb4A9XI0KCElRgIdLv5UQu5eACzNYq2dQo5J_SQP bGU9NyeEBuq9wZXgvMIKF
X-Yahoo-Newman-Id:   293921.35658.bm@omp1030.mail.ne1.yahoo.com
X-Yahoo-Newman-Property:     ymail-3

I'm pretty sure my server isn't hacked

Just to add to @Polynomial's (what seems to me to be correct) answer (upvoted), when you talk to your friend, don't approach him/her as if it's a confrontation. I've seen many folk (after being hacked) react so badly because they felt they were confronted.

I think you can quickly confirm if it is a phish by asking if he's aware of the situation or if any of his other friends have received such emails? If his account was hacked as Polynomial rightly suggested then I doubt you're alone in receiving such a spam/phish, unless for some (rare) reason you're being specifically targeted. I receive similar emails around once per month from some friend, whose webmail password has been compromised (it's interesting when it happens to a security mailing list).

Looking at the mail headers, the X-Spam-Status:   No, score=-0.1 headers show that everything on the mail was well-constructed, no content appearing like a spam mail, most likely a low SPF rating on the sending mail server and the websites referenced have no prior in terms of being a phishing or compromised URL. Taken with the results below, this would seem to indicate freshly compromised sites.

I also checked the reputation of the two sites (I regularly do this on such occasions and notify the vendors and the local CERT of such sites, I'd recommend doing so). I used to volunteer at a CSIRT and such notifications are invaluable.

kaosbolaclothing.com

Google Safe Browsing - no previous hosting of malware
McAfee - "fashion & beauty" & deemed to be clean
Senderbase - unknown

www.sidat.com.mx

Google Safe Browsing - no previous hosting of malware either
McAfee - uncategorised & deemed to be clean
Senderbase - unknown

From experience, I've found the Websense Lookup Tool to be the best but I no longer have a login there.

I unfortunately don't have time to actually look at the sites to see if they try to exploit anything but I'd be interested to know :)


What's the advantage of TLS-SRP over self-signed certificates? According to https://security.stackexchange.com/a/2531/5002 TLS-SRP allows one to authenticate a client or server without third-party certificates because it uses a shared secret.

If you're going to require the parties have a shared secret, how is this any better than agreeing on a pair of signed certificates ahead of time and using those to carry out future authentication and encryption?

The main advantage of SRP is that it can work over a low-entropy shared secret. Namely, a password. Passwords are not as strong (in general) as, say, RSA private keys, but they can be stored in human brains.

If you use a pair of self-signed certificates, then each party (client and server) will have to store a hash of the peer certificate (that's easy) and also its own private key (that's the hard part). Storing private keys is hard because it makes the storage device highly sensitive, e.g. theft becomes a critical issue. Passwords, on the other hand, can be kept in your mind, which (theoretically) is immune to theft.

TLS-SRP, in that sense, contrasts with TLS-PSK, in which the shared secret must have high entropy (because what travels on the wire allows for offline dictionary attacks). TLS-PSK does not offer any security advantage over self-signed certificates (it may have performance advantages, though: smaller messages, less computations...).


Example of malware in the wild? I'd like to test an application that detects malware on my network. In order to do that, I have a Windows VM set up that I'd like to infect with malware. But for the life of me, I can't seem to find an actual example of a website with malware in the wild.

To be clear -- what I'm looking for is a website that, when I navigate to it in my VM's web browser (any browser, I'm not picky), automatically installs malware (ideally invisibly) to the virtual disk. I realize that this probably requires an earlier patch of some plugin or software (e.g. Silverlight 4 or IE 8 or something) -- I don't mind this requirement.

Any suggestions on where to look for such a beast?

Here's a list of websites that maintain and provide a list of malicious sources:

https://web.archive.org/web/20160729161440/http://www.selectrealsecurity.com/public-block-lists


Microsoft account comprimised and someone did automatic sync and wondering if emails downloaded? I have a Microsoft account and today I got a Security alert saying "We think that someone else might have accessed your account" and had to change my password. When I checked my account activity it said there was an automatic sync in Algeria and Mexico and China yesterday. Does this mean it is likely people have downloaded copies of all my emails? I am worried that every single one of my emails has been downloaded.

This is what I see in my account activity in my Microsoft account:

Yesterday 8:31 PM
Automatic Sync
Mexico
Protocol: IMAP
IP: 189.219.94.26
Account alias:
Time: Yesterday 8:31 PM
Approximate location: Mexico
Type: Successful sync
You've secured your account since this activity occurred.
Learn about more ways you can protect your account.

I asked this question in the Microsoft forum but haven't had any replies.

From what I can see, yes your emails have been compromised. If you look at the log you notice that it has synchronised IMAP - This suggests that the client has downloaded your email settings, folders and all of the emails contained In those folders.

If you didn't know already IMAP is a popular protocol for incoming emails.


What are the possible ways to exploit a login page? In a recent interview I was asked how can you bypass a login page, all it has is Username, password and login button.

I was able to come up with below possible ways,

SQL Injection
Phishing
Stealing cookie
Trying default / easy to guess usernames and passwords

However, the interviewer wasn't satisfied by my answer and was expecting harder ways instead of these easier options.

So I wanted to know how else can a login page be exploited? What exploits am I missing?

Some thoughts:

View the source code for information that may allow you to breach the login page. Developer comments, variables used for authentication
View the page to see if its using a known framework with security issues. Find the version number and look up related CVEs
Proxy the request across and view the content. Tamper with information being passed across to see if it allows access
View the content of cookies if there are any to see if that data allows access (seriously I've come across access=true in the past)
Try going around the login page if you can guess some urls, they may have poor access controls on the page you are trying to get to
View the site itself for information. Use something like dirbuster to see if there are any directories open to you that relate to the login page. Maybe a user list of plain text password file
See what the login page is being hosted on. Maybe there is an exploit on the host platform you can use to gain access or get around the page
Use a list of user / passwords from previous breaches to try brute force access


How to secure a server backend I am developing a server which serves two purposes: it is a CMS for people to use and maintain some data, and a Web Service for a mobile app to get this data. It runs on a Debian server running Tomcat 6 (using Java/JSP) on AWS cloud.

Now, the server uses logins/passwords to identify users in both cases — in case of the mobile app, the login/password is in the app and shared across all instances of the app. If anyone starts looking at the network traffic of the client, he will see URL, login and password, will go to the URL and will be able to log into the CMS (or at least launch a brute-force attack against the login service).

What is the best way to secure the CMS? My ideas are roughly:

Move the CMS to a different server instance and a different domain. It will still share the underlying DB with the Web Service.
Obscure the login point of the server. Instead of basically redirecting all invalid URLs to the login page, send them strictly to 404 and rename login to something random.
Make sure the mobile app uses logins/passwords that don't work in CMS (by implementing different roles for CMS editor / app user) and harden the login against (brute force etc) attacks.

First, use SSL (https).  This will prevent an eavesdropper from learning users' credentials.

See
What are the pros and cons of site wide SSL (https)?,
HSTS extra security over HTTPS,
Guidance for implementors of HTTPS-only sites (Server side).

If you are embedding a password in the code of the mobile app that the user downloads, that's a bit weird and does not sound like good practice.  That's effectively equivalent to putting that password on your web site for everyone to see: anyone can download the app and look at the bytes to find the password.  Nothing stored in a program binary should be treated as secret.

If the user types in his/her password into the app, it is fine to store it in app-private storage and reuse it on every connection.  Or, it is fine to generate a private key on first launch of the app, securely send the corresponding client cert up to the server (over an SSL connection authenticated by the user's password), and then use SSL with client certs to authenticate the mobile client to the server on all subsequent connections (so the user does not need to type in his/her password again).

If the content on the CMS is intended for the public to see, then you should remove the password for viewing content, as it is a bit pointless.  If the mobile app is available to the public, and anyone with the mobile app can read the content on the CMS, you've effectively decided that the content on the CMS is intended for the public to see.


Victim system's internet connection slow after ARP spoof? I've been using Nemesis 1.4 to test ARP spoofing on a local victim machine. I've been spoofing both the victim machine and the default gateway to ARP redirect to my machine.

Spoofing victim's source MAC:

sudo nemesis arp -v -r -d eth0 -S [victim IP] -D [default gateway IP] \
                 -h [my system MAC]  -m [gateway MAC] -H [my MAC] -M [gateway MAC]

Spoofing gateways MAC:

sudo nemesis arp -v -r -d eth0 -S [gateway IP] -D [victim IP] \
                 -h [my system MAC]  -m [victim MAC] -H [my MAC] -M [victim MAC]

Afterwards a looping BASH is made and the ARP redirection begins, spoofing every 10 seconds. In tcpdump I can see the ARP replies going out, and it seems to be working. But once on the victims machine the internet connection suddenly becomes painfully slow, if it works at all. Is Nemesis not redirecting? If so what am I doing wrong?

From reading this article it appears that nemesis just poisons the arp cache of the victim and gateway to cause them to forward packets to your machine (the middle man).

You need to enable IP forwarding (see the previous article or this one for more detail on IP forwarding) on your machine to get the redirected packets forwarded to the correct systems.


How to make authenticity of text verifiable without third party services? There is a person who wants to establish a system which allows her/him to publish texts anywhere and make it verifiable that s/he is the true origin of that text. Only the first message is not verifiable but will establish the system.

Example:

"Hi, I am Mrs X and I am going to whistle you some interesting stuff. To prevent compromitation and proove that a text you might find anywhere on the web is from me I will use the following method .... "

Something that comes to my mind is this:

1) Create key pair

2) Publish the private one and keep the public key secret

3) Announce: the next text will have the Base64 of the encrypted text "what a wonderful day" below it.

4) Next time: publish message - announce the next to be found verification text - encrypt the text "what a wonderful day" using public key and base it on 64 - put it below the message.

Now if somebody wants to verify they will decrypt the verfication text using the known private key and so on.

Would something like this work? Or is there a simple established method?

Possible attack vectors:
- exchange of published private key
- use Base64(Encrypted(TEXT)) seconds after true published text and make it indistinguishable which one is true

You can use commitment schemes such as the one way hash chains or Merkle trees for this purpose to provide authentication.


Received weird request URL in my TOMCAT access logs I have received some weird request URL in my TOMCAT access logs. which is as follows:-

\x16\x03\x01\x01\"\x01" 200 40788

as clearly seen from above log, the server has given 200(success) response to the client(the one who is accessing above URL from our server).

I am really concerned whether the hacker is trying to post some malicious data on the server?

above request is in which format? is it in hexadecimal? how should I convert above request URL to text format so that I will get to know which resource he is trying to access or on which URL he is trying to post?

\x16\x03\x01...

This is the start of a TLS 1.0 ClientHello, i.e. the begin of a TLS handshake. The \x16 is the TLS record type 22 (hex 16 is decimal 22) which means handshake. The next two bytes are the major and minor SSL/TLS version of the record, where 03 01 stands for TLS 1.0. Probably somebody tried to access your HTTP site with HTTPS. It's not an attack.


What does the existence of this file indicate? C:\Documents and Settings\Sarah\Recent\DSCN0275.JPG.lnk
on a Microsoft Windows system, and use the xxd program to dump the contents of
this file:

It's just a normal shortcut file. When you right click on a file and choose "Create Shortcut" this is the resulting file it creates.
In this case it is in the recent folder. Items are automatically made and added to the recent folder when they have been recently accessed.
There is no security concern here.


Executing XSS payload when "http" is added to payload I have a context where every special characters are escaped properly except ':' &'/'. The output is reflected inside <a href="payload" tag.

1 )When I set payload to javascript:alert()(which is the only payload I can think of in this context), it is reflected as <a href="http://javascript:alert(1)"

2) If the input payload is

javascript://%0aalert(1);//

The reflected output is <a href="http://javascript://%0aalert(1);//"
and when clicked opens as http://javascript//%0aalert(1);// .

Is any bypass possible in this context?

No, if you can't change the part before the colon, you are guaranteed to always produce a HTTP URL, no matter what you append.

This follows the Uniform Resource Identifier (URI): Generic Syntax RFC 3986.

  Each URI begins with a scheme name [...].

The syntax of the scheme part is specified as follows:

URI  = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
...

So, no XSS is possible here and you are limited to comparatively harmless vulnerability classes, which deal with HTTP URLs, such as open redirects or referer leakages - depending on your scenario.


SSH ciphers, MAC and key-exchange (and pen-tests thereof) At work we've been trying to move our external-facing services away from a policy of inclusivity (where we tried to accept as many people as possible) to a more security-focused setup.

The first step was pen-testing some of our core web applications, where the focus tends to be on weaknesses in the application code, but a lot has been said of the SSL/TLS suites and ciphers.  Off the back of these test results, I have managed to at least get enough people interested in attaining the A-, A and A+ "grades" in the Qualys tests (management like quantifiable grades -- who knew?!).

However, another key component of some of our software is bulk-file upload/download via SFTP (i.e. over SSH).  I always have tried to apply as good practice as I could determine on the SFTP servers, so we routinely use:

key-only authentication
blacklisting repeated authentication failures
2,048-bit keys
disabling shell, exec and port-forwarding

But I must concede that I know very little about the crypto implementations, so the default settings have almost always been used.  However, I presume that, if a pen-tester flags RC4, 3DES, MD5, et al. in a TLS-based setup, they would also flag these algorithms in an SFTP server (were it included within their scope).

I'm primarily working on a Windows stack, and we've been using VanDyke VShell as our SFTP server of choice for a number of years.  By default, it enables all Cipher and MAC options (except for 'None') and all Key Exchange options except for 'Kerberos' and 'Kerberos (Group Exchange)'.

This leaves the following algorithms, as named by the VShell application:

Key Exchange: diffie-hellman-group14, diffie-hellman, diffie-hellman-group
Cipher: AES-256-CTR, AES-192-CTR, AES-128-CTR, AES-256, AES-192, AES-128, Twofish, Blowfish, 3DES, RC4
MAC: SHA1, SHA1-96, MD5, MD5-96, UMAC-64 (and, in more recent versions) SHA2-512, SHA2-256

As for the questions:

Where are the best references for me to determine which of these are now considered too weak to use?
How can I best-determine whether disabling any of these will adversely affect my end-users?
Are there any Qualys-like tests that I can use to regularly evaluate these servers, preferably with compelling evidence with which to beat management into submission?

Unfortunately the standards bodies don't fully agree on a single list of ciphers for SSL/TLS or SSH security. The following document and it's internal references will help a lot and I would think that in general owasp.org would be a great place to keep up with weak ciphers but unfortunately there is no one universal list at this time.

https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet

For SSH hardening specifically look at the following:

https://stribika.github.io/2015/01/04/secure-secure-shell.html

Ultimately an up to date list mapping the cipher supported with a reason why each one was depreciated would be useful for everyone but I haven't seen such an effort yet.
The best way to know what your end users are using is to monitor actual traffic to your site. You can either enable cipher suite logging on your SFTP server or webserver or simply use a protocol analyzer like WireShark, tshark specifically, for this.

https://www.wireshark.org/

Generally you will find that limiting cipher suites is actually easy because most clients from the last 5-10 years support a wide range of ciphers.
To test this I highly recommend using the nmap ssl enumerate ciphers .NSE script or for SSH the SSH2 enumerate algorithms script:

https://nmap.org/nsedoc/scripts/ssl-enum-ciphers.html

The command to test a website will look similar to the following:

nmap --script ssl-enum-ciphers -p 443 www.website.org

There are similar scripts for other protocols, for SSH the following would work

https://nmap.org/nsedoc/scripts/ssh2-enum-algos.html

This information can be gathered from the debug2 information in the ssh -vvv option but nmap is far easier to automate.

For externally testing websites there are sites like the following which will tell you information about depreciated SSL/TLS ciphers on HTTPS based services.

https://www.ssllabs.com/ssltest/

At this time there are no "Qualys like test websites that match their SSL test website for SSH" the closest way to get similar information for SSH is to use ssh -vvv option or use the nmap NSE script ssh2-enum-algos.html. There are other solutions to this but nmap is probably the easiest to implement and it's very scriptable so you could have it test a huge number of IP's easily.


Why do phishing sites use images instead of just copying the HTML? Why do phishing sites use pictures of the full site (e.g., they took  screenshot and broke it up) instead of just copying the real HTML and modifying the target for form submission of username/password?

It would seem a lot of people would notice that the text is not selectable or that interactive features do not work.

Using the real code from the website may increase the ability for automated detection to find and identify the phishing site. If the victim site has some specific text phrase, this could be used in searches across the web to identify potential phishing sites. Crawlers and other bots may also store complete HTML and could match against structural items. With images you do join all of the images and then do OCR, which would be very time consuming and hard to narrow down the list of potential sites imitating you.

Phishing site operators may also choose to cut up the screenshot images differently on each site and use different file names so that each site attacking the same victim is harder to identify.

Also, it may be possible to utilize CSS for the images and layout to further reduce the amount of available code and content to match against.

Remember, Phishers aren't trying to fool everyone. They less credible the site, they know the ones who fall for the scam are less likely to notice and report (Check out this Microsoft Research Report).


How can a system verify an online password using a phone keypad? I phoned into a financial company's website, and it prompted me to key in my password on the phone keypad, converting the alphabetic characters to the corresponding digit, and special symbols to '*'.

How can they possibly make this work without storing the password in some reversible format internally? Storing a salted hash of the password would not allow this sort of password verification without them checking every possible digit->alpha combination and every possible '*'->symbol mapping.

One possibility is to store a second hashed password. Store the hashed real password, and at the same time map that plaintext password to the keypad equivalent, and store the keypad equivalent as a second hash (and second salt).


Encrypt a body instead of Signing it (with JWT for example) What would be the issue if I encrypt the "claims/body/data" and I send it to the user, then when the user sends me this encrypted token, I decrypt it I trust it, and operate on the data in it (If it's decryptable using a secret key). So basically the same idea as JWT only I won't send the header and the signature, and the body would be encrypted.

Is there a known/implicit vulnerability with this ?

TL;DR: It is not recommended. If you don't want to use public key cryptography, you can use HMAC.

Using encryption may work to some extent, but you would really need to know what you are doing or hope you get lucky.

Signature/MAC protects the whole message from being changed. Encryption does not prevent change, the only thing it can prevent is the attacker knowing, what he is changing.

Now if the format is known, for example he knows where the user ID is (and is lucky), he can change it to a different (random) ID blindly. Now this may or may not be useful for the attacker but it brings a lot of problems.

Also, depending on the encryption algorithm, padding (if any) and other factors, you may face additional problems.

For example, if there is no IV in the scheme, an attacker may take part of one message and part of another and mix them together. So let's say I intercept two messages. One makes you administrator and one makes me user. I may be able to take the name from my message and the rank (administrator) from your massage and make myself administrator.

Also as pointed out by AndrolGenhald, with CTR mode (AES or any other block cipher), the attacker can completely change the encrypted message as long, as it is the same length. This may also be possible with less well known modes and/or ciphers.

PS: AES in GCM mode can be used to both encrypt and authenticate data, so using it prevents all the above mentioned problems and is preferable, if confidentiality of the data is required. However, it is still necessary to send the IV and the MAC with the body.


Execute reflected XSS in URL I am new to InfoSec and am trying to learn and try things for myself.
I am exploring vulnerabilities in phpBB version 2.0.15.

I have used OWASP ZAP to scan the site, and I have discovered

I can work out that the postorder parameter is exploited with JavaScript, and in this case, should just show an alert popup on the screen.

I am trying to replicate this myself, using the URL and seeing the popup in my browser, however i cant seem to manage.

http://localhost/phpbb2/viewtopic.php?sid=d0788fd3d4b38af8f932ebea058dcb99&start=0&t=1&postdays=0&postorder=javascript%3Aalert%281%29%3B&submit=Go

When using the link im expecting to see the JavaScript alert, however nothing happens.

How do I make it work? / What am i doing wrong? / What am i supposed to do with this?

Thanks

I believe you are referring to this vulnerability:
https://www.cvedetails.com/cve/CVE-2004-0339/

If we look at the details of the advisory, we see that the payload is slightly more complicated than the way you're trying to exploit it:

http://marc.info/?l=bugtraq&m=107799508130700&w=2

In this advisory, the (URL encoded) payload is:

'"><script>alert(document.cookie)</script><'

This is because the payload will be pasted inside of href="[your payload here]" in an a-tag. So if you try to inject javascript:alert(1), it will result in href="javascript:alert(1)". Maybe if you click on the link you will see the pop-up box. However, you can also break out of the href like in the example from the advisory, executing code the moment someone visits the page.

Do note that you need to use a browser that doesn't automatically reject xss, like Nipun suggested.


How to find external ip address a payload uses to connect back to the attacker? I find myself targeted with a malicious .apk file. I am provided with some malicious files disguised as a genuine .apk.

I used apktool to decompile the file and collect some information about the attacker. I could find none (please point me how to find some info if any can be found)

Could you point me in the right direction as to find which ip does the payload uses to connect back to the attacker? And also monitor the attacker if I deliberately allow the attacker to get a meterpreter session.

What else can I do to make the attacker regret targeting me?

Note:
I am aware of how to generate a payload, embed it to a genuine apk file and to use a meterpreter session to access data from the remote target.

You can create a wireless hotspot using your laptop, connect your phone on the wireless created by your laptop and then use wireshark to capture traffic from your phone to the internet. Then you will be able to see all the IPs your phone is connecting to.

Here's some useful links:

How to create a hotspot on linux
How to use wireshark


What authentication system (OpenID, Facebook, etc) permits Javascript-free and/or Cookie-Free operation? I'm looking for an authentication system that relies on 3rd parties (ADFS, OpenID, SAML) but doesn't rely on cookies or Javascript... or at least can make them optional.

My intent is to gracefully degrade and maintain state not in a cookie , but rather keep the session information in a HTTPS protected URI, that is repeated for each request.

What authentication systems support this primitive browsing?

Although this question doesn't directly deal with my webserver (and it shouldn't matter anyways) I would appreciate it if you could mention what authentication library works best or doesn't work for a given provider:

A helpful answer will tell me what technology supports or does not support cookie-free sign in, and what supports .js free sign in

Google OAuth:
Open ID
Facebook
LinkedIn
ADFS
???

A GREAT answer will tell me the technology and the corresponding library that works with is

WIF works without cookies or Javascript. Protocol is WS-Auth/Fed with ADFS Server.  (ref)
WIF ??? with WS-Fed (+SAML Token) Protocol with ADFS Server.
LinkedIn ToolKit:
Facebook Integration API:
DotNetOpenAuth:

The idea is that even though an underlying technology may support cookie free and JS free authentication, the corresponding library is implemented in a way that does not support this.

Please contribute whatever knowledge you have so I can triage the information into a nice summary for the benefit of all.

ASP.NET out of the box can handle cookieless session handling.  As such, any mechanism that uses ASP.NET sessions can work cookie-less.  The Windows Identity Foundation coupled with ADFS v2 will work cookieless, but every time you return back to the STS, you will need to reauthenticate so you don't get SSO.

WIF will work with MVC.

I cannot speak to any other platforms as my specialty is WIF/ADFS.

EDIT: JavaScript is not required for either.  Also, WIF will handle SAML tokens, but doesn't handle the protocol itself.  V1 only supports WS-Auth/Fed.


Linux Updates to Shellshock My question is about the community response to Shellshock.

What improvements were made in either the Linux development cycle or in the recommendation to its users to prevent something like Shellshock/Heartbleed from happening again?

I don't believe any improvements were made to the Linux development cycle in response to ShellShock.  As "the vulnerabilities had existed since version 1.03 of Bash released in September 1989" (Wikipedia), it's not considered a current development cycle issue.  (And insofar as it is, it's a universal lesson: "don't write buggy code, and find it if you do", that everyone tries and fails to learn).

The recommendation to users was: patch.  That was the last recommendation before that, and will be the first recommendation on the next bug.  In a world where software is imperfect, patching promptly is the best defense.


Storing user credentials in local file or database I'm designing a webapp from ground up.

From a security standpoint, assuming in both cases I will be hashing with a salt, a peper and a proper hashing algorithm.

Am I better off storing the user credentials in a database table along with the rest of the data, or in its own local file?

More specifically, would a separated design where the database user table contains the userID, name, email, etc. And the userID, password, salt are stored in a local file on the system. Is it worth the pain to design separately from a security standpoint, regarding the possible vectors of attack in general and if they're successful, to make the system more resilient.

Seems you are doing all the right things regarding crypto (salt, pepper, proper hashing algo). The additional security you might get by either going local file system or storing within a DB running on a different machine might not be significant.

If you go local file system

If possible turn on filesystem level encryption.
Set appropriate access permission on the file.

If you go the DB route

Make sure that machine running DB server is properly hardened.
If possible turn on DB encryption.
Ensure user authentication required to access DB.
If possible ensure Application Server to DB communication is over a secure channel


How to search for malicious software added after a recent date I recently gave my laptop to Apple for repair, and they required my admin password. Of course I supplied a temporary password, but they still had access to the admin account.

I trust Apple, but I'm still a little paranoid that someone may have added something malicious to my computer during that time. I dropped my computer off a few days ago and received it today, so I simply ran find / -type f -mtime -4 and manually checked for anything strange, but found nothing.

I don't know if the above is very effective since an attacker could just use touch to change the creation dates.

I also ran a ClamAV scan (though I'm not sure if it's that good on OS X since it's really a Linux tool?) which found nothing.

Is there anything else I can do to ensure the integrity of my OS X system?

Modification dates are not trustworthy at all. ClamAV doesn't even scan for Linux malware, it just allows a Linux machine to find Windows malware in files that it hosts.

Without physical control of the machine it is certainly possible that someone could have installed malicious hardware such as a keylogger or modified existing hardware, but that would be a relatively expensive thing to do for no reason. Do you have a reason not to trust the Apple repair employees? Are you concerned about a specific threat?

Installing malware would be the most likely "drive by" attack since it is basically free. The most effective way for you to ensure the integrity of your system in this case would be to perform a fresh install of the operating system onto a clean wiped disk. Backup your important files, but not any executable files. Change all of your passwords from the freshly installed operating system.

I cringe at the thought of sending my machine in to a repair place, and probably would do the system wipe immediately at a minimum. I would have wiped the machine before sending it as well.


Backup on a distant dedicated server, such that even if someone gets root / hacks my distant server, they cannot read the data Let's say we have:

a local computer (Windows or Linux)
a distant dedicated server with 2TB storage, running Linux

I'd like to do a backup my local computer's data folder (1 TB) to the distant server (updated every week of a few GB), but I have a very specific requirement:

I want that  that even if a hacker gets root access on the distant server, they cannot use the data.

NB: The files never needs to be used on the distant server, it's only for storage, the data never needs to be used on that distant server.

TL;DR I want that the data is totally impossible to use on the distant server.

I was thinking about using rsync, but then the files are in the filesystem of the distant server, and thus it can be read by a hacker if he gets root.

(Working) proof of concept but totally inefficient: do a backup_20201116_1538.7z archive of the whole data with 7Zip, AES-encrypted with a long password/key. Send this file to server. If someone has root access on the server, he has access to this .7z file, but he cannot do anything with it because he doesn't have the decryption key.
Inefficient because:

I need to make a temporary .7z file of ~ 800 GB before being able to send it via SFTP!

If next week I want to update the backup I need to resend a new 800 GB (argh!), so it's not incremental / diff like rsync!

You can use Duplicity or Rsyncrypto to achieve this. It will auto encrypt your files on the fly before it reaches the destination server.


Is there such thing as a smart phone with auto-forget password feature? Storing passwords to external services (e.g. corporate email servers) on smart phones is very insecure, since phones are more easily stolen. Has any vendor implemented a feature to only cache a password in memory for a limited amount of time? After the time period has elapsed, the app would ask for the password again.

To clarify - I'm aware that many (most?) users are lazy and want to just "set it and forget it". The always-remember feature will probably always be present. I was curious about an option to enable auto-forget for the security-conscious.

I'm primarily interested in solutions for iPhone and Android.

Yup, this is a risk.  However, there are reasonable ways to mitigate the risk of loss or theft of a smartphone.

One standard method is to wipe your phone once you've noticed it is lost.  Usually, if you lose your phone, you'll notice that fact fairly rapidly -- and if it's stolen, you might even know right away.  That gives the chance to immediately wipe your phone, which then prevents a loss of your passwords.  Many corporate-oriented systems also provide a way to lock the user's corporate accounts and reset their corporate passwords at that point, so that the password to your corporate email service is worthless.

Another standard defense is to require a secret PIN, swipe code, face recognition, or other password to unlock your phone.  That also helps protect you against most folks who would recover or steal your phone, since they're probably not going to be able to guess your PIN.  Of course, this defense is far from perfect: someone with sufficient sophistication may be able to bypass the unlock screen and get access to your data by reading it directly off the flash storage.  However, this requires more sophistication than most thieves are likely to have, so a PIN unlock screen may be good enough to deter common thieves.

So, if you put all of these together -- are they perfect?  No, they're not.  But they help.

I realize this didn't answer your question of how to enable auto-forget.  That will probably be platform-specific.  If you don't get a good answer here, you might want to try asking on Ask Different (for iOS) or Android Enthusiasts (for Android), two of our sister sites focused on specific smartphone platforms.

Trivia: On Android, have you looked at Menu > Settings > Location & security > Credentials storage > Use secure credentials?  I think this only protects your Wifi passwords, but it's one mechanism to know about.


Safe usage of Runtime.getRuntime.exec(String[]) I was reviewing code of an application that uses the following piece of Java code and wanted to know if the the use of exec() was susceptible to command injection.

public class FindFileInDir {
  public static void main(String[] args){
   try {
        Runtime rt = Runtime.getRuntime();
        String[] cmdArr = { "bash", "checkfileindirectory.sh", "<directory_to_search>", "<file_to_find>" };
        Process p = rt.exec(cmdArr);
      } catch (Exception e) {
         e.printStackTrace(System.out);
    }
  }
}

To provide some context, the shell script is just a wrapper for the find command that searches for a file in a directory. It takes two arguments directory_to_search and file_to_find. The directory_to_search argument to the script is fixed but the user contains the file_to_find argument. Is there are payload that can be used to chain multiple bash commands in this scenario?

I ran your program, linked to a checkfileindirectory.sh that looks like this:

#!/bin/bash

echo $1 > param1.txt
echo $2 > param2.txt

As a test, I changed "<file_to_find>" to "<file_to_find>;touch MikeWasHere.txt"

String[] cmdArr = { "bash", "checkfileindirectory.sh", "<directory_to_search>", "<file_to_find>;touch MikeWasHere.txt" };

And I get this output:

➜  /tmp javac FindFileInDir.java
➜  /tmp java FindFileInDir
➜  /tmp cat param1.txt
<directory_to_search>
➜  /tmp cat param2.txt
<file_to_find>;touch MikeWasHere.txt
➜  /tmp ls MikeWasHere.txt
ls: cannot access 'MikeWasHere.txt': No such file or directory

So it looks like java's rt.exec() is injection-safe.

OWASP's page on command injection has a paragraph about java's exec (emphasis mine):

  C’s system function passes its arguments to the shell (/bin/sh) to be parsed, whereas Runtime.exec tries to split the string into an array of words, then executes the first word in the array with the rest of the words as parameters. Runtime.exec does NOT try to invoke the shell at any point. The key difference is that much of the functionality provided by the shell that could be used for mischief (chaining commands using “&”, “&&”, “|”, “||”, etc, redirecting input and output) would simply end up as a parameter being passed to the first command

That seems consistent with our experiment that java's rt.exec() is injection-safe.


Can pre-compiled binaries be different than if someone builds from source himself? Given that I have an "acceptable" source code of some program (Tor was mentioned in a previous version of this question), where "acceptable" means that I trust this source code and want to use it for my needs; is there a possibility, that if I use pre-complied binaries (someone else's compilation), that I will get an "unacceptable" binary that contains different code than the "acceptable" source code I saw (e.g. backdoored binary)?

The answer is, of course, that it's possible.  There are four major ways that can happen.

1) The binaries you downloaded include a vulnerability and weren't built with the signed source code.

Answer: Perform your own deterministic build based on the instructions provided at blog.torproject.org, which states "We achieve our build security through a reproducible build process that enables anyone to produce byte-for-byte identical binaries to the ones we release. Elsewhere on the Internet, this process is varyingly called "deterministic builds", "reproducible builds", "idempotent builds", and probably a few other terms, too."

2) The compiler you used included a vulnerability in your binaries, perhaps a specific implementation of the Ken Thompson hack from 1984

Partial Answer: This one's harder, though using different compilers from different sources and then doing careful analysis on the results to see if they have the same behaviors would be reasonable, if time-consuming.

3) Your OS or drivers are compromised.

That's outside of the scope of this answer.

4) Your CPU and/or NIC is compromised.

That's also outside the scope of this answer.


Sensitive data and phone calls How safe is it to give sensitive information to someone over a phone line? Does it matter if the data was verbally spoken or if it was typed in?

Example: Opening an account with an internet provider and they ask for your SSN and/or credit card number.

The phone line is not considered a secure end-to-end medium. It is possible the tap into a phone line. The parties who are most interested in tapping your phone aren't interested in having your SSN or Credit Card number (government agencies).

People who are really interested in harvesting SSN and credit card numbers have other means which tend to yield a lot more credit card and social security numbers. You can imagine the incentive it would take to tap on every single phone line across the globe. It's a lot more interesting to use other scams to get to this data, not mentioning the detection rate.

So to conclude, the risk versus effort versus yield is not interesting enough for people to tap into your phone line to get your CC and SSN. People who will do phone tapping are not interested at all in your SSN or CC.


XSS - Can we steal cookies from another website on another tab? Suppose I found a XSS bug in a eCommerce website. Can we steal the victim's cookies from their bank website (if that is opened in another tab)?

Depends on how well the browser has implemented tab separation and cross-site origin policy. In modern browsers, no, you won't be able to do that. It would be possible to write a non-standard conforming browser that would allow you to access third party cookies, but at that point, the attacker can do much more interesting things, so being able to steal cookies is pointless.

In old browsers (very old browsers - I'm talking pre-IE4 era, if not even earlier), it's possible various tricks would get the browser to send the wrong cookies, but these are relatively easy bugs to pick up with automated testing, so they should have been fixed a long time ago.

The responsible thing to do in this circumstance is to let the ecommerce provider know about the XSS issue, providing all the details they need to recreate it, so they can fix it. They might even give you a reward, depending on their policy. However, it is usually illegal to go looking for issues without permission from the site owner - if they have a bug bounty programme, they will usually mention it somewhere, along with restrictions on the kinds of investigation they allow.


SSL handshake exception: unable to find valid certification path to requested target We are using a third party payment service for our web users to be able to pay for courses. Once payment is completed however, payu attempts to connect to our site and run an IPN. However, they get the following error:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX     path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid     certification path to requested target

Since our certificates are completely correct and up to scratch I can only imagine their services need to have the root CA certificate installed in their java trustore. Is this correct? Or is there something else we are missing?

The trust chain for this site is like this:

[0] /CN=www.vitalityinstitute.co.za
[1] /CN=Entrust Certification Authority - L1K
[2] /CN=Entrust Root Certification Authority - G2
[R] /OU=(c) 2006 Entrust, Inc./CN=Entrust Root Certification Authority

The first 3 certificates are send by your server and the last one should be in the local certificate store as a trusted certificate. But, according to this PDF from 2010 this certificate is not included in the trust store by default. Instead older certificates from Entrust are included.

Thus there are probably two options:

add the missing certificate as trusted to Java
or add the missing certificate to the chain of the web server. Since this certificate itself is signed by an older certificate from Entrust and this older certificate is probably included in Javas trust store this might just work. Unfortunately, this might cause problems with OpenSSL based clients as described here.


Are OpenJDK and non-Windows systems vulnerable to the Sept. 25th 2012 Java vulnerability? I have heard of this vulnerability, but although it was announced on the Full Disclosure list, it does not provide any details (other than a severity assessment). Does anyone have more info than me, and is able to tell whether non-Oracle JREs (OpenJDK's, for instance) and non-Windows systems are vulnerable to it?

It's been less than 24 hours, and it doesn't seem to have a CVE entry yet, so it's difficult to say. The details are pretty sparse.

All I can give you is my best guess:

Any initial exploits will work on Oracle Java SE only.
A variant of the vulnerability may affect OpenJDK, but it's unlikely to have the exact same problem. This is because it's an entirely different codebase. We may see problems later on with OpenJDK though.
It'll be cross-platform, since the constraint violation is in the JVM, not in anything Windows-specific. It may even work on non-x86 machines, e.g. ARM / PPC.


Script injection on different hosting servers = FTP hacking? I've been seeing the exact same injected script on several of my websites for the last few weeks. Today I realize these websites don't share the same hosting servers, yet the attacks (1) started at the same time (2) are identical.

Does this prove that my FTP passwords have been stolen (they're all stored in Filezilla XML file on my hard drive), otherwise what else could be the security hole?

Also, is it reasonable to store FTP passwords in a file locally? If not, how should they be stored?

It's also possible that all your websites have a common element (an insecure file upload) that's being targeted. Or someone is snooping on your network (which is why SFTP/SCP is better than FTP) But it's likelier that your passwords have been stolen.

It's generally a bad idea to store sensitive passwords in an unencrypted form on your local machine. Saving passwords is useful, but I personally use it for passwords which I don't care much about. (Even things like Firefox's master password feature can be circumvented by copying the entire user data directory). If you want to store sensitive passwords on your own machine, be sure to keep the machine secure with an antivirus and a strong firewall.


What's the usage of the signature algorithm in TLS_DH_* cipher suites? According to RFC5246 A.5 there are cipher suites TLS_DH_RSA_* and TLS_DH_DSS_*.

  How / where does the signature algorithm RSA resp. DSA from the cipher suite come into play when using (non-ephermal) Diffie-Hellman key exchange ?

To my understanding, when using (non-ephermal) DH, key exchange between client and server during the TLS handshake works as follows (suppose there is no client certificate):

Server sends its certificate in ServerCertificate message to the client. The certificate includes DH-parameters p, g and the server's public key constituent g^x mod p (RFC3279, 2.3.3, RFC 5246, 8.1.2).
After verifying the certificate, the client chooses private y, computes g^y mod p and sends public key constituent g^y mod p in the ClientKeyExchange message to the server.
The common private key g^(xy) mod p is known to client and server.

As far as I can see, there is no need for a signature here (up to the certificate's own signature, of course), since public visible g^y mod p is of no help for an attacker due to hardness of computing a discrete logarithm.

Added: No duplicate because the linked question in the comments asks for forward security while this question asks about the notation of the cipher suite.

As noted by @dave_thompson_085 in his comment above, the names DH_DSS, DH_RSA, ECDH_ECDSA, and ECDH_RSA are historical (see RFC5246, 7.4.2). Actually, the signature algorithms RSA, DSS in the names of these cipher suites have no meaning.

In TLS 1.1, however, as indicated by @StackzOfZtuff , there had been the convention that in a DH_RSA cipher suite a server certificate has to used that is signed by RSA (and similar for the other suites) (see RFC2246, 7.4.2).


HTTP/HTTPS on the same site Suppose a site allows connection to be established with HTTP or HTTPS .If you establish a connection to http://www.example.com or https://www.example.com then all further link's on the page displayed will have HTTP or HTTPS correspondingly. I understand that an attacker can degrade your HTTPS connection to HTTP using MITM and then can takeover your account but i want to know that can it pose any other threat other than this ??

Not all links are restricted to your initial request; if you include the protocol (e.g: http or https), then you can jump between both.  If you just have relative URL locations (such as: "/dir/page.php" instead of "https://site.com/dir/page.php"), then you'll stick to the same protocol.

Websites can implement Hypertext Strict Transport Security, this will force a browser to only use the HTTPS protocol for a website. The drawback is that the initial request remains vulnerable if it was done over a non-SSL channel.

When you asked about other ways that are possible, depending in your browsers mixed content handling, but an attacker could inject JavaScript in cleartext requests and access your DOM.