What do you see as the emerging threats for 2011 As we move in to the new year, what do you see as the emerging threats for organisational security?

I see more chat around;

Advanced Persistent Threat (APT) from foreign states.
More fines from the Information Commissioner (IC) for data loss (This is a very UK focused issue, due to the revised remit of the IC and their ability to now fine organisations).
More focus on industrial control systems (SCADA).

According to McAfee Labs Threat Predictions for 2011:

Exploiting Social Media: URL-shortening services
Social media sites such as Twitter and Facebook have created the movement toward an “instant” form of communication, a shift that will completely alter the threat landscape in 2011. Of the social media sites that will be most riddled with cybercriminal activity, McAfee Labs expects those with URL-shortening services will be at the forefront. The use of abbreviated URLs on sites like Twitter makes it easy for cybercriminals to mask and direct users to malicious websites. With more than 3,000 shortened URLs per minute being generated, McAfee Labs expects to see a growing number used for spam, scamming and other malicious purposes.

Exploiting Social Media: Geolocation services
Locative services such as foursquare, Gowalla and Facebook Places can easily search, track and plot the whereabouts of friends and strangers. In just a few clicks, cybercriminals can see in real time who is tweeting, where they are located, what they are saying, what their interests are, and what operating systems and applications they are using. This wealth of personal information on individuals enables cybercriminals to craft a targeted attack. McAfee Labs predicts that cybercriminals will increasingly use these tactics across the most popular social networking sites in 2011.

Mobile: Usage is rising in the workplace, and so will attacks
Threats on mobile devices have so far been few and far between, as “jailbreaking” on the iPhone and the arrival of Zeus were the primary mobile threats in 2010. With the widespread adoption of mobile devices in business environments, combined with historically fragile cellular infrastructure and slow strides toward encryption, McAfee Labs predicts that 2011 will bring a rapid escalation of attacks and threats to mobile devices, putting user and corporate data at very high risk.

Apple: No longer flying under the radar
Historically, the Mac OS platform has remained relatively unscathed by malicious attackers, but McAfee Labs warns that Mac-targeted malware will continue to increase in sophistication in 2011. The popularity of iPads and iPhones in business environments, combined with the lack of user understanding of proper security for these devices, will increase the risk for data and identity exposure, and will make Apple botnets and Trojans a common occurrence.

Applications: Privacy leaks—from your TV
New Internet TV platforms were some of the most highly-anticipated devices in 2010. Due to the growing popularity among users and “rush to market” thinking by developers, McAfee Labs expects an increasing number of suspicious and malicious apps for the most widely deployed media platforms, such as Google TV. These apps will target or expose privacy and identity data, and will allow cybercriminals to manipulate a variety of physical devices through compromised or controlled apps, eventually raising the effectiveness of botnets.

Sophistication Mimics Legitimacy: Your next computer virus could be from a friend
Malicious content disguised as personal or legitimate emails and files to trick unsuspecting victims will increase in sophistication in 2011. “Signed” malware that imitates legitimate files will become more prevalent, and “friendly fire,” in which threats appear to come from your friends but in fact are viruses such as Koobface or VBMania, will continue to grow as an attack of choice by cybercriminals. McAfee Labs expects these attacks will go hand in hand with the increased abuse of social networks, which will eventually overtake email as a leading attack vector.

Botnets: The new face of Mergers & Acquisitions
Botnets continue to use a seemingly infinite supply of stolen computing power and bandwidth around the globe. Following a number of successful botnet takedowns, including Mariposa, Bredolab and specific Zeus botnets, botnet controllers must adjust to the increasing pressure cybersecurity professionals are placing on them. McAfee Labs predicts that the recent merger of Zeus with SpyEye will produce more sophisticated bots due to improvements in bypassing security mechanisms and law enforcement monitoring. Additionally, McAfee Labs expects to see a significant botnet activity in the adoption of data-gathering and data-removal functionality, rather than the common use of sending spam.

Hacktivism: Following the WikiLeaks path
Next year marks a time in which politically motivated attacks will proliferate and new sophisticated attacks will appear. More groups will repeat the WikiLeaks example, as hacktivism is conducted by people claiming to be independent of any particular government or movement, and will become more organized and strategic by incorporating social networks in the process. McAfee Labs believes hacktivism will become the new way to demonstrate political positions in 2011 and beyond.

Advanced Persistent Threats: A whole new category
Operation Aurora gave birth to the new category of advanced persistent threat (APT)— a targeted cyberespionage or cybersabotage attack that is carried out under the sponsorship or direction of a nation-state for something other than pure financial/criminal gain or political protest. McAfee Labs warns that companies of all sizes that have any involvement in national security or major global economic activities should expect to come under pervasive and continuous APT attacks that go after email archives, document stores, intellectual property repositories and other databases.

please see the full article here


Steps to create user authentication system between mobile and server First time doing a secure login from a mobile app to a server (built in java). I want to understand if I got this right.

