Browser setups to stay safe from malware and unwanted stuff I have to set up a browser to surf the internet. I'm trying to stay safe from malware as much as possible. (I already know that there's no way to stay 100% safe.)
My idea is to use Firefox with these extensions: Adblock Plus, uBlock Origin, HTTPS Everywhere, and particularly NoScript Security Suite. I also thought about clearing the cache when Firefox is closed.
But since I'm not an expert, I searched for recommendations on the internet. I found this Security.SE that says:

disabling JS should not be considered a silver bullet for browser
security

Take into consideration that NoScript will also increase the attack
surface

Before reading it, I was pretty sure that No Script would have been enough to make browser very very safe.
But now I'm wondering if there are safer ways to secure the browser, and I have these questions:

Is my idea good? If so, what can I improve?

Should I use Chrome instead of Firefox? I read Is Chrome more secure?  which is why I'm asking.

Are the extensions that I mention above good? I know that both Adblock Plus and uBlock Origin block more or less same ads, but I prefer to keep both. Browser performance is not a problem.

Is there any other extension that I should install?

Is there some other browser setting that I should enable/disable? (such as the  option to clear cache when Firefox is closed)

I already know basic rules, such as update browser and OS, don't open unsafe link etc etc. I would like to know advanced tips.
I know that it also depends on the operating system and other stuff, but in this topic i would like to talk about the browser
PS: I know that instead of NoScript I could just disable all scripts with the browser settings, but I like the way I can allow a script in a site because some sites don't without a specific script.

First of all, good job on choosing Firefox and the right plugins, it's really the browser to go privacywise.
To extend upon the points that nobody mentioned yet, an important part of you hardening your browser would be the configuration of your Firefox browser! You can do that by typing about:config into the address bar and accepting the risks. Then you search for the specific string I specify in this answer. I will draw a line where the security completely destroys functionality (judging from my experience, since I myself use this setup).
First off, you're better off disabling WebGL: Motivation
webgl.disabled = true
Disabling WebRTC will prevent from getting your IP leaked behind VPNs (yes, NoScript SHOULD protect you but you can never be too safe):
    media.peerconnection.turn.disable = true
    media.peerconnection.use_document_iceservers = false
    media.peerconnection.video.enabled = false
    media.peerconnection.identity.timeout = 1

