How to prevent attempts to log into my accounts? I'm sure everybody knows the e-mails that many web services send out when you log into your account from an unknown device or geo-location to inform you about suspicious login activity.

The problems start as soon as one doesn't attempt the login him-/herself and this mail could actually indicate that some adversary tried to access one's account. This happened to a relative of mine about a month ago with their e-mail, their Facebook and Steam account. All pretty much at the same time. The Steam emails even suggested that the attacker was in fact able to log into the account.

We immediately took action by changing passwords for most of their internet accounts and (finally) activating 2-Factor Authentication where possible. But, over the last days, Facebook reported multiple failed login attempts again.

As far as I can tell, all the mails that were received were genuine. The links in them pointed to the real websites and they (especially for the ones from Steam) looked like the real deal. So I assume that there were in fact multiple attempts to break into the accounts (and maybe even a successful login in case of Steam).

What steps can we take to prevent these hacking attempts in the future? Or is it only possible to minimize the success rate of such attacks by choosing strong passwords, 2FA, etc.?

It is possible that the username/password have been leaked somewhere.
For this you can check https://haveibeenpwned.com/.

You did the right thing by changing passwords and using 2FA where possible. Also make sure that you use unique passwords per service.
This can be managed with a password manager. Creating random strong passwords without the need for you to remember them all.

This way, if passwords get leaked, only one account can be 'hacked'.

If you're receiving failed login attempts, then probably someone is still trying to access the account with the leaked password. Knowing you changed it and enabled 2fa, it should be no problem.


How to store derby database encryption key in HSM? The Derby Database supports encryption with a key or password. Traditionally this key is stored in the file systems, now I am looking to store and protect this key in the HSM instead, but I couldn't figure out how I should be doing it.

The most simplest approach seems to be just putting the key itself into the HSM? Then on server startup, the application will query the HSM for the key, use it to boot the Derby database, and then discard the key. However, I have read that it seems ineffective because the key can then be simply extracted, but I do not really understand what's the security issue with this appraoch, is this the approach that I should be taking?
The second way that I read about is hybrid encryption, but I am not really sure whether it is applicable to my case. I will generate a symmetric key, then generate a keypair in the HSM. Then I will use the Public Key from the HSM to encrypt the symmetric key and store it locally in the file system. On server start up, I will pass this encrypted symmetric key to the HSM to decrypt it using the unextractable Private Key. Is there any merits using this approach or its overkill for this purpose?

From the way I understand, most of the usage of HSM revolves around having different senders (encrypt) and receivers (decrypt), hence the use of KeyPairs instead of symmetric keys?

What some database engines do is to derive keys in the HSM and use different keys for different parts of the data. On top of that, they can also cycle keys (e.g. read/decrypt with key A, encrypt/write same block with key B). These operations are embedded in the database engine and I'm not sure Derby goes any close to that degree of sophistication.

On top of this, the benefit of database encryption is that if someone steals a harddrive (or a back up of your DB), they won't be able to access the data.

This changes completely in the case an attacker gets access to the server, as they will be able to connect to the database and extract the data, or alternatively they'll be able to scrap the key from memory.

My suggestion would be (similar to your first point): Use the HSM to derive a key (just getting the key our of an HSM feels dirty to me), and know that this is only to prevent the scenarios I mentioned above.


Why cant all voters be authorities in homomorphic encryption based voting scemes? In voting scemes I have seen so far that are based on homomorphic encryption, a group of partially trusted "authorities" share the task of decrypting the result.
The voter has to trust at least one of the authorities to be sure that his personal vote will not be decrypted individually. At the same time, every voter can verify that the (joined) authorities are not tampering with the result.

Is there a fundamental reason that the voters can not simulataneously all be authorities?
If this would be possible, the only way to find out the vote of A is to compute and decrypt the votes of all voters, and the votes of all voters minus A. But as A has to help decrypting, he/she can inhibit the latter.

I can only think of practical reasons:

Every voter could also inhibit obtaining the overall result. I guess there should be ways to handle that. These ways may be costly.
It would be too costly.

Thanks

To prevent coercion and vote-selling. If the voter has the ability to itself reveal the vote to a outsider, he could be coerced or sell his vote.

Thats why you need a trusted authority, that all voters trust not to reveal personal votes, even if a single voter wants his vote revealed.


Is converting malicious PDF to JPG then backwards via web services is good method to obtain safe PDF? I've downloaded a book but by default its considered malicious by me.
I thought of converting that PDF to JPG here:
https://smallpdf.com/pl/pdf-do-jpg
Then backwards:
https://smallpdf.com/pl/jpg-to-pdf
Is converting PDF to JPG then backwards via web services considered a method for obtaining a safe PDF?

JPEG is an inert format which doesn't support complex extensions, embedded executable code and most other things that make PDF potentially risky. By converting to JPEG and back, you eliminate all potential vulnerabilities except for the ones in JPEG decompression. Popular image decompression libraries got a lot of security attention in the early 2010s so they should be pretty safe these days.
JPEG is bad at compressing text (its techniques are good with color gradients, and not so good with the kind of sharp contrast that text needs between background and text). So the result will be large and may be hard to read. And of course the text won't be selectable or searchable. Sanitizing the book as a PDF (or converting it to epub) while keeping the text as text would give a result that's a lot more usable.
Of course, if the PDF is malicious, it can attack the conversion service. But the conversion service is the one that takes the risk, rather than your PDF reader.


Injecting information in a web page (Gmail). Does it raise security problem? I am developing a Google Chrome extension which encrypts/decrypts emails for Gmail users. So, I detect encrypted emails when the user opens an email on using tags. Once an encrypted email has been detected, the user is asked for a password and the plain text is displayed in a pop-up.

I want to use Jquery UI dialog to display the plain text. If you know a bit of Jquery UI dialog, you know that you have to inject a div tag in the web page (gmail here) in which you put the stuff you want to display in the pop-up. And then call dialog on this div.

So my questions are :

1.) Does it raise security problems to inject the plain text in the web page ?

2.) Does the web page (so Gmail) can detect such injection ?

3.)Is it vulnerable to a Man in the middle attack ?

Ideally, I would not want Gmail to be able to detect it and get the plain text, especially when we are now aware of PRISM program, but if it can only be detected by Gmail and nobody else it is still good for a start.

1.) Does it raise security problems to inject the plain text in the web page ?

Plain text is just text... there are no security impacts unless you start injecting code wich actually gets executed server side.Besides, what you are describing is client-side encryption/decryption. As a result, you'll end up with either plain text (=decrypted) or an block of "random" chars (=encrypted, guess base64-encoding after encryption and bas64-decoding before decryption will be safest when thinking email transfers)

  2.) Does the web page (so Gmail) can detect such injection ?

As Google changes/updates it's code on a rather frequent base, that's hard to tell. Currently it would not... yet that might change any second (depending on when Google pushes a next minor update online). Theoretically, it is possible for Google to implement a rather simple javascript routine that looks for modifications of the page itself, or of child elements of the document (like the textarea). Practically, it isn't currently done... but as I said: when Google changes it's code, you could be in trouble and your extension void before it's really live.

  3.)Is it vulnerable to a Man in the middle attack ?

If with "it", you mean your client-side encryption/decryption... no, as it happens CLIENT-side before sending any data anywhere.

If with "it" you mean "email traffic" when sending the data after encryption, you should know that — generally — email traffic "can" be vulnerable to MITM attacks. But as Google mail tends to enforce the use of SSL, I personally regard it to be safe from MITM attacks when users indeed keep SSL enabled at all times.

Talking about vulnerabilities, I would like to point you to two other things you should consider:

Depending on the crypto you are going to use, the way you are going to implement things can and will have an important impact on potential (crypto-related) vulnerabilities to consider.
Client machines of sender and/or receiver may be compromised — intercepting and transferring the decrypted data using malware like trojans.
Sending blocks of encrypted data via email can and most probably will put you on the radar of whatever governmental agency might be interested in the contents of such "encoded messages". It's been known for years, but recent news related to #prism reminded us all that "they" are actively parsing traffic like emails when something looks suspicious. I guess I don't have to explain that using cryptography isn't saying "I've got nothing to hide", but rather the opposite.

Last but not least, remember that - when it comes to software development in general - there are restrictions on the import of cryptography and there are even more restrictions related to the export of cryptography and export of cryptography in the United States) related to cryptographic implementations. Depending on your residence, these might have an impact on the product you are planning to create. Currently, many countries, notably those participating in the Wassenaar Arrangement, have similar restrictions. So, be sure to read the docs that come with the cryptographic algorithm(s) you are planning to use or you might face other kinds of trouble later on.


Some doubts about SQL Injection examples, how exactly works? I am a software developer starting studying application security and I have the following doubt related SQL injection.

I am following a video course and there are these two examples:

I have an insecure SQL query like this:

txtSql = "SELECT * FROM Users WHERE UserId = " + txtUserId

If the passed value of txtUserId is something like 99 OR 1 = 1, I will obtain a query like this

SELECT * FROM Users WHERE UserId = 99 OR 1 = 1

which will return me the entire list of record contained in the Users table because 1 = 1 is always true and the OR concatenation will return true so it is like this query:

SELECT * FROM Users WHERE TRUE

returning me the entire list of records. Is this reasoning correct?
Then I have this second more sophisticated example:

There is a user login form (username and password). Behind this form there is this insecure query implementation:

sql = 'SELECT * FROM USERS WHERE Name = "' + uName + '" AND Pass = "' + uPass + '"'

If the user inserts the following data into the login form:

uName = " OR ""="
uPass = " OR ""="

The result query will be:

SELECT * FROM Users WHERE Name = "" OR ""="" AND Pass = "" OR ""=""

