What's the purpose of Server Key Exchange when using Ephemeral Diffie-Hellman? What's the purpose of ServerKeyExchange when using ephemeral Diffie-Hellman? In this case, the ClientHello advertised EDH and EECDH (and not anonymous protocols), and the server selected TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA in its ServerHello.

According to RFC 5246, Section 7.4.3:

  This message will be sent immediately after the server Certificate
  message (or the ServerHello message, if this is an anonymous
  negotiation).

  The ServerKeyExchange message is sent by the server only when the
  server Certificate message (if sent) does not contain enough data
  to allow the client to exchange a premaster secret. This is true
  for the following key exchange methods:

     DHE_DSS
     DHE_RSA
     DH_anon

I understand RSA is being used for authentication (and not key transport). But since Diffie-Hellman is being used, both sides contribute material to the final master_secret. So there's no need for a message that allows the client to contribute more material earlier for the premaster_secret.

What's the purpose of ServerKeyExchange when using ephemeral Diffie-Hellman?

In Diffie-Hellman, the client can't compute a premaster secret on its own; both sides contribute to computing it, so the client needs to get a Diffie-Hellman public key from the server. In ephemeral Diffie-Hellman, that public key isn't in the certificate (that's what ephemeral Diffie-Hellman means). So the server has to send the client its ephemeral DH public key in a separate message so that the client can compute the premaster secret (remember, both parties need to know the premaster secret, because that's how they derive the master secret). That message is the ServerKeyExchange.

I'm not sure what you mean by "a message that allows the client to contribute more material earlier" in regards to the ServerKeyExchange. The ServerKeyExchange doesn't let the client contribute more material; the client sends a ClientKeyExchange in all TLS suites. The point of the ServerKeyExchange is to let the server contribute more material to the key exchange, by letting it send additional information not in the certificate.

About "backtracking to premaster secret:" The premaster_secret is the immediate outcome of key exchange. Key exchange in TLS never produces a master_secret directly; this is because the TLS designers wanted the master secret to have a consistent length with entropy spread throughout, so that your key derivation code doesn't have to worry about how key exchange happened. Different key exchange methods produce differently formatted shared secrets, so you always have to convert the premaster secret to a master secret of 48 bytes. There's no real concept of "backtracking," as the master secret isn't derived until key exchange is finished.


My admin password was changed! Can someone hack my router and change my admin password for Linksys router but leave my wifi passwords the same. Tried logging in on 3 different browser and 2 different computers. I also tried using the general admin password when initially setting it up in case it failed during an electrical surge. Not such why I couldn't log in to my router. Could it have been hacked?

Yes it could be hacked especially if password was not strong enough or simply because of vulnerable router.

Make sure that firmware is up-to-date, then check logs if it has one and change password to something decent.

Here it is how to reset a password:

Resetting the Linksys router to factory defaults

  If you can't access the router's web-based setup page or forgot the
  router's password, you may reset the router to its default factory
  settings.  To do this, press and hold the Reset button for 10 seconds.

  NOTE:  Resetting your router to its default factory settings will also
  reset your router's password.  The router's default password is
  “admin” as for the username, just leave the field blank.

  IMPORTANT:  Make sure that the Power LED of the router is blinking
  when you press the Reset button.  This indicates that the router is
  being reset properly.

  NOTE:  The location of the Reset button may vary for every model.
  Older Linksys devices may require pressing and holding the Reset
  button for 30 seconds to complete the reset process.

Source


Why do we trust session info over the wire but not an OAuth access token? I've been spending a lot of time looking into building an API that needs to be accessible by a single page JavaScript application and how to make it as secure as possible.

A lot of what I'm reading about standards like OAuth suggest that you never want the access token you issue to be made available directly to the client, and that's why things like the Implicit Grant are often criticized.

I recently read this article: http://alexbilbie.com/2014/11/oauth-and-javascript/

...which offered an interesting suggestion of proxying requests to the API through a thin server side component, so that the single page app could authenticate with the proxy, get back an encrypted session cookie, and then make requests to the proxy server which would attach the user's access token to the requests before forwarding them on to the actual API.

What I'm wondering is how this is any more secure than just handing the client an access token? If the attacker would've been able to get the access token, surely they can get the cookie storing the session information which is just as good as the access token for making requests to the API?

Why is it that we consider encrypted cookies with session details in them safe, but trusting the client with the actual access token is considered insecure?

Is the real difference just that an API with no direct client-side access is considered a secure, private API, and any API that needs to be accessed by the client side in any way (even through a proxy) needs to be treated as a public or open API, and you just have to accept the trade off of the risk of someone potentially being able to forge requests if they were able to get their hands on the session cookie or access token?

What is actually the most secure way for a single page application to prove it's identity to an API?

If the attacker would've been able to get the access token, surely they can get the cookie storing the session information

An XSS attack can't get to the cookie if you specify it with HttpOnly. It must have been an oversight, he really should have mentioned this. Oh, and Secure (HTTPS-only) as well. Then this cookie can't be stolen via XSS or MitM'd/sniffed.

  Why is it that we consider encrypted cookies with session details in them safe,

So by putting the tokens in a cookie marked HttpOnly, they're safe from XSS. By encrypting them, you've prevented them from getting leaked, intentionally or not, for example by the user inspecting his cookies.

  but trusting the client with the actual access token is considered insecure?

This problem isn't really the client but rather an XSS attacker, who could steal the access_token and then impersonate the user.

But now that we're using cookies, his last statement, made almost as an afterthough, is important:

  To protect an attacker just stealing the cookie you can use CSRF protection measures.

To mitigate CSRF, you can enforce on the server that the client provide an X-Requested-With (or other custom) header. That will prevent malicious sites or XSS-hacked sites from calling your APIs because the browser's cross-domain restrictions won't let them add custom headers, and then you can reject the requests.

  What is actually the most secure way for a single page application to prove it's identity to an API?

I've been looking around and I think this approach, using a proxy server-side, is it. You'll find variants of it elsewhere googling around, for example here and here, but Alex Bilbie's approach of encrypting the access_token has an advantage over those two that there is never a window (even a short one) where the access_token is vulnerable to XSS.


Security of certificate when using DNSSEC When setting up secure server, it is suggested not to use self-signed certs and instead to be signed by a CA.  Of course, post-Snowden we now know that there may be problems with CA's that could allow MITM attacks.

My question then is if a domain is setup with proper DNSSEC, is it immune from does this mitigate the types of MITM attacks that would be available via a compromised CA? (I hope that came out right)

Plain DNSSEC

DNSSEC only secures DNS records, and on its own does not help at verifying certificates. This mitigates DNS hijacking (when some man in the middle, for example a network provider threatened by governments) returns faked DNS records.

It does not help against other attacks, especially redirecting the traffic (without spoofing the DNS records) or tampering the traffic in-between (and wrapping it in TLS again). In this case, an attacker could use a valid certificate issued by a compromised CA.

DANE

DANE uses special, DNSSEC-signed DNS records (TLSA-records) which declare what certificates are allowed for a domain. If you put together DNSSEC and DANE, it is possible to either declare self-signed certificates as trusted (verified against the DNSSEC trust hierarchy), or have a second validation path of CA-signed certificates.

The large disadvantage of DANE: implementation coverage is still very, very low; pretty much nobody is using (or even able to use) it at the time of this answer: Firefox and Chrome plugins are available, and Postfix has support for it.


What encryption does Apple use? With their iOS devices, Apple allows people to block certain applications through "Restrictions". I recently had an issue with my iPhone where I'm positive that I entered the correct passcode on my new phone, but the device refused to give me access. Searching around online shows LOTS of other people claiming the same thing.

I'm wondering if it's actually a bug, or whether we're all just forgetful.

The passcodes are stored in an XML file. Mine was this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>RestrictionsPasswordKey</key>
    <data>
    PKu5mw2c2qFkynodAj9rc07KQ+E=
    </data>
    <key>RestrictionsPasswordSalt</key>
    <data>
    EPHEAw==
    </data>
</dict>
</plist>

Through editing the file and making changes, I can confirm that the following

Key: IxxWEBikzuZi33zUqCBnAcWAavk=
Salt: aSbUXg==

Equals passcode: 1234

Given that each passcode is only four digits, how can I decrypt my initial passcode to see if it really was what I remember it being, or if I had misentered it the first time around.

I can confirm that they use pbkdf2-hmac-sha1. You can read how to decrypt the codes here:

http://hashcat.net/forum/thread-2892-page-2.html

Turns out I'd misremembered my passcode after all!


Free/Inexpensive IP blacklists What are some free or inexpensive places where I can grab blacklists automatically? I do not want to have to query for each individual IP. The firewall, PF, requires you to have the IPs or ranges in a file line by line.

Any type of blacklist applies -- but I am more worried about malicious content, such as botnets, compromised hosts, and phishing IPs.

I have tried to research this through Google, but a lot of resources are for how to remove yourself from a blacklist, and many providers are on a query basis only. I understand that most providers do not want to give away their entire database of IPs, but maybe there is a free list established by a consortium that I do not know of.

These two repositories have lists of their sources inside of their readmes:

https://github.com/maravento/blackip

https://github.com/mitchellkrogza/Ultimate.Hosts.Blacklist

Please note the first project is no longer maintained. The 2nd project only seems to update monthly.


Drupal Security & Two DBs I use drupal for our site. It uses nodes that store data. We link lots of these nodes together to allow us to log jobs, customer info, invoices etc. These are linked via an addon drupal module. If I were to delete the links the entire site would be meaningless to me.

As this module is all that links the nodes together, I am thinking that from a security pov, I could create a database/app on another server and whenever drupal goes to get a linked node id, it will go via this other server (send a key and receive the correct nid in return). If the main database is stolen, the links will be meaningless and it will be basically worthless data.

Is this something that sounds viable and worthwhile?