You're better off disabling third-party cookies:
network.cookie.cookieBehavior = 1 (Only accept from the originating site (block third-party cookies))
Never store extra information about a session: contents of forms, scrollbar positions, cookies, and POST data:
browser.sessionstore.privacy_level = 2
Activate integrated privacy measures:
privacy.firstparty.isolate = true
privacy.resistFingerprinting = true
privacy.trackingprotection.fingerprinting.enabled = true
privacy.trackingprotection.cryptomining.enabled = true (disables cryptomining on piratebay)
browser.send_pings = false
browser.sessionstore.max_tabs_undo = 0 (Firefox doesn't remember your recent closed tabs anymore)
browser.urlbar.speculativeConnect.enabled = false (disable preloading of autocomplete URLs)
media.navigator.enabled = false

This enables the integrated privacy guard (uses mostly Disconnect.me filters, also breaks Captchas, but you can disable it for certain sites, since it will be like 1% of your total surfing):
privacy.trackingprotection.enabled = true
Disable the DOM Clipboard Event:
dom.event.clipboardevents.enabled = false
Protect yourself against punycode phishing attacks:
network.IDN_show_punycode = true
Disable WebAssembly:
javascript.options.wasm = false
In the normal browser settings you can also disable Pocket, erase history, cache, cookies upon exiting Firefox. That should be more than enough.

DANGER ZONE

disables playback of DRM-controlled HTML5 content, which, if enabled, automatically downloads the Widevine Content Decryption Module provided by Google Inc. This will break Netflix et al.!

media.eme.enabled = false
media.gmp-widevinecdm.enabled = false

Send Referer only when the full hostnames match:

network.http.referer.XOriginPolicy = 2

Only send scheme, host, and port in Referer:

network.http.referer.XOriginTrimmingPolicy = 2
If you're near-paranoid you can even disable Referer:
network.http.sendRefererHeader = 0
If you need even more privacy check this out.
You can also blacklist hosts if you haven't already so other apps don't have such a huge attack surface.
There is also a plugin called LibreJS which blocks proprietary, non-trivial and obfuscated JavaScript code.
Also setting the locale to en-US in your browser is a good approach to privacy.


How do enterprises deal with SSO and Google backing up WiFi credentials? Single Sign On in a company means that you have one set of credentials for all the services the company uses / provides to their employees.

Logically, these credentials might also be usable for Wifi.

Benefits for the employee: Only one password to remember
Benefits for the company: Wifi access can be revoked on a per-user basis. Administration is centralized.

Are there real-world examples and guidelines how to deal with the fact that Android smartphones store Wifi passwords on Google servers by default? Doesn't this give Google access to the full digital identity of an employee and access to the company's internal services?

Asking users to turn this feature off on their phones seems to be error-prone and might be forgotten. Especially after a smartphone change.
Prohibiting users to log in the company Wifi from their own devices is impractical and will probably even be ignored.
Only company-managed phones are also no option, because of point 2.

Is SSO a bad idea concerning Wifi? How do large enterprises, universities, ... but also small companies with less "enforceable" rules handle this?

Single Sign On in a company means that you have one set of credentials for all the services the company uses

That is not correct.
Single signon means an employee only has to sign on once, with a single identity provider or authentication service. That signon creates an SSO session, along with a token or artifact. Other services and web sites can use the token/artifact to verify the identity of the user. They are able to do this only because they trust the single signon provider.
This mechanism does NOT mean that the user has the same credentials for all the services. In fact it is designed to avoid that scenario, because it is a very problematic practice.

Logically, these credentials might also be usable for Wifi.

No. Again, you should not re-use credentials.
SSO for Wifi isn't really possible, because the Wifi connection is usually required in order to be able to access the SSO provider, creating a chicken-and-the-egg scenario. You need to establish a network connection first.
It's possible you've seen situations that looked like an SSO for Wifi, but it was probably more of a captive portal situation, where the Wifi itself is open to the public but the wireless access point restricts the ability to access the network until you authenticate with one of its pages.


Protection against account lockout DoS Any ideas on how to protect against the following scenario?

Company x uses active directory for authentication of it's employees.  The company has multiple authentication points that are semi-public and some that are fully public. (e.g., Extranet accessible from the Internet)

Usernames are pretty easy to guess, as they follow a standard naming convention, based on the name of the employee.

If Eve wanted to mount a DoS against Company X, and she has access to a large number of employee names, it would seem pretty trivial for her to lockout accounts of a lot of the employees of the company.

Any ideas on how to protect against this type of attack?

I understand that a variable length lockout could help, but it would still mean that employees are not logged in, working.

Thoughts?

There is a paper describing how to use Microsoft Lync (formerly Office Communications Server) to mitigate brute force attacks:

http://blogs.technet.com/b/drrez/archive/2010/05/26/protecting-the-edge-server-against-dos-and-password-brute-force-attacks-in-office-communications-server.aspx

snippets:

  "DoS attacks are indistinguishable from legitimate sign-in requests. The only differentiation is in the frequency of sign-in attempts and origin. A large number of sign-in attempts in rapid succession can be indicative of a DoS attack. DoS attacks attempt to guess the user's password to gain unauthorized access, and often result in locking out the user account if security policy is enabled in Active Directory."

  "By enforcing account lockout at the Edge Server, the security filter prevents DoS attacks at the edge of the network perimeter, and as a result, protects internal Office Communications Server resources"

Microsoft has another white paper titled:  Account Lockout Best Practices White Paper
search for "Protecting from External Account Lockout Denial of Service Attacks"

key snippets (copied verbatim):

  Protecting from External Account Lockout Denial of Service Attacks
  It is possible for a malicious user to launch a denial-of-service attack against your enterprise from outside of your network. Because most networks are interconnected, this can be a difficult attack to mitigate. The following techniques technologies are common techniques and technologies that you can use to help mitigate or prevent such attacks:

  •  Require complex passwords: All accounts should have a complex password. All administrator accounts (local and domain) should have a long, complex password and you should change the password regularly.

  •  Rename the administrator account: Because the administrator account cannot be locked out, it is recommended that you rename the account. Although this does not mitigate all of the attacks against the administrator account, it does help mitigate these attacks most of the time. For more information, see "HOW TO: Rename the Administrator and Guest Account in Windows 2000" on the Microsoft Knowledge Base|http://support.microsoft.com/?id=320053.

  •  Protect your environment with firewalls: To avoid an account lockout denial of service attack, block the TCP and UDP ports 135 through 139 and port 445 on your routers and firewalls. When you do this, you prevent logon attempts that occur outside of your network.

  •  Prevent anonymous access: Set the RestrictAnonymous value to 2 on all computers that are exposed to the internet and to the entire domain if all of the computers are running versions of Windows 2000 or later. This stops malicious users from making anonymous connections to resources and may help defeat some types of attacks. Note that some operating systems have limited support for computers that have this setting. Some programs may also have issues with this setting if the programs use an anonymous connection to gain access to resources. For more information, see "How to Use the RestrictAnonymous Registry Value in Windows 2000" on the Microsoft Knowledge Basehttp://support.microsoft.com/?id=246261.

  •  Protect site-to-site traffic by using a VPN tunnel: If communication between domain members in two sites is required, use a site-to-site VPN tunnel to securely connect site networks together. Do not open all NetBIOS ports on the firewall. You can use the Windows 2000 Server Routing and Remote Access service to create site-to-site VPN tunnels. If no VPN devices are available, you should configure the edge firewall or router filters to limit the traffic that is permitted to flow between the Internet Protocol (IP) address ranges that are used by each site. If sites need to use Active Directory replication only across the Internet, then use Internet Protocol security (IPSec) transport mode through the firewalls to secure all traffic between Active Directory servers. For more information about Active Directory replication through firewalls, see the "Active Directory Replication over Firewalls" white paper on the Microsoft Web site|http://www.microsoft.com/serviceproviders/columns/config_ipsec_p63623.asp.

  •  Protecting authentication and NetBIOS ports from Internet attack: On either the firewall or the router that connects your internal network to the Internet, block access to TCP and UDP ports 135 through 139 and port 445. If no edge filtering device is available, you can use IPSec filters to block these ports. To do this, use the configuration that is described in "How to Block Specific Network Protocols and Ports by Using IPSec" on the Microsoft Knowledge Base|http://support.microsoft.com/?id=813878.

  •  In the same IPSec policy, you must create an additional rule that adds filters to permit traffic to these ports when the source address is in a subnet that is used by the internal network. To do this, use the configuration that is described in "How to Block Specific Network Protocols and Ports by Using IPSec" on the Microsoft Knowledge Base|http://support.microsoft.com/?id=813878.

  •  Protecting authentication and NetBIOS ports from internal attack: If you must protect access to both authentication and NetBIOS ports from internal malicious users, you can restrict the computers that are permitted to gain access to these ports to only domain member computers by using the feature in IPSec that allows you to negotiate security. By allowing only trusted computers (domain member computers) to gain access to both authentication and NetBIOS ports, you reduce the number of computers that can perform the attack. This extra protection provides a defense against any breaches in your security perimeter and against malicious users who can connect to the internal network. For information about how to create a custom IPSec policy to use Kerberos authentication when negotiating IPSec security for access to TCP and UDP ports 135 through 139 and port 445 see the "Step-by-Step Guide to Internet Protocol Security (IPSec)" on the Microsoft Web site|http://www.microsoft.com/windows2000/techinfo/planning/security/ipsecsteps.asp.

  •  Update the server: Keep all of your servers up-to-date with current versions of antivirus software, firewall software, and Windows security patches. This helps prevent trojan horse programs and viruses from attacking your resources if the malicious user can launch an attack from your internal network instead of from the Internet. These updates are an important part of an in-depth and defensive security strategy.


Should root certificates have OCSP or CRL for it? Should root certificates have OCSP or CRL for its own revocation status?
So here is what I mean:
Intermediate Cert -> http://example.com/root.crl
SAN Cert -> https://example.com/intermediate.crl

But should you create a crl database for root?
Root Cert -> http://example.com/root.crl

Like the above?

No, root CA never includes CDP and AIA extensions in their CA certificate, because it provides zero value. Most revocation checking tools skip root CA certificate checking, because root CA revocation is an undefined operation.


How to detect malicious files or web shell on a vps web server How is it possible to detect malicious files or web shell on a vps web server?

I used to use a shared hosting, and when I tried to upload any malicious code for testing it got deleted automatically. Now I'm on my own vps and I want to increase its security. Is there any tool that can help me do this?

Conceptually yes, you can do this. You need to use on an Anti-Virus tool to scan the file system for you, like ClamAV.


Utility to build IP exclusion list? Are there any utilities out there that can assist in building an IP exclusion list?

Scenario: Recently suffered a brute force attack where 50000 failed login attempts came from a multitude of different IP addresses.

Question: Is there a utility out there that can take a list of IP addresses and help build an IP exclusion list. IE... Take commonalities from the IP list, and build an IP range to block?

Disclaimer: Security is not my background. I come from a programming background, and have worked with computers for 20+ years, but never with a primary focus on security. So I apologize in advanced if my question is not up to snuff with security professionals out there.

You have a unique requirement. But your basis may be off.

I'll use an incident I ran into this week as an example. I discovered an attack from 50 IP addresses from a block of IPs managed by a hosting company in Hong Kong. It would make sense, then, to block all IPs from this hosting company, at least temporarily. I believe this is similar to the scenario that you have in mind.

To accomplish this, you would have to run a whois on the IPs, link them to a common holder, and populate your list with the block of IPs. Programatically, this is trivial if the use case is as I defined.

But what if the owner of the IP block is AWS? Do you block all of AWS? For some sites, this might be a valid thing to do. Then what if the attacker detects the block (it's a common feature in botnets) and they switch to another hosting site; do you add this new block to the list? Project this process into the future where now you are blocking all major hosting providers and even a few ISPs (if the botnets switched to personal computers and your script added Comcast IP blocks). You have now DoS'ed your own service.

The problem, then, is not the process of adding IP blocks, but the problem is not adding too much.

The typical way security pros address this problem is to block each IP individually. Fail2ban is a common utility to do this.

Or, if you know that certain countries are not normally using your service, then you can use geo-IP databases and only allow (or block) certain countries.


Find encryption key with password and output One of applications I use has a password manager feature included in it. I can add logins to the password manager and they get stored in a .ini file (for simpler login purpose, I can select an account to log in with without typing username and password). I'd like to know if it is possible to find the key used to encrypt a password when knowing the password and password output. Looking at the .ini file, I can see that the password TEST returns LWa/oKXXFsaPqvG3C/BpDA== and the password 00000000000000000 returns CG/STksOscI5Ib4IectnbK3FYOSAHh+lPtSWMDceias=
I'm sure it is posible to extract the encrypt and decrypt functions from the executable file but I fear this is out of my capacities...
Thanks for your answers !

First, try several things to see if it is a simple cipher or something more difficult:

Does the same password always get encrypted to the same output?
What's the input-output size connection?
The output seems like Base64 encoding, so decode it and work on the bytes result instead.
Try encoding a long text and use frequency analysis on the decoded Base64 string, do you notice any patterns?
Try other ways to analyze the input-output and look for patterns.

If you don't see any patterns or anything, try finding what's the encryption algorithm. Usually good encryption algorithms like AES are pretty secure and you won't be able to break it. In this case, you could try searching for the key, is it hard-coded? Is it the same for all computers? Does it make a request to get the encryption key? There are many things that you can analyze before trying to break an encryption algorithm.
Additionally, check to see when the password manager is opened, how does it decrypt the encrypted passwords itself? There are many more questions that you need to find the answer to ...


Hashing large message for integrity I read about message integrity using hashing.

As I know, message integrity is hashing the message content and send to the recipient. If recipient got this message, do hashing again to compare with two hashing value.

I have one question about that.

May be file size is over 100 MB or something.

In my opinion, it may take too long.

So I would like to use some fields such as file size, and creation date in hashing. Is that possible or safe way for hashing?

How can I manage the hashing for large file size? May be file size is over 100 MB or something. In my opinion, it may take too long.

If you want to verify the integrity of a file you have to run over the full file. There is no way to skip any bits because exactly these might be affected by a change. Computing the hash over a file takes exactly one sequential run over the whole file and the algorithms are designed to be fast. You probably will not get it any faster.

  So I would like to use some fields such as file size, and creation date in hashing. Is that possible or safe way for hashing?

No its not. The contents of the file can be changed without affecting size and creation date. Apart from that the creation date is not a property of the file but a property of the storage, i.e. it can be changed without even affecting the file contents. This means with this proposal a matching hash does not proof integrity nor a hash mismatch shows loss of integrity.


What does Windows's built-in encryption do, if I can seemingly always read my encrypted files? I'm playing around with certificates and encryption on a Windows system, but either it isn't working or I don't know how it should works.

When I encrypt a file its name changes to green. But then, I can open it without any prompt or something. I thought "well... I'm logged with the same user that encrypted the file, let's transfer it to the phone", and so I did, and I can open the file without any problem on the phone as well.

Why?

Windows built-in encryption is done transparently at the filesystem level. The encryption key is stored in your account profile encrypted with your login password (this is why there's the warning when you change your password). So logging in unlocks the key, which then makes your encrypted files available.

Since the encryption and decryption is done transparently by NTFS, you don't ever actually see the ciphertext. If NTFS doesn't have the decryption key, it simply won't let you read the file. You can get to the ciphertext by reading the partition data raw, but there's no real advantage to doing that. The file can only be decrypted using the key I mentioned, which you never actually see.

Windows lets you back up your encryption key, where you export the key encrypted with another chosen password. This is useful if you ever put the disk into a different computer or reinstall Windows. But not really useful otherwise.

Since the encryption is tied to the filesystem, it's not designed for sharing encrypted data. Instead, you're protecting the files where they sit against anyone else who gets their hands on your computer.

If you want to create an encrypted container for transferring files to someone else, I'd recommend a compression tool that supports strong encryption. 7-zip is a great choice.


Snort Sensor Placement I have a snort sensor monitoring some of my network being fed from a mirrored port. This mirrored session only monitors traffic between the firewall and peering switch. Since this just sees traffic enter/exiting our network we miss a lot of internally routed traffic. What useful places on the inside of our network should I be looking at to place more snort sensors?

Sensor placement can be very tricky as there are loads of variables to consider. At minimum, you should take into account

Classification level of monitored resource
Network design
System throughput
Personnel time (for management and analysis)
Resource availability

Throwing all of those into a blender and turning on high for a few minutes will give you some nice data to start with for determining your deployment. Deployment planning is a multiphase process, and while they are not intrinsically separated, it is beneficial to remember that they are different parts of the same plan.
Data Collection and Planning
More likely than not, what you're going to want to do is construct a list of all of the systems that you want to monitor, then rate them based on importance or risk. That should give you a prioritization of what systems you really need to be watching now. In a perfect world, we would have a sensor monitoring the link connected to each and every system. However, that would be scary expensive, difficult to maintain, and noisy. Instead, talk to your network team and take a good hard look at your network design. Figure out on the network map where your prioritized systems live and figure out where the choke points are. Look at what hardware you have available to turn into sensors. In an awesome environment, you could have one big box with a few 10Gbps interfaces and do all of your monitoring for an entire enterprise using a single sensor. However, more likely, you're going to have a few surplus systems that used to be used by department secretaries and will need to spread the load.
Array Design and Deployment
Now is the time to think long and hard about what risk acceptance threshold is. How close to the sensitive data do you feel like you need to have a sensor, and how far away do you feel comfortable placing it? In some cases you may really need to monitor the switch port that a server is directly connected to. In other cases placing a single sensor on a building or floor uplink, and ignoring any intra-switch traffic, is sufficient. In another case you may feel as if mirroring a specific port is not good enough, and instead mirror an entire VLAN.
Workload and Other Considerations
As you're building our your sensor deployment strategy keep in mind that it can get very complicated. As you decide where to place your sensors, make sure to account for all of the other issues that arise. For every sensor you deploy there will be management overhead for an employee to actually maintain the system (apply patches, hardware replacement, etc), application management overhead (updating signatures, tweaking rulesets, making sure snortd stays running), and analyst time (interpreting the alerts and taking action). Depending on  your design, and how much time you're willing to front-load, these numbers can vary wildly. For example, using the right configuration management/automation tools, it's not that difficult to manage several dozen snort sensors using a fraction of an FTE.


How to make a good choice between Symmetric and Asymmetric Here and there and read a lot of articles and blog posts titled "Difference Between Symmetric Cryptography and Asymmetric Cryptography". But inside of them they are answered "What is Symmetric Cryptography? What is Asymmetric Cryptography?" only.

My question is:

In a war between Symmetric algorithms and Asymmetric algorithms for a project, which one is the winner? (Two algorithm with equal bits of security).

And yes, I know that it depends on the project conditions. The problem is that my colleague's interest to Asymmetric algorithms is an unfounded sense of mind only (Maybe because of the tremendous difference between key-length and calculation times).

So, I explain to different requirements in our project, and I hope you can convince us that which one is better for which case:

The project:

There are two entities. A customer and a Seller. Both have their own Smart Cards. Reading and Writing on Customer's card by the desktop application is allowed only if the Seller has his/hes smart card connected to that computer.

Ok, this is my requirement:

Requirement 1:

There must be a mechanism for Customer card to detect existence of Seller card. I have to option.

1- A Symmetric Key is loaded on both cards. They exchange two random challenges between each other and from the response, detect existence or absence of the other card.

2- Customer or Seller card has loaded with a their private keys that the related public keys are available inside the other card "Only". Each one generate a challenge inside and encrypt it with other entity public key and then sent it to other card. That card decrypt it with its own private key and re-encrypt it with public key of challenge sender and sent the result to it and ....

Requirement 2:

We need to have an encrypted communication between PC and Cards?

Please choose better choice for all cases:

Case1: Only Req1 is needed.

Case2: Only Req2 is needed.

Case3: Both Req1 and Req2 is needed.

Simply, I appreciate you if let me know their use cases. I mean which cases Asymmetric is better and which cases Symmetric is better?

As a side question, in view of can you please sort AES128, AES192, AES256, RSA1024, RSA2048, ECC160, ECC224, ECC256, ECC384 based on calculation time/speed and security strength? (A did a google search, and found this page comparing approximate strength)

Don't roll your own crypto.

But if you have to, read a proper book on crypto like Cryptography Engineering or Applied Cryptography.

Symmetric and asymmetric crypto are used for different things. It is very common they are used together.

Use asymmetric crypto (slow) to establish a symmetric crypto key (fast).


Is it a bad idea to bypass login wall for a specified IP address? I have a website that is available on the public internet. The website requires authenticated login before any of the content can be accessed.

I've been asked if I can remove the login wall for users on a single static IP (the organisation's office) to allow them to read the content. Login would still be required for any write operations.

This feels like a bad idea to me, but I'm struggling to come up with a concrete reason not to.

Auditing read access to the content isn't a concern for the client.

Ignoring the possibility that the IP address could change, are there any reasons why this is a bad idea? Are there any ways this could be exploited?

You don't have to worry about spoofing the IP from a different connection, because returned TCP packets would not make it to the attacker in that scenario.

So all you have to worry about is how easy it is for the attacker to make use of that IP:

Is that IP shared between multiple computers in the office?
Can that IP be used on WiFi? How well is the password kept when a visitor says 'can I use your WiFi'?
Are all the computers with access to that IP well secured, and have competent users?

If the IP is not well kept, then you should ask

In addition to IP, can you have a cookie stored on the single machine that is authorized?
(i.e. a limited-use Remember Me feature)

I commend your client for not using the Remember Password feature as is so tempting to do.

Also, how secure is your content?

What are the damages of the content being viewed by unauthorized persons?
What type of attackers would be attracted to your content?


Seeking lightweight encryption - shareable between Delphi & C I want to encrypt a text file in Delphi & decrypt it, line by line, in C on an embedded system which does not have much RAM (so, only one line in RAM at a time).

FOSS must be available for both Delphi & C; nothign too huge, preferably a single file for each. No messing about wth key files, the kay & salt will be hard coded into the applciatioon.

I am seeking "just good enough" "security through obscurity". Enough to deter a causual hacker. The actual embedded device will be behind a physical lock & key.

[Verdict] I will go with either TEA or AES (tbd). I will split the functionality into two parts: 1) decrypt into a plain text file, 2) parse that as an INI file and if I hit memory problems then change to a line_1=data_1, line_2=data_2 format.