So it is selecting records where

The Name field is empty ("") or equal to "=" (and this condition should be always false because it is pretty strange to have an empty user name or an username like "=").
The Pass field is empty ("") or equal to "=" (and this condition should be always false because it is pretty strange to have an empty password or a password like "=").

So we have a conditional like:

WHERE FALSE AND FALSE

And here my doubt: FALSE AND FALSE = FALSE

Why does it say that this query returns me the entire list of records of the user table?

If I understood the logic correctly, the second query should translated to something like this:

SELECT * FROM Users WHERE FALSE AND FALSE

What is wrong in my reasoning? What am I missing?

You've misread the injection, specifically this part:

""=""

This isn't checking if the Name is an equal sign, but rather if an empty string is equal to an empty string.  It's effectively the same thing as 1=1 (and they could have used 1=1 just as well here), and is therefore the equivalent of TRUE.  So this clause:

Name = "" OR ""=""

Is the same as Name="" OR 1=1 as well as Name="" OR TRUE

It's easy to misread something like that.  I'm sure that's all you need, since you otherwise understand these concepts clearly!  Just to be a pedant though, the query basically boils down to:

WHERE Name="" OR TRUE AND Pass="" OR TRUE

What happens next might depend on the exact order of precedence, but it will probably be fine.  Another trick you could use would be to end the username with a backslash remove Pass from the query all together (although this may not work in all flavors of SQL).  Imagine injecting User=\ and Pass= OR 1=1 -- (ends in a comment).  You'll end up with this query:

SELECT * FROM USERS WHERE Name="\" AND Pass = " OR 1=1 --"

Because of the backslash it will be searching for a Name of " AND Pass = (which won't match anything), but then the OR 1=1 will make it match everything.  The ending comment gets rid of the last double quote which would otherwise cause a syntax error.  This form gives you a bit more control over the query by effectively nuking the search on the Pass column and therefore ditching all the AND/OR clauses.  For instance, you could search for an actual ID by changing your Pass condition to OR ID=10 (presuming there is an ID column).


SSO Log Users Out Based on IP Address We would like to implement SAML based SSO for our organization. We do not want employees to be able to access specific accounts outsides of specific hours and IP ranges. (We do not want to setup a VPN for that use-case for multiple reasons)

Question: Is it possible to somehow log the user out of a specific account that he signed into via SAML when his IP changes and is not part of the allowed range anymore?

Things we want to avoid:
 - Browser extensions
 - Polling of any kind
 - No additional infrastructure if possible

I really don't know if this is possible but would really appreciate your help.

Pure SAML - no, it's not possible.

This is a frequent scenario in regulated industries, e.g. user comes to work in the morning, signs on to a sensitive service, performs tasks, does not sign out at the end of the work day, then takes their device home..and they're able to access the sensitive service. It's a tougher problem to solve if the sensitive service is hosted outside of company "walls". Tougher but not impossible, the devil is in the details.

Assuming you're going with Web Browser SSO profile in SAML, your control point where you can apply your IP/hours constraint is limited to the identity provider. To be more precise, it's limited to the authentication event, i.e. when a user signs in to the identity provider. Subsequent clicks by the user that may launch or target a particular application (acting as a SAML service provider) will bypass the identity provider most of the time. The identity provider will not see the request so you have no way of applying your policy.

If you're okay with doing this at the identity provider during authentication, some SAML identity providers will allow you to implement a policy that looks at hours of operation and/or IP ranges to allow or deny authentication. Some identity providers with more sophistication will allow you to use the change of IP (and/or date/time) as triggers for requiring reauthentication...which would then deny access as the next step.

The usual solution to this problem involves multiple layers where SSO is just one brick in the proverbial wall.


csrf attack when the victim not logged in If an attacker sends a malicious code for state changing event to a victim and the victim opens that malicious link and clicks on the submit button, can the attack take place when the user is not logged in to the attacked web application?

Yes it can happen. Many pages do redirect to the login page when a request that require authentication fails due to user not logged in.

If the user is unaware enough, he might try to login thinking that its is a "ordinary" login (and not a login that is caused by a request that require login). In many cases, the login page will then after login, resubmit the request that initially failed.
This can either be accomplished by that the request itself is saved in a cookie, or the request may be saved in a session bound to a cookie (like a forum post) and then is posted after user is logged in.

It can be similiar to session fixation attack, but instead the whole malicious request is "fixated" during login.

The resubmitting of failed requests can be seen as a example on many phpBB forums. Lets say you are replying to a thread, and your session expires. You then press on "Post", you are redirected to the login page, and then you re-login. After that, your post is posted, like it was "saved" in the login form.
However, phpBB employs CSRF protection. It was just a example on how such a resubmit can happen.

In some rare cases, the request may be saved in a permanent cookie, which make such a "unauthenticated CSRF attack" very dangerous. This is common with webshops, that might save the whole shopping cart in a permanent cookie. If a webshop would save a completed order in a permanent cookie and the webshop employ saved ("recurring payment authorization") credit card, its very possible that a user might visit the CSRF site, press the button, notice nothing happens. Then Days or months later, visit the webshop, and try to login, Voilá, a order is immediately placed due to the permanent cookie - with shipping adress directed at the attacker.


Github account hacked and repo wiped - Github Response One of my repo's was wiped today and just a message left in its place with a bitcoin ransom. I've no idea how they accessed my account, can't really see anything on github security page.
The domain of the email they want me to contact was only created today, google brings nothing up, also seems like a fresh bitcoin address as google returns nothing for it.
They only wiped one repo and there's like 50+ which makes me think they never accessed my account directly and possible from a server where i had cloned the repo to,  or it was a targeted attack and they knew exactly what they were after.
Is there anyway to check if my other repos have been accessed recently and cloned? they're all set to private.
I'm at a bit of a loss just now as what to do, 2 factor has been turned on in github, the main server where the code was used I've removed unused scripts etc changed passwords, currently building a new server droplet and moving everything as a precaution in case the server was accessed.
This code was still in beta, although we have about 50 customers using it. And there's a few instances during development just because of the sheer lack of time I've went for the old security through obscurity... So this will have a direct impact on my customers.
Anyone got any input, how i can try track back the source of this, find out how they got access in the first place?
Just checked the last commit details,

WARNING
gitbackupgitbackup committed 4 hours ago

All history of commits and all code is gone.
Update: Bitcoin address and email are starting to surface on google with reports of similar incidents, at least I know now its random and not targeted.
Response from Github
Github Got back to me today with a pretty standard response.
We recently noticed some suspicious activity on your GitHub account that suggests an attacker may have logged in, downloaded, and maliciously modified certain repositories, listed below. Out of an abundance of caution, we made the decision to force a password reset for the account associated with this email address. We have no reason to believe that GitHub has been hacked or compromised.
This kind of unauthorized access often occurs as a result of credential reuse across multiple online services. An attacker is then able to obtain lists of email addresses and passwords from other online services that have been compromised in the past, and try them on GitHub.
Repositories suspected of takeover:
xxxx
If you have a local copy of the repository, force pushing it to GitHub should restore the repository to its previous state. If you do not have a local copy, please contact our Support team at the email address below in order to request help.

From the OP:

  Ok looks like the source has been found.

  https://en.internetwache.org/dont-publicly-expose-git-or-how-we-downloaded-your-websites-sourcecode-an-analysis-of-alexas-1m-28-07-2015/

  Silly me! :)

  PREVENTION -

<DirectoryMatch "^/.*/\.git/">
  Require all denied
</DirectoryMatch>

  in your apache config.

  to restore your repo,

  git push origin HEAD:master --force

To make it self-contained, though, this happens when you serve an entire Git repo for your website. So, for example, if your deploy process looks like

Push your changes
SSH into the webserver
Pull your changes

Then you should take note.