It would cause a performance hit.  Additionally, it depends on what you are concerned about having stolen.  It's possible that even if you do this, an attacker might still be able to acquire your customer list, and potentially payment information if you are storing it.

Even if the data isn't useful in your application without a relation key, an attacker would probably be quite happy with the unrelated data if that data is coherent in any way.


Is APG secure enough? Ubuntu currently recommends using APG (Automated Password Generator) to create strong yet pronounceable passwords.

I usually use it like this (see option explanations here):

apg -s -m 16 -x 16 -M SNCL

This creates passwords of length 16, containing at least one character from each of 4 classes: small letters, capital letters, numerals, and special symbols, using a manually entered seed.

However, I think I have noticed a flaw: passwords usually contain only one digit and one special symbol, and one of them is usually located in the end of the password (sometimes in the beginning). Here's an batch of 16 passwords I just generated:

TelHulp5Ot*Graj8
notDodsOwgid5ut<
EywiJudCof8drog_
DuerfigOkCif0Ov~
udBon9opyivyawl@
@2drakBanRewyooc
abAxKec0quacJej>
Sam9?Trobhecvun[
RypMycs`Frewjij5
orEs%KooHujsayt7
Dunwib1flynjead_
Hud+quonEdDairr5
Aj|oj7owojadEmp4
@Shmeeb0quicOam_
CribDip9drefBag[
LocEwCyWrarl#on9

How much this flaw decreases the password entropy? Are such passwords still secure this days? I'm mostly concerned about using them for accounts at various websites.


Completely Protected Virtual Folder I am a Python / C developer currently working on a extremely important piece of software. The details of the code will not be mentioned, and the only place the code appears is on my own hard drive, in a virtual disk image used by a windows 7 virtual box (a hard drive inside a hard drive I guess). The algorithm represented in the code is extremely important, and I cant have ANYBODY get to it except me. I was curious if one could completely protect a single virtual folder from any unwanted access whatsoever. I want to give a level of protection so deep (for this one folder) that even if a CIA agent was assigned to tracking down this source code on my hard drive, they could not do it. I need this folder to be completely cut off from the rest of the world, and make sure no internet based attack, nor any virus could get to it. Is this possible? Any suggestions to lead me in the right direction?

P.S. As you can probably tell, I really don't know much about security, but I would appreciate any suggestions. A 'no this is not possible' answer is completely acceptable.

No.  Consider that when you're using a computer, you're just interacting with software that's reading and writing these files.  Anything your intended software can do, malicious software can do.  That being said, you could use Trusted Boot, Full Disk Encryption, and run only signed/verified software on your machine.  Using an air-gapped (never connected to the Internet) machine would also make it harder for an attacker.

Security is not an absolute state, it's just a question of making it cost more for the attacker to attack it than the data is worth to them.  If you believe it will be worth it for the CIA to attack you, then there's a good chance Rubber-hose cryptanalysis will work if all else fails.


Tool to listen http traffic goes to different ports (Windows) I am using a set of microservices (Spring MVC Hosted in Undertow containers along with Gradle) which are spawned on different ports in the same machine. Services make HTTP REST to each other.

I need a tool to monitor HTTP traffic between these services (same machine different ports). Please provide any recommendations.

RawCap

While the standard approach of Wireshark won't work on Windows due to how loopback interface is(n't) implemented in Windows, you should be able to use RawCap to capture the data and then analyze it in whatever way you want.


How to ensure that only my single page app can make requests to an API I have a REST API that can potentially serve multiple web clients.

I want to ensure that only my single page app on my-one-and-only-web-cleint.com can make requests to my API. How do I do this?

Right now there isn't much to stop someone from copying the source of my website and act as a copy of my single page app on my-one-and-only-web-cleint.com.

Only check I have right now is:

On server side: I check for request header's origin and only allow requests from my-one-and-only-web-cleint.com

But my understanding is that you can manually change the header, so this check can be bypassed.

This sounds like preventing a CSRF attack. The Same Origin Policy will already prevent anything within your API from being read by another domain, but to prevent requests that makes changes to your system you will need to guard against CSRF.

On server side: I check for request header's origin and only allow requests from my-one-and-only-web-cleint.com

Checking the Origin header or a custom one such as X-Requested-With is a valid way to beat CSRF.
An attacker cannot forge this header in the web browser, so anyone connecting to the attacker's site which he has connected to your API will not be able to use it as their browser header cannot be tampered with.
You should also rely on an authorisation system to prevent the attacker from making API requests server side (where they can set any header they want).


Are certificate sans case sensitive Creating a certificate request for my exchange server I am wondering if sans and CNs are case sensitive?

No, they are not case sensitive.  To quote RFC 5280 (emphasis mine):

  When the subjectAltName extension contains a domain name system
  label, the domain name MUST be stored in the dNSName (an IA5String).
  The name MUST be in the "preferred name syntax", as specified by
  Section 3.5 of RFC1034 and as modified by Section 2.1 of
  RFC1123.  Note that while uppercase and lowercase letters are
  allowed in domain names, no significance is attached to the case.

The referenced RFC 1034 echos this:

  Note that while upper and lower case letters are allowed in domain
  names, no significance is attached to the case.  That is, two names
  with the same spelling but different case are to be treated as if
  identical.

(The modification referenced as part of RFC 1123 was to allow the first character of a legal host name to be a digit, and is unrelated to case.)


How to not use database identifiers in a URL in the context of a REST API During my IT school years, I was told that including rows identifiers from a database in the resource URL, in the context of a REST API, is a bad practice. To my understanding, the rationale behind this statement is that exposing technical database identifiers is a security breach.
For instance, say I have a table USER_ACCOUNTS(id, username) in my database. Say I’m using a REST API to expose the user accounts data.
How would I expose the URL without using the real column ID ?
If the user ID is 3 in my database and I want to access his profile, how would I design the URL without having something like /users/3 ?
Is it true that exposing database IDs in the URL is a bad practice ?
If so, what are the alternatives ?
I thought of using a hash & salt value instead of the real, plain ID, but I can already see many drawbacks to this solution.
How do you deal with exposing database identifiers in your URLs ?
What are some of the best practices to deal with this issue ?

The answer is not far away, you need an Id to extract the user, however, the Id would be an UUID instead of running number which can easily be pooled.
You can easily use code libraries to generate the UUID for your continence.


How do services prevent malicious behavior when executing user provided code? Some services such as Github allows the execution of user supplied code using docker containers via Github Actions. Another example of a service provider that executes user provided code are continuous integration services such as Travis or AppVeyor.

This question does not consider the user's code breaking out of its VM or container, but rather code that can use up resources or launch attack on other systems via the internet.

Some examples of malicious behavior I'd like to define for this question are:

Using your resources to mine cryptocurrency (for example using multiple travis jobs in a build matrix to mine cryptocurrency).
Sending spam.
Launch DDOS attacks on some host.
Testing username/password combinations or credit card numbers against a service.

Since the code is user-define, it is pretty much impossible to do any sort of whitelisting or blacklisting. Blocking access to certain hosts on the internet would also be ineffective as the malicious user can host the malicious binaries anywhere and download them into the container or VM during execution.

How do services such as Github (via Github Action) and Travis prevent malicious behavior on their systems when executing user provided code?

I will give you some examples of how to detect by the platform your examples of malicious behaviour:

For cryptocurrency, probably by limiting the time of the execution you can block this types of attack, as far as I know for example bitbucket limits the time of the builds and deploy, so if you want more time you need to pay. Basically if you want more CPU you need to pay.
Sending spam, If your software makes too may connections to the Internet and your software is uploading traffic you can limit this. Also NIDS can detect this.
For the DDos attach is a similar approach as the previous one. Also the docker could be executed on a non secure environment with NDIS, firewalls and other security systems basically and will detect the attack.
And the other case is easily detected by the other two techniques mention or by the destination service that probably will contact with the platform and informing about the issue.

Be aware, that in general github, bitbucket and so on have security systems in place and if you are using free accounts you are on a different schema than a company that use that services. On the other hand, if the platform have the suspicious or the evidence that you are making some bad activity im sure they will block the access to the account and send you a lovely email :)


Web Application Vulnerability Scan- False Positives-Recognizing and Eliminating Web Application Vulnerability and Potential False Positives

As a Penetration Tester the application vulnerability scan is a major part of any penetration testing methodology. In the Application Scanning stage there are are several different types of vulnerabilities that may surface. The main ones being...

SQL injection/blind SQL injection,
cross-site scripting/persistent cross-site scripting,
command injection,
XPath injection,
SOAP/AJAX attacks,
CSRF/HTTP response splitting,
arbitrary file upload attacks,
remote file include (PHP code injection),
application errors.....etc
(I may have left some out, please don't grill me if I neglected to mention them above)

When using a scanner you can rest assured to encounter a false positive. In my experience the SQL injection vulnerability is what's going to harbor the most false positives.

False positives are a nasty byproduct of using scanners that are created to save time.
I haven't found a subject that directly touches on this subject  and wanted to start a brief Q & A.

So here is the point of this entire post:
When faced with the scan output and a potential vulnerability actually being a false positive. What are effective measures of determining these "False Positives"(if not already designated as such),verifying them, and then correcting them?

I know there is an independent process for each vulnerability, but I'd like to focus on SQL injection and cross-site scripting initially.

Any help is appreciated...

I personally see a lot of false positives with Cross Site Request Forgery.

This may not be the answer you're looking for, but you need to verify them to the best of your ability.

If you find something is beyond your ability you have a couple options:

learn how to do it - this of course takes time and experience, a luxury we don't always have
lean on a knowledgeable sysadmin
lean on a knowledgeable developer
lean on the vendor (if this is a 3rd party app) to confirm/deny the vulnerability

Vulnerability scans results can cover a wide range of technologies and platforms. You can't be expected to be an expert in all of them.


Decide for client certificate auth in https based on hostname or url Let's assume this (made-up) scenario: I install a webserver that reacts on two hostnames (anonymousserver.com and authenticatedserver.com)

I would like the following behaviour:

If the webserver is called by anonymousserver.com, ssl has to be used but no client certificate shall be requested.
If the webserver is called by authenticatedserver.com, ssl has to be used and a client certificate shall be requested.

So, is it possible to decide on doing client certificate authentication based on the hostname? The issue I see is that ssl handshake and http get request take place after another; the ssl handshake is already finished when the server knowns which url shall be processed

A) Decide on doing client certificate authentication based on the hostname

This can be done even if both domains are served on the same IP address as long as the browser sends the target hostname within the SNI TLS extension. All modern browsers do this by default and most but not all apps on recent mobile systems.

  B) Decide on doing client certificate authentication based on url

It is not immediately possible since the URL is unknown on initial TLS handshake. It can be done with renegotiation inside an existing TLS handshake.


API authentication without Oauth2 server I have an API that needs user authentication. It is the same way Google authenticates when you use their API to access user data. I really don't want to setup an oauth2 server and I want user to login via OpenId providers (Google, Facebook,...).

Does anyone know if this is possible and secure?

User access client app which is using my api
Client request the user to signin
User is redirected to the api server login page
User is redirected to the OpenId provider (they choose) and authenticates
OpenId provider sends the api server a token (TokenA)
API server send a new token (TokenB) to the client that is linked with the token (TokenA) and provider (facebook, google, ...) in the Database
When the client requests user data, they must send the new token (TokenB) to the server for verification

If someone has a better way to do this I would love to hear it!!!

Thanks

Just to be sure we're on the same level: 'oAuth' is not 'OpenID'. 'OpenID' is about authentication (proving who you are), while 'OAuth' is about authorisation (to grant access to things without having to deal with the original authentication). It's 'OAuth' that can be used in external partner sites to allow access to protected data without them having to re-authenticate a user.

To answer your question: I'm wondering that you want to go through the hassle of figuring out alternatives when plenty of simple libraries exist that allow you to implement oauth in a clean and (more important) official way. Instead of thinking you actually have to 'setup your own oauth2 server', you might want to take a look at http://oauth.net/code/ as there's no reason to do that to handle oauth for authorisation as part of your API's user authentication... just use your domain as your OpenID Provider.


Is it critical to enable DNSSEC if I am using TLS/SSL certificate on a website? I have TLS installed for a website, does it matter if DNSSEC is enabled for this domain or there is no real need for that then?

Check out Cloudflare: How DNSSEC works - they do a great write up on this and why its important. If you are concerned about providing a secure experience to your end users, or use your domain to provide email services that you send or receive from. DNSSEC would be a good (and easy to setup) choice for you.


Is Taking advantage of the IsNumeric() Function In VB.Net Through SQL Injection Possible? Suppose this is the only mitigation used on a server:

Dim IDPerson
IDPerson = Request.Querystring("id")
If IsNumeric(IDPerson) = True Then
IDPerson = IDPerson
Else
IDPerson = 0
End If

IDPerson is then used to write the query. The "id" is the GET variable.

I know IsNumeric will accept Hex as numeric.

Could a whole query be constructed in hex and pass the IsNumeric function?

I'm gonna say that it depends on what you do later with the ID variable.  If your code later converts the hex to a string and then builds queries with it, then the answer becomes 'yes'

Example:

I build an e-commerce website that looks looks up your purchase history based on your customer ID...  Being a noob, I came up with a clever idea of using your email address to generate your ID by simply converting it to hexadecimal.

my email = customer@example.com
my ID would then be =
637573746f6d6572406578616d706c652e636f6d

That looks like a "pretty secure" and unique ID, so I feel really good about what I've done.

Now the injection:

Someone figures out that the user ID is simply the hex equivalent of the email address and guesses that I may be converting it back into text and using that result in a query

http://mysite.com/orderhistory?userid=637573746f6d6572406578616d706c652e636f6d

injected ID = 31272064726f70207461626c652075736572733b202d2d
ascii equivalent = 1' drop table users; --

If I, the developer, check to make sure the ID is numeric... then hex-to-text the ID... then use it in a query....  I've just allowed a sql injection

References:

Here's a similar question regarding SQL injections using only alpha-numeric characters: https://stackoverflow.com/questions/8086906/keeping-clear-of-sql-injections

Here's another thread discussing sql injection via hex:  http://arstechnica.com/civis/viewtopic.php?f=20&t=107657

... Of course the right solution is to use 'real' prevention mechanisms such as parameterized queries, but this is certainly an interesting question.


nmap - "No exact OS matches for host (test conditions non-ideal)" even with 1 open, 1 closed port I'm trying to do some Nmap OS detection and I'm running into some results I don't understand.

The scan I'm running is the following:

nmap -O -F -v -T2 -oA nmap-uphosts-OSdetect -iL  < my_in_file

I've got -F in there to limit the number of ports because the scan of 40 hosts was taking really long with the default 1000 ports.  The -T2 because there seemed to be some IDS / rate limiting / reactive firewall type defenses when running it at full speed.

When my scan completes pretty much every single host has the following message in the results:

  No exact OS matches for host (test conditions non-ideal)

This occurs even on hosts with multiple open & closed ports, as required for OS detection.

It's worth noting that all of the hosts are VMWare VMs.  I'm not sure if this results in a fingerprint that Nmap has a little more trouble digesting.

Does anyone have any insight on what might be the cause &  how I can determine specifically which test conditions are non-ideal to try and get more conclusive results?  As it is all the hosts list several possible OSes without a conclusive ID.

Thanks!

EDIT - To clarify this is a lab / learning environment.  I have permission to run the scans.

Nmap fingerprints a remote system's operating system (more correctly, the OS's TCP/IP stack) by sending a series of probes and measuring the responses. These probes check for particular choices that the OS programmers made when implementing parts of the Internet protocols that are not as strictly defined as other parts.

There are several reasons why Nmap considers an OS fingerprint non-ideal, and it can be useful to know what they are and why they matter:

Scan delay is greater than 500ms - Nmap sends six probes in quick succession and checks to see how much the remote system increments certain counters. If there is too much delay between packets, then there's too good of a chance that someone else's packets were incrementing the counters instead. (-T2 sets a scan delay of 400ms)
Timing level 5 (Insane) used - -T5 can overwhelm a system or its network link, causing dropped packets and unpredictable responses, which lead to an unusable fingerprint.
Missing an open/a closed TCP port so results incomplete - Some probes are only sent to open ports, and some only to closed ports, so without one or the other, the fingerprint cannot be complete.
Host distance appears to be negative - This is a weird thing that can happen when a firewall is sending responses to blocked UDP ports. Any time a firewall sends a response to one of Nmap's probes, it makes the fingerprint less likely to match, since the responses will be a mix of good and fake.
Host distance is greater than five - The farther away you are from the target, the more likely there is some sort of packet filter or traffic shaper that is causing interference with Nmap's probes. Also, some of the timing stuff can be thrown off.
maxTimingRatio is greater than 1.4 - This is a measure of responsiveness to Nmap's probes. Nmap tries to send one probe every 100ms, for a total of 500ms between the first and the 6th probe. If it has to wait too long for any of them and the 6th probe is sent more than 700ms after the first, then we assume the timing checks won't be accurate.
Didn't receive UDP response. Please try again with -sSU - One of the probes sent is to a closed UDP port. If you didn't scan for UDP, then your fingerprint will be incomplete.

These reasons came from the Nmap source code, but you can see them when you run a scan with -v2 or -d.

Please note that "non-ideal" doesn't necessarily mean that you won't get an accurate fingerprint match. It just means that the chances are good that something will have interfered and caused a poor-quality fingerprint. In these cases, Nmap will not print an OS fingerprint for submission, since we don't want to clutter up the database with fingerprints that are "blurry."


Efficacy of self-made ransomware protection I was recently wondering about how to circumvent malware such as the infamous Cryptolocker a while back and was wondering about the efficacy of having a set of files with known content in a known location and then, in the event of a ransomware malware infection, using these files to uncover the cryptographic key used to encrypt the files.

For instance in the case of Cryptolocker, it was known fairly early on that the cryptographic function which encrypted the files was RSA, and thus brute force attempts at recovering the key could be made.

Of course, this isn't an ideal approach as it requires a large amount of computation, but with GPGPU programming alongside parallel CPU architectures (or even distributed computing) and disabling any timed-deletion of files by the Malware is this approach completely unfeasible?

Yes it is completely unfeasible. Your suggestion bases on you knowing the contents of a particular file. You want to use this and the encrypted file to decrypt the other files. There would be two ways to approach this. One would be to use weaknesses of the encryption algorithm in a known plaintext attack, the second, which you are addressing in your last paragraph, would be trying every key in a brute-force attack. However, both approaches can be rendered practically impossible. Brute force is hopeless with a large enough keyspace, and known plaintext attacks don't work on sophisticated algorithms like RSA. So when your ransomware is "well" implemented, it can indeed lock up your data in a way nobody except the ransomware writer can decrypt it.

Btw, knowing the encryption algorithm for any system is not supposed to weaken it. In fact, public (agreed-upon) algoritms are considered stronger as they can be reviewed by researchers around the globe. Its unlikely you can afford similar reviews for your secret algorithm.

Best ransomware protection are offline backups. Online backups (drive always connected to computer, automatically mounted NAS, etc.) won't help as they are likely to be be accessed by the ransomware. Only exception are online services like Dropbox which store file history.


How are ECDSA signatures computed for X509 Certificates? I am trying to verify a certificate signature on my own. To do this, I created a self-signed certificate using OpenSSL with the two following command lines:

  openssl ecparam -name secp256k1 -genkey -param_enc explicit -out
  private-key.pem

  openssl req -new -x509 -key private-key.pem -out
  server.pem -days 730

You can take a look at my certificate here.

I can clearly distinguish the public key and the signature which respectively are:

public key

  93 99 FD 9F 7F 04 48 AF 51 2C  6D 2D 69 04 B9 1F 88 A9 C2 64 31 8E 68
  70 5B 55  C8 63 C2 C3 AC A4 17 BD 89 1A 5E 8E 08 C4 B7 92  AD AF 51 28
  D3 AC BC CE 73 FA 5D D2 FE A7 EB 53  C7 6E 1A 00 84 2C

signature

  32 BA FB EB A8  E9 BB 4B 2D 2B 19 12 65 11 EC BB F5 46 5E B5 59  3A 9D
  42 F2 62 74 BA A0 E7 73 03
  E1 4C  CE 67 2B 7D 3B BA 75 E9 8B 95 95 57 E7 17 B7 C1  99 4B 71 96
  74 89 67 5F DC B1 0C 71 3B 5F

My problem is that I don't understand what is the input of the signature algorithm (ECDSA with SHA256)?

I tried to verify the signature by performing ECC computations on a hash (SHA256) of all the data before the signature TLV (i.e. all except
03 48 00 30 45 02 20 32 BA FB EB A8  E9 BB 4B 2D 2B 19 12 65 11 EC BB F5 46 5E B5 59  3A 9D 42 F2 62 74 BA A0 E7 73 03 02 21 00 E1 4C  CE 67 2B 7D 3B BA 75 E9 8B 95 95 57 E7 17 B7 C1  99 4B 71 96 74 89 67 5F DC B1 0C 71 3B 5F) but it seems that the signature is not valid with this input.

The signature is computed over the tbsCertificate (To-Be-Signed) data.

https://tools.ietf.org/html/rfc5280#section-4.1:

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

https://tools.ietf.org/html/rfc5280#section-4.1.1.3 says:

  The signatureValue field contains a digital signature computed upon
     the ASN.1 DER encoded tbsCertificate.  The ASN.1 DER encoded
     tbsCertificate is used as the input to the signature function.  This
     signature value is encoded as a BIT STRING and included in the
     signature field.  The details of this process are specified for each
     of the algorithms listed in [RFC3279], [RFC4055], and [RFC4491].

  By generating this signature, a CA certifies the validity of the
     information in the tbsCertificate field.  In particular, the CA
     certifies the binding between the public key material and the subject
     of the certificate.

So, the trivial version of what you got wrong is that you also need to exclude the leading 30 82 03 02.  And you didn't trim enough off of the end.  Namely, the 30 0A 06 ... part (the signature algorithm identifier).

But, using that already shown ASN/DER parsing, you see that the root SEQUENCE contains three children. The signature is over the first child only.


How do I maintain/check a user session in the backend without having to use tokens? I'm trying to login a user and, then, retrieve the user information like we do on a regular web app using php session.
I have searched some solutions but I couldn't find any answer for my problem/doubt.
I know that the best way of doing it is using tokens but I would like to know if there's any other way to do that with a minimum level of security.
I wanted some sort of stateful authentication.
The answers I got were things like "create a token a store it in the server" but I would like to know if there are more options. I actually wanted to store the user in a session/cookie or something like that (if possible), but I haven't seen anything regarding that. I use session storage to save the email and send to the server every request the problem is that local storage alone is a big security risk but I think using tokens is a little bit too much for what I need.
When I successfully log in, I store the user in a session like this:
session_start();
$_SESSION["loggedin"]=$email;

It saves the session but when I try to make another http request, it says:

Undefined array key "loggedin"

I tried to send the session id along with the request but doesn't work out either as the server seems not to be rememebering the session.
So my question is: Is maintening a session on server side not possible in this case? If so, do I have another option besides token? Should I store the token in the database or is there any other way of storing the token?

Security goal
Let's take a step back here and ask what security goal we are trying to achieve here. I think with any "login session" system the goal is the same, and comes in two parts:

Initial login: the user proves that they are who they say they are; this is usually done with passwords, MFA, email confirmations, whatever.
Maintaining the session: each subsequent request from the client to the server contains some proof that they are the same person that did the initial login, and not an attacker trying to hijack their session and pretend to be them.

The common way of achieving this is that upon successful login (step 1), the server gives the client some sort of long random-looking string (aka "an auth token"), and the client includes it in each subsequent request as the proof for step 2.
I say "common", but I'm not actually aware of any alternatives unless you want to get into TLS client certificates, or pre-shared API keys but those are a lot more effort and are not really "sessions" anymore.
Implementation
There is a lot of variety for what counts as an "auth token", for example:

JSESSIONID (commonly seen with Tomcat servers)
custom session cookie
JWT tokens
Bearer tokens
some custom value in the Authorization: header

Each of these has their own pros and cons. For example if you do JWTs, then you need to worry about securely storing a signing key in the server. Or if you use a session cookie then you also need an XSRF token. But in a broad sense these all follow the pattern of the server issuing a random-looking token upon successful login that the client echos back with each request.
Session management
(Response to comments)
You getting into the complexity of session management. This is getting way outside the scope of a security question, but I'll answer it anyway.
Yes, in order to process a request, the server will need to know "stuff" about the user and their session. For example:

Username / email
What group / permissions / access controls they have
What time they logged in / when their session expires
Whether they logged in with just password, or with password + MFA (for example if you require "step-up" to access sensitive parts of the app).
What IP their session is from (maybe you want to enforce geoIP restrictions, or make sure they don't change to an IP halfway around the world part way through their session)
A lockout-count (for example if you're doing a per-session lockout)
etc, etc

As this is mostly security stuff, the server needs to be keeping track of this, rather than trusting the client to give the correct information. Debates about where and how the server should store these "session objects" are basically as old as the internet itself. The most common designs are:

Server-side in memory: could be as simple as global vars in your application, or as complex as an in-memory database that synchronizes across servers. Pros: high performance as no db calls are needed. Cons: can run out of server memory, hard to scale horizontally (adding more copies of your server behind a load balancer), you need to worry about clearing out data when sessions expire.
Server-side in database: make a db table for tracking sessions. Pros: scales nicely. Cons: slightly worse performance, you need to worry about clearing out data when sessions expire.
Client-side (aka "stateless): put all the session data into an encrypted JWT (aka "JWE") and get the user to hand it back to you with each request. Pros: high performance, does not consume any memory on the server, scales nicely. Cons: more complex to implement properly, extra bandwidth usage.

As I said, this is an age-old debate, so google something like "server side session management" and you'll get loads of people debating the best way to store session data.


Testing for HTTP TRACE method How can I test for HTTP TRACE on my web-server?

I need to train a Tester how to verify that the HTTP TRACE method is disabled.

Ideally I need a script to paste into Firebug to initiate a https connection to return the web server response to a HTTP TRACE command.

Background:

Our security Pen Testers identified a HTTP TRACE vulerability and we need to prove that it is fixed.

References:

OWASP on XST
Apache Week

Simplest way I can think of is using cURL (which is scriptable).

 curl -v -X TRACE http://www.yourserver.com

Running it against an Apache server with TraceEnable Off correctly returns HTTP/1.1 405 Method Not Allowed (just tested on an Apache 2.2.22)

This also works on HTTPS sites, provided that cURL has the correct information supplied to the SSL layer. This is the lazy man's check of Google

curl --insecure -v -X TRACE https://www.google.com/

...it negotiates the connection (does not verify the certificate chain, but that's not the issue here since we want to check on TRACE status), and responds 405:

* Server certificate:
*        subject: C=US; ST=California; L=Mountain View; O=Google Inc; CN=www.google.com
*        start date: 2013-02-20 13:34:56 GMT
*        expire date: 2013-06-07 19:43:27 GMT
*        subjectAltName: www.google.com matched
*        issuer: C=US; O=Google Inc; CN=Google Internet Authority
*        SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
> TRACE / HTTP/1.1
> User-Agent: curl/7.25.0 (x86_64-suse-linux-gnu) libcurl/7.25.0 OpenSSL/1.0.1c zlib/1.2.7 libidn/1.25 libssh2/1.4.0
> Host: www.google.com
> Accept: */*

< HTTP/1.1 405 Method Not Allowed


How to guard the CSRF token? In my previous question, John Wu advised me to use a per session  CSRF token, and told me to ask another question about guarding the CSRF Token.

How can I guard a CSRF token which is a per-session type one, so that it can not be stolen by an attacker?

There is little you can or need to do to guard the CSRF token. Perhaps there is more, but I can only think of four things:

Don't put it in a URL parameter where it will be logged in all sorts of places.
If you are only serving your site over HTTPS, mark any cookies involved as secure.
Invalidate the token both client side (via cookie settings) and server side so that old tokens can not be used.
Be careful with CORS so that you do not accidentally make something containing the token available from another origin.

And then there is the issue of XSS. If you are vulnerable to that, it could be used to steal the CSRF token, since it can not be HTTP-only. There is nothing you can do about this, other than making sure you are not vulnerable to XSS. Use CSP, sanitize your input with a good library, scan your site, etc, etc.

However, if you have XSS issues you have bigger problems than the CSRF token being stolen.


Windows firewall blocking of a dynamically generated .exe If I block application A.exe on my firewall, but it dynamically generates B.exe and runs it automatically. Would B.exe also be blocked on my firewall?

It depends on the methodology you choose to allow access. You may choose to allow access to applications you want to and create a "cleanup" or "block everything else rule" wherein besides what you've explicitly allowed everything else I'll be blocked. So in your case since you haven't allowed A.exe or B.exe they won't get network access. You can further lock this down using checksums (if your firewall permits). Meaning you can state allow Firefox.exe with checksum xxxxx to access port 80,443 outbound. I know Symantec Endpoint Protection has this feature. You may look this up on your firewall. This is useful since the malicious program may spawn a process with a whitelisted executable filename.


VPN, ISP & deep packet inspection If I use OpenVPN on port 443 (TCP or UDP), is it possible for my ISP with deep packet inspection to find out VPN usage?

If so, what is the alternative?

If your question is whether or not your ISP can tell that you're using OpenVPN rather than browsing an HTTPS website then the answer is yes. Even though both use the same port and TLS, the handshake process differs between HTTPS traffic and OpenVPN. This means that DPI is able to differentiate between an OpenVPN connection and that which is HTTPS.

Your options for circumventing this are either SOCKS proxies (preferred) or Tor (can be detected and blocked by some parties).

If your question is whether or not your ISP can decrypt your VPN connection once one has been established, then the answer is no. They cannot run DPI on an encrypted session without performing a MITM attack.


Adding to the query string via input I have a form that takes multiple input fields and makes an API request via GET.

The fields are not properly sanitizing input and I am able to add arbitrary parameters to the query string by submitting input such as test&color=red.

Instead of some sort of encoding, the resulting API query looks like api.com/search?field=search&color=red

I cannot think of any malicious use to this, as anybody could just hit this endpoint directly or use a proxy to bypass any client side validation.

If you were performing an application review, is this something that might be worth calling out?

No. Client-side validation can be useful for performance or UX reasons, but it is not a security feature and its lack has no security impact whatsoever. Indeed, client-side validation can provide a false sense of security, so purely from a security perspective, I prefer to not see it.

Now, if the server is not processing the requests correctly - if adding new or malformed parameters can cause unexpected behavior, edit content that isn't escaped correctly in the response, or otherwise potentially have a security impact - that's of course something I would call out. The attack vector and mitigation wouldn't have anything to do with that client-side form though; the repro steps would simply be a URL to paste into the address bar of the browser, or perhaps use tools like curl or Burp Suite.


How to grade / judge / evaluate a steganography approach? When it comes to evaluating a text steganographic approach, I think we have to consider these things:

How unlikely it is for someone to guess that there is a hidden message in the message being sent?
How large a hidden text can be stored in a cover text of fixed size (larger the better)?
How hard is it for someone to decode a message should it get suspected?

It is easy to quantify 2 and 3.

But how do I arrive at a quantitative way of measuring 1?

PS: Please assume it is a text-in-text steganography approach.

Are there any metrics for that?

Whether it's text in text or other kind of steganography, you don't care at all about your points 2 and 3. They are incidental factors.

The only thing you should be concerned about when talking steganography is point 1 "Is my steganographied content distinguishable from normal content". If we see the problem as an attacker, you have an infinite number of document to analyse, you know how to break a steganographied content (know the algorithm) but you do not have the time to test all this algorithm on all the documents. So you need to have a program that will analyse the content and output a (kind of) binary answer : "there is a message in there" or "there is no message in there". In the real life, you would rather get a statistic like over 95% certitude there is a message in the document.

There are countless article in the state of the art that describes stego-methods of analyse the resistance against different types of attacks (Andreas Westfeld F5 implementation, Jessica Fridrich et al. steganalysis of F5)

As you can read in the literature, the quantitative way of measuring this point is statistical analysis.


How to block the websites on client machines In our office we are blocking sites like Facebook, Twitter etc.The problem is that some of the users bypass our proxy and firewalls through external proxy sites like www.youhide.com or www.freezethefirewall.com.

Problem: There's an enormous number of proxy sites on the Internet.
Is there any method to really prevent access to the blocked websites?

We are currently using windows 2003 server and client machines with xp platforms.

The technical solution is to monitor access and block new offending sites as they appear.

This isn't a technical problem, it's a policy problem. You cannot possibly block every proxy out there, so you must stop the problem at its source - the employees. You need them to understand why you're blocking those sites, and why they should adhere to your policies.

First, you need to identify what your policy is, and have your employees sign a copy. An internet policy at a workplace can be really easy to create. Ours looks something like this:

  Whilst at work, we expect you to work. Your work will require access to the internet. We trust you to understand that, whilst browsing social networking sites all day is tempting, it's counter-productive. Furthermore, there are certain types of content and activity that are not appropriate for a work environment. As such, this policy aims to provide a basic set of guidelines around internet access at work.

  As part of this policy, we expect you to agree to the following terms:

  Your internet activity at work may be monitored and logged, in order to facilitate investigation of any inappropriate usage.
  You should use internet access for work purposes, with personal use (Facebook, Twitter, etc.) kept to a minimum.
  You must not abuse your privilege of internet access. This includes browsing pornography and other abhorrent materials, downloading files from file sharing networks, or any other activity that may cause damage or degradation to our network.
  Your activity on social media sites is your own, and we respect that. However, you agree that, as an employee, your behaviour reflects on the company. As such, you should avoid posting content that is likely to damage the reputation of the company.
  You must not distribute any of the company's intellectual property via the internet, in accordance with the non-disclosure agreement you signed when joining the company.
  You must adhere to the attached security policy.

  Breach of these terms is grounds for disciplinary action, or, in severe cases, dismissal.

  We provide the following guarantees:

  All logs will be safely stored in accordance with the Data Protection Act 1998.
  Upon termination of your work contract with the company, all logs related to internet activity on your account will be destroyed.
  We shall attempt to make access to the internet available at all times, at a reasonable speed.
  We shall make appropriate provisions to ensure that the network is secure and functional.

  In order to fulfil our guarantees, we need our employees to adhere to this policy in its entirety. Should you have any questions about this policy, please speak to your line manager.

  This document forms a binding contract with between you and the company.

  Name (print): __________________________________________________________
  Signature:    __________________________________________________________
  Date:         ____ / ____ / ________

The goal is to make it clear, short, and informative. Make sure they understand exactly why the policy is in place:

To make sure people are actually doing the work you pay them to do.
To help ensure that that network security is maintained.
To make sure that the network access is fast for those who need it.

Once you've got a policy in place, you must enforce it. Penalise employees that violate the internet policy, and fire those who do it repeatedly.


Why users want to disable cookies? I just started to create a new web application. In the documentation, it is written that I have to prepare for the situation where users have disabled cookies. This is not the first time I have read this condition. Can anyone explain me why users want to disable cookies in their browsers?

Cookies have, historically, been a source of numerous security and privacy concerns.

For example, tracker cookies can be used to identify which websites you've visited and what activities you've done on them:

Site A includes hidden iframe that points at a tracker service.
Tracker service issues a cookie that identifies you, and logs your visit.
Site B includes the same hidden iframe.
Tracker service recognises your cookie, and logs that visit too.
Site A and Site B pay the tracker to get information about what other sites their users visited.

This is just one application. There are other ways to use tracker cookies, some of which allow all sorts of nasty attacks such as identity theft.

Another problem is cookie-stealing, which can be used to hijack insecure (i.e. non-HTTPS) sessions. Using an exploit (e.g. XSS) a page might manage to post another site's cookies back to itself, allowing an attacker to steal your session ID. Turning off cookies prevents this.

Due to these problems, users often disable cookies or block them on certain sites for increased privacy and security.


How To decrypt a private key stored in PEM format file I manage a system that stores RSA private keys.
The user can insert the keys either encrypted or clear text (it's always PEM though). the user also insert a passphrase.

using the openSSL API (and not CLI), I have two questions:

is there an API that receives a PEM key and return if the key is encrypted
is there an API that receives an encrypted key (in PEM format) + passphrase and return the key unencrypted?

I was looking a lot in the examples and wikis, but didn't found what I need

Amigal

The function PEM_read_(bio_)PrivateKey reads an encrypted or unencrypted private key. I suppose PEM_write_PrivateKey writes it again.


Is encrypting a private key inside a pkcs12 file using openssl secure? This answer states that encrypting a private key using openssl rsa -aes256 isn't secure, because the md5 hash of the password is used as encryption key.
But what if I do openssl pkcs12 -export -in client.crt -inkey client.key -name client -out client.p12 -password pass:12345 instead? (Using a better password of course.)

Some.
openssl pkcs12 (export) by default encrypts the privatekey (in a PKCS8 'bag') using the scheme pbeWithSHAAnd3-KeyTripleDES-CBC defined in PKCS12 aka RFC7292 appendix C which uses 3-key TDEA aka 3DES (as it says) and the PBKDF defined in appendix B with SHA-1, 2048 iterations and 8-byte salt; this doesn't appear to have an official name so I just call it PKCS12PBKDF. This seems to be an unwritten convention; all other programs I know of that create PKCS12 also use this scheme, at least by default and sometimes unconditionally. In OpenSSL you can use -key_pbe to specify any (other) PKCS12 scheme (or any PKCS5v1 aka PBES1 scheme, but don't because they're all obsolete and broken) or the PKCS5v2 PBES2 scheme with any supported cipher (in CBC mode) but always with PBKDF2, SHA-1, 2048 iterations, and salt. Although PBKDF2 is technically different from PKCS12PBKDF, the differences don't matter to security AFAICS.
This fixes the most glaring flaw in OpenSSL's 'legacy' PEM-file encryption, that it uses only one iteration of MD5. (Using MD5 is not a problem in itself; although MD5 is badly broken for collision, that doesn't apply to a PBKDF. But since the letters MD5 now provoke irrational panic in checklisters, managers, and other fairy-dust believers, and we have better hashes available, we use them.) But 2048 iterations is not great; it was considered adequate when PKCS5v2 was published back in 2000 but hardware has improved a lot since then and nowadays 10s or 100s of thousands are usually preferred, and some go for millions or more. More importantly, hardware has changed to make raw computation more available in the form of GPUs, FPGAs, and even ASICs, so nowadays an iterated hash is no longer best practice; instead we want a 'memory-hard' function like scrypt or Argon2; see e.g.:
In 2018, what is the recommended hash to store passwords: bcrypt, scrypt, Argon2?
Are there more modern password hashing methods than bcrypt and scrypt?
Is bcrypt better than scrypt
Do any security experts recommend bcrypt for password storage?
How to securely hash passwords?
Why are salted hashes more secure for password storage?
How are SCrypt's memory-hard requirements substituted with more CPU?
Has scrypt been broken, finally?
https://crypto.stackexchange.com/questions/959/strength-of-multiple-hash-iterations
https://crypto.stackexchange.com/questions/12795/why-do-i-need-to-add-the-original-salt-to-each-hash-iteration-of-a-password
https://crypto.stackexchange.com/questions/3252/is-bcrypt-better-than-gnuppgs-iteratedsalted-hashing-method
https://stackoverflow.com/questions/3897434/password-security-sha1-sha256-or-sha512
If you want the most secure private key encryption in OpenSSL 1.1.0 up (these versions are now widespread though not everywhere) use openssl pkcs8 -topk8 -scrypt plus optionally -scrypt_[Nrp] $val if you want to customize although the defaults should be satisfactory. Note however this is not necessarily portable to anything other than OpenSSL. You can also use PKCS8 with PBES2/PBKDF2 but increase the iterations (an option not available for the pkcs12 command) with openssl pkcs8 -topk8 -v2 $symmcipher -iter $num; this is much more interoperable and probably secure enough (given a good password and a decent $symmcipher). (As I noted on a different answer to the Q you link.)


Can I create an application that can decrypt data but the administrator of the application cannot? I have a windows application with a configuration file that contains some database passwords. I'd like to encrypt this data in such a way that my application can decrypt the data, but that the administrator of my application (ops team who will need to start/stop the service etc) cannot. Is this possible?

This is possible to an extent, on Windows, using the Windows Data Protection API; more specifically the CryptProtectData function. This function allows you to encrypt data against a user profile or machine, so that only that entity may recover the data.

Your setup would look something like this:

A dedicated service user is configured for the application.
A helper application running as that service user encrypts credentials with CryptProtectData, with dwFlags set to 0, and stores it on disk or in the registry.
Application runs as the service user and decrypts credentials on startup, using CryptUnprotectData.
Create a group for application service users which is not also privileged in other ways (e.g. part of the Administrators group)
Use this technique to allow that group's users to start/stop the service.
Ensure that the group cannot write/modify the executable file, or any of the DLLs within the application directory, or otherwise cause an arbitrary executable to be run under the context of the application service user. This also means that they should not be able to modify the registry keys and values for the service under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.

It is important to note that, should the application administrators be able to modify the application binary, or run a program under the context of the application service user, they could simply call CryptUnprotectData and gain access to the credentials.

If you make these application administrators part of the full administrators group, you are giving them the keys to the kingdom - they can install and run whatever software they like at this point (including kernel-mode code) and will be able to bypass any control you implement. Don't do that if you want to maintain control.


Can a telephone call be traced back to my location? Basically the title, can a simple telephone call be traced back to my location like seen in the common movies, and if so, what are the ways to prevent this from happening?

Yes, there are many ways to find a cellphone in use, the most common and old is triangulation (measuring distance from at least 3 cell towers) as you were pointed out in the comments, this is done obviously by the service provider.

One way to prevent this would be to block all signals (antennae) by putting the cellphone inside a Faraday Cage like a microwave (Talking about movies, Snowden 2016 he did it while they were interviewing him), but this would render useless the phone, unless it's a smartphone you can still use it like as if it were in "Airplane mode".

Then there's also Satellite Navigation antennae (GPS-US, Glonass-Russia, Galileo-EU and BeiDou-2-China). Most smartphones have GPS and Glonass, but still these are antenae that work on 1.2 - 1.6 GHz


SFTP or FTPS for connecting to a VPS? I'm going to be hosting one of my websites on a VPS soon and I want to make it as secure as possible. Only I will need access to the VPS, and I can't see that changing in the near future. Because it is an eCommerce website, I will be purchasing an SSL certificate anyway, and I'll also have SSH access, so I'm not sure which is better.

I've heard that SFTP is favored by most people and that it doesn't need as many ports open as FTPS, but are there any other factors to consider?

Also, I've heard that SFTP offers  another form of authentication besides a username and password, but because I'm new to all this I'm not quite sure. Could someone explain this?

The nice part of SFTP is that it's incorporated within SSH. Which means that you needn't install additional software. Security-wise, I'd say they are equally secure. There are however a few pros and cons:

FTPS

Pros:

Widely known and used
The communication can be read and understood by humans
Provides services for server-to-server file transfer
SSL/TLS has good authentication mechanisms (X.509 certificate
features)
FTP and SSL/TLS support is built into many Internet communication
frameworks

Cons:

Doesn't have a uniform directory listing format
Requires a secondary DATA channel, which makes it hard to use behind
the firewalls
Doesn't define a standard for file name character sets (encodings)
Not all FTP servers support SSL/TLS
Doesn't have a standard way to get and change file and directory
attributes

SFTP

Pros:

Has good standards background that strictly defines most (if not all)
aspects of operations
Has only one connection (no need for DATA connection)
The connection is always secured
The directory listing is uniform and machine-readable
The protocol includes operations for permission and attribute
manipulation, file locking, and more functionality

Cons:

The communication is binary and can't be logged "as is" for human
reading
SSH keys are harder to manage and validate
The standards define certain things as optional or recommended, which
leads to certain compatibility problems between different software
titles from different vendors
No server-to-server copy and recursive directory removal operations
No built-in SSH/SFTP support in VCL and .NET frameworks


How safe is XOR with multiple preprinted stainless steel key tags purchased from different channel? This is related to https://crypto.stackexchange.com/questions/48622/how-safe-is-xor-with-multiple-independent-but-non-random-keys but not exactly the same question.
Let's say there are three different vendors in the market, they sell a product called preprinted key tag. A preprinted key tag is a stainless steel card engraving with a barcode encoding a 256 bits random number. It is solid, waterproof, and fireproof, safe to store for a long time. In other words, a preprinted key tag is a random number in cold storage.
I don't trust the vendors, they might secretly keep a copy of those random numbers they sell.
I don't trust the independence of the vendors, they might collude together.
I don't trust any retail seller, they might secretly steal the information before they sell the preprinted key to me.
I don't trust any delivery company, they might secretly steal the information before they pass the preprinted key to me.
The only guarantee is, those random numbers printed on the stainless steel cards are as random as from any modern crypto-secure random number generator, no matter from which vendor.
Now, here is what I am going to do:

Buy my first preprinted key tag from Vendor A via online shopping.
Buy my second preprinted key tag from Vendor B via a local retailer.
Travel to another country, buy my third preprinted key tag from Vendor C via a retailer in that country, and come back to my country.

Finally, XOR the above three 256 bit numbers from these three tags to create a private key. Then lock those three preprinted key tags in a vault. In case someday I forgot the private key I can recover it from the three tags in my vault.
Assume the last step is safe, in other words, assume my vault is safe.
My question is: how safe is the private key created in this way?

Have you considered generating your own high-entropy key input BitBabbler and marking the stainless steel yourself mechanically, or with an electro-chemical process:

https://toolsspecialist.com/how-to-etch-metal-with-vinegar/ a straight-forward process with vinegar, salt, and 9-volts
an arguably better result in brass TechShopJim instructable
... spare a thought for ventilation, and disposal of larger amounts of etching fluids

Edit: then I got to thinking, how hard should it be?

that drill is the smallest I own, 1mm (~0.04") .. I'll be impressed if it lets me knock out hundreds of holes, but I'm going into mild steel, so, anyway!
the thing holding it is called a pin vise
you would actually need "fair" dice (don't use the ones you stole from the casino)
... and say I had two, I'd roll 50 times to get to 256 bit, ie. log₂(6^2)x50, but personally, I'd stop sooner - needing enough energy to boil an ocean is sufficient enough of a barrier for me!


Are there any web services which use any other form of authentication, than passwords? Out of curiosity and interest I was wondering if anyone had come across any web based services which offer users other forms of authentication, other than the standard password or PIN? Or if authentication on the web can even reach beyond these methods?

Some ways of authentication that you haven't mentioned: third party (login with Facebook, Google) authentication, 2 factor authentication (text message, call to your phone, challenge-response token)


Are backups really secure? In many places a common practice is to connect in a backup drive at the end of the day and let the computer do an automatic backup in case of an emergency. I have been doing that for the past 2 years until the day I needed to use one came, my computer was infected with malware but as I booted up in linux and inserted my drive I found out that the entire drive was also infected because the previous day I had connected the drive to get a backup while I didn't know a virus was in the system.

What are the common practices to take backups regularly without fear that the previous ones might get destroyed by something in the system?

You can find many examples of backup rotation schemes, like here:

http://www.backupassist.com/education/bsg2.html

We keep (at work) backups for the last 30 days, but that wouldn't solve this problem. It could well be that we are infected for two months without noticing it. In that case: remove by hand or reinstall.

When you use VMs like Amazon EC2, you can use snapshots. For your server or desktop OS, you can make a snapshot or image (disk image on tape or harddisk) of the installation right after initial setup, and right after all configuration is done, but without data. Later you can go back to that image. I use this method for creating vms for local development and testing machines.

You need to test backups on a regular basis. Do they still work? Do they still backup what is needed? Has the situation changed with new servers or data drives so you need to add or remove them from the backup scheme? And have you ever tested if you can restore a backup successfully? That takes time and effort, and you may postpone that, but you need it you better have a good procedure.

Another tip is to use two different backup methods, like one with tape, another in the cloud or using another backup program. For my laptop I use Time Machine and Crashplan.

None of these tips can make it so that nothing ever will be lost.

Sometimes you (or a process) delete(s) a folder without noticing it, and years later you need something in it, and it is simply gone. Once I deleted a mail account in my mail app, not realizing that this deleted sent mails. It tooks several years before I found out, and it was lost. I've had several times that I deleted something on my laptop that I needed later, and sometimes the backups saved me, but not always.

On my desktop I use Crashplan, which can backup everything and can save different versions of documents. But do realize that such a service can go bankrupt and then your backups are lost. You can use this program for local backups, but it seems to be that local restores won't work when CP is offline. So when they go bankrupt the local backups are gone too! Still it's a great service I think.


Do obscure image URLs prevent image harvesting? On a Web site which requires user login, and all content is viewable by any registered user, is there any point in making obscure image URLs like "1mh9cr2m78234bc23-32xy4723nxy12.jpg" to protect the content from automated harvesting?

Or is this wasted effort because whoever wants to get the content will just write a spider that fakes a login and crawls the entire site, and you may just as well name your images 1.jpg, 2.jpg, ...

Most automatic crawlers don't have time to comply with the registration procedures of all Web sites. If the picture names are not "guessable" then they won't be harvested by crawlers which scan "the whole Web". However, of course, any registered user who can see the pictures will be able to slurp all of them (and not only images, all the Web pages as well). The well-known opensource tool GNU Wget has command-line flags for recursive exploration of Web pages.

Note that the server can know, by construction, who is making each request (that's what it means that a user is "logged in"). You can then implement restrictive rules such as "no more than 10 pictures per user and per minute" or similar constraints. With such rules, a user bent on downloading all your files will have to create many fake accounts, register them all, and use them more or less in parallel. You can also filter on source IP address (if too many requests come from a single IP address in a short time, ban that address temporarily).

All these deterrents are just that: ways to make the task slower and harder for attackers (if we call people who want the pictures "attackers", which is subjective). Motivated attackers will obtain them nonetheless.

Generally speaking, when you publish a piece of data, then it becomes "public" and you cannot really control where it goes. This is the dilemma of all media content providers: once the music file is out, it is out.


In cracking a password, does it help to have other easy passwords in the same file? I've got an embedded device (it's a wifi camera) that I've managed to login on. I copied the passwd file and started john the ripper. It's taking quite some time.

$ cat passwd
root:9so4MTVQCT0io:0:0:root:/root:/bin/sh

$ john passwd
Loaded 1 password hash (descrypt, traditional crypt(3) [DES 128/128 SSE2-16])
Press 'q' or Ctrl-C to abort, almost any other key for status
Warning: MaxLen = 13 is too large for the current hash type, reduced to 8

Since I have access to the system, and I can change the password, would it be helpful to john if I changed the password multiple times (copying the hash each time)? Picking passwords like, 'password', 'pass123', etc, might help john find the salt (?) and make it easier to know which salt to use for this one? Or am I misunderstanding the idea of salting passwords? (I get that ideally from a security standpoint, each password would be salted differently, but I'm not sure if this is. Is there a way to know?)

Any thoughts? Thanks!

P.S. I posted this in unix.stackexch but I think this is a better place, so please forgive (or correct) this cross post.

Since I have access to the system, and I can change the password,
  would it be helpful to john if I changed the password multiple times
  (copying the hash each time)?

No, that won't help, except insofar as the more weak password you try, the more likely John is to get one quickly.

  Picking passwords like, 'password', 'pass123', etc, might help john
  find the salt (?) and make it easier to know which salt to use for
  this one?

John knows the salt; it's encoded into the hashed password string.  See the description of Traditional Unix DES password hashes; basically the password you enter is truncated down to 56 bits, a 12 bit hash is generated, and the hash is used to "perturb the algorithm" as those 56 bits are used to generate a password hash.  Then the hashed password and the 12 bits of hash are concatenated and the resulting string is base64'd, resulting in the string 9so4MTVQCT0io you see above.

  Or am I misunderstanding the idea of salting passwords? (I get that
  ideally from a security standpoint, each password would be salted
  differently, but I'm not sure if this is. Is there a way to know?)

The idea of a salt is that if your password is "Alpha123", and my password is "Alpha123", the fact that the system generates a different salt for each user each time they enter a new password means that these same passwords will result in different password hashes.

In Unix password hashes, the salt is always stored alongside the password.  The traditional DES algorithm mashes the bits in before base64-encoding the hashed password, so it's not obvious.  Newer password hashes are formatted to store the algorithm used, the salt, and the hashed password all in separate parts of a string segregated by the $ character:

$6$S9WFQfN9$q/4hhcE3zCfQhY/5I1KLpuw4nc8mD.suhGV.QTvcT.qfauOGBFTeOJMyRn0XjjMYIYsdEYmvULUbNua0/oFdS/

In this case, '6' means the password is hashed with SHA-512 and S9WFQfN9 is the salt.


Trust companies for information storage? Most people have personal information on many sites such as Amazon or smaller sites. When we type create an account and add details like our address and the place where we work, it is never said how well this information will be stored and secured. Then how do we know we can trust a site to be secure ? What if everything was stored as plain text or what if they were to sell this information ? Is there a way to verify this without being a security expert ? Thanks.

it is never said how well this information will be stored and secured

It's untrue that you are not told about data protection promises from the provider (see privacy policy). Also, use/reuse of data is described (often in a fuzzy way) in the Terms & Conditions that we approve so quickly. Technical implementation of the security/storage systems (including encryption used) are rarely shared with end users, however most companies are cautious about making promises.

Ensure that the company that you trust has been through independent audits and has been certified to meet compliance standards. Depending upon the location, regulatory bodies have been known to act against deceptive practices.

Some studies do show that Data Protection guarantees are hard to enforce [EU] [US].

As an individual you have very little power for individual verification for most websites. The Australian Government has a simple 8 point list of what to look for before you trust an entity.


HTTPS client “pairing” I've been redirected here from SuperUser, I hope the question is appropriate.

I need to restrict usage of a certain site to a limited number of customers.

More than that, actually: I would like to allow access from a restricted number of physical devices (Win + Android).

This means I should generate "device locked" certificates.

What is the best way to generate and deploy such certificates?

Note that:

Solution should not be browser specific (if possible; IE, FFox and Chrome are minimum).
Browser should combine certificate with some hardware fingerprint before trying to use.
I do not care if certificate is invalidated by system upgrade (I am perfectly OK issuing a new one... and deleting the old).
Checking should be done "server-side".

A SuperUser comment says:

There is no binding of a certificate to a hardware.
If you want this you need to use certificates which
are integrated into the hardware and cannot be extracted
from there, i.e smartcards.

Smartcards are not a viable solution for me, but some kind of USB equivalent could be used, if necessary, provided devices are cheap enough (few USD/each).

Alternatively I could request browser to send some information and try to validate the Client for there (something akin to https://panopticlick.eff.org/ coupled with custom certificate). Would that work? If so: what would I need? Are there libs performing similar checks Server-Side?

I searched the suggested "Similar Questions" but I didn't find something resembling my problem.

What you need is HTTPS with mutual authentication (client authenticates server based on its trusted certificate store, and server authenticates client by requesting a client certificate).

You should put the key for the client certificate on a smart card or equivalent HSM so that it can't be stolen if the client machine is compromised - there is no other way around this. If your inability to use smart cards is because the clients don't have readers, there are USB readers available. There are even pendrive-shaped readers that take a mini smart card (the same form factor as a SIM card) so you can order your PKI cards in that form factor and the whole solution will look just like a flash drive.

Card readers work fine with most OSes including Windows, Mac, Linux, and even Android through a generic USB API (you'd have to make your custom app talk to the reader though, the OS doesn't provide a library for that).

You could use certificates in software but the key material will then be at risk of being stolen via malware, so a hardware solution is definitely more secure.

For BYOD devices, they may already be compromised and a hardware solution will not fully protect you from an attacker using the key maliciously while the HSM or card is inserted.


DIsk imaging on virtual environment Every forensics material you read, tell you to get an image of the disk and work with this image. However, it seems they always refer to a single computer.

What if the compromise is on a VMWare installation where there are multiple disks setting up LUNs and LUN groups? How should I get the image?

You shouldn't get the image, they are already there on your vmware repos. You need only investigate them.

It is best possible if you set up (or use a soon created) virtual machine. So:

stop the comporomised VMs
get away their disks
give them to your investigating/service VM
check everything from it.

Luns haven't anything with them to do, they are only part of the virtual SCSI emulation of the vmware. They doesn't really matter, what really matters are the disk images on your system.

There is also a possibility, if you need to investigate a whole vmware system. In this case, the things are a little bit complexer, although I don't think that a vmware server could be really corrupted.

In this case I handled the vmware physical disks as normal disks (so I copied an image from them), extracted the .vmdk images from them, and used them. So, the image creation has a two-stage process:

extract the vmware .vmdk disks from the vmware repos,
analyse their content.

Here can a little trouble come in the picture, and this is that vmware uses vmfs filesystem for the vmdk images. But this vmfs can be processed by tools freely downloaddable from vmware.com.


Android as GSM basestation Is that possible to turn an Android GSM into a basestation?
For example, if it can send and receive data then it can emulate that even if it's for an only device, if it was that simple there were no such a big need for other stations. And if you have a link or doc or something that would be great!

No it is not. The baseband itself runs its own custom firmware which is not available for modification by the Android OS. If you could modify the baseband firmware, it would be theoretically possible to do this. Note that this may be illegal in some jurisdictions.


Forgot BitLock password- can I use dictionary attack? I know that password has 10 possible words, but I don't know in which order. Can I write a simple bot and try to brute force the password that way? Is there some lockout time on BitLock?

If you have a TPM enabled, it contains a part of your key that's really difficult to extract, if I'm not mistaken. You can only bruteforce the part of the key that's derived from your password, which is not enough to decrypt your data.

The TPM will not enable the decryption if it detects that the system it's booting has been tampered with. So, no bruteforce bot.

Without lots of money and efforts, I would say that you'll have to try manually. But take all of this with a grain of salt, as I've never used BitLocker or a TPM, and don't know much about them.


Response to unauthorized scan by legit company? On Christmas day, our web service came under an apparent attack and we responded by blocking the (single) source IP. Upon later investigation, it turns out the 'attack' was actually an intense vulnerability scan by a reputable company. It appears one of our hosting customers had requested it, but we don't know for sure.

The scan started with a request for what I assume to be a verification file (e.g. 38fsoif3n4.html) which did not exist. Unfortunately, our custom 404 page was temporarily misconfigured and returned an HTTP response code of 200 instead of 404. Presumably the bot checked for the verification file, was satisfied with a 200 response, and continued with the scan.

This version of events was pieced together from our log files and seems to make sense. The problem is, the company in question refuses to discuss the issue with us. In their first (and only) response to my questions, they acknowledged a scan took place and offered to pass our contact info along to the party that requested the scan.

Is this an acceptable response? I followed up and requested that since they had scanned our servers without our knowledge or consent - and presumably provided a report to a 3rd party - they should at least give us a copy of that report.

I also asked that they make their verification a bit more robust. They should, at the very least, inspect the contents of their verification file, rather than rely on a single HTTP 200 response. This was a fairly intrusive scan, with thousands of form submissions and SQL injection attempts over a short period of time. With that kind of impact, they should probably also verify via root domain email (e.g. postmaster@domain.com).

They have not responded at all to these (reasonable, I think) requests. For a security company, they've displayed a surprisingly lax approach to verification and may have revealed a vulnerability to a competitor or hacker.

How should I proceed? Legally? Executive Email Carpet-bomb? Public Shaming?

EDIT to clarify

We're not that concerned about our customer and would not pursue them legally. We provide a site-builder/CMS for non-technical users and host their sites in subdirectories. They can upload whitelisted files (no code) and enter text & html (client-side JS is OK, if they want). They would have no need to pen-test their own code, since they have none.

Our concern is the security company that scanned our server without permission, presumably gave the results of that scan to a 3rd party, and now will not even talk to us about it. I'd love to just let it go ("eh, big companies, whatta ya gonna do?"), but it seems irresponsible to just ignore it.

Just looking for any leverage, short of lawyering-up, to get the company to respond.

Whether you could pursue legal action depends on the contract and terms of service you have established, however that's probably not the right way to go as it will cost you money and lose you at least one customer. You might also discourage your customers from having penetration testing done, which would be a bad thing.

I would recommend educating all your clients as to the right way to go about having pentests done. Inform them you wholeheartedly support security testing, but that it can impact all customers if it is not done right so they should contact you to discuss scope and timings.


Resources/materials for implementing secure web services? I'm implementing a REST-style (note: it needs to be more pragmatic than canonical) web API and I would like to secure it. The language I'm using is rather fresh and doesn't have a lot of high quality pre-made security modules like, for example, Rails' Devise, and thus I have to roll my own. I also think this is a very good learning opportunity, so why not.

The basic scenarios I need to have working are:

secure login through the web
login for mobile users using the same API
ACLs based on who the user is

Having never implemented any of the above by hand, I don't quite know the best practices. I've unfortunately been unable to find any good resources that would have tutorials/guides on how some of these basics form of web security are implemented.

For example, what is a good example of cookie-based authentication, what do you store in the token that's left on the user's browser etc etc. I've failed to uncover anything solid through Google, surprising given that it must be one of the most common implementations for most websites.

Advice?

Thank you!

Most of the OWASP top 10 still applies to web services.  A more detailed resource would be the Mozilla WebAppSec Guide.

"RESTful" web services should not have a "session token".  Related:  "Do sessions really violate RESTfulness?"  However at the end of the day you need a some kind of token for authentication purposes.

In short,  if you are writing a session handler to solve a real world problem you are doing it wrong.  The last thing we need is yet another reinvention of the wheel.  If you are writing a session handler for the purposes of education,  then that is a great learning tool!  The Mozilla WebAppSec Guide and the OWASP Session Management Cheat Sheet have detailed requirements for a secure session handler.


John the Ripper - Calculating brute force time to crack password I'm using incremental mode (brute force) mode in John the Ripper to crack Linux MD5 passwords. I'm trying to calculate the time it will take to run through all combinations of 12 passwords (with 12 different salts for each password).

Using a 95 character count and a max length of 6 characters, there are 735,091,890,625
combinations (95^6).

Since each password is salted that puts us at (735,091,890,625 x 12) 8,821,102,687,500 hashing calculations.

When I run John the Ripper it's usually running at 1133p/s 14273c/s 14273C/s.

So...8,821,102,687,500 / 14273 =   618,027,232.36 seconds

51,502,269.36 / 60 =   10,300,453.87 minutes

858,371.16 / 60 =  171,674.23 hours

14,306.19 / 24 =  7,153.09 days

I realize there's always the possibility that a password will be cracked early. However, have I calculated that correctly? It will take  7,153.09 days (at the very maximum) to run through all combinations?

Your actual calculations seem solid after your edit with fixes.

However, now I'm going to handwave the math in seconds to demonstrate exponential speed increases which render fractions of days trivial.  Besides, a reboot or two would mess that up regardless, not to mention actually using the machine for other things, regular patching, power outages, normal speed variance as other processes run, etc.

Your expected time depends on your assumptions.  If you assume you're going to start this exact computer running on all twelve passwords and this version of JtR, and simply leave it there for a couple decades, then yes, that's about right.

If, however, we use House's corollary to Moore's law, i.e. aggregate computing power doubles every 18 months (with password hash cracking being embarrassingly parallel, this is reasonable enough to start with), then we realize that if you just wait 1.5 years, then you'd crack twice as fast, so you'd be done in about one decade instead of about two.

More advanced: You use this machine for 6 years, and are more or less 6/20ths of the way through.  You then quit using your old setup, and buy a new setup that's roughly 16 times faster for a more or less reasonable price, and the remaining 14/20ths are done in 1/4th the time, i.e. 14/16=just under a year + 6 years waiting = just under 7 years.

Numbers change with money, of course.

For extra credit, have or buy a good GPU and start using GPU based tools sooner, such as oclHashcat, which should give you dramatically better speeds.


Is it safe to publish some internal IP of my company? Sometimes when asking networking questions on StackExchange I want to publish some output where several internal IP adresses from my company appear (output of traceroute command for example).

Since I know it is easy to link my StackExchange account to the company I work for, I was wondering if those IP adresses could be used by attackers to infiltrate my company's network.

A solution is to hide these IP adresses by replacing the numbers with 'x' or '*', but when I have a lot of them it is annoying, so if it isn't necessary I'd be glad not doing it :)

It is (mostly) safe, depending on your organization.

IP addresses are not technically meant to be hidden. Security through obscurity is hammered into any security-minded individual as the one true evil. Technically, any IP address on your network can be discovered fairly easily by anyone determined enough to find it.

From a security standpoint, assume that every server on your network is known. Though try convincing your company's security team that is a different story. Ergo, your company policies may be a completely different matter.

The one thing I can see being a problem is revealing your network structure to potential outside attacks. Let's say you worked at Valve on this brand new game called Half-Life 2. You posted a question about access issues with your source code repository, and forgot to obfuscate it. Then someone doing a targeted attack against Valve may be able to access this repository from a compromised system. If you're unlucky, there's no authentication required to access the full source code.

Of course any attacker capable of compromising the system in the first place can very well figure out the repo on his own. In most situations, attackers will be able to figure this stuff out by the time they have any sort of intranet access to your network.


What is the most secure way to access clients' VPNs? I'm looking to provide our clients with a secure way we can connect to their VPN when performing software services.

The issue is security. We want to make them feel at ease that we are connecting to their systems in the most secure way possible. I was thinking of connecting to the VPN from a VM and try to lock down the VM so the host system doesn't affect the VM/VPN if the host gets a virus or is hacked.

Any suggestions on how to most securely connect to VPN or ways to convince clients that just using VPN in general is the most secure you are going to get.

Software Vendors with privileged network access are increasingly used by hackers to gain access to sensitive networks. A good example of how a of how a software vendor with VPN access can lead to a massive data-breach is the 2013 Target hack.

The point of a VPN is to segregate access. A Virtual Machine can also be used to segregates access, however if the host machine is compromised, then all of the tenant VMs are also boned. Simply saying that you use a VM doesn't automatically give you a separation of trust - this is just security theater.

Consider the following measures to improve  security posture:

Use a dedicated machine for accessing this senstive network.
Have a trained professional conduct regular internal-network security assessments of the protected
network and all adjacent networks.
Ensure trusted machines are regularly updated, and have endpoint
security measures in place.


Does Integrity assures protection from unauthorized read, without any modification? I'm not quite sure if I understood integrity deep enough.

Let's suppose that Alice and Bob are using a public-key algorithm and using signatures to assure their data integrity. A hacker was able to get their private keys, and is eavesdropping on their channel. The hacker is doing the following:

Receive the message sent from Alice to Bob.
Decipher it (he has Bob's private key).
Read the message.
Recipher it and rehash it (only the parts from the message which should be hashed. e.g the header).
Resend it to Bob.

Let's exclude the point that Bob would receive the message twice, let's suppose that the hacker has the possibility to remove the original message from Alice after that he received it.

Would Bob be able to detect that someone else did read this message? If so, how?

A signature scheme can only then assure integrity, if the signing keys are kept secret.

Here's a definition for integrity: Data remain in their given state if at rest.

Side notes: Integrity is lost, when data is edited. If they are edited by someone that is authorized to change them, integrity is still lost. If a scheme is in place, to authorize systems or people to change data, it can be shown, who modified them. It does not (typically) include if data has been read.