Thanks for your help.

Symmetric-key encryption is very light weight,  I am not sure why memory/cpu this would be a concern, even on a cheap micro-controller.  Perhaps 30 years ago this was a worry,  but not in twenty-twelve.

I like AES-128 in CCM mode with a random IV.  If you don't know what that means, you probably shouldn't be implementing a crypto system. Encryption isn't some magic wand that protects you from attack,  a lot can go wrong.  Good cryptographers are hard to come by.


Is it possible to automate use of passphrase-encrypted private keys? Suppose I have a public/private keypair, which I would like to use to serve HTTPS from a webserver. The part I'm worried about is this: the private key is encrypted with a passphrase, so that if an attacker gains access to my webserver he doesn't get the private key. But I want some automated system to launch the webserver: say, monit to restart the server if it crashes, or puppet to deploy it to many different machines. Is this possible? It seems to me that I have three choices:

Decrypt the private key and store it in plain text somewhere on the machine, in an area that I hope an attacker will be unable to compromise.
Store and use the encrypted key, but also store the passphrase for use by automated systems. This doesn't seem fundamentally any more secure than (1).
Store only the encrypted key, and require manual intervention anytime a server needs to be started.

Are there any options I'm missing? I can't imagine large-scale websites like Wikipedia or Google require manual intervention to start a server, so I'm guessing they must be storing the cleartext keys; but that seems like it must be a bad security practice.

A server restart is a serious occurrence, and should never happen on its own. Ideally there should be an admin logged on to trigger the restart - or at least to restart the server after he/she has diagnosed why it went down in the first place, if it was an unscheduled down.

So the admin may supply the passphrase manually.

As a weaker alternative, the SSLPassPhraseDialog may be used to supply the passphrase.