Git has a .git folder which contains all the meta-information about your repo, including your remote URLs. If you embed your credentials into the remote URL (if it looks like https://user@pass:github.com/user/repo.git, you've done this) then those credentials can be used to access your repository and do anything to it that you could do.

There are a few mitigations, depending on your situation:

As stated above, you can just configure your webserver to not serve the .git folder. This is the quickest, easiest solution, but also not a great one, because you're still exposing the contents of the repo to anyone who knows the paths. If you have any proprietary elements in there at all, use another mitigation.
Put your website's code in some subdirectory of the repository. You still get the ease of deployment, but now anything you want tracked but not published, you just... don't put in the public directory. This is a higher migration cost, but a cleaner approach, and easier to get right in the long run.
Pull with SSH, not with HTTPS. The keyfile, unless you're doing something horribly wrong, won't be published, so no one else can access the repo even if they do have access to the .git folder. Be aware that, with just this solution, they can still access the .git folder, but for some projects (e.g. most open-source ones) this is irrelevant, since everything in there is already public. As a nice side bonus, your server's connecting to GitHub will be more secure.


DB Security from system admin perspective I need some clarity in terms of Security involving Linux Admins and DBAs. Oracle DB on an Enterprise Linux server.

I want to ensure none of the contractor team be able to tamper database and its files(config, db and other imp files).

In order to do that I am looking for Security controls to restrict below two things.

DBAs to not mess with database.
ServerAdmins to not mess with important db files.

Now for the first point I am sure of having least privileges, custom db access, controlled access using LDAP groups.

However, for second part, I need suggestions on how linux sys admins can be restricted. Like disallowing folder access containing db files or something of that sort.
Being said that they should also be able to do their required admin duties after applying security controls.

There are expensive DB and File monitoring solutions in market however I'm looking for native options.
Please assist.

They need to have access to the servers and databases to be able to do their job. For sysadmins they would need the root account, for DBAs they would need the superuser account in the database (not sure what that user is for Oracle, but on MySQL that user is also named root).

If you don't trust them, don't employ them, or at the very least monitor them (by setting up off-site logging to a server they don't have access to). They will still be able to stop the logging (and make it look like it was accidental like network issue etc), but at least you'd have one more audit trail.

This related question on Server Fault goes into more detail about why this is impossible.


Why do we not trust an SSL certificate that expired recently? Every SSL certificate has an expiration date. Now suppose some site's certificate expired an hour ago or a day ago. All the software by default will either just refuse to connect to the site or issue security warnings.

This recently happened to Windows Azure Storage and since most of software in dependent services defaulted to refusing to connect lots of services experienced major degradation.

Now what's the logic in here? I mean a day ago the certificate was valid and everyone was happy to use it. Now a day later it's formally expired and noone likes it anymore.

I've read this answer and I don't find it convincing for this specific edge case. To every security model there is a threat model.

What's the threat model here? What could have happened between now and a day ago that a certificate is treated to be unusable to such extent that we even refuse to connect to the site?

When a certificate is expired, its revocation status is no longer published. That is, the certificate might have been revoked long ago, but it will no longer be included in the CRL. Certificate expiration date is the cut-off date for CRL inclusion. That's the official reason why certificates expire: to keep CRL size bounded.

(The unofficial reason is to make certificate owners pay an annual fee.)

So you cannot trust an expired certificate because you cannot check its revocation status. It might have been revoked months ago, and you would not know it.


Nmap SSL service detection: How to check all open ports only for SSL service? I am running nmap to probe services that use SSL.¹

In order to detect vulnerability in non-standard ports, I am using the -sV option to perform service discovery. But it is very slow since it runs several probes per open port. How to make it more efficient and quicker by running only SSL probes?

¹  Specifically, I am evaluating Heartbleed vulnerability at our site by running the nmap ssl-heartbleed script.

You can reduce the number of probes that Nmap sends by using the --version-intensity option. This option takes an integer argument between 1 and 9, limiting the number of probes sent to open ports to those with a rarity of that number or less.

The probe for SSL/TLS (SSLv3 and newer) has a rarity of 1, so you could get away with a simple --version-intensity 1. As a convenience, here are some mnemonic options and their intensity equivalences:

--version-light = --version-intensity 2
--version-all = --version-intensity 9
default = --version-intensity 7

If this is still too much, you can copy the probes (and matches!) you are interested in into a separate file and specify it with the --versiondb option.


Why will Google no longer allow me to end or begin passwords with a space? Why won't Google allow me to use a password ending in a space anymore?

Backstory: I have memorized a cipher that allows me to generate a different and very strong password across many different websites and services, without using the same password twice. In the case of Google, my cipher requires that the last character be a space. Now I have to create an annoying exception to my cipher.

This never used to be a problem, so why is Google doing this now, and is there any way I can get around this?

They trim passwords to deal with the (sometimes insecure) process of people copying and pasting them.

Note:

As a clipboard is not considered a secure data store, nobody worries about keeping it secret. So applications that watch the clipboard feel free to store, for example, store it in publicly accessible data files. You just can't know who actually is watching the clipboard and what they're doing with it. Consider how careful applications like browsers are to keep your password secure. Clipboard apps just don't think like that. Using a secure keystore --> great. Having the clipboard contents logged to disk --> not so good.


How to detect use of personal NAS devices from corporate machines? We have an issue where people are taking laptops home and connecting them to their personal home networks in order to backup corporate data to their private NAS devices. From a DLP standpoint we have trouble reconciling this activity because the activity destination is typically a private IP, something like 192.168.1.12, which is also being used within the corporate network for various labs and testing environments. Short of major policy changes about IP ranges in use and things like that, are there any creative ways to determine the difference between a personal NAS device on a home network vs a corporate-issued one being used from within the corporate network?

We tried frequency analysis of similar activities, but again many generic private IP's are being reused across both corporate and personal environments. I thought about tracking against the 'name' of the network to which the user is connected, but haven't had a ton of luck with that information being readily available in the logs I have. I've been tasked with trying to explore this from an incident response/SOC standpoint, so my available logs are more so correlated with IDS/IPS, mcafee, CIRT, and DLP-type solutions, rather than something like OS event logs.

As a low-effort, low-yield approach; could you simply put out a note reminding people not to use personal NAS for business backups?

Knowing the risks of being caught with unauthorised material will surely deter at least some people whilst a more formalised technical solution is found?


Shuffle large string securely I have a large string that I need to shuffle in a secure manner. It will be around 4000 characters. The resulting permutation of such string, must be one in the set of all possible permutations (4000!). The resulting permutations must of course also be evenly distributed between all possible states. I need to reasonably prove that my implementation meets those requirements, but formal methods are not needed.

I was planning on using a simple Knuth-Fisher-Yates for this, but I worry about my RNG. I am bound to implement this in JavaScript, as my application must run in Thunderbird. From (what I can read)[https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues], Mozilla can provide a cryptographically secure random value, and I plan on combining it with (this)[https://github.com/davidbau/seedrandom] to get random numbers in the desired range.

Now, I believe I could have issues with the internal state space of the PRNG. If it has to few, it will "wrap around" and produce a bias for certain numbers. If it has too many, it might apply modulo to scale down, thus also producing a bias for numbers in the lower range.

How long a seed would I need to initialize a PRNG used for KFY-Shuffle a string of 4000 characters? Am I overthinking this, is there something I did not think of?

Now, I believe I could have issues with the internal state space of the PRNG. If it has to few, it will "wrap around" and produce a bias for certain numbers. If it has too many, it might apply modulo to scale down, thus also producing a bias for numbers in the lower range.

No, the state space of a good PRNG will not make it appear biased in the ways that you fear here.  A good, non-crypto RNG will produce output that appears unbiased and independent to some set of statistical tests.  A cryptographically secure one, in addition, will produce output that appears unbiased and independent to any efficient observer; i.e., you can't write an efficient program to tell its output apart from a truly random sequence.

  How long a seed would I need to initialize a PRNG used for KFY-Shuffle a string of 4000 characters? Am I overthinking this, is there something I did not think of?

The number of distinct permutations of a 4,000 element sequence is 4,000! (factorial), which is something like 2^43000, so technically you need a 43,000 bit string (5,263 bytes) to be able to uniquely address any one such permutation.

Practical answer: just use a crypto RNG.  While it's unlikely at best that it would be able to output all possible permutations even when fed external entropy, the thing that matters is that no real-life attacker will be able to tell the difference.


If only getting and storing BIN part of credit card number, should I comply with any PCI (or other) specification? I have a fraud detection system.

From the client side (browser) I want to receive the store BIN section of the card number (first 6 digits) and if possible also the last 4 digits

Besides the above, I do not process or store credit card number (or any other payment method).
I also don't process or store any personal information (don't get user name / email / ID number etc.)

So, my question is:
In my case as described above, if only storing the first 6 digits (and if possible also the last 4) - do I need to comply with any PCI (or other regulation) requirements?

It seems that storing only a fragment of the whole PAN is not under the scope of PCI (https://pcissc.secure.force.com/faq/articles/Frequently_Asked_Question/Are-truncated-Primary-Account-Numbers-PAN-required-to-be-protected-in-accordance-with-PCI-DSS), unless my systems is considered as a "connected system".
So, if the client side where the user fills the credit card number, sends to my system only the BIN - should my system be considered as a "connected system" ?

Thanks!

So, if the client side where the user fills the credit card number,
  sends to my system only the BIN - should my system be considered as a
  "connected system" ?

No.  The phrase "connected system" in PCI has a specific meaning, to quote DSS 3.2.1 "Scope of PCI DSS Requirements":

  The PCI DSS security requirements apply to all system components
  included in or connected to the cardholder data environment.

"Connected" means that you're a Merchant or a Processor or some other entity that has a Cardholder Data Environment.  The CDE is fundamentally in scope, and the systems "connected" to that environment are also in scope as a result of that connection.

If you are not a Merchant, and not gathering PAN, then you are not in scope for PCI DSS.  (You want to be careful, though; I would ask the user for first 6 and last 4 and not have them type in the full PAN even if your code intends to discard the middle.)


GnuPG does not verify signature while decrypting I have signed file 1.txt, result file is 1.txt.asc. I changed content in file 1.txt.asc (signed content, not signature). Then I verify signature in 1.txt.asc and I get information that signature is not correct and that's ok. Then I encrypt tht modified 1.txt.asc, result file is 1.txt.asc.gpg. Then I decrypt that file and I should get information that signature is not correct, but there is no such information. From documentation:

  --decrypt [=file=] Decrypt file ... If the decrypted file is signed, the signature is also verified.

I have also saved decrypted data to another file, then I verified signature and I get information that signature is not correct. So it seems that decrypt operation did not verify signature. Why is that?

gpg will verify the signature if the signature is over the encrypted content. In other words, say you generate fileA.gpg as follows:

gpg -r [Some ID] -o tmp.gpg -e fileA
gpg -s -o fileA.gpg tmp.gpg

Then gpg -d fileA.gpg will validate the signature of the encrypted content and then proceed to decrypt the data if the signature is good. Now if we do this in the opposite order of operations i.e.:

gpg -s -o tmp.gpg fileB
gpg -r [Some ID] -o fileB.gpg -e tmp.gpg

Then gpg -d fileB.gpg will simply decrypt the file and the result is a signature, but gpg does not proceed to do anything with the signature. In other words gpg will only verify the signature when performing decryption if the signature is for the data it is decrypting.


Telnet and vpn - protected or not I am curious how safe I am if I use telnet through a VPN-tunnel to my webhotel? I thought that the information was encrypted between my computer to the vpn-providers default-gateway. But when it leaves the gateway on its way (through internet) to my webhotel its no longer encrypted? This is just a guess - Am I completely wrong? I sent this question to my vpn-provider in Sweden (dold.se) and got the answer (without tecnical explanation) - YOU ARE COMPELTELY SAFE USING OUR SERVICE

Would be glad if someone could explain how it really works in this case. I am just curious and normally use an SSH-klient (putty) to connect

cincerely

A VPN is like an armoured pipe: it protects the data as it transits between its two endpoints. However, it does nothing beyond these endpoint.

As I understand your question, you have a "VPN provider" that allows you to set up a VPN between your own machine, and some server on the VPN side. Your traffic between your machine and the VPN server will be protected against eavesdropping and alterations -- but only for that portion of the path. Once the data has reached the VPN server, it no longer benefits from the VPN. In particular, if you use plain telnet, then your precious data will travel unprotected between the VPN server and your "webhotel" (whatever you mean by that term).

While most low-scale, amateurish eavesdropping occurs near the end-users (WiFi is a boon for wannabe spies), this does not mean that other network parts are inherently safe.

Therefore, don't use telnet. If you want to do a safe telnet, you must use a VPN that goes from your home machine to the ultimate destination server (the webhotel).


Is localStorage a security liability for JWTs? I'm using JSON web tokens for authentication in my app. Since data is pulled from protected routes in the API, security tokens are stored in the frontend.

My question is this: Is using HTML's localStorage to store JWTs (nothing else) an unsafe option compared to cookies? I understand cookies have their own disadvantages, but I'm looking for the safest way available to store a JWT locally.

localStorage should never be used for storing any sensitive data; if you absolutely must use something other than cookies, use at least only sessionStorage instead, which is only available to that window/tab until the window is closed.

You cannot control the expiration time like you can do with cookies.
A single XSS vulnerability can be used to steal all the information from data inside localStorage, also it persists when you close the tab.
localStorage doesn't have any options to restrict the visibility of an object to a specific path like with the attribute path of HTTP Cookies.
Cookies are ideal because you have much more control over them: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie
You can specify a number of attributes/flags, like: Secure, HttpOnly, SameSite, HostOnly.
It wasn't designed as a secure storage mechanism, and it's implementation can vary from browser to browser.
There is no way to restrict script-access to information stored in localStorage, which is possible with the HttpOnly attribute for cookies.
Cookies are stored encrypted on the client computer, unlike data in local storage.

OWASP strongly advises to never use local storage for storing any sensitive information:

  Any authentication your application requires can be bypassed by a user with local privileges to the machine on which the data is stored. Therefore, it's recommended not to store any sensitive information in local storage.

JWTs are highly sensitive data. Not only because they act as tokens for authentication, but they also very often contain sensitive data like email/username, roles, etc. only base64-encoded (although best practice is to avoid that). So they are often still to be considered sensitive data even when they are not valid anymore.

I recommend to read the corresponding section in OWASP's HTML5 Security Cheat Sheet: https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/HTML5_Security_Cheat_Sheet.md

An interesting read about the topic can be found at: https://dev.to/rdegges/please-stop-using-local-storage-1i04


How to secure a router/modem? I found a lot of resources about how to secure WiFi networks. This question is not about that. How can I make sure the software running on the modem/router is not exploitable to known security flaws? I found reports on many discovered vulnerabilities, but to my surprise no-one has put up exhaustive lists on vulnerable devices? Even the manufacturers don't report which of their devices are vulnerable, even though they know.

Listing some vulnerabilities which allow remote code execution on routers:

UPnP: researchers found exploitable flaws in some widely used UPnP implementations. UPnP is a feature which is on by default in many routers, printers and other devices.

  Over 80 million unique IPs were identified that responded to UPnP
  discovery requests from the internet. Somewhere between 40 and 50
  million IPs are vulnerable to at least one of three attacks outlined
  in this paper. Source.

I've disabled UPnP on my modem.

WPS: This only applies to attackers within WiFi distance, so it's not that bad, but I've disabled WPS on my router anyway.

Then there's Misfortune Cookie, which in 2014 affected at least 12 million devices on the internet. The vulnerability is in a RomPager webserver running inside many routers to provide an admin interface. "Attackers can send specially crafted HTTP cookies that exploit the vulnerability to corrupt memory and alter the application state." I don't understand why the web server for the admin interface of a router has to be visible to the internet in the first place... I was unable to find out whether my modem or router are affected by this.

I consider this question as too broad for a good but small enough answer.
 Fortunately there is already a website out there which addresses your problem in a very extensive way and which is kept up-to-date about new problems: routersecurity.org. There you will find a security checklist for things you need to watch out for, current bugs in existing routers, and extensive introduction about the topic and lots of links to external resources for even more information. There is no need to replicate all these information here so please have a look there.

Apart from that it helps often to search for your specific router model in connection with the words "vulnerability" or "exploit" or "security". You might also just use the name of the vendor instead of the exact model for this search since some vendors have  bad security record while other have a good one. If you really don't find any information about your router model online it might just be that insignificant that it is probably vulnerable but nobody cared to look (yet).


Send fake response(?packets) to a program So my idea was.. There is a program that require login to be able to use(the program should work offline aswell not requiring any online data), so i want to make that program to be able to run offline aswell, so what i did is i captured the packets (with wireshark) that moved to the program while logging in, next i tried to replay (with bittwist and colasoft packet player) those packets in offline while trying to log in in the program with that i tried to fake log in, but it not seems to work, the program doesn't receive or accept those packets. What's wrong with my idea or method or how should i do this?

You are trying a replay attack.  Those who design protocols know about replay attacks and try, usually successfully, to defeat them.  Often that's done by using a timestamp or a random number (called a "nonce" by cryptographers) in a hash that's attached to a message.

You can find some detail here: http://en.wikipedia.org/wiki/Replay_attack


Email Spoofing by SMTP Message-ID? Many of my users today got email from docs#@mydomain.com (where docs# was between docs0 and docs8 or so, and mydomain.com is obviously changed from my real domain name), with the sender name of "Administrator."  The message had subject "New Voice message" and message: "You have received a voice mail message.  Message length is 00:06:11."  It was sent to many different users and distribution groups, a weird mix of different departments that wouldn't normally make sense (email to our customer service group, plus our CFO, plus a random IT member?  Weird).  There was an attachment: ATT00001..txt, a text file.

Some research online shows this to be a virus attempt possibly from CryptoLocker (yikes!!!), and the remaining text file is what was left after being stripped upon arrival, either by our spam filtering service (I don't think so, based on logs), our SonicWALL gateway (I believe it's this that saved us), or a virus scanner built in to Outlook (nope, Webmail shows the same attachment).  We use Postini for our spam filtering service, so our MX records direct all email there and our squid proxy server only accepts mail from Postini, does some filtering, and passes it on to our Exchange server.

Based on the email header, I've figured out this route that the email has allegedly taken (Domain and our public IP have been changed):

  docs9718.mydomain.com (10.139.106.94)                 --> smtp.mydomain.com
  (10.0.0.18)

  docs844.mydomain.com (10.0.0.18)                  --> mydomain.com (10.0.0.147)

  ABTS-KK-dynamic-175.185.172.122.airtelbroadband.in
  ([122.172.185.175])   --> exprod5mx283.postini.com ([64.18.4.10])

  psmtp.com (exprod5mx283.postini.com
  [64.18.0.107])            --> proxy2.mydomain.com

  proxy2.mydomain.com ([127.0.0.1])                 --> localhost
  (proxy2.mydomain.com [127.0.0.1])

  localhost (localhost.localdomain
  [127.0.0.1])              --> proxy2.mydomain.com

  proxy2.mydomain.com (12.7.13.46)                  --> proteus.mydomain.com
  (192.168.200.3)

Postini was allowing these messages through, even though there were a couple of strange things about them.  For example, the SMTP Message-ID is a unique string that is set by the first message server that handles the message, and is normally not messed with by any subsequent servers.  Yet this email's Message-ID was WPU1PYS3Y86EVSN2PK75E3MI0SPZGWSTD0W1EU@mydomain.com instead of, for example if I got something from Dell, it would say SomethingSomething@Dell.com.  It has my domain in its Message-ID.

But that's when I realized, the first servers to handle the message DID have my domain name!  That's how the SMTP Message-ID was spoofed, I presume.  In fact, that residential address in India (ABTS-KK-dynamic...) is probably a home user with a virus, and that virus made up the first few addresses.

The problem there is those 10.x.x.x addresses are not only in the private ARPA IP range, but they obviously don't really correspond to our domain (altered, but in this example my "real" IP is 12.7.13.46).  Another issue is that there is a gap between the fake mydomain.com and the Indian computer.

How do our mail servers not account for a major gap in the headers?  And does it not verify anything about the originating server, just takes its word for it?  Because not only is it not a valid IP, it doesn't match DNS records for that domain it says, plus the originating domain is the same as the destination domain!  That wouldn't normally make sense, as that mail would be internal.

Also, am I right about this SMTP Message-ID spoofing technique?  I can't find anything like it online.  But the tactic makes sense - If I say it came from some bogus mydomain.com servers and the middle servers never verify that, the final server will believe it really came from my domain.  Simple MAIL FROM: spoofing on an open relay won't work on our server, but something like this apparently can.  I'm just not sure if that's what's being done here.

Here's the entire faked headers file (renamed public IP, domain, and To: email addresses only): Pastebin link

Everything about an email message can be forged, or can be tampered with in transit.  The only headers you can trust are those put there by your server; the only content you can trust is that protected by a verified digital signature.  In the case of your pastebin file, if I'm understanding your description of your network setup correctly, lines 1 through 22 are trustworthy, lines 23 through 25 are probably trustworthy, and everything from line 26 on down is forged.

Email servers don't account for gaps in the headers because they don't need to.  Most email servers are designed on the Unix philosophy: do one thing, do it well, and provide a standard way to interface with other programs.  An email server's job is to move email from Point A to Point B; things like checking for gaps in the headers is the job of a spam filter.


What can I do to prevent BGP hijacking as an admin of some OVH's VPS? I am an operator of some public service which is run on some OVH's VPS.

Recently I was contacted by an anonymous contact, who suggested that the service was BGP-hijacked and some sensitive info of users may have been leaked (although all passwords, even if leaked, should be SCRAM'd).

Am I able to do anything to prevent BGP hijacking in the future?

Am I able to do anything to prevent BGP hijacking in the future?

As a client of OVH, you cannot prevent BGP hijacking -- this is more the responsibility of OVH's network administrators. However, you may be able to mitigate the risk by using appropriate security on your network services. For instance, if you are running a web site on your VPS, you can (and should) use TLS to protect traffic to your site.


How does a refresh token help? I have a basic doubt or apparently am missing out on something fundamental.
When talking about an Android app that talks to the backend using APIs, the access to the resources/APIs are protected using access tokens and refresh tokens (much like OAuth 2.0).

From what I understand, this is how it works :

The user open the app and provides his login credentials.
App makes a POST request to the server and the server issues an access token (random, unguessable token) to the app.
The app stores this access token securely on the local storage (sqlite db/shared preferences etc.) and uses sends this token with every other API call to let the server know that it is authorized to access the resource.
Now this access token has an expiry time as well. So that even if the access token gets compromised, somehow, the attack window would be small.
Now when this happens, it would require the user to renter his login credentials and obtain an authorized access token again, which at least in case of mobile apps, is a bad (not acceptable) user experience.
So to solve this problem, there is a refresh token that is also issued to the app along with the access token in the first place. This refresh token is a very long lived special token, which makes sure that as soon as the access token expires, it requests the server for a new access token, thus removing the need for the user to re-enter his login credentials to retrieve a new authorized access token.

Now my question is:

how does this solve our original problem of preventing unauthorized access to the APIs ? In my opinion, it actually facilitates it further.

If the access token gets compromised, it's highly likely that the refresh token would also get compromised the same way, isn't it? And because the refresh token is a very long lived token, the attacker would be able to use it (till the refresh token does not expire) to keep generating new authorized access tokens. Is that correct ?

Please help me understand this.

The main advantage of a refresh token is that it is easier to detect if it is compromised.

Consider these two scenarios:

A single long-lasting auth token is used.
A short duration auth token is used, and a long-lasting refresh token periodically requests a new auth token once the previous one has expired.

In scenario 1, if the auth token is compromised it would be hard for anyone to detect this, and the unauthorized access could continue indefinitely.

In scenario 2, if only the auth token is compromised (refresh token is not compromised too), it could only continue until the token expires.

In scenario 2, if the refresh token is compromised, once the refresh token is invoked, all other auth tokens that were generated using that refresh token are invalidated, so only 1 party can use the api (per refresh token) at a time. This results in multiple users repeatedly invalidating each other's auth tokens by generating new ones. The api could detect the breach because refreshes are being made prior to the auth token expiration, and would know to immediately revoke the refresh token.


Why does my x86 shellcode test program segfault? I am trying to learn how to create shellcode, my goal is to call execve(). I wrote the code in assembly and it works perfectly, there are no null-bytes or absolute addressing methods. The code works fine, but when I copy the opcodes into a c program and test it to see if it works it returns segmentation fault. What is the problem?

ASM:

section .text
global _start
_start:
    jmp xxx

xx:
    mov al,11
    pop ebx
    xor ecx,ecx
    xor edx,edx
    int 0x80
    mov al,1
    xor bl,bl
    int 0x80

section .data
xxx:
    call xx
path db "/bin/sh"

C CODE:

char shellcode[]={"\xb0\x0b\x5b\x31\xc9\x31\xd2\xcd\x80\xb0\x01\x30\xdb\xcd\x80"};

int main(){
    void (*ptr) (void) = &shellcode;
    ptr();
    return 0;
}

I see multiple problems with your shellcode. First of all let's debug your code. I compiled the C code containing your shellcode, run it with gdb and step until the first system call (int 0x80)

[----------------------------------registers-----------------------------------]
EAX: 0x5655700b --> 0xde3050f7
EBX: 0x5655550c (<main+35>: mov    eax,0x0)
ECX: 0x0
EDX: 0x0
ESI: 0xf7f9fe24 --> 0x1d6d2c
EDI: 0xf7f9fe24 --> 0x1d6d2c
EBP: 0xffffd9d8 --> 0x0
ESP: 0xffffd9c0 --> 0xf7fe5ae0 (<_dl_fini>: push   ebp)
EIP: 0x5655701f --> 0x1b080cd
EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
[-------------------------------------code-------------------------------------]
   0x5655701a <shellcode+2>:    pop    ebx
   0x5655701b <shellcode+3>:    xor    ecx,ecx
   0x5655701d <shellcode+5>:    xor    edx,edx
=> 0x5655701f <shellcode+7>:    int    0x80
   0x56557021 <shellcode+9>:    mov    al,0x1
   0x56557023 <shellcode+11>:   xor    bl,bl
   0x56557025 <shellcode+13>:   int    0x80
   0x56557027 <shellcode+15>:   add    BYTE PTR [eax],al
[------------------------------------stack-------------------------------------]
0000| 0xffffd9c0 --> 0xf7fe5ae0 (<_dl_fini>:    push   ebp)
0004| 0xffffd9c4 --> 0x0
0008| 0xffffd9c8 (")UUV\030pUV$\376\371\367$\376\371\367")
0012| 0xffffd9cc --> 0x56557018 --> 0x315b0bb0
0016| 0xffffd9d0 --> 0xf7f9fe24 --> 0x1d6d2c
0020| 0xffffd9d4 --> 0xf7f9fe24 --> 0x1d6d2c
0024| 0xffffd9d8 --> 0x0
0028| 0xffffd9dc --> 0xf7de3141 (<__libc_start_main+241>:   add    esp,0x10)
[------------------------------------------------------------------------------]

Here we can see a few problems:

The EAX register is not set to 0xb. This is because your shellcode does not clear the values in the register and instead it just sets the lower byte with the instruction mov al, 0xb
The EBX register should be pointing to the char* with the file you're trying to run (usually it's "/bin/sh"), instead it's pointing to a random memory position, in this case in the main function.
The ECX register should be pointing to the array of char* that indicates the complete command you want to run. In most shellcodes I've seen it's just ["/bin/sh", 0], but you may want to use something different such as ["/path/to/binary","-argument1",..., 0], in this case you should create that array in memory. In your shellcode ECX is set to 0x0
The EDX register represents the environment for the execution of the binary. You can take a look at the execve(3) manual page to understand a bit more how it is used, but for our purpose here it's ok to have a NULL value in it

Now, how can we fix it? Well, first of all we'll need to point EBX to a "/bin/sh\0" string in a memory portion we can access, f.e. the stack. And we need to do that in our shellcode. We can do it with the following gadget:

xor eax, eax //Clear the eax register so we have a null byte to end our string
push eax
push "n/sh" //The string needs to be written "backwards"
push "//bi" //The double "/" is to avoid null bytes in our shellcode
mov ebx, esp //esp is pointing to "//bin/sh\0", so we need to move that pointer to ebx

Then we need to point ECX to an array of char* such as ["/bin/sh", 0]. We already have a part of it in EBX, so continuing our shellcode we can do the following:

xor eax, eax
push eax
push "n/sh"
push "//bi"
mov ebx, esp
push eax // Remember it's still 0 from our previous xor eax, eax
push ebx // Push it so ESP points to EBX
mov ecx, esp // move ESP to ECX, the result is ECX -> EBX -> "//bin/sh\0"

Finally, we should set the AL register to 0xb and make the syscall. So our final shellcode should look like this:

section .text
global _start
_start:
    jmp trampoline

shellcode:
    xor eax, eax
    push eax
    push "n/sh"
    push "//bi"
    mov ebx, esp
    push eax
    push ebx
    mov ecx, esp
    mov al,11
    int 0x80

section .data
trampoline:
    call shellcode

We can compile it nasm nasm -o shellcode.bin -f elf32 -O0 shellcode.nasm, extract the opcodes and put them in the C code to test it:

char shellcode[] = "\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80";
int main(){
    (*(void(*)())shellcode)();
    return 0;
}

Compile it with your favorite compiler, I use gcc gcc -o shellcode.o -fno-stack-protector -z execstack -m32 shellcode.c. And run it:

$ ./shellcode.o
sh-4.4$


PHP bin2hex vulnerable to timing attack? I've read in a few places[1][2][3] of the desire to make PHP's bin2hex constant time.

In what scenarios would bin2hex be vulnerable to a timing attack?

Is this below code for handling a CSRF token vulnerable to a timing attack?

// generate a CSRF token, n is some large number
$token = bin2hex(openssl_random_pseudo_bytes(n));
// ... store $token on in the PHP session and render form with CSRF token
// ... on form submission compare the form's CSRF token to the session token
hash_equals($sessionToken, $formToken);

http://blog.ircmaxell.com/2014/11/its-all-about-time.html
https://github.com/php/php-src/pull/909
http://grokbase.com/t/php/php-internals/14bs5tmqbr/php-src-constant-time-bin2hex-implementation-909

In what scenarios would bin2hex be vulnerable to a timing attack?

The timing attack discussed in the mailing list and blog post is a cache-timing attack, which was famously demonstrated by Daniel J. Bernstein against OpenSSL's implementation of AES here (PDF).

In order for bin2hex() to be vulnerable to a timing attack, the following conditions must be met:

Internally, it either indexes or branches based on the secret we are trying to protect (e.g. HMAC key). The PHP implementation does index based on what could potentially be a secret.
The attacker has to be able to alter the state of the processor cache somehow. (e.g. Renting a neighbor VM on the same baremetal machine with your cloud provider and executing a strategy similar to FLUSH+RELOAD.)
The attacker can rapidly issue many valid requests from a privileged network position with minimal network jitter (surprisingly trivial these days).
The key we want to protect is reused. (General case; some CSRF tokens are not reused.)

The feasibility of such an attack is still an unknown, but patching this potential side-channel is actually not that difficult. The previously linked methods were derived from libsodium's bin2hex implementation, which was provided by CodesInChaos.

Is this below code for handling a CSRF token vulnerable to a timing attack?

I don't know. The bin2hex() might be a very minor concern, but not one that I can demonstrate a practical exploit for. Maybe someone in Crypto Stack Exchange can?

Update: There's a Lib for That

If you use paragonie/constant_time_encoding (which didn't exist when you asked this question), you shouldn't leak any information via cache timing.

<?php
use \ParagonIE\ConstantTime\Hex;

$rawBinary = random_bytes(32);
$data = Hex::encode($rawBinary);
$decoded = Hex::decode($data);

This library cover all of the RFC 4648 encoding schemes:

Hex
Base32
Base32Hex
Base64
Base64UrlSafe
Base64DotSlash
Base64DotSlashOrdered

The latter two are compatible with crypt(3).


Performing a vulnerability assessment on Windows Tablets? How does a security auditor perform a vulnerability assessment for Windows Tablets including Surface RT tablets deployed ones and any management application that comes pre-installed with it?

Also, there are tablets, which comes without Surface and these versions are generally the same Windows OS (Desktop OS). How does one access security testing for these?

My entire point is how should an auditor go about performing a vulnerability assessment for these tablets, what are the necessary pointers he/she should access and are there any online resources for this task - maybe test cases, or a checklist?

For the main part, configuration assessments of windows tablets are exactly the same as for standard windows builds and the approaches and resources would be the same (e.g. CIS security benchmarks).  The only likely unique point for a tablet review would be the presence/absence of hardware features like TPM chips which can support full disk encryption.

Windows RT as run on the surface is a slightly different case as it is a more locked down version of windows, but it still has a command line and powershell, so it would be possible to assess the configuratio of the device in largely the same way as you would assess a standard windows build.

There are some potential differences in terms of manageability (e.g. Windows RT cannot be domain joined) but whether those are relevant depends on the specific organisation requirements, so the best approach here would be to lay out specific requirements and then manually assess against each one.

From a black-box review perspective (e.g. using tools like Nmap and Nessus) the approach would be the same as for any system.


Bypassing Web Application input validation A malicious user can use Base-64 or other encoding scheme to bypass web application input validation or to bypass some external Web application firewall. Since these encoding schemes are infinite how we can make these inputs finite to validate each and every input string.

The attacker doesn't get to choose what encodings might be effective. If there is no base64-decoder at the application end, performing base64 encoding will achieve nothing.

If there is a base64 decoding step at the application end, the application should be performing input validation after the decoding has been done.

In the case of WAFs, which sit in between and don't know what decoding the application might be doing, you're right - they're not reliable.

Some tools only apply the protocol-standard decoding (eg URL-decoding for URL parameters) and would false-negative on attacks encoded using an ad hoc scheme; some tools try a selection of encodings and optionally combinations n deep of encodings to try to spot attack signatures, which can lead to false positives as harmless text that will never be base64-decoded gets misinterpreted as the base64-encoding of something that could be an attack.

So yeah, fixes like WAFs that operate above the application layer are unreliable - but that's nothing new. Nobody should be relying solely on a WAF for security; they're good for detecting generic attacks, and for temporary custom workarounds for known vulnerabilities until an app fix is available, but they can never be a watertight input filter.


Is it bad practice to add an encrypted private key to source control? I understand that it is bad practice to add passwords and secret tokens to source control, with obvious implications arising if you are working on an open-source or related project.  Rather, you should store them as environment variables.

However, is it legitimate to add an encrypted private PEM key file to source control for an open source project, and only keep the decryption password as an environment variable?  Or should I store the entire contents of the PEM as the environment variable?

There is nothing insecure with what you are suggesting.

However, why would you want to store a private key in your source control? If I fork your project, why will I be using your private key? It is obvious that I would want to generate and use my own private key, so make that part of the setup process.


Why aren't hardware R/W switches used to defend hard drives? ISTR back in the early days of (build your own) PCs having an old 486 PC with two hard drives, and hacking the "Turbo" switch on the front panel (remember those?)  to be a read-protect switch for drive D - i.e. when the switch was one way the hard drive became like a CDROM, and you flipped it the other way when you wanted to write to it.

OS on the r/w C drive, all your data on the write-protected D drive.

Granted in those days drives were IDE 40-way ribbon cables with a separate R/W line, but surely this techniqe is implementable in SATA?

SATA has no separate wires for reading and writing so a pure hardware solution is not possible.

You actually have the same problem with Ethernet too: with Fast Ethernet you had separate Tx and Rx (Transmit and Receive) wires and thus could simply built a guaranteed passive network tap by not connecting the Tx lines. With Gigabit Ethernet this is no longer possible so network tapping at this speed will be controlled by software which makes it harder to guarantee that the tap stays passive all the time.


Isn't oAuth weaker than traditional passwords I understand the need for oauth for programmatic access to apis, etc. whereas passwords are used for more human-level authentication.  However when we store passwords, we (hopefully) salt + hash them. When we store tokens they are in some format that can be reversed into plaintext as we often surface these tokens to developers.

What I find curious is that I have not come across any concern for storing tokens, but isn't this inherently less secure treatment than that for passwords? Why are we okay with this? Couldn't we hash the token in the db after the one time we show it to the developer and then if they need to change it ask them to reset (just like we do for passwords)?

Tokens and passwords are really very different things. But you haven't specified in your question what you are really asking.  You mention OAuth in the subject line of your question but then don't mention it again in the body of the question.  OAuth has different kinds of tokens in its spec, depending on what sub-spec you're talking about and what kind of token you're talking about.

I have to assume you're talking about Bearer tokens, i.e, the tokens that are handed out after the OAuth flow is completed. In some cases you may not even need to store Bearer tokens in the server anywhere, so the question of whether or not to store them as hashes doesn't apply.  If you're talking about refresh tokens, then that might be a situation in which you might want to store them, but I can also see the same methods applied to refresh tokens as to bearer access tokens, so they probably don't need to be stored on the server either, they just need to be signed to detect tampering. In order to get OAuth to work this way, you'd need to take a look at the OAUTH-JWT Bearer token spec: https://tools.ietf.org/html/draft-ietf-oauth-jwt-bearer-12

That all having been said, no matter what kind of token you are using or what kind of OAuth flow you're using, you should be relying on TLS to secure the communication between resources.

OAuth is a very complex spec and there is no one-size-fits-all answer to most of the questions about OAuth.


SSH access during manufacturing What are security pros and cons if we have to enable SSH access during the manufacturing of the device (i.e. Fire Alarm Control Panel)? It is a manufacturer requirement.

SSH access will be disabled before shipping the product, but technically it will have the option to re-enable, if it is needed.

It's is perfectly normal for manufactured devices to be "rooted" or placed in a state that allows for escalated privileges.

Phone manufactures years ago used COM ports via Bluetooth to assist with installation. While some either forgot to disable or simply chose not to, this increased the attack surface, and allowed for BlueSnarfing/Bluejacking among other attacks.

The key part is the risk assessment:

What happens if a product leaves the factory with SSH still enabled?
Is it "Mission Critical" or "Life Critical", would someone die due to device tampering?
Is there a way to verify SSH is disabled/removed before shipping the product?
What are costs imposed in verifying that SSH access is removed?
Are you legally/morally/ethically required to check/disable/uninstall SSH access?
Would such a feature be useful in the field to technicians?
If you chose to keep it enabled, how do you ensure reasonable authentication/authorization?

Most building fire equipment is legally regulated, as it's deemed in many countries to be a "necessity to preserve life". Tampering with such devices is against the law, and depending on the legal requirements, you could also be held liable for negligence. You may wish to view any state/provincial/regional laws and federal mandates regarding automated fire equipment.

It is without a doubt an intelligent enough attacker could exploit the SSH access to tamper with the equipment. Depending on what is accessible from the remote SSH session, this could be quite serious.


What is the most credible timestamp I can create for a digital file? Is it possible to create a timestamp that is so hard to fake, that it could be used as proof or simply strong evidence in a court of law, that something was not created after a certain point in time?
The file could be anything; a word document, an image, an audio file, a software specific file, ie. PSD.
Some ways I think might work are by uploading it to a reputable cloud or social networking site but what if by some twist of fate the large company goes bust and I can no longer prove it?
What is the most secure, hardest-to-fake, longest lasting (not likely to become invalid anytime soon) way to prove that a digital file was not created after a certain point in time?
It could still be possible to fake, but preferably by some highly advanced means that makes it unlikely.

The use case I'm essentially envisioning is:

A simple 'your word against theirs' situation.
Against all sane advice, I create a file on a pay-if-you-like-it basis, with no written contract. They like it and use it, but don't pay.
I want to sue them with very strong evidence that I created the file before them (if they're trying to argue that they made it themselves - like a simple branded word template).

I'm not looking for advice from a legal standpoint, but expertise about timestamps, and how to create one with strong authenticity (I think).

Just last week I heard of this Proof of Existence service that makes a secure digest of your file and gets it added to the public Bitcoin blockchain.

So henceforth and forevermore (or until Bitcoin is cracked or abandoned), you'll have publicly-certified, publicly-verifiable proof that THAT particular instance of your file existed at that time. Even if the Proof of Existence web service goes away, you could conceivably use a blockchain explorer tool to show the earliest date that your secure digest showed up in the blockchain.


How can a new website create trust with users? Earlier I asked a question on how to authenticate business identities, now I am wondering on the other side (the user side).
There is also How do I choose whether to trust a particular website?

How can one create trust with a user when you are a new site, and are requesting for some personal information like address, phone or even a business registration copy?

Of course most user registring would be business, which they make the address & phone publicly available, but there are also freelancers that wouldn't feel comfortable sharing their home address...

I was thinking of Truste but the price tag is making me wanting to stay away. What methods or solutions can I implement to create a trust with users?

The main way to help users to trust you is be worthy of your users' trust, and make it apparent to your users why you are worthy of their trust.  There are various ways to establish that you are worthy of trust.  The details are likely to be specific to your particular site, but here are some examples from other domains.

One way is through branding: if your brand is familiar (e.g., the user has had positive interactions with you before, or they have heard positively about you from friends or family), they will be more likely to trust you.

Another suggestion is to ensure that everything you do is in the customer's interest -- and make this apparent to the customer.  Don't be "sleazy".

For example, don't ask for the user's address or phone number just because you want it or because it would let you send the user marketing.  Wait until a point arises when the user will get some tangible benefit from providing this information, and then allow them to provide it.  For instance, it is one thing to ask for your customer's shipping address and phone number when they want to order something and have it mailed to them; it is another to require them to provide this information just to create an account with you.  If you must ask at account creation time, make it optional and allow them to provide it later when it is needed.

Another way is to provide user-friendly policies.  Think of mail-order companies, which promise that if you don't like what you ordered, you can return it for a refund, with no questions asked.  Think of Zappos, which not only offers no-questions-asked returns, but will even pay return shipping.  That can increase confidence among customers and give them peace of mind that if they don't like what they ordered, they can get their money back.

You will probably want to have a privacy policy (though many users will never look at it, some may).


DOM based XSS and the “#” character I'm studying the DOM based XSS attack. I understand that briefly is an attack where in the attack payload is executed as a result of modifying the DOM “environment” in the victim’s browser. But I do not understand becouse in many tutorial this attack is related to the use of special characther "#"(hash) in order to not send the malicius string to the server. can I use "#"(hash) only in this version or in reflected NOT DOM based too?

The URL hash isn't transmitted to the server. It's only available to the client, so the server is never aware of its value. Thus, non-DOM XSS isn't possible via URL hash.

Since the client is aware of its value, it could try to use it, fail to sanitize its value, and insert malicious markup / execute some Javascript code, leading to a DOM XSS vulnerability.


What is the purpose of Rb in the 3rd step of the 3-pass mutual authentication in ISO/IES 9798-2? Recently I am studying ISO 9798-2 Three-pass mutual authentication. There are 3 steps, as following:

B -> A: NB // B sends to A a "nonce" value NB
A -> B: {NB||NA}K // A's identity is proven to B by showing B that A has the correct pre-shared secret K to encrypt the challenge NB.
B -> A: {NA||NB}K // B authenticates itself to A by decrypting the encrypted challenge NA.

My question is, why bother using NB again in the 3rd step ? Couldn't B proves its identity by simply sending A the NA value ? The 3rd step could be simplified like this: "B -> A: NA". From some documents on the Internet, it seems to have some crypto-purpose to re-add NB into the 3rd step. Why ?

In all generality, authentication protocols strives to be provably secure while assuming the minimum of properties for the used primitives. For instance, do all challenges have the same length ? When using concatenation (as in NA || NB), is the separation between NA and NB unambiguously defined ? To what extent is the encryption mechanism malleable (e.g. what does happen if an attacker tries to swap the two halves of an encrypted message) ? Inclusion of NB in the third message is an attempt at avoiding some attacks of this kind.

See this document for an analysis of the ISO 9798 authentication protocols. The three-pass protocol is actually not optimally secure.


Store a Cryptographic Hash with look-up capability I want to be able to store the hash of a piece of text in a database and then allow a third-party to confirm its existence if they know the original text.

I do not want to store the original text, only the hash.

This text may be sensitive, so I feel that the hash should be salted; however, I can't salt each piece of text with its own random salt as I would need to know the salt used for each original piece of text before I can perform the look-up.

I could use a single (private) salt that is used for all text values; but this seems weak.

Is there a cryptographically strong solution to this?

If you need a really safe system with salting and key-stretching, then there is no way to make the hashes searchable. It is the same problem as with storing passwords:

With salting you prevent rainbow table attacks, but one has to read the salt first before you can verify the data-hash.
With key-stretching (making the hash slow) you can thwart brute-force attacks, but one cannot quickly verify many/all data-hashes.

This makes using safe hashes and searchability mutually exclusive. It depends on the required level of security, whether you can go without the salt, or if you can switch to less safe encryption.

One way out of this problem could be, to encrypt the data, without storing the key. This requires the user to enter a password every time he uses the service. From this user password you would then generate a key with a key-derivation-function and keep the key in memory as long as necessary.


Ethical Hacking - Penetration Testing Book(s) I am an IT student who wishes to seek a career in the field of Ethical Hacking, more specific in Penetration Testing.

Due to the nature of my course, none of my classes go deep enough into this subject so that I could just do this directly after graduating so I of course want to take a certification exam for this (I intend on taking the OSCP Certified Professional exam, at first at least) but because the course for this exam is time-limited (30 days of labs and then the exam itself) and because at the same time I still have to successfully graduate, I can't prepare for it at the moment.

This is a problem because I seriously doubt I (or anyone for that matter) can just jump right into this course without any preparation, so my question is what books are out there that I could read in order to gain some knowledge on the subject? I would prefer books that are as recent as possible to avoid reading information that is dated or has changed a lot.

Thank you

As a penetration tester I don't think that books are the best medium,  because there is no substitute for experience.  Hunt for bugs in open source software,  obtain CVE's and put that on your resume.

...That being said there are books that I have enjoyed and that i think are relevant to modern systems:

The Tangled Web

Cryptography Engineering  (Formally known as Practical Cryptography)

Exploiting Software:  How to Break Code

A Bug Hunters Diary


How to test my anonymity? let's assume that I've used proxies and anonymizing tools as much as I want.
 How to be sure that I'm totally anonymous?

I'm not talking only about IP spoofing and identity hiding, but other and advanced tracking techs including ISP recordings and so.

P.S: this is for CEH exam purpose only!

There were several facts which can be used for testing anonymity.

In general you could check it out by the following

Set two email accounts send the email to another account ,verify the ip address.
Your Browser might reveal some sensitive info,check it out here
Use network analysis tools like wireshark and you could analyze the packets for anonymity
If you are running VPN from wikibooks :

  If you are running a VPN and browser, it is simple to check if the VPN
  is working by checking your IP address at whatismyip.com for example.
  If you are running a proxy chain, you can enable and check each stage
  individually. Any malfunctioning will halt the http traffic.

  For other applications such as instant messaging, it is not so
  straightforward. Also, when you run another proxy client on top of a
  VPN, your IP will becomes that of the proxy server, independent on the
  working state of the VPN.

  When you look at the list of interfaces via WireShark, you can see
  your original Ethernet Controller, plus a virtual VPN adapter, with
  packets traveling in both interfaces. Any application packets will now
  go through the VPN adapter, instead of the Ethernet Controller. The
  VPN client will reformat and encrypt/decrypt these packets, for
  transport across your Ethernet Controller and the VPN server. For more
  efficient transport, VPNs use the UDP protocol exclusively. To check
  if there are any packets that leaks directly into the internet, the
  filter is:

not host 192.168.0.1 and not udp

  Any packets for the VPN tunnel and for the local firewall are
  rejected. So there should be no captured packets if the VPN is fully
  functional. TCP protocol can also be used with SSL encryption for
  example, as in OpenVPN.

  If two VPN's can be chained by the use of a virtual machine, the
  external destination of the packets at the host should be the IP
  address of a single VPN server only, while the guest communicates with
  the other VPN server

Also check for possible 'DNS leaks'  by using the DNS service from your proxy rather than the one from your ISP or what is coded into your router

Apart from the above general facts you could run a anonymity tests from onion router sites

For advanced analysis of wireshark you can refer over here


Is pinging a website essentially the same as visiting the website through a browser? I was looking at the domain information of a website (poaulpos.net) on who.is that Chrome connects to whenever I visit a specific an old Tech Times article about Thunderstrike 2, a Mac firmware attack ("Thunderstrike 2 Is The Latest Nightmare Of Mac Owners"). I have Little Snitch, an application based firewall, so I blocked it the first time Chrome attempted to connect to it.

My question is very basic: clicking on the diagnostics tab of any who.is entry automatically runs a ping and a traceroute on the website. Is that more or less like visiting the website by typing the hostname into your browser and letting it load?

The website in question was only registered yesterday and contact information is Whoisguard protected. I'm pretty paranoid. I'm suspicious of the website and am worried if somehow, I could've just allowed something malicious onto my laptop by attempting to reach the website via the who.is diagnostics tab.

They are not the same at all.

A ping request is an ICMP packet which just by default sends null data to check if the host is up (You can change around the parameters being sent (read more here).)

When you visit a website in the browser you are using the HTTP protocol which requests data and so you have a CLIENT/SERVER setup here (data is served to the client from server upon a request that is sent in the HTTP protocol).

Either way, if you are not the one sending the request but rather the service (poaulpos.net) you are using sends it, there is no traceback to you and therefore no security risk for you.


Create a new database + user with php script -- Secure I have a web application that should manage a multi client solution. Due to the complexity of the solution, each client would require 4 database to store data.

The portal itself is another database that sits on top.
I now think of making the administration a bit easier and extented the script of new client creating.

The script should automatically create a set of 4 new databases, create a new user based on form input and grant that user access. Finally it should store that credentials in the user configuration.

Problem: I'm a bit concerned to store credentials of a admin user in a php script. I guess the script must have a powerfull user to be able to create users, databases and also grant access.

Are there any best practice how to ensure that the application is protected?

Best practise would be to not do that.

I'm a developer that works on a seriously complex system. We have several different teams working on multiple interconnected systems that all works towards the same database, almost. We have split some data over multiple databases, generally separated by country, for performance reasons. But they all have the same design and are created manually when need arises.

I fail to see that you have a system so complex that it would require you to have separate databases. MySQL can handle many rows.

So instead of splitting databases, or even tables, per client, just connect each row with a client_id. Then you don't have to have extra sensitive credentials in your code and can safely follow the "Least privilege"-principle

If you still feel that you absolutely, without a doubt, need to have a database per client, consider these points:

Does it really need to be made automatically, or can you not do it manually whenever a new client is added?
Make sure the file is not accessible from the outside, which applies to any type of credentials you might need.
For the love of god, don't post your credentials on github.


What exploit is trying to be leveraged here? (Apache access.log) I've just deployed a barebones Apache server on Digital Ocean, only hosting static files. No PHP et al.
I'm not too bothered to see random exploit attempts, but 99% of the requests are of this similar format and I'd like to know what they are trying to do.
The source IP is always changing, but the GET resource request is the same, as well as the user-agent. My server is under a constant 30kB/s public inbound (sometimes peaking at around 80kB/s) from this type of request.
I have written a .htaccess and I regex the user-agent for 'wget', and direct the request to a 403. Very noob at this but I feel like that was possibly redundant.
180.190.118.26 - - 14/Feb/2021:09:10:07 +1100] "GET /index.php?c=update&a=patchsum&product=BTFLY-A&ver=1.3.0 HTTP/1.1" 403 407 "-" "Wget/BTFLY/\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff

There is no index.php on my server, but I'm still curious nonetheless about how concerned I should be.
Thank you

The request seems to match a butterfly vpn router (OpenWrt BTFLY-A 1.3.0 / LuCI 15.05 Branch), so someone probably used your IP for a vpn service in the past and there is an active endpoint querying it.
https://forum.openwrt.org/t/how-to-flash-openwrt-on-a-butterfly-vpn-router/73652


Is it possible to read files in a mobile phone for carriers through mobile network alone? Say a smartphone does not have any (internet) data plans activated (no gprs, 3g data etc.). It just connects to the tower for calls. So is it technically possible for the carrier or law enforcement agencies to get into a phones' file system through the cell network alone?
For sake of argument let's say the phone is an unlocked one with full access to OS. Eg: Firefox OS, Maemo (Nokia N900), Meego (N950), BB etc.

Just because you do not have a data plan does not mean that the phone company can not issue a reprogram to the phone and activate the data functionality regardless of if you are paying them for a subscription to data.  That said, what level of access they have to the phone's OS, even with a data connection, depends on the way the device is configured.

If the device has been installed with a clean copy of the OS that doesn't trust any software from the carrier, then accessing data on the phone likely won't be possible even with an open data connection.  If the phone is unaltered out of the box, it may be possible that the carrier has software in place to allow remote access and management of the device's OS installed though.

Their capability would then be anything they could program in and decided to do.  In theory, it would even be possible to tell a pre-installed application to turn on the data radio when receiving a particular call or SMS message, so turning off the data connection on the phone might not be sufficient to prevent remote activation.

It might not be known if such software is placed on the particular phone by carriers, but there also isn't really anything to stop them and is even a reasonable use case for it (in recovering stolen phones).


Is a honeypot an effective deterrent to hackers successfully compromising your network? According to Microsoft, adding a honeypot to your corporate network is an effective way to deter hackers from compromising your network.

Aren't honeypots more for research purposes and not ideal for corporate networks?

Wouldn't having a honeypot on your corporate network likely give a hacker a better grip hold in making attacks?

More information:

Security Fundamentals (Microsoft Virtual Academy). The quiz for #4 made that claim. I answered based on my understanding in the security field and got it wrong. Hence my confusion.

Deploying a honeypot is not unlike adding a painted door or a fake safe to a bank vault.

It does not deter anybody (its purpose is not to be detected as a honeypot). Possibly someone misspelled detect.

It can reduce (somewhat) the time spent by attackers against the real door. Not by much.

More than that, it can be optimized for data gathering (simplistically, you know nobody is going to ever use the services on the honeypot, so you can tune them all to "log everything high volume paranoid dump dump dump". Service efficiency goes to hell, but as soon as someone attempts anything you need guess nothing. The "safe" is all alarms, and no bullion.

Even more, you can correlate what is happening on the honeypot with what is going on in the rest of the network. The honeypot will tell you what's behind what the other machines report as unusual but random "noise".

Finally, the honeypot can apparently allow an attack to succeed, so that you can gather yet more data. Example: the attacker wins a root shell on the honeypot. He proceeds to download more sophisticated tools. Now you have, at the very least, a copy of those tools as well as an idea of where he downloaded them from.

(If you have time you can crash the connection in a not-too-suspicious way and let him reconnect later after having added suitable instrumentation to his tools, that are now his no longer).

You can determine whether he's just a script kid looking for some warez bouncing, or someone who actively targeted your network. Even by avoiding the honeypot he will tell you something that's worth knowing.

But pretty much nothing of the above comes for free; nor will it work by itself. You need someone continuously managing (normally at a very low level, but continuously and always ready to escalate) the honeypot. The honeypot has to be maintained and updated, just as much (possibly much more) than the other boxes.

You have to decide whether the gain is worth the pain, and whether you can invest in the necessary pain.

Just "adding a honeypot" will do nothing to increase the network security; to the contrary, it will engender a bit of false security, and possibly provide a security breach if the honeypot isn't as well insulated and armored-in as you believed; it might also attract more attention than if it weren't there, if it offers services or vulnerabilities the other machines don't share.


How to defend myself against potential malicious browser add-ons? So previously I asked a question about what type of private data can addons extract from my browser :

Can a malicious add-on access internet history and such in Chrome/Firefox?

and it turns out if they simply have a permission to read content of the page I'm visiting which most of them have, then they can simply send it to their server and basically record my history this way (since addons dont need permission to access internet and send data)

now my question is, do popular Internet security programs like Kaspersky and their addons detect this type of malicious activity and stop it?

if not, what should I do? because even if an addon is well known I cant still be sure that its not doing something malicious after their latest update, and I  don't have the knowledge to check if they are malicious or not. and I cant simply stop using addons since I need most of them! (but I wont install newly made add-ons with no reputation)

so what is the solution here? how can I make sure that no malicious activity is taking place by firefox/chrome addons, is there any good Internet-security/Anti-Virus/addon that does that?

also do chrome and firefox check addons to make sure they are not malicious before putting them in their websites or not? if so, then how likely is it that they miss a malicious addon?

You cannot trust either FF or Chrome to check addons. They do remove the reported ones, but it may be too late.

One way you could test things is monitor traffic between before and after enabling an addon so you detect if something is wrong.

Another way is to only get trusted ones, the ones already tested by thousands of community members.

Anti-viruses will not help because some addons are specifically designed to transmit encrypted data (proxy addons, encrypted chat addons and so forth). Malwarebytes, for example, has a browser extension, but it's something that prevents from general web-site malware; an addon can transmit encrypted information (just like the actual browser or even the OS can) without you or any AV/Extension/defense being able to detect what is transmitted.

Recent browsers can launch separate privacy modes which by default do not load any addons, so if you want to play something sensitive the safe way, you can always use that option.


Shared Key vs Pre-Shared Key Does Shared key and Pre-shared key mean different thing ?
Currently reading Text , Security+ Guide to Network Security Fundamentals.

The difference is exactly the same as the language suggest. "Shared key" means that the same key is used by several party. It doesn't tell you how the key was distributed among them.

"pre-shared key" means the key has been shared before the current operational context.

To go you two examples:

When you perform a Diffie-Hellman key exchange in an SSL connection, you actually generate a new key that is shared by both client and server without any of them having a previous knowledge of that key. That key is shared but not pre-shared.
If you protect a ZIP file with a password, this password becomes the shared key and it must be shared between all parties. That key is both shared (everyone uses the same) and pre-shared (its distribution isn't covered by the ZIP protocol and must be performed through a different secure channel before usage)

These are only two examples, there are many more.


Only allow access to specific service running on computer in Demilitarized Zone over internet If a computer (running different services such as ftp and ssh) is placed on a Demilitarized Zone, will all of its services automatically be accessed by anyone on the internet?

If the answer is yes, then is it possible to only allow a specific service such as ftp, to be accessed over the internet and block access to all the other servers?

The definition of a DMZ is that you have two firewalls, one between the system and your LAN and one between the system and the global Internet.

A skilled administrator will of course configure the firewall facing the internet to only allow those services which are required by the server.