Login in for the first time:
1. On the mobile device hardcode a security phrase (ex: "superSecurePhrase@@!!".
2. Take in a username and password.
3. Use base64 to encode username+phrase and password+phrase.
4. Using https send this information to my server.
5. On the server decode using base64 with the matching phrase hardcoded on the device.
6. Hash password and save to DB, also hash username and save to DB.
7. Use AES algorithm to create a session token
8. Send session token to device.
9. Save session token to DB, and when user requests something, make sure they match.

To verify credentials it is pretty much the same process except username and password aren't saved, but instead queried for the DB and checked for a match?

Is this the general pattern used for this kind of thing?

Potential vulnerabilities:
1. Physical access to the device to retrieve the hard coded base64 phrase?
2. SSL Sniffing and acquiring the token?

Thank you for your help.

You don't need half of those parts. Adding them will only create a more complicated system, with more room for failures.

You could do this:

Use certificate pinning on the device

This ensures that the device is talking to your server, and make the work very hard for any third party trying to read the data stream.
Using SSL, send login and password to the server

Any other data can be skipped. Timestamps, secret phrases, anything else is superfluous. You could send some device ID, it can be useful for accounting, not for authentication. You don't need the information, leave it out. Using SSL enables you to send the password as it is, without encryption, hashing or encoding. SSL will encrypt to you, transparently.
Store the username in clear, hash and salt the password

Hashing the username does not give any security, and increases difficulty for you. Salting and hashing the password will help your data survive longer in a case of database leakage. Just select the right encryption algorithm, and good salts. This site is a very good reference on password storage.
Use tokens with expiration time

Store the tokens on database, and send them to the client. You don't need to change  the token on every request, you just need to see if the token matches and is not expired. On every new login, expire the older tokens.

Don't trust the client. No matter how secure is the client code, someone can break it. Keep this in mind when designing the security of your system.


pass the hash via psexec from windows server 2012 ( DC ) to client I am trying to do some pentest training on my local labs. I created a lab has 3 Windows 2012 r2 servers and 2 Windows 7 + 8 PCS. All machines protected via passwords. I added both to the domain controller then I tried to use psexec tool to connect to both via this command:

PsExec.exe \\192.168.1.22 cmd

It connected without password or user name.

Can anyone explain why this happened and why I can log in to pc's on my domain without passwords?

The command is being run in a shell under an account that has administrative privileges to 192.168.1.22. This allows you to run PSExec on that device without the password, because the shell session is already authenticated. It's like how when you're already authenticated to Google, you don't need to login again to access youtube because of cookies.

This is also how token hijacking works. By hijacking an existing privileged process, no password or username is needed, similar to stealing cookies. Thus, using this method, 2FA is bypassed completely.


Until what point can I rely on HTTPS for client-server communications? I'd like to know until what point and under what circumstances it is fine to rely on HTTPS for client-server communications. In the previous years, there has been some news about hacks of Certificates Authorities (like diginotar), I know there also are some flaws in the way HTTPS work, for example ISP DNS resolvers might not be trustworthy in some region, and send fake HTTPS certificates to the clients...

Let's say i'm running server hosting a website that will handle million dollars of money transactions, it will probably be subject to hacks. The server is ultra-secured (no DDOS, ssh intrusion or code injection possible), my concerns here are about the communication between my server and the clients that might live anywhere in the world.

My questions:

Is the choice of the CA to register my domain an important one?
Are there some CAs that are considered as more safe or less safe?
Are there some CAs that are blacklisted or forbidden access in some regions of the world? (This would make my clients from those regions unable to access my platform through HTTPS.)
Is it possible for ISPs to monitor the requests made from client for certificates, and sometime issue fake certificates?

Is the choice of the CA to register my domain an important one?

Yes.  There have been physical on-premise breaches that have exposed signing certificates from some CAs (RSA).  There are CAs that have issued bogus certs for legitimate companies (THAWTE/Symantec, China).  There are CAs that have been banned for chronically/"mistakenly" issued bogus certs that have ended up used in malware or used to provide for illegal SSL interception of legitimate sites.  (China's Wosign and CNNIC)

Are there some CAs that are considered as more safe or less safe?

In my opinion, yes.  According to people who build and maintain certificate untrusted lists, yes.  Google actually maintains a list and API of untrusted certs via  project called Submariner.

Are there some CAs that are blacklisted or forbidden access in some
regions of the world? (This would make my clients from those regions
unable to access my platform through HTTPS.)

Yes, but the matrix of what country trusts what CA doesn't exist.  And even worse, unless you're living in a country who controls your Internet access, the problem becomes more nebulous with trying to determine what companies trusts what CAs...

Is it possible for ISPs to monitor the requests made from client for
certificates, and sometime issue fake certificates?

It is possible for people inline to your connection to perform an SSL/TLS Man-in-the-middle attack (commonly dubbed, SSL Interception) but if, as the user initiating the connection, you're checking your certificates when your browser complains about a problem, you should see it (e.g. go to https://www.google.com and the cert your browser sees is for some-other-registrant).

If you are still using SSL and some early versions of TLS, there are known attacks for them as well.

If you are still using old certificates that are using antequated hashing or encryption algorithms, there are attacks against them as well (e.g. DES, 3DES, MD4/5).


How can I detect whether a webshell exploit has been run? My forum was running MyBB 1.6.10 and maldet found a JPG file with the webshell by Orb malware code at the end (php.cmdshell.unclassed.352). I'm using nginx and had secured against arbitrary files being processed as PHP files per this guide.

Still - how could I check whether the exploit has indeed been executed from the malformed JPG file that the attacker uploaded as their avatar?

You can do a self pen-testing by:

Executing that php file in your case the arbitrary jpeg file in your browser and see if it displays or execute a simple Linux command say ls.

Example: say the jpeg file is in your <path>/uploads/ you shoulbe be able to get a shell from your browser if you enter http://yourSite.com/uploads/shell.jpeg

You can also detect such web malware by analysing your HTTP access logs. Because these malwares depends on the HTTP protocol having your ewb server serving the requests; it should log all access and errors. For Nginx your logs should be under

access: /var/log/nginx/access.log
error: /var/log/nginx/error.log

Example: cat /var/log/nginx/access.log | grep -i 'name_of_file.jpeg.php'

Note: You do not want to remove the web malware until you see what the uploader has done or doing to your server, so you can recover from any damage.

Post Mitigation: After you mitigate the damage, fix your application vulnerability by updating to restricting who can upload files, in addition you may want to disable PHP execution entirely in you /uploads/ folder (how?)


DNS queries with hex string that is a SHA1 of a domain name! Is it a malware? My computer does a lot of queries to strange domains such as:

56cea5c2b408989ab067adcb787d0f99209bbe07.mydomain.com

The strange thing is that 56cea5c2b408989ab067adcb787d0f99209bbe07 is the SHA1 of the string "Ebay.com"

Is it a malware? It seems to build hidden queries to well known web site.

---- EDIT ----

This is not the only SHA1 domain prefix that I found, another one exist for "Twitter.com".

Another factor I have to add to the discussion is that when you find an HEX string of length of 16, or 20 is very likely it is an hash. The first thing you can do is a search on Google. There are many web sites that collect hashes (MD5 or SHA1) strings. Try to put the HEX string in google and see :)

Pure speculation, but I had to give it a try (always fun playing Sherlock Holmes  every once in a while - the pre-Hollywood version obviously).

First of all, it's possible, or even likely that .domainname.com is being automatically added by your Operating System. It's quite common to append a domain suffix for DNS queries for a hostname without extesion. My hypothesis is therefore based on the fact that some program simply tried to resolve 56cea5c2b408989ab067adcb787d0f99209bbe07 without any extension. This part of the theory is easy to check on your computer though.

Why would a program try to resolve {something_random} or {hash_of_something}? I am guessing just to test whether name resolution works, and also trying to avoid caching or static /etc/hosts records.

Why hash('ebay.com')? That's the strangest part, but perhaps the developer couldn't figure out a better way to generate a random-like value? so they were just feeding some strings into the hash function? This is the odd part for sure, but there could be a simple explanation (i.e. developer just being stupid/silly/quirky).


Escaping Virtualbox type intrusion detection? Is there a way to run intrusion detection for if anything tries to escape from Virtualbox?

Thank you.

In a general sense, you can do this with standard security tools. Note: It would be hard to know ALL the ways to detect this from the VM before such an attack occurred versus after it's gotten access to the Host OS where it would be much easier to detect.

To detect a program while it is trying to escape you would have to be monitoring the VM OS.

To detect things that have escaped you would be monitoring the Host OS. So placement of tools is important and relative to the way you asked your question.

That said, assuming you are strict about your use of the Host OS being dedicated solely for the purpose of hosting Virtualbox VM's it would be easy to setup a lot of systems monitoring on the Host OS to look for anomalous behavior. You could also turn the logging levels way up because in the VirtualBox software should be the only thing really active on the Host OS system. This makes user/system access and other types of activities really easy to spot IF you aren't running other things on the Host OS.

In theory, if you aren't doing much with the base OS then abnormal patterns in usage which would occur if someone started accessing the Host OS would be easy to spot. That said if this was your primary laptop you will create a lot of noise in the logs which will make this much harder to do.

The IDS/IPS/Other and security tools, especially operating system security tools which monitor system calls, can easily be placed on both the VM OS and the Host OS so if the attacks you are thinking about can be detected and are not true Zero-day exploits then they should be possible to detect when using appropriately configured intrusion detection/prevention systems.


How can I securely convert a "string" password to a key used in AES? I'm writing some software where I have to encrypt all files that are written to a specific folder using AES. There is one password/key that is configured somewhere, that is always used.

I don't want to store a base64 string because that is too complicated for the person who might have to change the configuration. I want to store a string containing any characters. What is the best way to convert this password to a key for use in AES?

Can I just get the bytes from the key?
LShould I generate a key using PBKDF2?

As I understand, I then also need to provide a salt. However, in my situation the salt seems unnecessary because I only have one key.

Do I just provide an empty salt or is that somehow not secure?
Or is there a completely different (hopefully simpler) way?

What you do is the following:

Generate a long key (this is just a secure randomly generated amount data, you can use 128 bits)
You use this key to encrypt your file with AES (meaning you use it as a password)
You encrypt the key itself with AES using your password (which is a bit shorter but easier to remember. Now AES requires this again to be either 128, 192 or 256 bits of length so you need to make your password of that length. Hence you can just use PBKDF2   (or scrypt or bcrypt) to create a fixed-length key from your password.  DO NOT STORE THIS.
You keep a hash of your hashed password using PBKDF2 (or bcrypt or scrypt). This will allow you to check if the password is correct before trying to decrypt your encrypted key.

So:
hash(hash(password)) --> can be stored
hash(password) --> cannot be stored

You always need to provide a salt even if you only have one key (this largely prevents rainbow table lookups). Fortunately for you, salt generation is done automatically by PBKDF2.
So in the end you actually have 3 things:

Your encrypted files
Your encrypted key
A hash of your password to verify it

You might ask why you need the key: If you would change your password (and you had encrypted all your files with your password), you would need to first decrypt all your files with your orignal password and then re-encrypt them with your new password. With this implementation all you need to do is decrypt and re-encrypt the key (as this key serves as your password).
EDIT
I kind of misinterpreted your question, I've added the key derivation function.
Also a good read (courtesy of IBM)


User privileges for unsanatized code We all know there are still vulnerable code out there even though they may or may not get exploited and found for hacking attempts. I've seen people do it countless times and have a possibly plausible solution I've been working on for this. The only thing I lack is possibilities and opinions for this idea.

Based off of the Web Application Firewall, I planned on creating a vBulletin plugin (first) in order to detect unsanatized code by including functions for all possible unsanatized code and sandbox it. In order to lower privileges of anyone without a key (either user defined or generated), either the forum owner will manually access the control panel and disallow what code gets filtered/blocked or automatically detect what known vulnerabilities the code may have and give a 404 to any user that inputs arbitrary exploitable code such as SQLi (accessing a table other than the one on the page allows) and others.

Since people have told me that using a Web Application Firewall has many bypasses that are just annoying to the hacker, I was wondering whether or not sandboxing and lowering privileges is a good idea if I improve the functionality on vBulletin through numerous plugins/products so it can be at least 90% versatile over time?

Opinions are welcome as well. Another question is known bad coding practices. I don't know everything, but I know my mistakes and people have broken and hacked their way through my code to show me. What bad coding practices are known and uncommon/known and common in PHP/JS?

Thanks for the time.
If this would fit in another SE site, sorry & many thanks if it gets migrated.

Edit

I was wondering whether or not protecting the additions to a site before protecting the site overall is a good idea. If we look at vBulletin as it stands right now, people are still creating plugins and products that aren't 100% secured and lead to finding that there may be unnecessary code, improper sanitation, and/or unsanatized input. This would wrap the code and protect it through privilege restrictions. The cons about this is less knowledge about security to the owner(s), but more time knowing your website is protected whether you're vulnerable or not.

whether or not sandboxing and lowering privileges is a good idea

ALWAYS!!! Every time, everywhere (English is weird), isolate your processes. In an ideal world, we'd SELinux the hell out of every application, user, file, etc.

A properly established mandatory access control provides both protection against exploits and detection of compromise when you see patterns in your audit logs that just shouldn't be there, which of course you're always reviewing to correct bad rules or notice something unwanted has happened.

WAF, MAC, firewalls, etc. are body armor for your web server. They make you heavier and slower, and chest armor doesn't stop you from being shot in the arm, but it does improve your survival odds.

AppArmor is a simpler interface to the Linux security modules, and a decent substitute for corralling specific applications that you consider high-risk if SELinux is melting your brain.

  whether or not protecting the additions to a site before protecting the site overall is a good idea

Yes again! The more compartmentalized you can make things, the better off you are. If the a module only needs access to the posts table, provide it a context where it can't access the credential table, etc. It's a lot harder to leak the access you don't have than the access you do have.


Unique(ish) OS / hardware fingerprinting In the manners of Browser fingerprinting, is it possible to obtain a somewhat unique fingerprint for the device OS and hardware (a 1 out 1000 entropy score would be good enough for my needs)

Edit:
For more context, I am trying to differentiate as accurately as possible unique visitors on a web page. Ideally, if someone already visited the page but returns with a different IP and via a different browser I would be able to make an "informed" guess whether or not that visitor is returning.

The Electronic Frontier Foundation (EFF)'s Panopticlick site is dedicated to browser fingerprinting that goes well beyond your desired 1:1000 entropy (using these methods, pretty much every browser is unique).

Their implementation is designed to show you how hard it is to be anonymous online, so the site has a good amount of explanation, including a detailed technical writeup as well as some pointers in how to defend against this sort of tracking.

Please respect people's privacy.  It's one thing to track people through logins.  It's another thing to track them without their knowledge and/or permission.

  Ideally, if someone already visited the page but returns with a different IP and via a different browser I would be able to make an "informed" guess whether or not that visitor is returning.

There should be enough data specific to hardware and OS to get a fingerprint that is agnostic to the browser within your desired 1:1000, but you may be able to get further with fuzzy matching so long as you are comfortable with collisions between different users (which is another privacy issue).


nmap scan shows ports are filtered but nessus scan shows no result I'm performing an port scanning on a range of IPs on our remote site. I tried running nmap scan on that IP range and some of the IP result are shown as filtered

When I perform a nessus scan on the box, there is no result at all for some of the IPs.

As such is it safe to assume that there is no open ports on some of the remote server?

Unless you've got nmap configured not to perform host discovery (-PN or -PN --send-ip on the LAN), if it is indicating that all ports are filtered, then the host is up, but the firewall on that host is dropping traffic to all the scanned ports.

Note that a default nmap scan does not probe all ports. It only scans 1000 TCP ports. If you want to check for any services, you'll want to check all 65535 TCP ports and all 65535 UDP ports.

Also, to be precise, but when the port scan says a port is filtered, that doesn't mean that there is no service running on that port. It's possible that the host's firewall has rules that are denying access to the IP from which you're running the scan, but there may be other IPs which are allowed to access that service.

If the port scan reports that a port is closed, that's more definitive that there's no service listening on that port.

I can't comment on the lack of results from nessus, it's been a while since I've used it.

Example of closed vs. filtered vs. host-down

E.g., on my network, this host is up, has no services running, and does not have a firewall, note that the ports are reported as closed (this means the host responded to probes on that port):

% sudo nmap -T4 -n 192.168.1.24

Starting Nmap 5.00 ( http://nmap.org ) at 2011-11-30 11:20 EST
All 1000 scanned ports on 192.168.1.24 are closed
MAC Address: 00:0E:00:AB:CD:EF (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 7.70 seconds

This host is up, has no services running on ports 100-1000, and has a firewall. Note that the ports are reported as filtered (this means that the host dropped probes to those ports):

% sudo nmap -T4 -n -p 100-1000 192.168.1.45

Starting Nmap 5.00 ( http://nmap.org ) at 2011-11-30 11:24 EST
All 901 scanned ports on 192.168.1.45 are filtered
MAC Address: 00:12:34:AA:BB:CC (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 20.03 seconds

Just for illustration, I punched a temporary hole in the firewall for that last host for port 443 and reran the scan. (There's nothing running on 443 there.) Notice how 998 ports are reported filtered, but port 443 is reported as closed; the firewall is allowing 443 through, and the OS responds with an RST.

% sudo nmap -T4 -n 192.168.1.45

Starting Nmap 5.00 ( http://nmap.org ) at 2011-11-30 11:43 EST
Interesting ports on 192.168.1.45:
Not shown: 998 filtered ports
PORT    STATE  SERVICE
22/tcp  open   ssh
443/tcp closed https
MAC Address: 00:12:34:AA:BB:CC (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 5.67 seconds

There is no host at this address (host down):

% sudo nmap -T4 -n 192.168.1.199

Starting Nmap 5.00 ( http://nmap.org ) at 2011-11-30 11:26 EST
Note: Host seems down. If it is really up, but blocking our ping probes, try -PN
Nmap done: 1 IP address (0 hosts up) scanned in 0.56 seconds

if I rescan with -PN --send-ip (the latter is needed because I'm scanning the LAN, and I don't want to use ARP probes), I see:

% sudo nmap -T4 -n -PN --send-ip 192.168.1.199

Starting Nmap 5.00 ( http://nmap.org ) at 2011-11-30 11:29 EST
All 1000 scanned ports on 192.168.1.199 are filtered

Nmap done: 1 IP address (1 host up) scanned in 101.44 seconds


Understanding a crash Say you're fuzzing a Windows x32 application for a file format bug and, say, you found a pattern that causes the application to crash.

My normal steps are:

load application into a debugger
generate and investigate the crash.

In my actual conditions, I can see my pattern into the stack but, at crash time, I can't find any impacted register nor SEH overwrite but only what's the instruction that causes the crash:

MOV WORD PTR DS:[EDI+2],DX

basically, it can't write because it is an unmapped memory area.

Have to admit that I'm completely lost because I can't proceed to verify the offsets into memory.

Your file input has probably affected the value of EDI in some way, or caused control flow to take a path it would not otherwise take.  I would normally look a few instructions back and try to determine how EDI came to have that value, or perhaps break at the beginning of the function where the crash occurs and step through it (or a few functions further up the stack).

Another relatively new option would be to use WinDbg's time travel debugging feature!  You can let it run in the debugger until the crash, then step backwards in execution to figure out how you arrived at the crash.

Obviously, if you have source, you'll be much better off looking at it that way in parallel to figure out what happened.


How to have client encryption without server encryption key I want to build a service where people can message each other via their mobile device so that they encrypt all of their information on their device and not on my server. Basically I want to two people to securely message each other and have confidence that my servers nor anyone else can have any knowledge or access to their data without their permissions. I'm especially wary of preventing mitm attacks.

Currently all my messaging runs through my rabbitmq servers in the US, but I want the data messages going through rabbitmq to be encrypted before getting to my mq servers. I understand that this is what SSL basically is, but is it really the best option out there especially if the certificate servers are US based? Is it possible to have dynamically generated client keys only stored on mobile devices that can't be cracked by me? What I'm afraid is for the government asking for my encryption keys to decrypt my clients traffic in case of an impending lawsuit.

First: The very first rule of cryptography: Don't roll your own crypto!

Second: Why do you want to setup this service? Signal (+ OTR or Axolotl) does all this already for: It's open-source, allows peer verification, offers end-to-end encryption, offers client-side encrypted storage and is trusted by all well-known cryptographers.
Disclosure: I do use Signal and I'm convinced of its quality, I'm not working for OpenWhisperSystems or otherwise affiliated.

But now, let's head over to actually answer your questions:

  I understand that this is what SSL basically is, but is it really the
  best option out there especially if the certificate servers are US
  based?

SSL (or more modernly called TLS) usually provides transport security between the end-user and your servers. It does not by itself do anything beyond that. You could let the clients establish TLS sessions between each other (resulting in good end-to-end encryption) however TLS is more designed to be a (somewhat) real-time security protocol. Concerning the certificates, if you do use something else than the RSA key exchange, a leak of the private key won't allow TLS data decryption (if you deleted the ephemeral (EC)DHE keys) but would allow man in the middle attacks (this assumes you use anonymous / ephemeral (EC)DHE). Adapting a TOFU-style approach or another key-update mechanism could make the connection resistant to man in the middle attacks after the initial connection.

  Is it possible to have dynamically generated client keys only stored
  on mobile devices that can't be cracked by me?

Absolutely. OTR already includes such a functionality. Basically you want to end up as a relay for the messages the clients transmit (much like the standard internet infrastructure) while they securely negotiate a shared secret via your servers. You can verify your peer than by comparing the hashes of the shared Diffie-Hellman secret (or the public key of the other party used to authenticate Diffie-Hellman public keys) out-of-band.


Never heard of compiler vulnerabilities when compiling? Does there exist any real source code that exploits a compiler vulnerability? I mean code that during compilation causes a buffer overflow in the compiler resulting in execution of arbitrary code.

When someone tries to compile that source code using a particular compiler version the compilation results in some exploit that infects the target machine.

I'm not searching for toy examples or just research papers, but actually for something documented that affected at least some machine with a real payload.

I know theoretically that this is possible, but I'm curious if this has ever been a real issue for someone.

Yes, take a look at the change log of gcc, llvm, etc, although practical examples are rare. IIRC I have seen at least two practical PoC's; one was for java and the other a C compiler. If you extend the concept of a compilation to include JIT you can find many more examples in JavaScript, Ruby or the PHP engine to mention some.

There is also an issue of compilers introducing vulnerabilities into the compiled binary that may not exist in the source code through optimization. The first example that comes to mind is this Linux kernel exploit from a few years back where compiler optimization removed a check that would have prevented the vulnerability in the first place.

CERT cover some various examples of code that may get optimized into being insecure over here.


Verify GnuPG download with signature file - and it fails I'm trying to verify the new GnuPG download (for OS X) using GnuPG. (First of all I'm not sure if you should verify a file with the old version of it, which I probably didn't verify back then to be honest.)

Guess what - the verification doesn't work:

gpg --verify GnuPG-2.1.2.dmg.sig GnuPG-2.1.2.dmg
gpg: Signature made Thu Feb 12 18:13:44 2015 CET using RSA key ID DD5F693B
gpg: Can't check signature: public key not found

How can I get this working on my Mac?

OpenPGP Signatures vs. Checksums

Verifying an OpenPGP signature not only checks whether a file was not corrupted (for example during transmission) like a "normal" SHA or MD5 checksum would do, but also checks whether the signature was issued by whom it pretends to be from (in other words, if the signature on the file was issued by a specific key, which is also referenced in the signature).

Fetching the Right Key

You need to fetch this (public) key before being able to verify the signature. This can easily be achieved by running gpg --recv-keys DD5F693B (but be aware of OpenPGP key ID collisions and better configure using long key IDs instead).

Trust

Having fetched the key, you will get an output similar to this one:

gpg: assuming signed data in `enigmail-1.8-tb+sm.xpi'
gpg: Signature made Tue Mar 17 13:31:23 2015 CET
gpg:                using RSA key 0xDB1187B9DD5F693B
gpg: Good signature from "Patrick Brunschwig <patrick@enigmail.net>"
gpg:                 aka "Patrick Brunschwig <patrick@brunschwig.net>"
gpg:                 aka "[jpeg image of size 13251]"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 4F9F 89F5 505A C1D1 A260  631C DB11 87B9 DD5F 693B

Now you know that the key was really used to sign the file you downloaded ("Good signature from [...]"). Still, this key could have been issued by everybody! Just because you fetched a key from the key servers, there has been no verification by anybody on its contents yet.

Having the key will not suffice to be sure who (which person) really signed the file:

  WARNING: This key is not certified with a trusted signature! There is no indication that the signature belongs to the owner.

You also need to be able to verify the key to not only verify the file integrity (you already achieved that now), but also be sure whom it comes from. For example by meeting the issuer and asking him whether it's really his key, through the web of trust (or another way you consider reliable).

But this is another, long topic.


Attacks on using https at coffee shop to access bank account? Correct me if I am wrong: If you use https, you communication with a server is secure because it is encrypted. If my computer is connected to a wireless network and someone can see all the raw data/traffic between me and the wireless router, then they only see encrypted communication. The only thing they can see is what website/ip address that I connected to.

Is this correct?

I have heard a couple of times now that you still really shouldn't be accessing your bank account at a coffee shop becuase hackers can "do things" unless you use a VPN. This is, for example, mentioned in this Youtube video.

In the video linked about it is mentioned that an attacker can use devices and techniques to actually get a lot of information.

My questions are:

What types of devices and general methods can be used to gain this information?
What type of information can the attacker extract? If the traffic is encrypted, how can the attacker see any of that communication? Can they, for example, see the balance on my account?

They are awfully vague in the linked video, so no real guidance there. I could think of the following risks:

Even if you use HTTPS, the domains you visit will be visible to the eavesdropper. You might not want the world to know about all the domains you visit...
Sure, everything is fine as long as you use HTTPS. But are you actually using it? SSLStrip is a real thing, and unless you trust yourself to check that the connection is secure every single time you could easily fall for it.
In theory, the bad guy could have come across a rogue certificate somehow or there could be some bug in your browsers TLS implementation. While not common, these things are not unheard of.
There are known vulnerabilities (such as POODLE, CRIME, and BEAST) in older SSL cipher suits. But if you use a modern browser this should not be a problem (and I am not sure it would be even if you use an old one).

Of these four points, the first two are the only ones I would really worry about. But the first one doesn't really apply to banking, and the second can be handled by just checking the connection. So while I wouldn't do online banking in a coffee shop unless I really had to for some reason, it is not the end of the world if you do it.

Also note that the show you linked to disclose that they are sponsored by a VPN company on their homepage.

I should also mention there might be legal issues involved here - is your bank willing to pay you back in case your account is hijacked if you have accessed it over coffee shop Wi-Fi, even if the reason your account was hijacked has nothing to do with it?


Detection of abnormal file access patterns A company allows its developers access to snapshots of their entire codebase through a local network share. In order to perform their job, the developers compile code daily, where each compile reads a set of files from the codebase, transferring the data within from the network share to their local development machine. For convenience purposes, the company allows its developers administrator access to their local development machines, and USB port access is unrestricted.

In this environment, a malicious developer could read every file from the network share, and store those files on an external drive locally, which is (obviously) a security risk. If the company wanted to be notified of suspicious data access patterns on the network share, using only tools on the server hosting the share, how would they go about doing this?

Ideally, this system would eventually be extendable to any large set of files hosted on a network share. In one example, the server would recognize that the .h and .cpp files for a particular part of the code are frequently accessed together, and no red flags would be thrown if they're both accessed in a short interval. However, if a large number of unrelated files are accessed in a short period of time, that should throw a red flag.

It looks like you want to consider Data Loss Prevention tools (https://en.wikipedia.org/wiki/Data_loss_prevention_software).

However before you go straight to the technology solution, you have to understand what "normal" file access looks like.  If you do not know what that looks like it becomes impossible to know what abnormal looks like.  This is similar to teaching IDS/IPS what the network looks like.


Average number of exploitable bugs per thousand lines of code? Over the years I've heard various estimates for the average number of exploitable bugs per thousand lines of code, a common figure being one exploitable bug per thousand lines of code. A Google search gives some much lower figures like 0.020 and 0.048 on one hand but also very high figures like 5 to 50. All these numbers are for code that hasn;t been reviewed nor tested for security.

Have any serious empirical studies been done on this subject? Such a study could be done based on well reviewed open source software by checking how many security holes have been reported over the years. If not, where do these numbers come from?

Any number you get is going to be fairly meaningless -- some factors to consider:

Programming Language - Some languages let you do very unsafe things; e.g., C makes you directly allocate memory, do pointer arithmetic, has null terminated strings, so introduces many potential security flaws that safer (but slightly slower) languages like ruby/python do not allow.  Purpose of application?  What type of coder/code review?
Type of Application - if a non-malicious programmer writes a relatively complex angry bird type game in Java (not using unsafe module), there a very good chance there aren't any "exploitable" bugs -- especially after testing; with the possible exception of being able to crash the program.  A web application in PHP written by amateurs, has a good chance of having various exploitable flaws (SQL injection, cross-site scripting, bad session management, weak hashing, remote file inclusion, etc.).
Programmer expertise at writing secure code.  If you hire a high school student with no past experience to code up some web application, there's a reasonable chance they'll be major flaws.

Furthermore, counting the number of "exploitable" bugs is not a straightforward task either; if finding bugs was straightforward they'd be removed in code review.  Sometimes many bugs only arise due to subtle race conditions or complex interactions among programs/libraries.

However, if you take open-source projects, its fairly easy to find a count of LoC at ohloh.net and a count of "exploitable" vulnerabilities at cvedetails.com (I arbitrarily defined 'exploitable' as CVSS over 7).  I randomly decided to look at some web browsers, programming languages, and web frameworks and found:

Web Browsers:

Google Chrome 380 CVE with 6 239 930 LoC so 0.06 vulnerabilities per thousand LoC.
Firefox 395 CVE in 8 000 969 LoC at rate 0.05 per 1000 lines of code.

open source programming languages:

python with 3 exploitable CVSS>=7)
in 862 830 lines of code at a rate of 0.003
Ruby 13 CVSS >= 7 in 171 122 LoC at a rate of 0.08
PHP with 122 exploitable CVSS>=7 in 3 761 587 lines of code at a rate of 0.03 (factor of ten worse than python).

Web Frameworks:

django with 1 exploitable CVSS >= 7 in 149 292 LoC at a rate of 0.007.
Ruby on Rails 7 exploitable CVSS >= 7 in 156 317 LoC at a rate of 0.05.

So again for these specific major programming projects (likely written by expert programmers) found rates of major exploitable vulnerabilities at a rate of 0.003 to 0.08 per 1000 LoC.  (Or 1 per 12 500 - 300 000 LoC).  I would necessarily extrapolate to non major open source projects.


Why is email often used as the ultimate verification? In many services, email can be used to reset the password, or do something that is sensitive. Sensitive data is also quite often sent to you by email, e.g. long links that enable access to your account or similar.
However for most people, their email service provider can read all their emails, can see what is being sent, and can send email themselves as "you". So doesn't that give your email service provider basically full access to your accounts? This seems like the incorrect medium to send such information via.
I don't really know if this matters, however you never really see these email services sending you "encrypted" email with your pgp key.
Also, it is well known that email is inherently insecure, or not designed with privacy or security in mind.
However it keeps being used for these purposes.

This seems like a very wrong medium to send such information via.

Email is used for the same reasons Social Security Numbers get re-used as account identifiers in the US: Ubiquity.
Not everyone has a Facebook account.  Not everyone has a Twitter account.  But almost certainly, anyone with Internet access has an email account.  It is a reasonable expectation that customers can provide an email contact for businesses to use.

And I don't really know if this matters, however you never really see
these email services sending you "encrypted" email with your pgp key.

Because pitifully few people have a PGP key, and even fewer are set up with an email client that integrates encrypted email.
I once wished to purchase software, and the vendor would only sell to people who communicated with them via PGP email.  I tried sending the PGP-encrypted blob as an attachment, I tried inlining it, and I tried add-on software that integrated PGP email into my mail client - none of them passed muster with the vendor.  I never purchased the software.  PGP email is neither ubiquitous nor, it seems, trivially interoperable.

Also, quite often it is mentioned that email is inherently insecure,
or not designed with privacy or security in mind.
However it keeps being used for that.

And it will keep being used for that until something better comes along and something better is available to everyone to use, trivially.


Why do people trust PlayFramework2 dependency management? If you worked in a big company that was very security conscious, would you build a product based on PlayFramework2 underneath?  Since it does automatic dependency resolution at load time, aren't you placing a lot of trust in some possibly untrustworthy source of updated libraries?

Why would you trust it?  How do you know that the libraries it's downloading from the wild are safe?  Wouldn't it be possible for a hacker to compromise the source of the libraries, injecting some unknown code into it?

Misconceptions

Play Framework 2 doesn't have its own dependency management or repositories, it uses SBT which in turn uses the existing Maven Central repository, which is where pretty much all Java packages live.

Regarding the downloading on load, this does not happen. No libraries are downloaded when you run an application built with SBT. Libraries are downloaded when you build the project with SBT. Usually only once, after which SBT saves libraries to ( default for Maven ) ~/.m2/repositories.

Trusting Maven Central

Maven Central has some requirements on security:

  To improve the quality of the Central Maven repository, we require you to provide PGP signatures for all your artifacts (all files except checksums), and distribute your public key to a key server like http://pgp.mit.edu.

Meaning you can verify yourself whether something is uploaded by an entity you trust.

  Only releases can be uploaded to the central repository, that means files that won't change and that only depend on other files already released and available in the repository.

This basically means that if a user of Maven Central would get "hacked", noone can replace any libraries that user released. They would only be able to release newer versions, which  unless you're using dependency version wildcards, your software will remain safe.

Custom Repositories

There's a bunch of alternative repositories ( i.e. JBoss' ), but most importantly you can also use a tool like Sonatype's Nexus to be your own Maven Repository. If you really want to be sure nothing malicious is going on you can set up a company Nexus and upload only verified trusted libraries to it.

Bottom line

It's pretty much like any package manager or software repository, and completely up to you whether you trust the people behind it. In my opninion it's a lot safer than downloading libraries from the internet yourself.


Why is RSA decryption slow? I've been researching the disadvantages of using RSA for encryption, and one I've found repeatedly is that RSA decryption is slow, but I haven't seen an explanation as to why this is. Can anyone explain why this would be?

RSA decryption is slow compared to encryption as d the private exponent is necessarily large, while (with proper use of RSA) there's no reason the public exponent can't be chosen to be small like 65537 (or even 3).

RSA encryption generates the ciphertext by m^e mod N, where (N, e) are your public key and decryption works via c^d mod N where (N, d) are the private key which is calculated efficiently when you know p and q the large primes.

Here's an example of a key I just generated.  To keep the example simpler, I only used 256-bit RSA (weak), in reality you should use at least 2048-bit RSA these days, in which case have p, q, N, and d will each have eight times the number of digits.  (Meanwhile e will stay 65537 even with 2048-bit RSA.)

p = 255972651020913583852708738755558492779
q = 315961372360286283221530569994994089667
N = 80877470103268491690225776687889776985485516372419877405296906209811698014593
e = 65537
d = 62101042930507606982857645825838676738862341745400679479964616076341592694761

You can check that the RSA conditions are satisfied, p and q are prime, N == p*q, and e*d % ((p-1)*(q-1)) == 1 (this last condition is what allows RSA decryption to work via Euler's theorem ).  You can also test that encryption works -- for a message m = 12345678901234567890, then c = m^e mod N is c = 37526865766319703630750491158429044860161927049301804846356525193422406944367 and then c^d mod N will be 12345678901234567890 (no wolframalpha link -- input too long for free version).  Here's a ipython notebook demonstrating all the steps -- note in python pow(x, y, N) is the syntax for x^y mod N.

From this it appears quite obvious that the time to calculate m^e mod N will be a much quicker calculation than c^d mod N.  For encryption, exponentiation by 65537 by repeated squaring will require squaring and taking the modulus 16 times with one additional multiplication as m65537 = m * m216 (its 16 squarings as x2n = (x2)2n-1).  For decryption with RSA-256, exponentiation by d will require squaring 256 times and about 128 (the number of 1s in d in binary excluding the first 1) other multiplications with RSA-256 and for each squaring you need to also calculate the modulus of N.  It should be noted that these modulo multiplications of large numbers is not a constant time operation but depends on the bit-length of the numbers.  Note if you chose d to be small like e then your private key could be brute forced (encrypt a message using the public key, and then try every small value of d until it decrypts properly).  Even if d is too large to brute force in this trivial manner, attacks on small d (meaning d < N1/4/3), then there are more sophisticated attacks that will allow an attacker to discover the private exponent.

(And yes, I ignored some real world RSA facts.  You can use Chinese remainder theorem by using p and q as part of the private key to speed up decryption.  Also, you do not use RSA on the actual message, you need to use secure padding (OAEP) and then only encrypt a random symmetric key which is then used to encrypt the actual message).


Bypassing HTML encoding I am testing a web application where the server accepts special characters like @#$*, but when I insert double / single quotes, the server HTML encodes it.

("test&quot;&gt;%3Cscript%3Ealert(&#39;XSS&#39;)%3C%2Fscript%3E")

is the output from the server.

How can I bypass this HTML encoding?

If you want to exploit XSS, you need to be able to inject HTML into the page. If the < and > characters are escaped, it is not possible to inject a tag. If the " and ' characters are esacped, it is not possible to inject an attribute. So it seems the page you are testing is safe from XSS.


Wiping a server with sensitive data ORIGINAL QUESTION:

We have servers which we want to wipe and sell due to an environmentally friendly scheme, recycling, reducing carbon footprint etc.  The servers have a raid configuration.

After doing some research, I am thinking of doing the following:

Use a Linux Live CD to boot into server
Use a strong password date +%s | sha256sum | base64 | head -c 32 ; echo and do a full disk encryption
Wipe the raid configuration using dd if=/dev/zero of =/dev/cciss/c0d0 bs=1M, dd if=/dev/random of =/dev/cciss/c0d0 bs=1M, dd if=/dev/zero of =/dev/cciss/c0d0 bs=1M
Wipe the HPA using hdparm -N /dev/cciss/c0d0, hdparm -N p[value goes here] /dev/cciss/c0d0
Wipe the DCO using hdparm --dco-identify /dev/cciss/c0d0, hdparm --dco-restore /dev/cciss/c0d0, hdparm --yes-i-know-what-i-am-doing --dco-restore /dev/cciss/c0d0
Bad sectors? sudo badblocks -n /dev/cciss/c0d0

Too little, okay, overkill?

The servers have sensitive data which must never be viewed by anyone.

Also, do I need to consider anything else, like wiping the RAM or any other possible area on the server where residue may be left?

UPDATE 1:

All disks are magnetic 2.5" scsi disks.

There is no need to do full disk encryption in step 2. Simply do

dd if=/dev/zero of=/dev/sda bs=1M

where /dev/sda is the hard disk device (change it to whatever your disk is called). You might also want to change the block size.

If you don't like the overwrite by 0s (there are people who claim that such overwrites aren't enough to actually make the old values unrecoverable, though you need special hardware to recover the overwritten data), use /dev/urandom instead, for as many times as you deem secure. You can also use the program shred.

You could probably stop after step 2.

I'm not sure why you overwrite your RAID config block 3 times in step 3. If you overwrite the whole disk in step 2, it should already be gone. Also, AFAIK, it contains no sensitive information.

I'm also not sure about your step 4. Why do you think that this wipes the HPA? Shouldn't you do this before step 2, disable the HPA by making it 0 blocks long, and then overwrite it in step 2?

In step 6, you're scanning for bad sectors. You're not doing anything else. But since you're already scanning for them, you might as well use badblocks -w and do a destructive scan, which will overwrite every sector and make step 2 unnessecary.

Hard drives set aside a few sectors that can be swapped for defective sectors. These defective sectors are often still readable and they might contain sensitive information. So you should take care of those, too. They do not get overwritten in step 2 (nor, I think, in step 6)


How does the "post/redirect/get pattern" improve security? How does the "post/redirect/get" (PRG) pattern improve security?  I see the "confirmation through redundancy" principle at play, but I don't understand how they could counter-balance the risks.

As a network developer, I see an opportunity for someone to hijack the request or perform other kinds of man-in-the-middle attacks. If your site isn't loaded over HTTPS, or doesn't mandate the use of cookies, how could this be allowed?

https://en.wikipedia.org/wiki/Post/Redirect/Get

It's mostly a usability issue and not a security issue.

POST-REDIRECT-GET (RPG) is there to stop the client from submitting the same form 2 times by error when he tries to reload the page for example.

Also, if the client try to navigate to a previous page that is a POST, the browser will often display a blank page which is a poor user experience. By adding the REDIRECT-GET, you won't get this blank page issue.

I don't think it's related in any way to the security of the application as it won't let you do something that you are not supposed to do if you only use POST.

Note

You seem to worry about Man-in-the-middle attack and request hijack, but if you have those kind of problems it's already game over RPG or not. So, if those things are the issue, I would suggest to use https.


Diagram of personal information security vulnerability? Is there a standard diagram format or language for illustrating a security model and what information is needed to access specific accounts? Something like UML for passwords and 2FA?

I was recently reading Sean Coonce's blog post on how he lost $100k in crypto to a SIM port hack.

Or here's another example where "Getting into Amazon let my hackers get into [an] Apple ID account, which helped them get into Gmail, which gave them access to Twitter".

Is there any kind of established systematic way of identifying these kinds of vulnerabilities?

In both of these examples the hackers were able to gain access to one system because they were able to gain access to other systems.

I'm envisioning a graph diagram something like this:

Where the nodes are either pieces of information, or systems to be accessed.

Does something like this already exist and is in use by security professionals?

I am not aware of a diagram set but there is veris:
veris framework

It translates the "Who did what to whom using which attack vector" in a structured JSON Format. It uses a 4 dimensional model for threats to describe any incident.

Actors
Actions
Assets
Attributes

So the example model from above would be slightly different, you can model every incident with those 4 dimensions and then link them together via the asset used and its attributes.

I personally like the structure when establishing kill chains for apt attacks.

Another option would be the attack tree model from Bruce Schneier Attack Tree Model

There you go backwards through the steps for a given attack, starting by the affected asset and then model every step the attacker has to take to gain access to the asset. This would model the above given scenario from the bank account backwards and create a path for the attacker. Then you can assign probabilites and cost to every node to model the most likely way any attacker would go.

A more sophisticated approach ist the SANS Threat modeling approach
This creates a campaign out of the attack tree an then describes every step as an scenario.


Authorization on complex ownership I have problem with object ownership in my web application. In my web application. There are object types:

1. Faculty
2. Student
3. Student Group
4. Student Lesson

The following user roles are available:

1. Group Leader
2. Teacher
3. Dean
4. Admin

Each Object type has many objects. In the application, the role "User" has permissions on specific object types, for example:

GroupLeader1 has permission on StudentGroup5
Dean4 has permission on Faculty2

And object types has hierarchy:

Faculty has Students.
StudentGroup has Students.
Student has Lessons

Dean4 has permission on all students which corresponds to Faculty2.
Dean3 has permission on all students which corresponds to Faculty4.
GroupLeader1 has permission on all student which corresponds to StudentGroup5.

How can I handle this complex ownership problem, are there any models for this situation?

This is a the classic problem. I've been interested in this for some time now and I'm not aware of any standard model that really solves it out of the box (yet).

RBAC can be adapted to work for your situation by introducing parameters. There are several names that these adaptions go by, the most common is parameterized RBAC (pRBAC). I've also seen names such as Context Aware RBAC, Object Aware RBAC and relational RBAC, which are different incarnations of the same basic idea. Unfortunately, some of these terms, because there is no standardization or consensus, also refer to other access models.

There are several pRBAC concepts floating around, which all differ in detail but are still largely the same idea.
You could take a look at the papers A Design for Parameterized Roles by Mei Ge and Sylvia L. Osborn. A formal model has been described by Ali E. Abdallah and Etienne J. Khayat in their paper A Formal Model for Parameterized Role-Based Access Control.

Just as in standard RBAC, in pRBAC, a subject is assigned a role. The role consists of one or more permissions, each permission consists of an operation, object pair.
In extension to RBAC, pRBAC allows objects to have parameters and users to be initialized for a certain role with parameter values for an object they have a permission on in that role.

So, for example, the object studentCourseResult would be assigned the parameter studentId. Instead of have a role named Teacher you would define the role TeacherOf with parameter values studentId = {1, 2, 7, 9, 11}.
If the parameter value for the object is within the set of parameter values assigned to a subject for this role, access is granted.

Note that it is an easy step from here to not only allow the = operator for parameter constraints, but also allow >, <, <=, etc.

Other than pRBAC you could take a look at Attribute Based Access Control (ABAC), which is quite fashionable at the moment (but it is solving a different problem and creating new ones) and authoriZation Based Access Control (ZBAC) which is definitely a very interesting concept, but likely an overkill for the use case you describe, as it mostly (and very neatly) solves the problem of cross domain authorization.


CSP base-uri directive on "View page source" on I am in the process of implementing a CSP header for a webapp, with the goal of reducing possible XSS attacks. See CSP for an overview of CSP. I provided the base-uri directive as 'self' and this works as expected with violations being reported to the report-uri. See base-uri for an explanation of the base-uri directive.

What is surprising to me is that when I use chrome (Version 56.0.2924.87 64-bit) to "View page source" there is a CSP violation report. Here is an example of the violation report:

{
"csp-report": {
    "document-uri": "http://localhost:8080/frontend/Page1.action?param1=1",
    "referrer": "",
    "violated-directive": "base-uri",
    "effective-directive": "base-uri",
    "original-policy": "base-uri 'self'; report-uri /frontend/CspReport.action?",
    "disposition": "report",
    "blocked-uri": "http://localhost:8080/frontend/",
    "status-code": 200
    }
}

I simplified the policy to make sure nothing else is interfering. From what I understand the "blocked-uri" should match the 'self' keyword because it matches the beginning of the "document-uri".

What makes this more strange is that it only happens when viewing source on some pages (but on these pages it happens 100% of the time) and does not seem to happen on firefox at all and does not happen when simply navigating between pages.

So, the question is why is this a CSP violation when it seems to not violate the specified directive?

To help future users I will summarize the help information provided in the comments by @Sjoerd and @dandavis .

In the CSP specification 'self' is defined as follows:

  'self'

  Refers to the origin from which the protected document is being
  served, including the same URL scheme and port number. You must
  include the single quotes. Some browsers specifically exclude blob and
  filesystem from source directives. Sites needing to allow these
  content types can specify them using the Data attribute.

This is partially ambiguous as it seems scheme is not defined. In the example provided, Chrome defines the scheme of self to be http: and view-source:http: as a different scheme.

Firefox seems to have chosen a different interpretation where view-source:http: is the same scheme as http: or at least that they both match 'self' in the base-uri policy.

In chrome, you would expect the CSP report to contain

"blocked-uri": "view-source:http://localhost:8080/frontend/"

Which would hint about why the uri was blocked, but it looks like the view-source: part is removed before sending the CSP report.


Failed to send emails that I never sent Some months ago, I started to receive some emails from "Mail Delivery Subsystem" (mailer-daemon@googlemail.com). Despite this is "automatic" failure email, I thought these emails were spam, so I just ignored. But today much more emails, and this started to disturb me.

These emails are send from mailer-daemon@googlemail.com (there is a icon that indicates a reply email) and says that "MYEMAIL@aol.com couldn't be found". "MYEMAIL" is the email that is receiving these messages, but with domain "aol.com" (I don't have any email from this domain).

In these emails, there is always a attached file about something attractive, like diets and wines. I think the most curious detail is that I was receiving these emails but in a "normal way". Before receiving from mailer-daemon, I was receiving like normal spam, even with the same subject, and at some point this has changed to mailer-daemon. Another detail is despite these emails always have a attached file, I can't see the attached file icon's until I open the email. Only then, when I close the email, I can see the attached file icon's. Obviously I never downloaded these files

I already changed password, checked login's entries and everything seems to be normal. I can just block emails from mailer-daemon@googlemail.com, but I'm concerned about why this is happening.

I've had this issue before, with another e-mail provider. In my case, someone was able to obtain my e-mail address, but not my password.
Then, my e-mail address was used as the "reply-to" or the "sent-from" address on a spam e-mail.

It is annoying, but you're e-mail itself is probably safe. (TFA helps).

Example for clarity:
Through whatever means, I notice that a valid e-mail address is Mycroft@googlemail.com.
Now, I can authenticate to another mail server, say postoffice.com. I can then use a sendmail program that does something like this:
to: JoeBloggs@aol.com
from: Mycroft@googlemail.com
Subject: Best Diet Program Ever!!
Body: blah, blah, blah.
For more info, click here!
EOT

You will then get the mailer-daemon message, and I have not compromised your e-mail, but I have compromised your email ADDRESS.


Why is it called micalg? RFC3851 says:

  The multipart/signed Content type has two required parameters: the
     protocol parameter and the micalg parameter.

and

  The micalg parameter allows for one-pass processing when the
     signature is being verified.

I haven't found any words on why it is called micalg.

It's there in the RFC in the paragraph under your quoted parts: "Message Integrity Check algorithm"


Double socket connection I'm busy experimenting with TCP socket connnections. I have made a client SOCK_STREAM socket andi've got a few questions:

Is there any way that a streaming(TCP) socket can get data from another socket without having to connect to it?
Is it safer to have a socket that a client connects to send data, and another one that the client gets data from (the server sockets exchange data) instead of one up and down socket?

Because what i'm trying to do now is to set up a client socket that request data from a server socket. Then that server socket forwards data to a random other socket that sends the data to the client.

If you don't exactly know what I mean, i'm open to questions!

To answer the first question: no, it is not possible for one socket without connecting to it, unless you attack the IP layer underneath. In that case you don't have to talk about sockets anymore.

No, it is not safer to have a server socket connect back to the client. An attacker could send the server socket almost anywhere.

If you want to protect a socket, use TLS.


Verification of client certificates I've read a lot of articles about client certificates. Please correct me if I'm wrong:

client certificates are issued using CA
CA could be created by myself (self-signed) or bought
client certificate has pair of public\private key and signature created using private key of CA
client needs to have installed client certificate only
server needs to have installed CA to validate signature of client certificate using public key CA

Question: what is difference between bought CA and self-signed CA? Because as I understand in both cases I need to install CA on server to validate client certificates.

Let me address your root question (pun intended):

  Question: what is difference between bought CA and self-signed CA? Because as I understand in both cases I need to install CA on server to validate client certificates.

Background

To answer this, let's make sure we understand what a certificate is. When you have a public key / private key pair you can give the public key to whom ever you want, it's public, but how will people know that it's actually your public key? Imagine this scenario: Alice sends her public key to Bob, but Charlie intercepts the message and replaces Alice's public key with his own. Bob has no way of knowing that the public keys were switched because all he sees is a public key. Now Bob thinks he has a secure connection with Alice, when in fact he has a secure connection with Charlie who's pretending to be Alice.

Certificates solve this problem of knowing whose public key you have. The process is that I will contact a Certificate Authority company and prove to them that I am who I say I am (exactly how they want you to prove this is answered in this question). Then I can submit my public key to them and they will bundle it into a certificate, which contains the public key itself and a bunch of information about who I am. The CA will sign the certificate to say "We certify that this public key belongs to this person", and so that the data in the cert can not be modified. Now I have an "official" document proving that this public key belongs to me. Now there's no way for Charlie to pretend to be Alice.

In most cases, you will not be requesting a certificate for yourself as a person, but for a specific server within your company, or in your case clients, but the idea is the same.

Answer

You have 2 ways of getting your public key made into a certificate:

You can submit it to one of the publicly trusted root CAs of the internet (Digicert, Verisign, godaddy, letsencrypt, etc) who will issue you a certificate (for a cost),
Or you can make your own self-signed CA and issue yourself a certificate.

The only real difference between the two comes down to public trust; if you pay one of the public roots to certify your public key then every computer on the internet will automatically trust your certificate to be genuine and authentic because they trust the CA's reputation. Zero extra work for you.

If you make your own self-signed CA then every computer will say "what is this, and why should I trust it??" (remember that Charlie can easily make his own CA and create a certificate with Alice's name attached to Charlie's public key). So you will have to manually go onto every computer that needs to validate one of these certs and tell it to trust your self-signed CA by adding the self-signed root certificate to that computer's "Trusted Root Certification Authorities Store".

Advice

Making your own self-signed root CA is not necessarily bad, it depends on what you're trying to do. In a lot of cases, having your certificates be publicly trusted on the whole internet does not add anything. For example, in a corporate ID badge system to get into the building; who cares whether those ID badges are publicly trusted or not - you only care about whether the door scanner recognizes them. Or client certs on embedded devices; the devices will need to authenticate to a server to receive firmware updates - only that server will ever need to validate the certs.

If your use-case is one of these "closed system" use-cases, then by all means, use your own self-signed CA.


Is IP Forwarding a risk by itself? A coworker claims that merely enabling IP_forwarding on a single homed Linux machine poses a security risk as he says it could then be used as a proxy.

I can't think of how this would work, except maybe if another machine on the same LAN set it as a gateway.  Is there a risk here that I can't see?

It would not work very well, as far as I can see. Proxying (as well as SNAT/masquerading) requires much more than simple IP forwarding.

Let's see, say that

192.168.1.1 is your network gateway
192.168.1.2 is Alice
192.168.1.3 is Eve
192.168.2.2 is Bob.

Eve sets Alice as her gateway, and pings Bob. The packet arrives to Alice who then forwards it to the real gateway, whence it would arrive to Bob marked as Eve's. Bob would answer and the reply would be sent directly to Eve, bypassing Alice.

So Bob will never know what happened, and will hold Eve responsible for what Eve did.

The only thing is that now Alice gets to eavesdrop one side of the conversation.

So now Eve forges a packet as coming from Alice. Alice receives a packet from her own address coming in from the outside, and in all probability she drops it.

Eve could forge a packet belonging to Charlie, but then, she could do this even before, without Alice's forwarding support. Actually, she could forge anyone in the local network; by setting Alice as the gateway, she is now worse off, for she can forge anyone except Alice.

If she has some way of foreseeing Bob's responses, she can engage in a blind spoofing of the conversation (but again, she could do this before), if she can make it so that Charlie does not respond by aborting the connection, and that the gateway doesn't inform Bob that Charlie's not reachable. Also, for connection protocols such as TCP, "foreseeing Bob's responses" is not all that easy unless Bob's TCP stack is vulnerable to prediction.

If the real gateway has security on it, now she can make it look as if Alice was forging a packet from Charlie, so that the real gateway spots the forgery and believes Alice to be responsible.

This last seems the most feasible "attack" that Alice exposes herself to by providing forwarding services.


How to improve security of a stored password? Our application needs to store a password in a database. It‘s not possible to store a hash because the password is needed to access other data that are protected by this password.

Currently, the password is stored encrypted with a key that is part of the code. We are aware that there is no way to store the password in a 100% secure way, but what would improve security and why? For example, would a salt add security?

Restrictions:

The password is originally entered by a user into the application
Access to the password is required in non-interactive mode (so cannot be unlocked by a user)
Only solutions on the application level can be applied

There are a couple ways this problem is approached.  One is to configure the system to connect to a PKCS#11 server, and to use the HSM to decrypt the master password when the application service is started. (This becomes another chicken-and-egg problem when you realize you have to store the PKCS#11 credentials in a file.)

Another approach is to require a human to enter an "unsealing" password every time the service is started.  While this can be more secure, it can't provide automatic recovery in the case of a failure.

Yet another approach is to store your master key in an on-board Hardware Security Module (HSM), such as a TPM chip.  You would have to consult your OS documentation for information about using this approach.


Google images - tracking used filters Let's say that I use Chrome's incognito mode and search for a specific term using Google Image Search without being logged into my Google Account. After Google gives me the results, I click on a certain image and then click on "Show more related images". Then Google uses the chosen image as a filter for new related images, while still using the same search term.

My question is the following: does Google track this activity? I mean, does the choice of an image used as a filter stay get stored or only the search term?

Google track this activity?

Yes. They track it.

Below, you can see:

I'm in incognito mode
I made a random image search
I clicked on a random image.

The click generated an imgevent JS method / function to be executed which made an ajax call and tracked the terms and image that was clicked on. It even tracked how much scroll I did before I clicked on something and a few other variables.

Whether or not this is directly associated with you is "black box" as far as Google is concerned. However, They know your IP, they know your timezone, and a lot of other information that incognito mode doesn't hide.

If you don't really want to be tracked for something:

Use Tails
With the tor browser
Over a VPN
From a public location
to search DuckDuckGo via their Onion address. http://3g2upl4pq6kufc4m.onion/


Can I use Truecrypt/Veracrypt to "Wipe" a partition? I am using a non-SSD drive: Western Digital Black 1TB. Windows XP (please don't judge why I'm still using XP. I've actually recentlly started to use Win 7).

For ex: if I have 2 partitions. 500GB encrypted system partition. and 500GB non encrypted partition.

Can i use Truecrypt/Veracrypt to "Wipe" the 500GB non encrypted partition by creating an encryption partition using a very secure random password? (Wiping in this context means the data in the non encrypted partition should be unrecoverable)

For example- I'll use Truecrypt/Veracrypt to "Create a New Volume" > Encrypt a Non-System Partition Drive  > Choose "Create encrypted volume and format it" and then use a very secure random password and format it

And the same goes true with using "Encrypt the system Partition" and Encrypt the system partition in place?  For example, if I have an unencrypted System Partition 500GB C: Drive. If I use Truecrypt/Veracrypt to "Encrypt the system Parition" and "Encrypt the system partition in place."  all the data in the non encrypted system partition C: drive is now inaccessible without the password?

BTW I am using Truecrypt. (Also please don't judge why I haven't upgraded to VeraCrypt)

Thanks!!

Yes, you can securely overwrite an entire partition by using TrueCrypt or VeraCrypt. Select the partition for encryption, and enable a single secure overwrite. You do not even need to select a secure password, as the master key that is used to overwrite the partition is already generated randomly. Note that you would want to create a new encrypted partition, not encrypt an existing partition in-place.

The only difference between encrypting an existing partition and creating a new partition is that the former will be less efficient due to reading from the entire disk as well as writing to it, and will also require you use a secure password. The latter technique is faster, just as secure, and does not require you use a secure password to effectively destroy all the data on the partition.


how is my router being modified to include WAN port-binding items for Teredo and Spotify My router's configuration app (browser-interface) has a page for Virtual Server. It has entries I did not create, at least not intentionally using the interface, for Teredo, Skype, Spotify, uTorrent.

I have two questions about this:

1) how did these entries get there in the first place?

2) I changed the IP address of the gateway from 192.168.1.1 to 192.168.2.1 because we just got FIOS internet in addition to COMCAST, intending to phase out the COMCAST in the very near future;  the FIOS router was defaulted to 192.168.1.1 so I changed my router's IP address to ...2.1   and now some though not all of these entries for Teredo, Skype,  Spotify, and uTorrent still show the 192.168.1.x IP address.  Can these "stale" addresses be deleted?

Several protocols exist, which allow applications running behind NAT-aware routers to configure the router to make some redirections, i.e. to allow these applications to be contacted from the outside. See e.g. IGD and NAT-PMP. Without such specific protocols, applications which want to do direct client-to-client communications (e.g. Skype) need to resort to cruder tools like UDP hole punching.

Thus, your entries were added automatically, on behalf of the applications which asked for them. How to remove stale entries is entirely device-dependent. Simply rebooting your router might do the trick; or not.

From a security point of view, this highlights the fact that NAT is not totally equivalent to a firewall which blocks incoming connections. Applications which run on the machines behind the NAT and intent on doing some server-type actions can still do them.


As an end user on a network, how can I avoid being MITM'd by an SSID-spoofing device? I've been looking at SSID spoofing devices lately, including the Wi-Fi Pineapple and similar hardware. While these types of devices seem very useful to someone who's up to no good or working as a white-hat hacker, I'm interested in how I could detect such devices, and what methods exist to stop MITM attacks caused by them, as the user of a Wi-Fi network with no administrative privileges.

I'm making the assumption that using a wired network isn't an option, as well as that I have at my disposition widely-available Wi-Fi analysis software (including signal strength monitors and SSID scanners).

As a client your basic countermeasure is to use a VPN.  Since you don't have a good way to baseline anything about the multitude of Wifi access points you might have to use, your ability to spot a real one vs a Wifi Pineapple is pretty minimal.  Your only hope, really, is to immediately route all traffic through a properly authenticated VPN which will resist attack (or at the least, fail and indicate your traffic is being heavily manipulated).

If you are the Wifi operator, you have a number of additional options to mitigate, most of which include just basic channel use awareness since a Wifi Pineapple or similar device is only going to work by displacing your existing infrastructure (or operating so close to the border that it can lure some users away) and in either case, you simply need to be running your own counterintel (watching open Wifi activity from a listen-only station with a good antenna) in order to spot an attack in progress.


Is that a tool dedicated to accessing rtsp streams over IP? Like sqlmap for databases, is there a tool that can find vulnerabilities, try default passwords, etc. for the rtsp (VoIP) protocol?

There are various Metasploit modules that can be used for RTSP depending on the application using this protocol.


Google searches seen by ISP When you enter something in the search bar right before it connects to google, can an ISP see that?

No, that's a parameter that will be sent to Google after the HTTPS encrypted connection is established.

The ISPs can only see the root URL you are going to "www.google.com". The encryption between your browser and Google is the first thing established. After that, your ISP sees only encrypted data.


My data in popular web apps like Facebook, YouTube Why do these companies allow to download your data?
Is there some law enforcing them to do so?
How complete should these data be?

GDPR, article 15, enforces the right of access by the data subject. This means a company must be able to check, which personal data is stored, and it must also provide a full copy on request. Failure to do so can result in significant fines.

All the relevant requirements and limitations regarding the right of access are listed in the link I provided above.


Suspicious site activity on www.computerworld.com Just after visiting www.computerworld.com/article/2536806/networking/10-killer-texting-tricks.html on chrome a window opened up¹. The window showed an odd behavior; it kept on switching site posts in the same window².

There were two things I noticed. First, the site loaded in the windows was engine.spotscenered.info from which the site joystamps.com was redirected. Second, the window popped behind the main browser window unlike normal popups which literally pop.

After visiting the site for the second time the windows did not pop up at all but after a few minutes of browsing on the internet the window again popped up out of nowhere even with the computerworld.com tab closed. This something I don't get how come the windows popped up even with the tab having the script closed.

¹

²

If you closed the tab and all the popups, or better the whole browser. And "popups" kept opening. You're likely infected with malware (or visiting multiple suspicious sites at the same time).

Run some antivirus and anti malware scans,
Make sure everything is up-to-date,
Install an ad blocker or (stricter) popup blocker.


SSLv3 cannot be disabled, can I use weak cipher as a workaround? We're using lighttpd 1.5.0-2349 which unfortunately doesn't support the option to disable SSLv3. I think a potential workaround would be to only allow it to use some cipher which has already been disabled in most browsers, so that if SSLv3 is used, there is no cipher overlap between server and client.

Is this a good idea? Which cipher would be suitable for this purpose?

There are secure non-POODLE-vulnerable ciphers which you can use with SSLv3 - POODLE only impacts variants with CBC.  The RC4 ciphers, for example, are not vulnerable to POODLE.  Now, RC4 is a tricky thing.  It's considered breakable (but not really actively broken), but since it's the best workaround for things like BEAST and POODLE, it's heavily used and probably secure enough for some small window of time ahead.

Since you're going to upgrade lighttpd anyway, RC4 should be fine until you get that done :)


My router got hacked, do I need to reset all 9 devices in my house? My router got hacked. And people suggest that the best way is to factory reset the router, then reset all the devices using the network.

I'm getting a new router so the reset router part is solved.

My further question is, there are 9 devices in my house: 2 desktops, 2 laptops, 1 iphone, 1 ipad, 1 android phone, 2 android tablets. Do I need to reset all of those devices? Would there be a problem if I leave one or two of the devices not reset? Would the hacker get into my network again through the one device that's not reset?

One of the desktop is my son's. And it's all him homework and games. No important login info there. Can I leave this one not reset? And another laptop my mom just use for browsing and simple stuff. Can I leave this one not reset as well?

Is it not necessary to reset the iphone and ipad? One of the android tablet has got seem like Adware on it, ads popping up all the time. How can I reset this tablet?

Would there be a problem if I leave one or two of the devices not
  reset? Would the hacker get into my network again through the one
  device that's not reset?

Facts

A Malicious guy accessed your home network for more than an hour, you didn't know exactly what happened there, but for some reasons, you assumed that the router has been compromised.

Answer

Nuke it from orbit.

Wipe all your devices. Within one hour, a malicious person can do some tremendous damages.


How to prevent browser from rendering malicious content if request or response is hacked? We are currently working on OWASP security fixes and we identified one attack scenario for which we are trying to figure out a possible solution:

User hits a valid HTTPRequest to our application. The URL in user's browser is set to our application url e.g. https//www.abc.com/request
Either of these:

A: Attacker intercepts the request and forwards it to some malicious site instead of our application. The URL in user's browser is set to application URL e.g. https://www.abc.com/request but the content will be that of malicious site.
B: Application processes the request and dispatches the response through Apache. While the response is en-route, an attacker intercepts the response and replaces the content of entire response with some malicious site or message like 'You Are Hacked!!'

In either case, the response gets rendered in user's browser, with the URL still pointing to https://www.abc.com/request in the browser but the content being malicious. This makes the user believe that it is still in our application.

We could replicate this scenario through our proxy tool. Being HTTPS, may be the attacker cannot decipher the response, but can certainly change the response content or redirect to some malicious site. Is there any way to identify and prevent rendering such responses in the browser through Apache or custom HTTP headers?

What if in scenario (2A), the user is routed from a valid HTTPS site to a malicious HTTP site?

If the request to your domain is HTTPS (e.g. https://example.com) this is effectively immune to a MITM attacker (corporate proxy issues aside). If an attacker redirected example.com to the IP of their own site then their own site would not have a trusted certificate installed for example.com so the user would get browser warnings and would be strongly discouraged from accepting the ceritificate and browsing to the site.

The only way round this for the attacker would be to gain a copy of your certificate with the private key, or somehow have their own trusted certificate for the domain which would be very difficult to do. And if they can do this by breaking into your server, then they win anyway. Bottom line - have trust in the Public Key Infrastructure of X.509. Read up there for more information on how this works.


Is checking zip content on another PC enough to prevent data leak? Let's say I have two kind of files on my Windows desktop - first are files that can be published and shared with other people, second kind is confidential and should remain private.
To share files I compress them with Peazip. I am a bit paranoid of software bug that would cause other files to be added to archive (I realize it's probably very unlikely, but still).
Is checking archive content (by previewing or extracting it) on another PC enough to prevent possible leaks?
Cheers,
Dominic

Is checking archive content (by previewing or extracting it) on another PC enough to prevent possible leaks?

Is it enough to be 100% sure - No, since the software used to extract might have bugs too. Or the original software might have added the data accidentally at some place in the ZIP file where they don't get extracted but are still visible when looking at the file through other means.
Does it reduce the risk - Yes.
Does it reduce the risk enough - Depends on what you consider enough.


Does HTTPS protect mobile internet connections against "network injection"? The Star recently published an article describing an alleged attack against a Moroccan journalist. The article describes the attack as such:

Forensic evidence gathered by Amnesty International on Radi’s phone shows that it was infected by “network injection,” a fully automated method where an attacker intercepts a cellular signal when it makes a request to visit a website. In milliseconds, the web browser is diverted to a malicious site and spyware code is downloaded that allows remote access to everything on the phone. The browser then redirects to the intended website and the user is none the wiser.

There's also an accompanying schematic summarising the attack set up:

Some quick googling seems to indicate that "network injection" is actually a euphemism for packet injection.
In this specific case (i.e., attacking cellular internet connections),

Does HTTPS provide adequate protection from such an attack?
If not, why?

From the article:

The website must use “clear text” which means the URL starts with
“http” not “https.”

The technique described in the article sounds hardly different from a man in the middle (MitM) attack, at least in terms of the potential impact.
Just like in a MitM scenario where an attacker can read and modify all data on the wire, TLS (therefore HTTPS) retains confidentiality and integrity as long as certificates are used and trusted properly. Without knowing the server's private key and the victim's session key(s), the traffic cannot reasonably be viewed or modified at that level.


Should the password of a password protected channel be hashed? Let's take a chat system, where any user can create a channel with a password protection. Thus, other users may only join using the channel password.

This password is therefore known to every person inside the channel.

Should this password be hashed in the database? This would mean that the application is not able to show the password (e.g., if one user forgot it).

Personally, I don't see a reason why the password should be hashed, because when setting the password, it's absolutely clear that other people will need to know it.

Personally, I don't see a reason why the password should be hashed, because when setting the password, it's absolutely clear that other people will need to know it.

Then why bother storing the password at all, just let anyone in! ;)

If you are storing a secret, it's because this secret identifies a subset of your total users. Not all your potential users know it. Now, you've probably been told that passwords must be stored hashed and salted. This is a password you're dealing with. I'll let you draw the logical conclusion.

Maybe the same group uses it to access a SharePoint which occasionally contains sensitive information. Maybe they use it for their group calendar which reveals when their office is empty or when they travel away from home. Maybe the person who created an account was so out of clue she used a password otherwise valuable to her personal assets. Maybe they just can't deal with the amount of credentials they have to handle and that alone explains the reuse.

Don't be the person who's responsible for causing harm to others out of sheer negligence. Hash them (with a slow password hashing algorithm). Salt them (with a unique salt per password).


Why does one need a strong password on Unix? SSH Server: I only allow public key authentication.
Malicious Software: If it's running as my user it has access to my data and an internet connection, it's bad enough already. Yes, su access would make it worse, but the issue here is not password strength but having trusted a malicious application.
Physical Access: su access is irrelevant at this point, the attacker has physical access to my hard drive, so they can do as they wish.

So, in what scenario does having a strong password that is error prone to type would help me?

You seem to have a pretty clear understanding of the risks. As others have stated it highly encouraged to use a strong password, so if you are running a sensitive service, then by all means, please use strong passwords only.

When using a weak password, there are a couple risks that come to mind which you did not mention:

There may be other services besides SSH (e.g. FTP or others) that are still accepting password-based authentication. It's quite possible that one of those services will be accidentally enabled some time in the future, or a sysadmin may temporarily enable password-based authentication on the SSH.
There is an important point you did not mention in regards to malicious applications. In the event of an intrusion to a non-root account, it is extremely important to prevent upgrade to root access. If the root password is weak then you may very well have an open vulnerability there via brute force. Also, supposing there is some other account that has sudo permission, these need strong passwords also.

Do not dismiss the importance of preventing malicious applications from being able to gain root access; and beware of the risk of changes in your configuration. Also there is a strong possibility that you and I do not know the same attack vectors that your adversary does.

You may be able to increase the length of the password to compensate for decreased complexity, thereby making it easier to type. As a touch typist, I have a hard time relating to your problem though.


Using HTTP GET instead of a POST request can leak source code? Is it possible to leak the server-side code of a website if a GET request is sent instead of a POST request to a page? The idea is that if a POST request is made to a webpage e.g. http://<server url>/index.php, then the parameters passed via the POST request get read, the server side code e.g. PHP gets executed and a HTML output is returned to user. However, if a GET request is sent for a webpage to the server, then the server does not execute the server-side code - it simply returns index.php to the end user leaking the server-side code.

I have heard that this is a common vulnerability, but I am unable to find scenarios where this exists. Also what server configurations would typically allow this vulnerability to occur?

Thanks

John

However, if a GET request is sent for a webpage to the server, then the server does not execute the server-side code - it simply returns index.php to the end user leaking the server-side code.

Your assumption is wrong. A GET or POST does not change anything related to sourcecode leak. They are processed the same way, and the result will usually be HTML being sent back.

Main differences between POST and GET:

A GET request will show fully in the address bar, and a POST does not

Bookmarking a GET request with a password will also record the password, and a POST will not.
A GET request gets written fully on webserver logs, a POST generally not

If someone reads the logs of the webserver, all info of all requests can be read from a GET, but not from a POST

Using POST will make slightly harder to someone to conduct a CSRF attack against your site. But have absolutely nothing to do with a source leak.