To strenghten the scenario, the script itself has to be secured (otherwise it's no better than a cleartext passphrase, or no passphrase), so it would have to ask for the passphrase to a second server that has some means to ascertain whether the request is legitimate or not.

For example, if there is a diagnosed down on the server, then and only then a SSH login for the servermaint user from that one IP is granted and the correct password echoed:

ssh -i identity_file servermaint@passphraseserver "getpassphrase"

And the identity_file only identifies that one server with a known IP address.

An attacker gaining access to the Web server would find no passphrase, and would be unable to login to passphraseserver (actually he would, but such an attempt would trigger an alert and log him instantly off instead of supplying the passphrase - and would also mark the server as compromised).

An attacker would then have not only to break into the server, but also to cause a webserver shutdown, and remain in control of the webserver while shutdown diagnostics and forensics are carried out - an unlikely event at best: with that kind of control, he might be able to exploit the Apache process and get a copy of the passphrase when the real sysadmin types it in.

Of course, in a simpler and way more common scenario ("I just want my server to go back up if it goes down, as fast as possible - don't care why it went down, it will always happen every now and then"), it would be easier to leave out the passphrase altogether.


Does using the Google Maps client-side Javascript API leak data? I am currently working on a project where we are using Google Maps to display some data by using the client-side JS API to manually add the points on to the map once the user has clicked on a button.

It has been suggested that using Google Maps may leak our data to Google, and I would like to understand the possibility of this.

Does Google have a way to obtain all the points that are plotted on the map?

According to Google maps API's Terms of Service agreement, Google has a right to obtain information from  you, when you use Maps JavaScript API. Basically, when using the JavaScript Maps API, the following information is sent to Google:

  Map size and location for retrieving map tiles and copyrights
  Addresses for geocoding
  Direction and Elevation requests
  Locations around which to search for Places
  KML when using KmlLayer

Source: Google Maps FAQs


SSL between websites on the same server I have deployment that includes a public asp.net website and an internal webAPI both installed on the same machine.

The webAPI will only communicate with the website. For example, it will not be exposed to the Internet, but is internal and will not be accessed by other machines.

I think to pass a pen. test, the communication between the website and webAPI may have to be HTTPS (I believe this has been raised in previous tests). In this scenario, is it ok use a self-signed cert, for example the one I create?

Yes, but only if the other side can reliable detect if that certificate/pubkey is actually in use or if it has been replaced by a different one. (And if the private key is kept safe.)


Only HTTP(S) port is open. Why do I need to worry about unpatched software? Unpatched software poses no risk by themselves. They're only problematic when someone exploits it.

How could malware get into my system if I do have unpatched software in general and I'm connected to an infected network,

but none of my ports are open except for that very one HTTP port which I use to browse the internet using a secure up-to-date fully-patched drive-by-download-immune text-only browser?

I don't do self-injury by downloading anything.  The only one thing I download is if there is a patch for my browser and I would verify the file's checksum multiple times before running it. The checksum is itself obtained via HTTPS/TLS from multiple trustable sources.

Assuming the text-only browser I use is has no security vulnerabilities,  how could malware enter my system?

Your key assumption is impossible. A "drive-by-download-immune browser" capable of surfing the modern web does not exist. Even if no known public vulnerabilities exist for a certain browser, there is always the possibility of zero-days.

You don't download anything, but every time you visit a website with Javascript enabled, you are allowing arbitrary code execution on your machine and the only thing protecting you is your browser's sandbox. Refer to the previous point about zero-day vulnerabilities.

Sure, you can have a very secure system by turning everything else off and surfing the web with a text-only browser but that is a highly unusable system.


Should I encrypt data on my server as an extra layer of protection? I'm going to create a client-server application that stores a user's sensitive financial information on the server.  I would like to encrypt this data so that even if a hacker gets access to the server he/she cannot read the user's financial information.  The data would be decrypted by the client with the user's password.

For extra difficulty, one user can be granted access to another user's data.

Is this feasible? If so, is there an online guide which provides an example of the types of cryptography to use?

For example, I'm thinking that each user should have a private key derived from his/her password, and a corresponding public key which is used to encrypt his/her data on the server.  This public key is also stored on the server, so that if Alice wanted to give Bob access to her data, she would unencrypt her data using her private key, then encrypt it again using both her and Bob's public key.  One problem with this approach is that if a hacker gets access to the encrypted data he/she could use 'brute force' by trying every combination of, say, 8 characters as passwords to see if that combination unencrypts the data. I therefore want to make the unencryption process so slow that it is not practical to use brute force.  Is there such a public-private key algorithm?

Edit: Ok, after a bit of research have found that there are plenty of hash algorithms (such as PBKDF2) that are designed to be slow because they take an iteration parameter that can be as large as you like.

I see a lot of flaws here:

If one account is comprimised, every person's details who are secured against their private key are revealed. This puts users' security in the hands of other users, which is possibly the worst situation to be in.
Users choose terrible passwords, which no password derivation function can save them from. Even if you're using a work factor in PBKDF2 or bcrypt that ensures an attacker can't compute more than one hash per second, they'll guess weak passwords like "letmein1" and "a1b2c3" after less than a minute.
You can't encrypt arbitrary length data with RSA (public/private key), so you need to encrypt the data with a block cipher, using a randomly generated surrogate key, then encrypt that key with the public keys of the users.
Your protocol provides no authenticity information. An attacker could use the public key of a user to encrypt a set of false financial information, then insert it back into the database. You'd need to combat this by signing the data with the user's private key, which adds extra complexities when you're allowing other users to access the data too.
You're encrypting and decrypting the data a lot, so you make yourself more susceptible to side-channel attacks like DPA and timing attacks. You'll need to account for these and take countermeasures.
Since the information is financial, you're going to have to host your server in a facility with some serious physical security.
You're going to need to use strong transport security. You can't just use any old SSL certificate - you're probably going to need something like an EV cert running 256-bit AES.
It is generally bad practice to store financial information in a database of any kind. A more suitable solution is a HSM.
I'm not sure of the legal situation in your country, but you may be forced to adhere to PCI-DSS, the Data Protection Act, or any other number of regulations. Most of these require audits, which aren't cheap and aren't easy to pass.

In all honesty, this entire scheme sounds like an accident waiting to happen, especially since you're a beginner with crypto. My advice is don't store sensitive financial information unless you are a payment processor or a bank, and have strong experience in security. Rule #1 of security is "security is hard". Getting it wrong puts your customers in danger, and sets you up for a series of expensive lawsuits. If you're a company looking to sell things, or provide a paid service, use a payment processor company who already adheres to strong security procedures and standards.


Is iPhone's fingerprint signature a one-way hash? I've been considering the security of the iPhone 5S fingerprint feature. My main concern is, not that someone could replicate my fingerprint in the physical world and bypass the phone, however that someone could reconstruct my fingerprint based on the digital signature that is stored in the phone.

Is the fingerprint stored as a one-way hash (or equivalent)? How realistic would the possibility of reverse engineering it be to create the original signature?

I imagine a rainbow table for a set of fingerprint hash signatures would be next to impossible with today's computing power.

Fingerprints cannot be hashed. Well, you can hash any sequence of bits, but that would not be interesting at all. Fingerprint readers, like all biometric applications, make physical measures which are never exactly reproducible. Instead, the reader must detect the positions of some "characteristic points" on the finger image (where ridges meet, mostly), and then look for a match with fingerprints recorded in the phone. The match is never exact, due to the limited precision of the measure and unavoidable threshold effects.

Bottom-line is that the phone necessarily stores the information about the locations of the "characteristic points" in a reversible way, not as a hash. This may not be the complete finger image, but it would be enough to design a fake finger which would fool your iPhone.

Now that should not be that much a concern. The iPhone may contain some information about your fingerprints, but its case is also covered with a lot of accurate copies of the same fingerprints, simply because you hold the phone with your hands. If someone steals your phone, then he can have your fingerprints without even bothering to power up the phone.

More generally, you leave your fingerprints everywhere, e.g. on the knob of every door that you go through. Your fingerprints cannot be considered secret (correspondingly, their use for unlocking a computer or a phone has always seemed to be a rather poor idea to me, at least from the security point of view).


Threat Model for a third party messaging application for an organisation Are there any templates or guides anywhere which illustrate how threat models should be documented?

For example, what kind of threats are there for cloud-based/ third party instant messaging services? Would you use STRIDE (Spoofing, Tampering, Repudiation, Information disclosure, DoS, Elevatation) as a reference point? What kind of diagrams do you need?

Looking for some overall guidance to help explain how they would go about producing a threat model analysis for a third party / cloud based messaging service.

Looking at your tag, are you searching for application threat modeling?

One great place to start would be at OWASP, they have the following guides and some templates to illustrate threat models.

For myself, i'm referencing both OWASP and SANS articles. Here a link to OWASP.

OWASP Application Threat Modeling

OWASP Threat Risk Modeling

SANS has their own threat modeling article as well, you can easily search for it in google.

SANS Application Threat Modeling


If a hacker were to compromise a GMail database Assuming the systems that store the Gmail database is compromised what is preventing them from reading everyone's emails by looking at the data in the database?

I assume nothing, and in order for this to be prevented the email data would need to be encrypted (something which GMail presumably does not do). Is this a correct assumption?

Google can read the contents of the emails stored in GMail. That's explicit: they officially scan the email contents, see this FAQ, specifically the question "Is Google reading my mail?":

  No, but automatic scanning and filtering technology is at the heart of Gmail. Gmail scans and processes all messages using fully automated systems in order to do useful and innovative stuff like filter spam, detect viruses and malware, show relevant ads, and develop and deliver new features across your Google experience. Priority Inbox, spell checking, forwarding, auto-responding, automatic saving and sorting, and converting URLs to clickable links are just a few of the many features that use this kind of automatic processing.

(This answer can be summed up as: "no, we do not read your emails, except that we totally do read them, but, trust us, that's for your own good".)

So if Google can read the emails, any attacker gaining control of the Google servers obtains, by definition, the same kind of power, i.e. he can read the emails, too.

Now there may be details about storage: possibly, the database contents might be encrypted with a key known by some other Google servers, so that an attacker gaining access to the database only, but not the other servers, would still be locked out of the email contents. This is not very probable, though: there is some non-negligible overhead (a little extra encryption cost, and, more importantly, the inability to perform the most expensive scan&match methods directly on the database machines themselves). So such database "encryption" is normally done only when you do not trust the database provider (but Google is big enough to be its own database provider) or when the data is very sensitive (e.g. passwords). My guess is that emails are stored as cleartext on whatever machines do the storage at Google's.

(Usual wisdom is that email contents are much more at risk during transit than when stored by a competent, security-aware provider. For much better email protection, use GnuPG with your correspondents; this will protect emails both in transit and when stored. GnuPG interaction with GMail's Web interface appears to be tricky, but GMail is also an IMAP provider that you can use with a classical mail client software.)


Is Android's Password Screen Lock Enough Data Theft Protection? With the exception of the SD card data, is Android's built-in password/pin/pattern screen lock enough to protect data stored in your phone's internal storage in case of theft? Or can a thief simply by-pass this by hooking-up your phone to a PC via USB, or open the device and take the internal disk and be able to view what's inside through hacking?

As an additional question: In case remote swipe apps are not applicable, what other options can you do to protect data in your Android?

No.  The pattern/PIN screen lock is not sufficient to protect the data against sophisticated attackers.  However, it might be good enough in practice for most users, if the data is not super high-value.
There are two cases, depending upon whether you enable encryption of internal storage or not.
If you do not enable encryption. In this case, the data is stored on your phone's internal storage in cleartext.  In principle, a sufficiently sophisticated attacker, if he has access to your phone, can likely disassemble the phone, pull out the flash chips, and read off the data.  However, this requires more sophistication than an ordinary thief is likely to have.  It's not as simple as just plugging in a USB cable.
So, if you're primarily concerned with garden-variety thiefs, a lock pattern or PIN might be sufficient, if the lock pattern or PIN is long and strong enough.  Some caution is required, because your fingers are greasy and leave smears on the phone, which are visible later.  The thief might be able to figure out your lock pattern or PIN from these smudges.  See, e.g., the following research paper:

Adam J. Aviv, Katherine Gibson, Evan Mossop, Matt Blaze, and Jonathan M. Smith, Smudge Attacks on Smartphone Touch Screens, WOOT 2010.

I've summarized the findings of this paper elsewhere, but the short version is that smudges are a serious threat to security, and it's hard to say for sure that you will be safe.
If you do enable encryption.  If you enable encryption, then all data on internal storage is encrypted using an encryption key derived from your lock pattern or PIN.  In principle, you might imagine this would provide strong security, but in practice, it has several serious shortcomings:

Low entropy. There's just not enough entropy in a pattern or PIN to provide a strong encryption key.  Others have calculated that there is a maximum of about 400,000 possible Android dot-patterns.  That's only 19 bits of entropy, which is definitely not sufficient for an encryption key.  (This is probably an overestimate, because not all patterns are equally likely; the short ones are probably far more likely.  This makes the actual situation even worse than these numbers would indicate.)  The number of possible PINs is comparable, or even lower, depending upon the length of your PIN.
If a sophisticated attacker gains physical access to your phone, he can likely disassemble it, extract the flash chips, and read off the encrypted data.  Then, he may be able to mount a simple brute-force search that tries all 400,000 possible lock patterns, deriving a candidate decryption key from each, and seeing which one works.  A 19-bit cryptographic key is not sufficient security to prevent this kind of brute-force search.  So I think it would be prudent to assume that if the attacker has enough sophistication to disassemble the phone and read the flash chips, he may be able to get access to your data.

Smudge problems. In this scenario, the smudge attack is just as bad.  If the thief can recover your unlock pattern or PIN using the smudges on your phone, then obviously the thief can gain access to all your data.  See above for discussion of the smudge attack; the short version is that it's hard to say for sure that you will be safe.

Bottom line. If you just want to protect yourself from a thief who grabs your phone and runs, then an unlock pattern or PIN may be sufficient.  Realistically, such a thief probably just wants a free phone of their own; they probably don't care about your data very much, or won't expend much effort to try to get to it.  So, as long as there is no trivial way for them to gain access to your data, I'm guessing the average thief won't bother; they'll just reset your phone to factory defaults and then start using it.
On the other hand, if you have reason to think that you might be targeted by someone with an interest in the data on your phone, I don't think any of these methods are enough to provide strong protection.  Turning on encryption helps a bit, but probably does not provide strong protection.
If you want to protect yourself from the smudge attack, you could get in the habit of wiping off the screen of your phone (this is far from perfect, but it may make the smudge attack harder or successful less often).
For more reading, see Are the iPhone “connect the dots” passwords secure?.
USB debugging. What about USB debugging, mentioned by others?  Well, sure, if you enable USB debugging on your phone, then a thief who knows about this can just hook up a USB cable and dump your data.  But very few end-users will ever enable USB debugging (and what fraction of ordinary street thieves are going to know about this, or bother trying it?), so this is probably not relevant to most Android users.


Does http support encryption without https (like STARTTLS)? Does http support encryption without https, akin to STARTTLS in smtp?

This may sound like a stupid question, but just think about it.

Banks require strong encryption, and cannot do business without it.

However, regular websites may not necessarily do so, but would benefit from casual encryption nonetheless, preventing many kinds of attacks, just as is the case with STARTTLS in smtp.

As such, for a regular web-site, if the browser is having any issues with ssl (be that protocol incompatibility, an underpowered mobile device, or an explicit preference of the user), it should just safely proceed without encryption without too much extra hassle.

Is there any extension of the HTTP protocol that would allow for encryption without explicit use of https?  E.g. something akin Accept-Encoding: gzip and Content-Encoding: gzip?  Or STARTTLS in smtp?  If not, why not?  Even WPA2 from WiFi comes to mind, which does do encryption, but doesn't bother with certificates or certificate authorities.

Basically, I'm thinking about something like the HTTPS-Everywhere extension, but which works automatically without the viral propaganda of the https:// address scheme -- without forcing people who don't want to be a part of it to be a part of it, like the https:// address scheme does, without dividing the address scheme, and without requiring the content provider to commit to always supporting https:// from thereon.

There is a standard for STARTTLS in plain HTTP. Note that "STARTTLS" is still SSL; it merely modifies the dynamics, but no implementation complexity is avoided that way.

Generally speaking, nobody uses STARTTLS for HTTP, mostly because it is less secure. Indeed, a very big part of SSL-for-Web-browsers is the visual feedback, by which the user is made aware of the encryption (the famous "padlock icon"). Without it, the user would have no way of knowing whether he really gets SSL, or whether he is browsing a fake site which plunders his passwords and bank accounts.

"Protocol incompatibility" and "underpowered device" are myths. Any browsing-capable device currently running knows at least how to do SSL 3.0, and that's sufficient for decent security. As for power, I have personally implemented and run SSL on a 33 MHz embedded ARM CPU; that's the kind of device that you would not deem worthy as a wristwatch. Even a basic bank smart card, the small chip embedded in a plastic rectangle, has more power than that. When people say that they don't support SSL because of lack of power, this is a lie; what they should say is that they don't support SSL because they are lazy.

As for "user preference": well, that one is kind of intangible. However, safety belts are mandatory in cars, and for good reasons. In fact, the Society as a whole is entitled to enforce safety belts regardless of "user preferences", because the same Society as a whole will have to support the consequences of a careless driver who has a slight accident turned into a dramatic disability because he did not have his belt on. The same reasoning applies for SSL: I do not want to let users "opt out" of SSL when such opting out is bloody stupid.


What's wrong with my own authentication scheme? So I want to write my own authentication scheme for a web-app server, as follows. I assume this is a Bad Idea from either security or cost-effectiveness reasons and I know the conventional wisdom is using an existing library, but I'd be happy for pointers as to where exactly I would be going wrong, since this scheme seems both secure and easy to build.

In Pseudo-API, I would respond to the following:

POST /login,signup (+username, passwd) -> create and return token for this user. (Save user<->token relationship on server.)
POST /logout (+token)                         -> destroy token for this user on server. (Destroy user<->nothing relationship on server.)
POST /any-action (+token)              -> perform action if token is correct. (user and token match user<->token on server.)

Is the above an insecure paradigm?

Yes, this is insecure as specified.

Your design seems to be vulnerable to Cross-Site Request Forgery (CSRF also known as XSRF) attacks (need to add a CSRF token with all POST actions that is displayed with the form and stored in a session cookie).  Basically, if a user goes to some other website (email, forum, blog) while logged into your website, their browser may be forced (by javascript, by a secret form) to make an unintended POST request to your website doing some action that I don't want.

Your scheme also isn't particularly specific.

How are passwords dealt with (bcrypt or PBKDF)?  Or at the very least a salted hash?  Are they checked with a constant time string comparison right?
How is data protected over the network during transit (HTTPS?),
How is data inserted/pulled from the database? Prepared statements (also known as parameterized queries) everywhere? (Great!)  Or do you execute a string with an SQL command containing user input (Vulnerable!)?
How are tokens are stored in the browser (Secure HTTP-only cookies?)

Quite possibly they could be other flaws in the implementation as well.


How dangerous is the remote Jeep Cherokee attack? Recently two researchers working with a Wired Magazine reporter have demonstrated a serious vulnerability in UConnect, the software that powers the onboard entertainment systems of all Chrysler group cars manufactured after 2013: http://www.wired.com/2015/07/hackers-remotely-kill-jeep-highway/

This does sound scary, but in the article it is stated that

  Uconnect’s cellular connection also lets anyone who knows the car’s IP address gain access from anywhere in the country.

which is quite logical, I need to know where to send my payload, but doesn't this decrease the severity of the attack by orders of magnitude? It isn't easy to get a particular car's IP, definitely without physical access, and that's assuming it's constant, which it likely isn't since it's using cellular connectivity. Apparently the car belonged to one of the researchers, so I imagine they found out what the IP was before performing the attack.

Am I missing something? Is it easier than I think to grab the IP of a car I spot in the street?

Here is the copy of the paper they wrote on this topic, linked directly to the section on "Cellular Exploitation":

http://www.ioactive.com/pdfs/IOActive_Remote_Car_Hacking.pdf#page=42&zoom=auto,61,288

As you can see, it was not necessarily trivial to discover the method. However, now that it has been done, you can see that this was the way to find vulnerable cars:

  To find vulnerable vehicles you just need to scan on port 6667 from a Sprint device on the
  IP addresses 21.0.0.0/8 and 25.0.0.0/8.
  Anything that responds is a vulnerable Uconnect
  system (or an IRC server).
  To know for sure, you can try to telnet to the device and look
  for the ERROR “Unknown command” string.

Now, linking the IP to a "car I see on the street" is a much more difficult task. The authors write this:

  If you knew the VIN or GPS, you could scan the IP ranges where
  vehicles are known to reside until you found one with corresponding VIN or GPS.
  Due to
  the
  slow speed of devices on the Sprint network, to make this practical, you’d probably
  need many devices to parallelize the scan, possibly up to a few hundred.

Earlier in the paper, they detail methods of accessing information like the VIN or GPS coordinates.

Of course, you can't do this particular technique anymore, because changes have been made. The vehicles have (nominally) been patched, and more importantly, the sprint network no longer allows it.

The authors used a hacked femtocell in their research, and I suspect that method is still a viable way to do this.


Storing Private Keys Generated on Server with specific User's Password Securely I am currently building a system (PHP Web Application Framework) that creates an RSA Key Pair for a user to allow other users to send secure information from one to another. The public key is unencrypted (as expected) and the private key is encrypted with the users password. As the initial RSA generation process is quite computationally expensive (generation of large primes), I am using two methods to make the primes.

The first is a java applet that runs on the clients browser, creates the primes and keys, secures the private key with the password, and sends it back to the system where it is stored and used later.

The second is to use an application (running on the web server as a cron or on another server that can access and update the app) which will do the same as the applet. However, I am still not sure about how to secure the private key so it is only accessible to the user, and it can't be accessed by anyone else.

Sadly, this is where I am hitting a road block. I am unsure of how to secure the data (either generated on the web server or by another server), so it (or the users password) is not directly or indirectly available to any hackers, even if they have access to the entire file system and database on the server. Does anyone have any suggestions on how something like this could be achieved?

I am not sure of what you are trying to achieve here. If you are trying to secure user data, so that only the receiver of the message has access to it, then a solution would be:

Generate the certificate on the client, using the applet and protect the private key using a password (the user password or another password)
Send the public key to the server so that it is available when someone wants to send an encrypted message.
The private key should not leave the computer of the client. The obvious problem here is that if the user uses another computer to access your application he would need to copy the certificate there. You can solve this problem by using smartcards or USB tokens and store the certificates there. In this way, you would only need the token's password to access the private key.

If you also have some sort of admin functionality and you have an user that should be able to decrypt everything, then things get a little bit more complicated. You may have an admin certificate and after the applet generates the keypair, encrypt it using the admin's public key and send it to the server, where  you should store it in an encrypted form.

At least the admin should have an USB token with his certificate, so that even if an attacker gains access to your server, he would not have access to any of the private keys that could decrypt messages.


ARP poison on divided network (every PC in it's own subnet) Let's say that we have a room with a router and 30 PC's plugged in. Every PC has it's own 'subnet'. If we check for available hosts via ettercap/wireshark (on any PC), it only discoveres two hosts: our own and the router. I couldn't find any switches in the room, but they are probably hidden somewhere.
My teacher gave me a task, to sniff his wordpress password. As you probably know, login is easy, cause it can be easily enumerated, for ex. with wpsniff. In my own network, in home I work on w-shark, cause I have one mask, one router and it's simple - every packet is visible.
In the class, my IP address is like '10.169.100.181' and the 'main host' is on '100.1'.
Is there any way to configure ettercap to work with VLSM subnets, or any other way to retrieve any packet that is in a different subnet, but on the same router? He said on the first lesson, that there is a plugin for Firefox, that may work with a thing like this.
I know, that this question is stupid and you'll say that I should go learn somewhere, but I don't know where. If there is someone who can point a way (just the way), I would be grateful :)
Edit
Every cable goes near a wall to the same steel box, where is the router and switches probably. The only thing I know that on other PC's the 'main host' is on the same address as mine and the endings of local IP's are different. I have 10.169.100.181, my colleague has 10.169.100.182, but we both has the same 'router address' - 10.169.100.1. We just don't see each other.

ok so first thing is it doesn't sound like your systems are on different subnets as it would usually be understood if your colleague is on 10.169.100.182 and you're on 10.169.100.181 . Assuming a usual subnet mask of 255.255.255.0 , everything starting 10.168.100. is on the same IP subnet.

Next question, when you say you can't "see" each other, what have you tried.  Usually on a standard switched cabled network you won't see unicast traffic that you are not the source or destination for (you should see any broadcast or multicast traffic).  What might be different to your setup at home is that if you're using wireless networking at home the situation will likely be different and there you may be able to see more traffic (depending on the exact config. of the network)

So to establish what filtering is in place you could test with your colleague to see what happens if you try to contact each others systems.

From what you've said you have access to Wireshark.  so if you get that running, then ask your colleague to ping you or port scan you (using something like nmap) you can establish if there's firewalling in the way.

Assuming that there isn't and you can send traffic from one system to another, you can then (with proper authorisation of course) use standard arp poisoning tools to attempt to re-route traffic from your target system via your own and at that point you may be able to use the firefox plugin your teacher refers to (I'm assuming here he means firesheep or similar) see credentials in transit.

This won't work if the connection is protected by SSL encryption (which it should be), then there's more you'd need to do.


Erase RAM while device is on Is there anyway to get rid of the data in RAM without powering off the system?  or better to say how we can reduce the chance of getting meaning full information from the volatile memory while the system still is on?

Since you do not mention OS:
http://man7.org/linux/man-pages/man3/bzero.3.html - it's fairly ubiquitous.

Use explicit_bzero() to avoid the compiler accidentally trimming away your wipe for whatever reason. If you kill off the sensitive program and fork a few processes that each gobble say, 512M, you have achieved what you need. Remember to unmount swap first - even before running your sensitive program.

You can set the children to each chunk as much memory as you like. The reaper will clean them up when they hit memory limits.


Convincing my manager to use salts My manager says we don't need to salt our passwords because people are not likely to use the same password because they all have different native languages, in addition to the websites they are active at. What is the best counter argument to this?

I'm not sure where you are from. First of all his opinion is against the the considered industry best practice as defined by NIST. Furthermore your manager is dangerously wrong. The more users the more likely it is to get the same passwords for several users. Also the following companies do it and I'm quite convinced that they have a larger global user base than your website:

Facebook
Gmail
Linkedin

Also another reason which is something you can explain from a business perspective is the risk of image/brand damage when  you get negative publicity. To give you an example Adobe used a bad implementation for password storage which lead to the same issue as you are having now: the value resulting from hashing (in case of Adobe they were using encryption rather than hashing) the password was the same for several users if they were using the same password (in their case due to not using an IV while performing symmetric encryption, but this is not relevant). This caused a massive storm of negative publicity, after all an internet company should be adhering to something as simple as password hashing no? The financial cost resulting from such negative publicity can be significant.

Also depending on the country where you live and the laws employed, these days the management can be held personally accountable if it is determined that they were negligent when it comes to protecting data privacy (if cracked passwords are used to get personal data of users for instance). Also depending on the type of information stored, financial, medical, credit cards, different rules may apply which can result in other types of fines as well.

This is something which might not be relevant for password hashing directly, but might come in handy if your manager makes further bad decisions. So make sure to make copies of emails where you clearly explain the problem and also save your managers reply. (just to cover your own ass)

The fact that you are not using salts also probably means you are not using a correct hashing algorithm, as these often take care of the generating salts and performing an amount of iterations. The three accepted algorithms are:

PBKDF2
bcrypt
scrypt


How do you sniff a wifi router without connected into it? I am curious with current technology and tools, are we capable to sniff up and down stream of any open/closed wifi router without connected into it?

At first - strictly speaking - your wifi router is most likely two things. First: A wifi switch and second a router (and probably a lot more). The thing you want to attack is mist likely the wifi part as you state you dont want to initiate a connection.

Since wifi is no strictly directed method of message sending, packets will be broadcasted and that's it.
So: If the wifi is unencrypted you can simply use a wifi-card and put it in "monitor mode". That means it will simply accept all packets flying though the air. Since everything in an open WiFi is plaintext you can read the contents (until transport encryption kicks in).
If the Wifi is encrypted you can do the same as well but you will only get encrypted content. Under certain circumstances decryption after capturing is possible (see Wireshark-Wiki). You will need at least need to know the AP's SSID and PSK for that.


Is it possible to FDE a VPS/VMS Is it possible to implement Full Disk Encryption on a Virtual Machine Server or a Virtual Private Server?

Also, if it's possible, will the service provider (of the VPS) be able to decrypt/see my files on the VPS? And most importantly, will they be able to see the decryption password when I enter it?

Supported options will depend on your service provider. Any encryption of drives etc only protects the data when it is not being accessed / used.

There is no practical encrypted processing at the moment; so if you are ever accessing / processing the decrypted files at the service provider, any intelligence agency with access to the data center,  or the provider, will be able to lift the keys from the memory of the running processes.

If you encrypt and decrypt files locally and then process and store them on a cloud server without ever revealing the private keys to the remote server,  or trusting any software from the hosting service you can store your data confidentially.


Is safe to save files on HDD with bad sectors? I have a 500Gb 2.5 External Hard-Drive. I have separated good-sectors into "X" partition, and have separated bad-sectors into "Y" partition.

I've managed to use that drive as a backup. But is it safe if I use that "X" partition to save my critically-important backup files?

As usual, the answer is it depends.

First, saving sensitive data in a single support is always a risk. Almost every broken device worked nicely until things have gone wrong, and disk manufacturers only give a mean time between failure, which means that extreme values can be rather far from that mean value.

Said differently, the trust in a HDD cannot be binary, and critically important backup files should exist in 2 different supports. When I was younger we used different tape sets to make sure that if a tape was no longer readable, the data (eventually a slightly older version) will exist on another one.

Modern disks almost always have bad sectors, and contain a table of those bad sectors. You only get alerts from the firmware when that table is ready to fill up. And the disk controller hides those hard level details from you.

That being said, if the disk has a lot of bad sectors because it fell on the ground while being accessed, as you can fear other damages on the hardware, you should not use it for important data. But the mere presence of bad sectors, without more details on the age of the device or a special cause is not a reliable hint for the trust you can have on it.


My iTunes account got hacked and someone used it to buy in-app purchase. How could that happen? The account was hacked, I found out in my credit card statement and Apple support gave me refund which is nice. I wonder how it happened, and if there are even more serious risks that I don't know.

The iTunes account is only for a very old iPad which has no iOS update anymore. I never bought any app or even entered the iTunes account username and password in the last two years. A few months ago I tried to buy an iPhone 6s Plus and did use this account to login browsers in computers, but those are computers at home with updated antivirus and Windows updates. Any clue, and what should I do for protection and cleanup?

You said that you are worried that your notebook might be infected in addition to worrying about your iTunes/Apple account being compromised.  That, in combination with the fact that I always assume the worst will be the basis/context for my answer to you.

I always assume the worst as I stated so here is what I would do:

1)  Wipe your notebook; if you suspect any kind of compromise or any kind of malicious infection at all then your safest bet is to wipe it and start over.  Are there other options here such as trying different scans to try to "potentially" find the compromise?  Sure.  Could it take forever, and possibly not yield fruitful results?  More than likely.

2) Change your iTunes/AppleID password right away.  Create another string of randomly generated characters that include the usual: uppers, lowers, special characters, and numbers.  May I suggest a password manager?  If for nothing else, use the password manager to generate a random password as most of them have this capability built-in to them now.

3) Update your security questions on the account to completely different questions and answers than before.

4) Turn on Apple's two-factor authentication.  This is purely OPTIONAL, however it's a great additional layer of security nonetheless.

5)  Practice safe browsing and computing habits going forward.  I know this is pretty broad and generalized, but the more you're aware of what sites and services you visit and use and their practices as well as their reputation while online, or even offline for that matter, the safer you'll stay in the long run.

These are just the general overview items.  Please let me know if you'd like any more in-depth.


Expressing the risk of not having a security policy (e.g. ISO 27002, chapter 5) How do I express non-compliance to ISO 27002 chapter 5 as a risk?

The basic principle of an ISMS according to ISO 27001 is a risk-based approach. Following this, every control of Annex A (ISO 27002) needs to be evaluated and included or (with reason) excluded in the SOA statement.

For the practical controls, that is trivial. But I would like to express the early chapters which basically deal with having the ISMS and its documents, as risks (and preferably, quantify them).

At this time, my best idea is to define a meta-risk of not having a unified, defined approach to security. However, this does not create any business risks by itself. I could argue that it raises the probability of other risks.

I'm looking for other ideas to approach this problem. If I want to express, say, non-compliance to ISO 27002 chapter 5.1.1 as a risk - what are possible ways of doing so?

As an optimist I would say: you are looking at this half-right.
You are right about the fact, that not having a security policy creates risks.
You are not right about that this does not include business risks. ISO/IEC 27000 itself says under chapter 3.6:

A large number of factors are critical to the successful implementation of an ISMS to allow an organization to meet its business objectives. Examples of critical success factors include the following:
a) information security policy, objectives, and activities aligned with objectives;

To correct your question further: The risk the organization is facing is not being not compliant with the ISO norm, the risk lies in the consequences that ensue from not having a security policy.
What are those consequences? These are threats that the respective organization might face because of the non-existence of a security policy. ISO27005 has some examples in Annex C under "Compromise of information" or "Unauthorised actions". See Annex D for pairing with vulnerabilities to make things perfectly clear.
For example:

Lack of procedures for classified information handling  - Error in use

This vulnerability and the paired threat are corresponding to a missing policy for handling classified information. An organization needs a policy like that, which describes how classified information is handled and who has access to it under what circumstances etc. After a policy has been worked out and presented to all employees, is has to be enforcedin varying degrees.
If there is no policy -> it can't be enforced -> there can't be any procedures -> classified information will be handled poorly => for instance: employees don't shred secret files before throwing them away.
(You can find all this in chapter 8.2 in the ISO/IEC 27002 norm.)
So how do you describe the risk in the end?
Exactly like you would describe any other risk. The only difference is, that this one is much more impactful. Just follow the risk assessment process in ISO/IEC 27005 and imagine an organization that has no security policy.
It's all in the norms, you just have to look know where.


Can Windows Theme files (aero.msstyles) be sideloaded with spyware in their resources, specifically in UI scripts Short version: topic

Detailed version:

I want to use a specific 3rd party theme for Windows. I'm already using an open source solution which I've compiled myself to disable Window's restriction on Themes.

In the past, when using 3rd party theme related mods that come with DLLs (for example authui.dll for the login ui, or imageres.dll for modding system icons), I avoid using unknown DLLs by simply copying the unknown DLL's theme related resources (such as Bitmaps, Icon groups or UI scripts) unto it's virgin MS Dll counterpart. I call this resource grafting, where resource are changed but the executable elements of DLLs or exes are left alone.

Going back to the theme I want to install, I used sha256 hashing to determine that only aero.msstyles which is also modifiable by resource hacker. So I did the same thing I usually do and transferred resources from the third party theme to Window's own aero.msstyles. Problem is that I ran into a type of resource that I am unable to read or know the contents of. It's called VARIANT. From some experiments done in a VM, it seems to be some kind of binary UI script that resource hacker is unable to decompile. I usually like to be able to read any UI scripts that I transfer but I am unable to do so with this one.

Would this constitute any real security risks? Can UI scripts be side-loaded with some kind of exploit? Seems unlikely to me since the function of a theme file (msstyle) is to coordinate the appearance of the system UI but I don't know enough about the inner working of the whole theming system to be sure. I thought I'd get some other point of views before I take the theme out of the Virtual Machine.

I used vBinDiff to compare the hex code the altered VARIANT/NORMAL binary to that of the original theme. You can also copy the binhexes and save them to two text files which you would compare with WinMerge.

vBinDiff and WinMerge will highlight what modifications and what additions/substractions were made to the binaries, displaying them side by side. I read through the differences, 90% of them were no larger than 4 octals (4bytes), typically what you would expect to see when modding colors using a hex editor. The biggest divergence was an added 32bytes of code.

There are two possible explanations for the such an addition: (1) the author added extra image resources and added the entries necessary to reference them, (2) there is some kind of unwanted code that has been slipped in.

To address the possibility of 2, I did a search to see how small trojan code can get. How likely is it that a trojan has been stuffed into 32bytes if compiled UI scripts? I found a few mentions of an old 17byte virus from the DOS era called trivial which I disegarded right away because it would become apparent very quickly given it's known behavior. As far as full fledged trojans with backdoor and downloading abilities, the smallest I found was 20kb (trojan tinba), discovered in 2012. There is also Catchy32 which is still considered a Trojan but with simpler and very specific  functionalities and that one's about 580 bytes (reference). Based on this info, I established that it is highly unlikely (if not impossible) to slip any code in 32bytes of code and established that the resource in question is clean.

Mind you, this doesn't answer the question I asked but it comes pretty close. Thought I'd share it.


Does including decorative HTTP headers into server reply pose extra security risk? Suppose I reconfigure my HTTP server to add the following HTTP header into every reply:

X-Hello: Hello!

or some other presumably funny text.

Can this have any negative effect on the server security?


Unable to scan live hosts in a home network I have been trying to scan live hosts that is connected to my home network using nmap but it keeps on returning the IP address of my router and my personal computer.

I tried using the following commands with nmap:

$ sudo nmap -sP xxx.xxx.xxx.xxx/24

$ sudo nmap -sP -PT80 xxx.xxx.xxx.xxx/24

Both of these commands did return on 2 live hosts, that is my laptop's and router's IP addresses.

Am I missing something?

The nmap flag -sP is depreciated and is now -sn(no port scan.) I am unsure what the -PT80 is for, are you trying to scan for port 80 or set a timing template? You didn't tell us if you had anything else connected to the network or what exactly your network setup is so I can't really speculate further. In any case try this nmap command instead:

$ nmap 192.168.1.1-255 #replace with your own home IP range


Is there a way to negotiate a secret between 2 parties with no prior knowledge? Is there a way for 2 parties to negotiate a shared secret (for example, a session key) without having a pre-shared knowledge?

SSL does this by using asymmetric encryption. Is there any other way to achieve this without use of PKI?

There is Diffie-Hellman (which SSL can also use), but this is only secure if an attacker cannot perform active attacks, or the parties can be mutually authenticated.


Use externally generated CA cert to sign CSR's in OpenSSL I wondering if it is at all possible to use an externally generated root CA ( and by external I mean an internal root CA that was created using another tool) and use it with OpenSSL to sign a CSR?

The guides I'm reading around creating my own certificate authority detail creating the private key and root ca certificate using OpenSSL itself, and then using this to sign CSRs.

What I want to know is, can I use and existing Root CA from another tool( providing I export the private key) and use this to sign a CSR ,also created from a different tool and not OpenSSL?

Any info and commands would be awesome as I'm new to this.

Yes, you can. You just need to have the private key in the proper format to be used by openssl.

Not knowing in which format you exported, it's impossible to provide commands, but -supposing it can't sign directly with it- openssl x509 may be able to convert the file.


How to defend and attack single database on server? Lets say I would have my own web server with MySQL database hosted together with new website. What are the techniques that I can protect it and what are called the attack that can query my db ? Is that even possible ? What are the threats and against what should I got protected ?

Only allow connection from localhost if you dont require external connection to your db
Use strong password
Don't create application vulnerable to SQL injection


Generating unique public-private key pairs Consider that there 100 computers in a network where each computer is required to generate 10 unique public-private key pairs [and that each of the 100 X 10 pairs are to be unique] . Is there any standard algorithm which achieves this ?

Even if there are standard algorithms to generate unique keys, is there any possibility of a collision for some reason ?

Just generate 100×10 key pairs and, unless you are using Debian’s (in)famous OpenSSL version, you are pretty sure that they are all different.


Twitter.com in private browsing leaks data to normal browser. Other sites as well? Bug or feature? This is the first time I encountered similar thing. When I log into the Twitter web site in Chrome (namely, the Iron version which is said to be security enhanced, but that does not matter here) in private browsing mode it automatically logs me into my Twitter account in the main browser window as well.

Is it a feature of Twitter?
Or a bug of Chrome?

This can be very embarrassing, indeed.

Other web sites or other browsers are more secure regarding this issue? Is it possible that one of my add-ons leak? I only have Alexa and HTTP Everywhere. This would be very dangerous.

In 2010 August the following news circulated through the tech media: Private browsing modes leak data

Edit: I just replicated the same error on a freshly installed Google Chrome on a freshly installed Windows 7. The culprit is the HTTPS Everywhere add-on.

This is not a feature in Twitter or the Chrome version you're using. It's either a bug in the browser or a misconfiguration on your side.

Please refrain from using non-standard and non-official browsers. Instead of using SRWare Iron (a fork of Chromium), you should use Chrome, which can be easily configured to reach your privacy goals.


Can my work computer sniff my home network? Can my work computer sniff the websites that my parents personal computer go through? I know this would be very unethical for the company to do so but I never realized this is POTENTIALLY possible when my parents brought it up when they saw me working from home.

If your employer has set up your work computer to create a security hole in the network you are connected to (like installing a remote access trojan or other reverse shell backdoor) then your work computer could allow your employer to access the work computer as if they are sitting at it. Once they have access, they can attempt to traverse the network that computer is on by exploiting vulnerabilities in services and applications running on other networked hosts. If your employer manages to log into your home router, they could download logs of all host requests on your network (what sites every host has requested). Also, once someone is backdoored into a system, they may be able to run wireshark or a tcpdump to sniff traffic to/from that host, depending on their access level. So, it's possible, but is a multi-step process.

If you suspect something like that may be happening on your work computer, open a terminal or command prompt on your work computer and try a netstat command with different flags (like "nestat -an") to see what your work computer may be communicating with and on what ports. You can also run Wireshark to see a stream of network-based communication that your work computer is doing.


Is SSL really insecure on most of the web? This report seems to suggest so The Wikipedia article on TLS article has a tremendously long list of attacks against SSL. A table on that article shows a survey from September 2015. If you look at that survey, it shows that nearly two thirds of a selection of the most popular sites online are insecure.

I assume actually implementing these attacks is tremendously difficult and complex, but it still seems a little odd that ~66% of websites have known security shortfalls and 90% are susceptible to the BEAST attack, known about since 2011, if used with an old browser.

This leads me to basically having zero faith in SSL. Is this overly alarmist? Does that survey somehow paint a picture worse than it really is? Does TLS/SSL seem like a really broken concept if it's repeatedly circumvented from a tremendous number of angles?

Is this overly alarmist?

To a point, yes, it is alarmist. Certainly better to be concerned and care about securing communications though.

  Does that survey somehow paint a picture worse than it really is?

You may not be taking in enough understanding about the types of attacks or requirements to launch one, causing the slight jump to mistrust. Such as you make no mention to understand that this survey reflects site owner's configurations and not representative of the TLS/SSL packages current or updated state such as the latest from openssl.

  Does TLS/SSL seem like a really broken concept if it's repeatedly circumvented from a tremendous number of angles?

No, a symbol of a strong system is to be able to find and fix mistakes. To have a plan to patch or mitigate with supported upgrade paths and a large community assisting with expertise and monetary means. Take your jump at beast attack numbers, you could easily brag about those heartbleed numbers being low and have opposing confidence. Also openssl and other implementation packages are not to blame here, this survey paints the picture of what are the site owner's configurations not the state of SSL/TLS package capabilities that are well maintained and updated.


Secure HTTP login in an embedded (IoT) system HTTPS in an embedded (IoT) system is (as far as I know) not necessarily a good solution. Basic Authentication is not secure. Acceptable in an internal network.
Idea: Login.html (when called up) sends a new random number to Browser.
With the number, the user + password are sent back in encrypted form.
EDIT: Browser uses the random number for encryption (as quasi public key). Next Login.html call next new random number.
EDIT_1: Browser sends user+password+random number as Hash back. Hash is every time different. The functionality of the Login.html is not relevant for security.
How safe would that be?
Thanks for Answer.

Without proper encryption, an attacker can not only read requests and responses, but also modify them. This means that the attacker can modify the Login.html page to do no encryption at all.
The behaviour of the actual server is no longer relevant, as the client is talking to the attacker and not to the actual server.


Unkown ip adress in my lan While scanning my LAN with Angry IP Scanner, I found an ip @ that I didn't recognise 192.168.1.59:

IP              Ping            Hostname                MAC Address                      MAC Vendor
192.168.1.10    0 ms            DESKTOP-F126TH4         48:5F:99:46:XX:XX                CloudTechnology               // Laptop
192.168.1.100   3 ms            [n/a]                   C4:71:54:B8:XX:XX                TP-LINK                       //Router
192.168.1.59    0 ms            [n/a]                   E8:6A:64:D4:XX:XX                LCFCTechnology                // ??
192.168.1.2     51 ms           [n/a]                   [n/a]                            [n/a]                         // Smartphone

My router is the .100, the .59 doesn't appear in my router dhcp table and I can only ping it through my laptop (.10), I changed my wifi password but the same device show up immediately after, I disabled wifi on my router and connected through a Ethernet cable and still the .59 show up.
Any idea what it could be ?

It looks like the network adapter that is connecting to your network using the MAC address that you show is likely made by LCFC(HeFei) Electronics, as some of the network adapters that they produce have MAC addresses in the E8:6A:64:xx:xx:xx range.  See https://udger.com/resources/mac-address-vendor-detail?name=lcfchefei_electronics_technology_co-ltd.

If you don't recognize this device, see Unknown MAC address connected to router for some ideas as to how to proceed next.


Are there potentential risks to allowing a PHP website MySQL User to have Create, Alter, and Drop Permissions Let me prefix my question with some information on our environment. We have a web server with 100+ websites. The web server has a corresponding MySQL Server version 5.7. Each PHP website has MySQL Database with a MySQL User attached to it that only has permissions set for it to be able to access to it's database. Previously we have only given that website user, SELECT, UPDATE, DELETE, and INSERT permissions. We are now running into a situation where we must now give the user Create, Alter, and Drop permissions. I'm wondering what potential security risks that puts us in by giving these website users these additional permissions.

The first obvious one I can think of is with the DROP permission, someone could obviously drop all tables and all data would be lost. I'm thinking we may be able to restructure our code to not require DROP. If that's the case and we only need to add CREATE & Alter to the user's then what is a worst case scenario situation? The database are also locked down by IP to only be accessed within our network so the only way a user could be accessing the database directly would be through a SQL Injection through the website.

Unfortunately I'm not very familiar with PHP so I cannot provide any hint of how this could be specifically exploited from the code but I want to point out some other details.
From a security engineering point of view, you open a serious amount of attack opportunities. First of all, the reasons to avoid DROP are obvious. Apart from that, if an SQL injection does happen the user could have made a script that creates an infinite amount of databases and potentially DOS your system, a scripted attack using ALTER may also cause chaos in your database.
You can check some of those things in the backend but still granting too much power to a user

It's difficult to propose something without the source but why don't you  try to isolate the "dangerous" actions inside the server by passing the request to a backend verification and then have root or another privileged user alter the database?


Is it possible for someone to make a purposefully vulnerable site then take advantage of that vulnerability to hack the users? Is it possible for someone to make a purposefully vulnerable site then lure users to his site where he then takes advantage of that vulnerability to hack their social media accounts etc? If so how?

Is it possible for someone to make a purposefully vulnerable site

Yes.

then take advantage of that vulnerability to hack the users?

Yes but, he doesn't need the vulnerability.
When we talk about a vulnerable site, that usually means it allows anyone to do some action which was not intended by the owner. For example, a vulnerable StackOverflow site could allow anyone to log in under the account of someone else. However, if I was the owner of StackOverflow and wanted to take over your account I wouldn't need to exploit a vulnerability on the page. I could do that directly (such as manually changing your password to something else).
The main reason I can think for that would be for plausible deniability / looking inept rather than malicious.